Download MetaTrader 5

Fix Arrow after condition

To add comments, please log in or register
fly7680
657
fly7680  
Hello, I should fix the arrow when the moving average crossed the fractal channel as written in code. The problem is that if you create another minimum on the first tick of the candle 0, the arrow is not present.
How can I fix?

Thank you


if(iMA(NULL, PERIOD_CURRENT, MediaM_Periodo, 0, MODE_EMA, PRICE_CLOSE, 2+i) > iCustom(NULL, PERIOD_CURRENT, "FractalChannel", 1, 2+i)  //Moving Average > FractalChannel  
&& iMA(NULL, PERIOD_CURRENT, MediaM_Periodo, 0, MODE_EMA, PRICE_CLOSE, 1+i) < iCustom(NULL, PERIOD_CURRENT, "FractalChannel", 1, 1+i)  //Moving Average < FractalChannel
)
 {
  Buffer1[i] = High[i] + Distanza_Icona * myPoint; //Set indicator value at Candlestick High + fixed value
 }



Files:
To add comments, please log in or register