NinjaTrader Support Forum  
X

Attention!

This website will be down for maintenance from Friday May 24th at 6PM MDT until Saturday May 25th at 11AM MDT. We apologize for the inconvenience. If you need assistance during this time, please email sales@ninjatrader.com


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 11-01-2008, 07:05 AM   #1
designer
Senior Member
 
Join Date: Sep 2008
Posts: 289
Thanks: 0
Thanked 0 times in 0 posts
Default SMA Crossing Strategy

I followed Josh's Strategy creation from the webinar last week using the Wizzard. When plotted it on the chart (see attachment) I get the Buy and Sell signals one or sometimes two bars late. I tried changing to false for "On bar close" and "look back" to 1....but still the signals are late. Is there a setting I'm missing? I want the signas to be realtime on the crossing of SMAs. Thanks
Attached Images
File Type: jpg SMACross.jpg (74.7 KB, 36 views)
designer is offline  
Reply With Quote
Old 11-01-2008, 10:39 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
Default

Image looks correct. The actual cross occurs one bar before the execution is plotted. You can verify this by checking the values of the MAs on each bar, the bar above the circle does not have a cross, I can see this in the image. It looks like it but, just check the values and I suspect you will see that I am correct.
NinjaTrader_Ray is offline  
Reply With Quote
Old 11-01-2008, 11:10 AM   #3
designer
Senior Member
 
Join Date: Sep 2008
Posts: 289
Thanks: 0
Thanked 0 times in 0 posts
Default

I did, the Smas crossed on the 17th and the Buy signal was triggered on the 21st at the open. Also the Sell Smas cross was on the 13th and the signal was triggered on the 14th. I tried changing the look back to cero in the Wizzard but did not allow me. it seem too late to me in both cases is there a way to make the signals get triggered sooner or realtime? Please advice.
Thanks
designer is offline  
Reply With Quote
Old 11-01-2008, 03:00 PM   #4
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
Default

Unfortunately I have no furher advice. From your image, the lines on the 17th do not cross, I can see that they cross on the next bar which is when the signal is triggered which would fill on the next bar which is exactly what is seen in the image you posted.
NinjaTrader_Ray is offline  
Reply With Quote
Old 11-01-2008, 04:21 PM   #5
designer
Senior Member
 
Join Date: Sep 2008
Posts: 289
Thanks: 0
Thanked 0 times in 0 posts
Default

Ray,
So if I wanted to have the buy signal triggered earlier I would have to use intraday bar charts?
designer is offline  
Reply With Quote
Old 11-01-2008, 06:02 PM   #6
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
Default

If you want it on a daily chart you would need to run your strategy with the parameter 'Calculate on bar close' set to false.
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

Similar Threads
Thread Thread Starter Forum Replies Last Post
Price crossing MA rob36 Strategy Development 2 09-08-2008 10:38 AM
How to Calculate Price which produces HMAs crossing each other mrlogik Indicator Development 1 06-24-2008 03:43 PM
EMA Crossing Formula pipsheker General Programming 1 05-18-2008 12:49 PM
Period 14 crossing Period Linear Regression 25 Viper3 Strategy Development 8 10-21-2007 10:51 AM


All times are GMT -6. The time now is 03:31 AM.