Sound alerts with 2 options.  [SOLVED]

Questions about MultiCharts and user contributed studies.
stefanols
Posts: 51
Joined: 01 Jan 2014
Has thanked: 14 times
Been thanked: 2 times

Sound alerts with 2 options.

Postby stefanols » 03 Mar 2016

Hi,
I checked in alerts but could not find anything about it.
Hope someone could help.
I am trying to use the same indicator and to get 2 different sound alerts.
E.g. RSI under 10 and RSI over 90.
I have one indicator that does something similar but I can not get it to work.
Thanks in advance. BR Stefan

Code: Select all

inputs:
Price( Close ),
Length( 2 ),
OverSold( 10 ),
OverBought( 90 ),
OverSColor( Cyan ),
OverBColor( Red ) ,
SoundDirectory("C:\ProgramData\TS Support\MultiCharts64\TS_Sounds\");

variables: var0( 0 ) ;
vars:
patText(""), CheckAll(0), SoundFile(""), SoundStr("");


var0 = RSI( Price, Length ) ;

Plot1( var0, "RSI" ) ;
Plot2( OverBought, "OverBot" ) ;
Plot3( OverSold, "OverSld" ) ;


if var0 > OverBought then
SetPlotColor( 1, OverBColor )
else if var0 < OverSold then
SetPlotColor( 1, OverSColor ) ;

condition1 = var0 crosses over OverSold ;

{if condition1 then
Alert( "Indicator exiting oversold zone" )
else
begin
condition1 = var0 crosses under OverBought ;
if condition1 then
Alert( "Indicator exiting overbought zone" ) ;
end;}




if var0 > overbought then

begin
SoundFile= "RSI above 90.wav";
patText = patText + "[RSI>90]";
end;


if var0 < oversold then

begin
SoundFile= "RSI under 10.wav";
patText = patText + "[RSI<10]";
end;


User avatar
TJ
Posts: 7742
Joined: 29 Aug 2006
Location: Global Citizen
Has thanked: 1033 times
Been thanked: 2222 times

Re: Sound alerts with 2 options.

Postby TJ » 03 Mar 2016

Hi,
I checked in alerts but could not find anything about it.
Hope someone could help.
I am trying to use the same indicator and to get 2 different sound alerts.
E.g. RSI under 10 and RSI over 90.
I have one indicator that does something similar but I can not get it to work.
Thanks in advance. BR Stefan
::
You have to use the PLAYSOUND keyword.

stefanols
Posts: 51
Joined: 01 Jan 2014
Has thanked: 14 times
Been thanked: 2 times

Re: Sound alerts with 2 options.  [SOLVED]

Postby stefanols » 03 Mar 2016

Thanks!


Return to “MultiCharts”