![]() |
|
|||||||
| Strategy Development Support for the development of custom automated trading strategies using NinjaScript. |
![]() |
|
|
Thread Tools | Display Modes |
|
|
#1 |
|
Junior Member
Join Date: Aug 2009
Posts: 29
Thanks: 0
Thanked 1 time in 1 post
|
When using the CancelOrder() method I'm finding that the order is not canceled immediately, but rather at the start of a new bar. Is it supposed to work like this?
When I create an order through chart trader, and then close the order, it closes immediately. How can I achieve this level of response programatically? Thanks Peter Update: O.K. After many hours I've got this issue sorted, one must use this limit order method - EnterLongLimit(int barsInProgressIndex, bool liveUntilCancelled, int quantity, double limitPrice, string signalName) and not the short version. It would be helpful if a note could be added to the help guide on this issue.
Last edited by boreland; 12-27-2009 at 03:56 PM.
|
|
|
|
|
|
#2 |
|
NinjaTrader Customer Service
Join Date: Sep 2008
Location: Germany
Posts: 22,377
Thanks: 252
Thanked 966 times in 949 posts
|
Hi boreland, correct you would need to use the extended overload in multiseries context to submit to the need bars object, but not sure I fully follow on what you expected from CancelOrder() - it would depend mostly if you run the strategy on each tick or not (CalculateOnBarClose setting).
For the EnterLongLimit, the orders just expires at the end of each bar if not resubmitted or set to liveUntilCancelled.
Bertrand
NinjaTrader Customer Service |
|
|
|
![]() |
| Thread Tools | |
| Display Modes | |
|
|
Similar Threads
|
||||
| Thread | Thread Starter | Forum | Replies | Last Post |
| NinjaTrader crashes when I load strategy with CancelOrder() | leontancfa | Strategy Development | 7 | 09-17-2009 07:49 AM |
| Strategy: Using CancelOrder() method to cancel orders | NinjaTrader_Josh | Reference Samples | 0 | 07-20-2009 01:51 PM |
| How CancelOrder() work? | xewoox | Strategy Development | 6 | 02-18-2009 02:21 PM |
| Simple Limit Strategy with CancelOrder | stefy | Strategy Development | 7 | 11-10-2008 07:44 AM |
| CancelOrder() problem | John833 | Strategy Development | 41 | 10-31-2008 03:15 PM |