Announcement

Collapse
No announcement yet.

Partner 728x90

Collapse

IOrder states logic

Collapse
X
 
  • Filter
  • Time
  • Show
Clear All
new posts

  • bltdavid
    replied
    Good info here, too:
    http://ninjatrader.com/support/forum...76&postcount=5

    Leave a comment:


  • NinjaTrader_PatrickH
    replied
    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:


  • bltdavid
    replied
    "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:
    http://ninjatrader.com/support/forum...ad.php?t=26644

    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?
    Last edited by bltdavid; 10-14-2015, 10:38 PM. Reason: Added question "for sake of completeness"

    Leave a comment:


  • NinjaTrader_Matthew
    replied
    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:


  • NinjaTrader_PatrickH
    replied
    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:


  • koganam
    replied
    Originally posted by misova View Post
    I am sending the latest version of IOrder state diagram.
    The layout was significantly changed towards lower complexity
    and to be more specific and precise...


    Very nicely done. Makes the order states clear and transparent. I suggest the NT adopt it and put it in the official documentation.

    Leave a comment:


  • misova
    replied
    I am sending the latest version of IOrder state diagram.
    The layout was significantly changed towards lower complexity
    and to be more specific and precise...


    Attached Files

    Leave a comment:


  • misova
    replied
    Originally posted by gregid View Post
    I would suggest adding vertical swim lanes to separate which state/action happens on the PC or at the broker side
    I am not sure, how to draw it ....the only action I see at the broker side is to reply with OK / REJECTED...

    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, 09:34 AM.

    Leave a comment:


  • gregid
    replied
    I would suggest adding vertical swim lanes to separate which state/action happens on the PC or at the broker side

    Leave a comment:


  • misova
    replied
    Thanx, should be updated and OK now...

    Leave a comment:


  • gregid
    replied
    Originally posted by misova View Post
    This is the latest version of the IOrder states diagram,
    where were added in red color:
    1. Overfill event
    2. Rejection event

    These are good candidates for error handling.
    Still any other improvements/insights ?

    There is a problem with your attachment - can you submit it again?

    Leave a comment:


  • misova
    replied
    Latest version of IOrder states diagram

    This is the latest version of the IOrder states diagram,
    where were added in red color:
    1. Overfill event
    2. Rejection event

    These are good candidates for error handling.
    Still any other improvements/insights ?

    Attached Files
    Last edited by misova; 05-01-2015, 12:32 AM.

    Leave a comment:


  • NinjaTrader_AlexG
    replied
    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:


  • misova
    replied
    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, 08:57 AM.

    Leave a comment:


  • misova
    replied
    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 wjadevries, Today, 12:04 PM
1 response
11 views
0 likes
Last Post NinjaTrader_Jesse  
Started by PhineasPhred, Today, 11:52 AM
2 responses
13 views
0 likes
Last Post PhineasPhred  
Started by kenbun, Yesterday, 12:21 PM
2 responses
21 views
0 likes
Last Post eDanny
by eDanny
 
Started by patricia70, Today, 11:26 AM
3 responses
12 views
0 likes
Last Post NinjaTrader_Spencer  
Started by pdennis, Today, 11:42 AM
1 response
10 views
0 likes
Last Post NinjaTrader_BrandonH  
Working...
X