Page 1 of 1

How to add an allert soud in indicators?

PostPosted: Wed Aug 25, 2010 6:57 pm
by clodhoppes
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()"?

Re: How to add an allert soud in indicators?

PostPosted: Thu Aug 26, 2010 2:34 am
by Apprentice
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

Re: How to add an allert soud in indicators?

PostPosted: Thu Aug 26, 2010 7:29 am
by clodhoppes
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?

Re: How to add an allert soud in indicators?

PostPosted: Fri Aug 27, 2010 7:55 am
by Nikolay.Gekht
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.

Re: How to add an allert soud in indicators?

PostPosted: Fri Aug 27, 2010 8:13 am
by clodhoppes
I get it. Thanks for your explanation. I wonder if there is some reference book for SDK indicator development except the SDK user guide.

Re: How to add an allert soud in indicators?

PostPosted: Fri Aug 27, 2010 12:49 pm
by Nikolay.Gekht
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