![]() |
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
|
|||||||
| 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. |
![]() |
|
|
Thread Tools | Display Modes |
|
|
#1 |
|
Junior Member
Join Date: Jun 2009
Posts: 17
Thanks: 0
Thanked 0 times in 0 posts
|
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. |
|
|
|
|
|
#2 |
|
NinjaTrader Customer Service
Join Date: May 2008
Location: Denver, CO
Posts: 3,157
Thanks: 0
Thanked 3 times in 3 posts
|
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
Ben
NinjaTrader Customer Service |
|
|
|
|
|
#3 |
|
Junior Member
Join Date: Jun 2009
Posts: 17
Thanks: 0
Thanked 0 times in 0 posts
|
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.
|
|
|
|
|
|
#4 |
|
NinjaTrader Product Manager
Join Date: May 2007
Location: Denver, CO
Posts: 17,458
Thanks: 1
Thanked 107 times in 70 posts
|
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.
Josh
NinjaTrader Customer Service |
|
|
|
|
|
#5 |
|
Junior Member
Join Date: Jun 2009
Posts: 17
Thanks: 0
Thanked 0 times in 0 posts
|
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?
|
|
|
|
|
|
#6 |
|
NinjaTrader Product Manager
Join Date: May 2007
Location: Denver, CO
Posts: 17,458
Thanks: 1
Thanked 107 times in 70 posts
|
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.
Josh
NinjaTrader Customer Service |
|
|
|
|
|
#7 |
|
Junior Member
Join Date: Jun 2009
Posts: 17
Thanks: 0
Thanked 0 times in 0 posts
|
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.
|
|
|
|
|
|
#8 |
|
NinjaTrader Product Manager
Join Date: May 2007
Location: Denver, CO
Posts: 17,458
Thanks: 1
Thanked 107 times in 70 posts
|
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.
Josh
NinjaTrader Customer Service |
|
|
|
![]() |
| Thread Tools | |
| Display Modes | |
|
|
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 |