PDA

View Full Version : Do something within a certain amount of bars


dwalls
01-21-2009, 09:57 AM
Hello,
If I want to do something within a certain amout of bars, how is that coded?
Example:
if (CrossBelow(SMA(Fast), SMA(Slow), 1))
and the
(CrossAbove(SMA(Fast), SMA(Slow), 1)) within a certain amount of bars of the CrossBelow...say 10 bars...then do something.

How is that coded?

Thanks

NinjaTrader_Bertrand
01-21-2009, 10:09 AM
Hi dwalls, you can simply change your Cross Above / Below lookback to for example 10 bars. Then both will evaluate to 'true' if the condition occurs within the last 10 bars.

dwalls
01-21-2009, 10:11 AM
Dah..thanks.
I forgot that.