Here's an example I used to use for highlighting extreme moves in the
TICK indices...

function SayNotTooOften( text, Minperiod ) 
{ 
   elapsed=GetPerformanceCounter()/1000; 
   Lastelapsed = Nz( StaticVarGet("lastsaytime") ); 

  if( elapsed - Lastelapsed > Minperiod ) 
   { 
     StaticVarSet("lastsaytime", elapsed ); 
     
     Say( text ); 
   } 
   
} 


if( LastValue(C)>=800 AND LastValue(C)<=1000)
{
   SayNotTooOften("Ticks plus 800",60);
}
if( LastValue(C)>=1000 )
{
   SayNotTooOften("Ticks plus 1000",60);
}
if( LastValue(C)<=-800 AND LastValue(C)>=-1000)
{
   SayNotTooOften("Ticks minus 800",60);
}
if( LastValue(C)<=-1000 )
{
   SayNotTooOften("Ticks minus 1000",60);
}

--- In [email protected], "Pete" <dryhe...@...> wrote:
>
> I searched this forum and the online AFL Reference but did not find
> any examples of using this command within a trading system.
> I have been using the AlerIf() function to play a windows sound when
> one of my signals register on the chart. Very symple, one line of
> code, works great.
> But I would like to include the Say() command in this scheme. The idea
> is to have the Say() command actually tell me which entry signal has
> been triggered. Examples:
> Say("M-A-C-D Cross Long");
> Say("M-A-C-D Cross Short");
> The part I don't yet understand is how to get the Say() command to
> activate when the current bar or last bar in range is showing one of
> the signals.
> Thanks for your input.
> 
>   Pete  :-)
>


Reply via email to