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 > Application Technical Support > Automated Trading

Automated Trading Support for automated trading systems using NinjaScript. Support for our ATI (Automated Trading Interface) used to link an external application such as TradeStation and eSignal to NinjaTrader.

Reply
 
Thread Tools Display Modes
Old 06-13-2009, 01:02 AM   #1
leyland
Junior Member
 
Join Date: Jun 2009
Posts: 17
Thanks: 0
Thanked 0 times in 0 posts
Default Automated exit order is filled late

I am a newbie, so please bare with me, When working with an automated strategy I am finding that the orders are always being executed one bar after the close of the current bar. Is there a offset feature for this?
Also, how do I program the start and finish of the automated trading in a intraday enviroment. eg. start at xx and finish at xx. Thank you for your help.
leyland is offline  
Reply With Quote
Old 06-13-2009, 07:07 AM   #2
NinjaTrader_Ben
NinjaTrader Customer Service
 
NinjaTrader_Ben's Avatar
 
Join Date: May 2008
Location: Denver, CO
Posts: 3,157
Thanks: 0
Thanked 3 times in 3 posts
Default

Hello,

If you are backtesting, you cannot change what bar the strategy executes on. It will executes AFTER the criteria is met, therefore it has to be on the bar AFTER the bar where the criteria is met.

If you are forward testing or trading live, change the strategy so that is runs with CalculateOnBarClose = false and see if that helps:
http://www.ninjatrader-support.com/H...BarClose1.html

This link will help with your section question:
http://www.ninjatrader-support2.com/...ead.php?t=3226
NinjaTrader_Ben is offline  
Reply With Quote
Old 06-15-2009, 01:30 PM   #3
leyland
Junior Member
 
Join Date: Jun 2009
Posts: 17
Thanks: 0
Thanked 0 times in 0 posts
Default re-auto trading

Thank you for the reply. I had made sure to have the "calculate on Bar close off" when working with the ninjascript wizard. The execution is still coming way at the end of the 10 min. bar even in live mode. I am not sure what settings need to be changed.
leyland is offline  
Reply With Quote
Old 06-15-2009, 02:35 PM   #4
NinjaTrader_Josh
NinjaTrader Product Manager
 
NinjaTrader_Josh's Avatar
 
Join Date: May 2007
Location: Denver, CO
Posts: 17,458
Thanks: 1
Thanked 107 times in 70 posts
Default

leyland,

Ensure you are running a new instance of the strategy. You will enter trades when your conditions are true. If they are true at the end of the bar then it will trade then.
NinjaTrader_Josh is offline  
Reply With Quote
Old 06-15-2009, 04:15 PM   #5
leyland
Junior Member
 
Join Date: Jun 2009
Posts: 17
Thanks: 0
Thanked 0 times in 0 posts
Default Re auto reading

Thanks Josh. I've have done all that. I guess what I am wondering is this: I am running a 10 minute chart, I have a number of conditions that all have to be met for an order to be triggered. I would like the order to be placed in "real time" a soon as this happens instead of at the end of a 10 minute bar. Can I do this?
leyland is offline  
Reply With Quote
Old 06-15-2009, 04:21 PM   #6
NinjaTrader_Josh
NinjaTrader Product Manager
 
NinjaTrader_Josh's Avatar
 
Join Date: May 2007
Location: Denver, CO
Posts: 17,458
Thanks: 1
Thanked 107 times in 70 posts
Default

Are you backtesting or in realtime? When backtesting you can only trade at the end of each bar because you do not have intrabar information.
NinjaTrader_Josh is offline  
Reply With Quote
Old 06-15-2009, 05:06 PM   #7
leyland
Junior Member
 
Join Date: Jun 2009
Posts: 17
Thanks: 0
Thanked 0 times in 0 posts
Default

Hi Josh. I am doing both. However, it is in real time that I am still noticing the 1 bar delay problem. I am wondering if I may have missed something with my settings? I just set up an account with IB. Is there a special setup that I may not have done with them? In a perfect world, should I be able to do what I am asking in regards to the real time scenario on the 10 minute chart. Thanks you for your time.
leyland is offline  
Reply With Quote
Old 06-15-2009, 05:12 PM   #8
NinjaTrader_Josh
NinjaTrader Product Manager
 
NinjaTrader_Josh's Avatar
 
Join Date: May 2007
Location: Denver, CO
Posts: 17,458
Thanks: 1
Thanked 107 times in 70 posts
Default

In real-time you should not see end of bar closing if your conditions are true intrabar. I suggest you use Print() functions to see what is happening with your OnBarUpdate() method.
NinjaTrader_Josh 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
06/05/2009 2:59:19 PM Order Order rejected - reason:Too late to replace order (201) junkone Strategy Development 1 05-06-2009 02:29 PM
Exit on close - late mikie2k2 Strategy Development 12 02-19-2009 02:35 PM
Exit with both sides filled billitin Automated Trading 1 06-30-2008 03:16 PM
order filled one bar late sub5mango Strategy Development 10 06-25-2008 06:38 AM
Delay exit orders until entry order filled dtf139 Automated Trading 3 02-15-2008 03:00 PM


All times are GMT -6. The time now is 06:42 AM.