Hi guys
I have a problem with a code.
I would like to know how to perform a routine every time a candle exceed a MM, only 1 time, and the order can not be repeated until next crossing.
Code example:
The code above repeat the order for many times after take profit and before the next line cross.
I want the orders that it can open not exceed 1 order per cross. Or a limit variable (N orders).
So, If somebody could help, I would be grateful.
Thanks in advance.
I have a problem with a code.
I would like to know how to perform a routine every time a candle exceed a MM, only 1 time, and the order can not be repeated until next crossing.
Code example:
Inserted Code
int limit=1; double MMA; for (int shift=1; shift<=limit; shift++) { MMA=iMA(NULL,timeFrame,FastEMA,0,MODE_EMA,PRICE_CLOSE,shift); //---- sell conditions if (MMA>Ask + 0.0010){ SellValue=1; break; } //---- buy conditions if (MMA<Ask - 0.0010){ BuyValue=1; break; } }
The code above repeat the order for many times after take profit and before the next line cross.
I want the orders that it can open not exceed 1 order per cross. Or a limit variable (N orders).
So, If somebody could help, I would be grateful.
Thanks in advance.