NinjaTrader Support Forum  

Go Back   NinjaTrader Support Forum > NinjaScript Development Support > Strategy Development

Strategy Development Support for the development of custom automated trading strategies using NinjaScript.

Reply
 
Thread Tools Display Modes
Old 12-28-2006, 02:49 AM   #1
SuzyG
 
Join Date: Nov 2006
Location: , ,
Posts: 66
Thanks: 0
Thanked 0 times in 0 posts
Post imported post

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.
SuzyG is offline  
Reply With Quote
Old 12-28-2006, 03:18 AM   #2
NinjaTrader_Ray
Administrator
 
NinjaTrader_Ray's Avatar
 
Join Date: Nov 2004
Location: Denver, CO, USA
Posts: 11,163
Thanks: 6
Thanked 45 times in 32 posts
Post imported post

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
NinjaTrader_Ray is offline  
Reply With Quote
Reply

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT -6. The time now is 07:36 PM.