Fix Arrow after condition

Back to topics list To post a new topic, please log in or register
avatar
86
fly7680 2016.06.20 12:09
 
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
 }



Attached files:
  fractalchannel.mq4  (1.97 KB)
Back to topics list  

To add comments, please log in or register