![]() |
|
|||||||
| Strategy Development Support for the development of custom automated trading strategies using NinjaScript. |
![]() |
|
|
Thread Tools | Display Modes |
|
|
#1 |
|
Join Date: Nov 2006
Location: , ,
Posts: 66
Thanks: 0
Thanked 0 times in 0 posts
|
If I set the lookBackPeriod to be 0, I get no result:
CrossAbove(EMA(10), SMA(20), 0) Is this as expected?I can only see the crossover 1 bar later. Is it possible to know exactly when it occurs? CrossAbove(EMA(10), SMA(20), 1) <-- this works fine. Thank you. |
|
|
|
|
|
#2 |
|
Administrator
Join Date: Nov 2004
Location: Denver, CO, USA
Posts: 11,163
Thanks: 6
Thanked 45 times in 32 posts
|
That is correct since on the closeof a bar, you want to check for cross over condition on that bar which is now 1 bar ago, so the lookback period would be 1. There is no way to check what bar the actual cross over happened if your lookback period is greater than 1.
Ray
Ray
NinjaTrader Customer Service |
|
|
|
![]() |
| Thread Tools | |
| Display Modes | |
|
|