MQL4 my indicator only shows a straight line please help!!
Maxwell Ogunsanya:
The code is supposed to perform the calculation shown in the my mql4 version on every bar. However, it shows the same value as far back as I try to go.
How do I make sure that the calculation is performed on each bar or if there is a more efficient way to code this I would appreciate that highly. :)
double lowestPrice = Low[iLowest(Symbol(),0,MODE_LOW,50,i)];
The other lines should be modified in the same way.
I am trying to convert an indicator I found on tradingview to MQL4:
==============================================
BullTrend = (close - lowest(low, 50)) / atr(5)
BearTrend = (highest(high, 50) - close) / atr(5)
BearTrend2= -1*BearTrend
Trend = BullTrend - BearTrend
==============================================
The code is supposed to perform the calculation shown in the my mql4 version on every bar. However, it shows the same value as far back as I try to go.
How do I make sure that the calculation is performed on each bar or if there is a more efficient way to code this I would appreciate that highly. :)