Announcement

Collapse
No announcement yet.

Partner 728x90

Collapse

Using UnManaged orders, why not submit Exit orders from OOU() rather than OEU()?

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

    Using UnManaged orders, why not submit Exit orders from OOU() rather than OEU()?

    Hi,

    Objective of this post: I am seeking more timely submission of Exit Orders upon the Fill of an entry order.

    Context for this Strategy:
    - I am using Unmanaged orders on CME Futures contracts
    - Only one contract per order so I assume I will never see a partial fill.
    - Use Limit orders for entries so the approximate position average entry price is reasonably well understood.


    Context for the questions: A number of samples and posts include the following statement.

    /* We advise monitoring OnExecution to trigger submission of stop/target orders instead of OnOrderUpdate()
    since OnExecution() is called after OnOrderUpdate() which ensures your strategy has received the execution
    which is used for internal signal tracking. */

    Q: "ensures your strategy has received the execution which is used for internal signal tracking." What internal signal tracking of impact to my strategy am I missing out on by submitting exits in OOU() rather than OEU()?

    Q: At what point (e.g. before or after OOU() and OEU()) of the order lifecycle is the Strategy Position status updated, specifically Position.Quantity and MarketPosition?

    Q: At what point (e.g. before or after OOU() and/or OEU()) of the order lifecycle is the Strategy Position status updated, specifically Position.Quantity and MarketPosition?

    Q: So overall.. why "not" submit Exit orders from OnOrderUpdate() rather than OnExecutionUpdate()?

    Thanks!

    Hedge

    #2
    Hello Hedge,

    The execution often happens after the order update. So the execution information is not yet ready as the order is updating in OnOrderUpdate(). Further, the position will not yet have changed.

    The position is updated in OnPositionUpdate which occurs after the execution update, but is not guaranteed to be before or after the order update.

    The position may not have updated, but if you are using the unmanaged approach this would not result in an ignored order as you can send any order you want at any time.
    Chelsea B.NinjaTrader Customer Service

    Comment


      #3
      Hi Chelsea,

      Thanks for the reply.

      That is good information.

      I have been assuming that when using Unmanaged Orders, an OnOrderUpdate() event showing the order state as OrderState.Filled means the execution for that order in reality is fully complete.

      Is this assumption incorrect?

      Hedge

      Comment


        #4
        Hello Hedge,

        This is correct. The order.OrderState.Filled means that the order.Filled is equal to the order.Quantity.
        Chelsea B.NinjaTrader Customer Service

        Comment


          #5
          Thanks!


          Originally posted by NinjaTrader_ChelseaB View Post
          Hello Hedge,

          The execution often happens after the order update. So the execution information is not yet ready as the order is updating in OnOrderUpdate(). Further, the position will not yet have changed.

          The position is updated in OnPositionUpdate which occurs after the execution update, but is not guaranteed to be before or after the order update.

          As your reply above implies I have noticed that on occasion the marketPosition event Argument OEU() does not match Position.MarketPosition.
          " if (Position.MarketPosition != marketPosition) Print(.... "

          E.g Position.MarketPosition has been and is still currently "Position.MarketPosition == MarketPosition.Short" while e.marketPosition == Long


          So I wanted to clarify how I should read marketPosition while processing a new event in OEU().

          Does e.marketPosition in an OEU() event reflect:
          - The current Position.MarketPoisiton value at that instant
          - Sometimes reflect a change to the true Strategy Position prior to the OnPositionUpdate() event that will show that change in Position.MarketPosition
          - Instead is displaying the side of the Market of the order referenced in that Execution event
          - Something else..

          Hedge
          Last edited by hedgeplay; 05-10-2022, 10:27 PM.

          Comment


            #6
            Hello hedgeplay,

            The position.MarketPostion is the updating position, while marketPosition is the actual positions market position.




            In OnExecutionUpdate the execution.Position is the account position at the moment of the execution.
            Chelsea B.NinjaTrader Customer Service

            Comment


              #7
              Thanks Chelsea!

              These references are very helpful.

              Hedge

              Comment

              Latest Posts

              Collapse

              Topics Statistics Last Post
              Started by NullPointStrategies, Today, 05:17 AM
              0 responses
              53 views
              0 likes
              Last Post NullPointStrategies  
              Started by argusthome, 03-08-2026, 10:06 AM
              0 responses
              130 views
              0 likes
              Last Post argusthome  
              Started by NabilKhattabi, 03-06-2026, 11:18 AM
              0 responses
              70 views
              0 likes
              Last Post NabilKhattabi  
              Started by Deep42, 03-06-2026, 12:28 AM
              0 responses
              44 views
              0 likes
              Last Post Deep42
              by Deep42
               
              Started by TheRealMorford, 03-05-2026, 06:15 PM
              0 responses
              49 views
              0 likes
              Last Post TheRealMorford  
              Working...
              X