Thanks for the report. I've put together a quick test here and I see no difference in the way that GTC or DAY orders are handled. Your script has quite a bit in there that could be hanging things up. Would you be able to simplify this as much as possible and see if you can demonstrate this behavior again?
Announcement
Collapse
No announcement yet.
Partner 728x90
Collapse
NinjaTrader
CancelOrder() possible for order that needs refreshing every bar?
Collapse
X
-
Hi NutFlush,
Thanks for the report. I've put together a quick test here and I see no difference in the way that GTC or DAY orders are handled. Your script has quite a bit in there that could be hanging things up. Would you be able to simplify this as much as possible and see if you can demonstrate this behavior again?MatthewNinjaTrader Product Management
-
Hi Matthew,Originally posted by NinjaTrader_Matthew View PostHi NutFlush,
Thanks for the report. I've put together a quick test here and I see no difference in the way that GTC or DAY orders are handled. Your script has quite a bit in there that could be hanging things up. Would you be able to simplify this as much as possible and see if you can demonstrate this behavior again?
quite frankly, I am starting to get a bit "unnerved" as I feel I just "get the ball kicked back to me".
What do you want me to simplify? This is as simple as it gets if I want to test the suggestions you made:
- use a different time frame (1 min vs. 3 min)
- use TriggerCustomEvent()
- use a timer to get a trigger from outside OnBarUpdate()
The code runs one scenario after the other, which might look confusing to you, but there shouldn't be anything that could "hang things up".
The GNB test also starts with the most simple test: cancel the 3min bar entry triggered by the next 1min bar of the secondary symbol. This is exactly what you suggested as a solution and it doesn't work!
So would you please take the time and run my scripts? Unless we see what your results are we won't even know if our NT installations behave similarly. Otherwise there might be something wrong with my platform and we would need to sort that out first.
Feel free to post your test routine as well so that I can try yours also.
Please be aware that I used my IB sim account (not sim101) to test the orders.
Cheers,
NutFlush
Comment
-
NutFlush,
Sorry for the confusion as I misunderstood your use of GoodTilCanceled to refer to the TimeInForce property "GTC" or "DAY'. I now understand that you were referring to the liveUntilCanceled bool.
Yes, it is by design that an order with liveUntilCanceled false will not work with CancelOrder(). The order will simply expire at the end of the bar. If you want control over when the order is canceled, you will need to use liveUntilCancled = true (reference sample)
Please allow me to clarify a few things as I do not want to make you feel like we're punting the ball at you, but we need to work in mutual agreement of our support services:
We do not debug custom scripts. If you need help debugging your script, you can always work with a NinjaScript consultant.
If you feel there may be a problem with the NinjaTrader core, or would like clarification on designed behavior, we are happy to and is our responsibility to help, but we will need you to put these requests in the most simplified way possible. We simply do not have the resources to analyze and step through all of your personal debug methods you've added. While I'm sure this information has been helpful for you in your own testing, this information is unnecessary to get to the base of the problem; as you put it, "might look confusing" and admittedly, confused me. I hope you understand where we are coming from in this regard.
I've attached a sample of what we mean by a simplified script. This should help both parties move forward on inquires in the most productive manner possible.
Please let me know if there is anything I can assist with.Attached FilesLast edited by NinjaTrader_Matthew; 08-13-2013, 04:55 PM.MatthewNinjaTrader Product Management
Comment
-
Hi Matthew,Originally posted by NinjaTrader_Matthew View PostNutFlush,
Sorry for the confusion as I misunderstood your use of GoodTilCanceled to refer to the TimeInForce property "GTC" or "DAY'. I now understand that you were referring to the liveUntilCanceled bool.
Yes, it is by design that an order with liveUntilCanceled false will not work with CancelOrder(). The order will simply expire at the end of the bar. If you want control over when the order is canceled, you will need to use liveUntilCancled = true (reference sample)
Please allow me to clarify a few things as I do not want to make you feel like we're punting the ball at you, but we need to work in mutual agreement of our support services:
We do not debug custom scripts. If you need help debugging your script, you can always work with a NinjaScript consultant.
If you feel there may be a problem with the NinjaTrader core, or would like clarification on designed behavior, we are happy to and is our responsibility to help, but we will need you to put these requests in the most simplified way possible. We simply do not have the resources to analyze and step through all of your personal debug methods you've added. While I'm sure this information has been helpful for you in your own testing, this information is unnecessary to get to the base of the problem; as you put it, "might look confusing" and admittedly, confused me. I hope you understand where we are coming from in this regard.
I've attached a sample of what we mean by a simplified script. This should help both parties move forward on inquires in the most productive manner possible.
Please let me know if there is anything I can assist with.
thanks for your clarification. I understand that you don't debug scripts for customers (and totally agree). My scripts were an attempt to make clear where the issue is and hopefully provide useful information (as output) to help you guys to further analyse the cause. I understand that this was too detailed and will try to keep scripts as simple as possible in the future.
On the other hand I would expect that whatever (little!) information I provide will be carefully looked at. It appears to me that this is not always the case - and wasn't so here.
My initial question was this:
As you explained, the answer is "Yes, they cannot be cancelled!". Why this answer wasn't given to me in the first place is beyond me. Unfortunately the ensuing discussion and programming cost me a lot of time and also unnecessarily consumed your support resources...Is it in general not possible to cancel the orders that expire after one bar?
I am truly open for feedback to show me that my initial post wasn't as clear as it should have been, as I am no native English speaker.
Anyway, I must say that in general I really appreciate the support given by all of you! No hard feelings!
Regarding the other issue with the TriggerCustomEvent() not running on historical data:
Will you get back to this post here when you have more information?The custom trigger method doesn't work as I expect in the strategy base. We're looking into this further.
Thanks,
NutFlush
Comment
-
Nutflush,
It was a misunderstanding and sorry for that. Providing a sample script that clearly shows what you're trying to do may help prevent this type of confusion moving forward.
In terms of the TriggerCustomEvent(), our development has informed me that these events will only work on historical data for an indicator, but not in a strategy. We're looking to ensure that this method will behave the same on both bases and will work in real-time and historical.MatthewNinjaTrader Product Management
Comment
-
OK, will try to do that in the future!Originally posted by NinjaTrader_Matthew View PostNutflush,
It was a misunderstanding and sorry for that. Providing a sample script that clearly shows what you're trying to do may help prevent this type of confusion moving forward.
Thanks for the info!Originally posted by NinjaTrader_Matthew View PostIn terms of the TriggerCustomEvent(), our development has informed me that these events will only work on historical data for an indicator, but not in a strategy. We're looking to ensure that this method will behave the same on both bases and will work in real-time and historical.
Will this be implemented through a new release? Any idea when that change will be implemented?
Cheers,
NutFlush
Comment
Latest Posts
Collapse
| Topics | Statistics | Last Post | ||
|---|---|---|---|---|
|
Started by Geovanny Suaza, 02-11-2026, 06:32 PM
|
0 responses
656 views
0 likes
|
Last Post
|
||
|
Started by Geovanny Suaza, 02-11-2026, 05:51 PM
|
0 responses
371 views
1 like
|
Last Post
|
||
|
Started by Mindset, 02-09-2026, 11:44 AM
|
0 responses
109 views
0 likes
|
Last Post
by Mindset
02-09-2026, 11:44 AM
|
||
|
Started by Geovanny Suaza, 02-02-2026, 12:30 PM
|
0 responses
574 views
1 like
|
Last Post
|
||
|
Started by RFrosty, 01-28-2026, 06:49 PM
|
0 responses
579 views
1 like
|
Last Post
by RFrosty
01-28-2026, 06:49 PM
|

Comment