![]() |
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
|
|||||||
| Strategy Development Support for the development of custom automated trading strategies using NinjaScript. |
![]() |
|
|
Thread Tools | Display Modes |
|
|
|
|
#1 |
|
Member
Join Date: Apr 2008
Posts: 72
Thanks: 0
Thanked 0 times in 0 posts
|
I'm wondering which method I should put my limit orders submissions in to that would avoid race conditions during a quickly moving market. I would have a List<LadderRow> of limit orders on the book and would want to remove/cancel limit orders as the market ticked in any direction. It would seem I'd want to put them in the OnBarUpdate() method. But what would happen if say the bid price moved up a tick and down a tick before my order confirmation could be received? I'd think a cancellation order might be sent before I received a order received packet.
So I wonder if instead I should place my order logic in a custom timer event method like the one listed in the reference samples. That way it would only check every 1000ms to see the status of the market and make any order changes. Thanks for input. |
|
|
|
|
|
#2 |
|
NinjaTrader Product Manager
Join Date: May 2007
Location: Denver, CO
Posts: 17,458
Thanks: 1
Thanked 106 times in 70 posts
|
If you do it off of OnBarUpdate() and had CalculateOnBarClose = false then you would run into issues you suspected in your post. Using a custom event could be one way to go about this. You could also program it to not do anything till modification confirmation has been received.
Josh
NinjaTrader Customer Service |
|
|
|
|
|
#3 |
|
Member
Join Date: Apr 2008
Posts: 72
Thanks: 0
Thanked 0 times in 0 posts
|
Thanks for the confirmation Josh. I'm going to test out utilizing the OnOrderUpdate method. Is this what you were referring to in your last sentence?
|
|
|
|
|
|
#4 |
|
NinjaTrader Product Manager
Join Date: May 2007
Location: Denver, CO
Posts: 17,458
Thanks: 1
Thanked 106 times in 70 posts
|
Correct. Off of OnOrderUpdate() you can check for the order state to be cancelled.
Josh
NinjaTrader Customer Service |
|
|
|
![]() |
| Thread Tools | |
| Display Modes | |
|
|
Similar Threads
|
||||
| Thread | Thread Starter | Forum | Replies | Last Post |
| Unmanaged Order Submission | NinjaTrader_Ray | Version 7 Beta General Questions & Bug Reports | 32 | 11-19-2009 03:08 PM |
| NT7: New Unmanaged Order Submission | BillCh | Suggestions And Feedback | 1 | 06-26-2009 08:30 AM |
| Race Condition Issue and Order Reject | dax3k | Automated Trading | 7 | 04-06-2009 08:19 AM |
| stop and target order submission | mdm72 | Strategy Development | 3 | 02-26-2009 07:08 AM |
| Race Conditions | TAJTrades | Strategy Development | 11 | 12-15-2008 07:19 AM |