savio:
Hi All
Any Help Will be appreciated .
Hi All
I'm new to MQL4 I just start ... I'm trying to create alert to notify ( IF High OR Low touch Moving Average ) ONLY ONE ALERT PER BAR. This is the code made.
double LastSignal=0;
if( LastSignal != Time[0] )
{
double TouchFromDownM1 = (High[1] = MaCurrent_M1);
double TouchFromUpM1 = (Low[1] > MaPrevious1_M1 && Low [0] <= MaCurrent_M1);
if ( TouchFromDownM1 )
Alert("One Alert High Touch MA In 1M For : "+ Symbol(), " Cross Up");
if ( TouchFromUpM1 )
Alert("One Alert Low Touch MA In 1M For : "+ Symbol(), " Cross Down");
LastSignal = Time[0];
}
Change
double LastSignal=0;
to
static double LastSignal=0;
and it should work OK
Thanks so much
You are missing trading opportunities:
- Free trading apps
- Over 8,000 signals for copying
- Economic news for exploring financial markets
Registration
Log in
You agree to website policy and terms of use
If you do not have an account, please register
Hi All
I'm new to MQL4 I just start ... I'm trying to create alert to notify ( IF High OR Low touch Moving Average ) ONLY ONE ALERT PER BAR. This is the code made.
double LastSignal=0;
if( LastSignal != Time[0] )
{
double TouchFromDownM1 = (High[1] = MaCurrent_M1);
double TouchFromUpM1 = (Low[1] > MaPrevious1_M1 && Low [0] <= MaCurrent_M1);
if ( TouchFromDownM1 )
Alert("One Alert High Touch MA In 1M For : "+ Symbol(), " Cross Up");
if ( TouchFromUpM1 )
Alert("One Alert Low Touch MA In 1M For : "+ Symbol(), " Cross Down");
LastSignal = Time[0];
}
Any Help Will be appreciated .