Announcement
Collapse
No announcement yet.
Partner 728x90
Collapse
NinjaTrader
IOrder states logic
Collapse
X
-
Hello bltdavid,
Thank you for your post.
You would use OnOrderUpdate() and check for the Error listed as ErrorCode.UnableToChangeOrder. Keep in mind the order will just stay in the state it was, so the state won't change.
For information on what information you can pull from an order event please visit the following link: http://ninjatrader.com/support/helpG...t7/?iorder.htm
Leave a comment:
-
"not accepted" vs "rejected": Calling ChangeOrder on a Working order
Something in this order flow chart is not as clear as I was hoping for.
When ChangeOrder() is issued on an order in the Working state, and the change is not accepted, doesn't the original state of the order remain in the Working state?
See last post in this thread:
It seems the chart does not quite reflect Josh's point.
My deeper question is this:
If Josh's comment in the above thread is true, how does one discover the change request was not accepted? I mean, what does "not accepted" mean? I note that Josh did not use the word "rejected", he specifically used the words "not accepted".
Ok, so if a Working order remains in a Working state after a ChangeOrder() is not accepted, how does one discover this "not accepted" status of the call to ChangeOrder?
[I mean, one could assume that a change request via ChangeOrder that is not accepted would change a Working order to a Rejected order ... but if Working state means working at the exchange, I can understand how a "not accepted" change request would not actually affect the status of "working at the exchange".]
Thus, I can see how it does make sense that a change request that is "not accepted" does not change the state of a Working order. But, there we go again ... from a NinjaScript point of view (aka the Strategy programmer) what does "not accepted" really mean?
How does the strategy programmer know that a change request via ChangeOrder on a Working order is "not accepted"? ChangeOrder has no return value ...
Am I nuts?
What am I missing?
In context of calling ChangeOrder on a Working order, what is the difference between "rejected" and "not accepted"?
And, also, for sake of complete understanding, are there cases where a ChangeOrder on a Working order would ever change the state to Rejected?
And, lastly, does the order flow chart need updating to reflect any of this?
Leave a comment:
-
Very cool - I appreciate the efforts in this thread. We'll look to have something of this nature added to NinjaTrader 8 documentation when we have the time.
Leave a comment:
-
Hello,
Thank you all for your comments on misova's diagram.
I have forwarded koganam's suggestion to the development team for consideration in the documentation.
Leave a comment:
-
Very nicely done. Makes the order states clear and transparent. I suggest the NT adopt it and put it in the official documentation.Originally posted by misova View PostI am sending the latest version of IOrder state diagram.
The layout was significantly changed towards lower complexity
and to be more specific and precise...
Leave a comment:
-
-
I am not sure, how to draw it ....the only action I see at the broker side is to reply with OK / REJECTED...Originally posted by gregid View PostI would suggest adding vertical swim lanes to separate which state/action happens on the PC or at the broker side
In my thinking it would introduce some request / response sequence diagram,
which I am not sure, how to draw and mix with current state nature of diagram
in some elegant and simple way..
If you have any idea how to draw it, I will do it pleasure...Last edited by misova; 05-01-2015, 10:34 AM.
Leave a comment:
-
I would suggest adding vertical swim lanes to separate which state/action happens on the PC or at the broker side
Leave a comment:
-
There is a problem with your attachment - can you submit it again?Originally posted by misova View PostThis is the latest version of the IOrder states diagram,
where were added in red color:- Overfill event
- Rejection event
These are good candidates for error handling.
Still any other improvements/insights ?
Leave a comment:
-
Latest version of IOrder states diagram
This is the latest version of the IOrder states diagram,
where were added in red color:- Overfill event
- Rejection event
These are good candidates for error handling.
Still any other improvements/insights ?
Last edited by misova; 05-01-2015, 01:32 AM.
Leave a comment:
-
Hello,
Thanks for the reply.
If an order is filled and you attempt to modify the order before the filled status is received the order modification order will be rejected. The original order will be filled and is not rejected.
The modification is the rejection and the original order will be filled.
Leave a comment:
-
As I am reading another forums, I think I start to understand the mechanics of Rejected order state.
I misunderstood: that if order is in state Rejected, then it was refused and could have Filled Quantity. My simple logic said: order was Rejected, so it could not be filled.
But now I start to see my mistake: In reality, order can be in state Rejected could be filled (=have Filled Quantity).
It is most common scenario, that order that was filled is in state Filled or PartFilled, but it can be also in state Rejected.
This is something new for me...Last edited by misova; 04-30-2015, 09:57 AM.
Leave a comment:
-
This part is understood now, thank you.
Could you put more light on Comment #9 also please?
There is a problem discussing, that Rejected and Filled status should be exclusive states,
but probably they are not. ..
Thanks
Leave a comment:
Latest Posts
Collapse
| Topics | Statistics | Last Post | ||
|---|---|---|---|---|
|
Started by Geovanny Suaza, 02-11-2026, 06:32 PM
|
0 responses
636 views
0 likes
|
Last Post
|
||
|
Started by Geovanny Suaza, 02-11-2026, 05:51 PM
|
0 responses
366 views
1 like
|
Last Post
|
||
|
Started by Mindset, 02-09-2026, 11:44 AM
|
0 responses
107 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
569 views
1 like
|
Last Post
|
||
|
Started by RFrosty, 01-28-2026, 06:49 PM
|
0 responses
571 views
1 like
|
Last Post
by RFrosty
01-28-2026, 06:49 PM
|

Leave a comment: