Set the bars in calculation - page 4

 

Brian Lillard:

int iBar=prev_calculated,iCnt=BarsInCalc-(iBar>0?BarsInCalc:iBar);

This doesn't work

Yes it does.

What are you expecting it to do?

First tick, iCnt will = BarsInCalc.

Subsequent ticks iCnt will = 0.

If you are not seeing this show your complete code in OnCalculate().

 
William Roeder:

See How to do your lookbacks correctly #9 - #14 & #19.s

Ast the screenshot shows after compiling the prices are doing what they do after first tick and thereafter. I don't know how anyone got that I was not compiling without a return but whatever like I said eventually and like evolution it is going to work 😊

Not yet

Anyways I show you my code

😐

Maybe the IndicatorCounted() I supposedly made will be enough and I'm sure because of what I have been through

 
Keith Watford:

Brian Lillard:

int iBar=prev_calculated,iCnt=BarsInCalc-(iBar>0?BarsInCalc:iBar);

This doesn't work

Yes it does.

What are you expecting it to do?

First tick, iCnt will = BarsInCalc.

Subsequent ticks iCnt will = 0.

If you are not seeing this show your complete code in OnCalculate().

Please reply.