I am using the Say() function to say the name of the script and "Buy" or "Sell" when Buy or Sell is generated. It works as intended when used on 1 script at a time: a signal is generated, I hear it once and that's it. But I am facing a problem when I have several charts loaded. Since I have the same formula in all the charts and I have several charts up on the screen at the same time. It so happens that when a buy or sell is generated for different scripts at the same time, the say function gets in a loop and keeps repeating the Say() function. Any workaround for that?
I call it like this:
Code:
function SayOnce( text )
{
if ( StaticVarGetText( "lastsaidtextr" ) != text )
{
Say( text , False );
StaticVarSetText( "lastsaidtextr", text );
}
}
Code:
SayOnce( Name() + "Going Long" );