![]() |
This website will be down for maintenance from Friday May 24th at 6PM MDT until Sunday May 26th at 12PM 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 |
|
Senior Member
Join Date: Aug 2009
Location: bay area
Posts: 127
Thanks: 1
Thanked 2 times in 1 post
|
during OnBarUpdate i am checking is this is serialized or not.
i have a strategy that reverses on the same bar, an exit and an entry order. the problem is that during backtesting the orders always fire exit followed by the entry order, forward testing this is not the case. entry orders can be executed before the exit. i can only figure this happens because OnBarUpdate processes are not serialized within this process. if they are then exit orders or not confirmed before the entry order is sent. i can not figure out any other reason for this to happen. |
|
|
|
|
|
#2 |
|
NinjaTrader Customer Service
Join Date: Sep 2008
Location: Germany
Posts: 22,421
Thanks: 252
Thanked 982 times in 964 posts
|
jupiejupie, I'm not exactly sure why you feel it would matter for use but yes that could happen - in realtime trading / simulation you're not processing events according to a historically known sequence but it would depend then on realtime market dynamics seen, the command to reverse will issue 2 orders to achieve that, whoever fills first will be the exit order and the other will serve to get you into the new desired direction.
Bertrand
NinjaTrader Customer Service |
|
|
|
|
|
#3 |
|
Senior Member
Join Date: Aug 2009
Location: bay area
Posts: 127
Thanks: 1
Thanked 2 times in 1 post
|
it matters because every once in a while the strategy places double my contract for the position. but it never does this in backtesting only forward testing, so it is not something that i have control over, it's totally how nt7 places and receives orders.
i only want my contacts double if i choose to do so not because nt7 gets confused as to the orders placed. |
|
|
|
|
|
#4 |
|
NinjaTrader Customer Service
Join Date: Sep 2008
Location: Germany
Posts: 22,421
Thanks: 252
Thanked 982 times in 964 posts
|
There would be normally 2 reasons seen for this :
a) strategy vs account position not in sync as needed b) you're placing doubled up orders on your conditions such as placing an Exit order on the reversal signal when the enter method would do the reverse for you automatically This could only be understood by simplifying and debugging your strategies order event sequence. One very useful tool is the TraceOrders feature : http://www.ninjatrader.com/support/f...ead.php?t=3627
Bertrand
NinjaTrader Customer Service |
|
|
|
|
|
#5 |
|
Senior Member
Join Date: Aug 2009
Location: bay area
Posts: 127
Thanks: 1
Thanked 2 times in 1 post
|
yes i am placing a exit order and then a entry order, so if i just reverse instead that will take care of the problem?
thanks so much can you also look at this reply, the ninja assist left work before it was resolved, i'd like to get some coding finished this weekend http://www.ninjatrader.com/support/f...ad.php?t=46985 |
|
|
|
|
|
#6 | |
|
NinjaTrader Customer Service
Join Date: Sep 2008
Location: Germany
Posts: 22,421
Thanks: 252
Thanked 982 times in 964 posts
|
Quote:
Bertrand
NinjaTrader Customer Service |
|
|
|
|
|
The following user says thank you to NinjaTrader_Bertrand for this post: |
|
![]() |
| Thread Tools | |
| Display Modes | |
|
|
Similar Threads
|
||||
| Thread | Thread Starter | Forum | Replies | Last Post |
| How do I kill ALL NT processes in Task Manager? | Rocket130713 | Automated Trading | 1 | 08-19-2010 04:31 AM |
| OnBarUpdate | eqtrader | General Programming | 5 | 07-28-2010 10:37 AM |
| OnBarUpdate() | Rhyshaelkan | General Programming | 0 | 01-09-2010 03:11 PM |
| Twice through OnBarUpdate()? | cybertunerone | Strategy Development | 4 | 02-08-2009 01:52 AM |
| OnBarUpdate | SystemTrading | Miscellaneous Support | 3 | 08-20-2008 10:38 AM |