Adding an minus ..

zoom27

Member
Hello...

I need some help with my indi setting...when im putting a minus -10 in the indi it shows a perfect chart but it come 10bars later...haw we can slove this problem ??

if (calculateValue || timeFrame==Period())
{
for(i=limit; i>=0; i--)
{
hma1 = iHma(iMA(NULL,0,1,-20,MODE_SMA,Price,i),Length,i,0);
hma2 = iHma(hma1 ,Length,i,2);
hma = 2.0*hma1-hma2;
 

stovedude

Active member
You are shifting the indicator back (into history) 10 bars, which can look perfect, but the most recent closed bars will of course be missing the line. In other words, you are just moving the lagging indy to the left 10 bars, which will not gain you anything, because that period is already over and finished 10 bars ago.
 

Aurix Exchange
Top