How to add an allert soud in indicators?

Moderator: admin

How to add an allert soud in indicators?

Postby clodhoppes » Wed Aug 25, 2010 6:57 pm

Can anyone do me a favor? I just need an allert sound in developing an indicator, but I don't want to compile a signal. How can i make it? Use "allertSound()"?
clodhoppes
 
Posts: 26
Joined: Sun Aug 15, 2010 8:11 pm

Re: How to add an allert soud in indicators?

Postby Apprentice » Thu Aug 26, 2010 2:34 am

You're completely right, you can do it using
Code: Select all
terminal:alertSound (file, recurrent)

Or you can use
Code: Select all
ExtSetupSignal("Signal Name "", ShowAlert);

and
Code: Select all
ExtSignal(source, period, Note  , SoundFile);


Leave the opportunity to other users use to have ShowAlert option.

By setting signal parameter
Code: Select all
strategy.parameters:addBoolean("ShowAlert", "Show Alert", "", false);
 strategy.parameters:addBoolean("PlaySound", "Play Sound", "", true);


and then

Code: Select all
if instance.parameters.PlaySound then
        SoundFile = instance.parameters.SoundFile;
    else
        SoundFile = nil;
    end
User avatar
Apprentice
FXCodeBase: Confirmed User
 
Posts: 36341
Joined: Thu Dec 31, 2009 11:59 am
Location: Zagreb, Croatia

Re: How to add an allert soud in indicators?

Postby clodhoppes » Thu Aug 26, 2010 7:29 am

I appreciate your help. I prefer the first option. May I write like this in an indicator:
terminal:allertSound("C\sounds\popmessage.wav",true)

By the way, I want to ask how to change the size of dot or bar?
clodhoppes
 
Posts: 26
Joined: Sun Aug 15, 2010 8:11 pm

Re: How to add an allert soud in indicators?

Postby Nikolay.Gekht » Fri Aug 27, 2010 7:55 am

Stop guys. The indicator cannot alert. Only signal can. However, I could create a small C++ library for lua which can be used from indicators and can play a sound.
Nikolay.Gekht
FXCodeBase: Site Admin
 
Posts: 1235
Joined: Wed Dec 16, 2009 6:39 pm
Location: Cary, NC

Re: How to add an allert soud in indicators?

Postby clodhoppes » Fri Aug 27, 2010 8:13 am

I get it. Thanks for your explanation. I wonder if there is some reference book for SDK indicator development except the SDK user guide.
clodhoppes
 
Posts: 26
Joined: Sun Aug 15, 2010 8:11 pm

Re: How to add an allert soud in indicators?

Postby Nikolay.Gekht » Fri Aug 27, 2010 12:49 pm

There is a number of books about Lua itself, but not about the indicator/signal/strategies development. For Marketscope-related things you can also look for our development forum, there is a number of articles about the indicator development. We do our best to improve the documentation, but, i'm afraid it will take an year before the documentation will be really good.

Below is the list of the currently existing articles:
Guppy's Multiple Moving Average
Piercing Line pattern detection
Yesterday's Close Value
Nikolay.Gekht
FXCodeBase: Site Admin
 
Posts: 1235
Joined: Wed Dec 16, 2009 6:39 pm
Location: Cary, NC


Return to Indicator Development

Who is online

Users browsing this forum: No registered users and 7 guests