Announcement

Collapse
No announcement yet.

Partner 728x90

Collapse

About OnOrderUpdate processing data

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

    About OnOrderUpdate processing data

    Hello,

    I'm getting a curious behavior, need a confirmation please.
    I'm using triggers by OnOrderUpdate and OnExecutionUpdate.

    I discovered that processing CancelOrder() inside OnExecutionUpdate, will be process first OnOrderUpdate, following after with normal process data.

    Send you capture .. in the log I get Debug event 1,2,3 ...

    Click image for larger version

Name:	imagen.png
Views:	55
Size:	488.5 KB
ID:	1329978

    This is strange but finally can be useful to avoid "flag variables".
    Does it depend from the regular NT8 process? Please could you tell me something more, and if is it a stable behavior and if it never change please?

    Many thanks. Regards.


    Attached Files

    #2
    Hello ClauTrade,

    When you call CancelOrder the order state of the order will change so OnOrderUpdate would be the next event to be called even if that was executed from OnExecutionUpdate based on a previous execution event.

    Comment


      #3
      Hello Jesse,

      many thanks for the fast reply! ...Great, I think that is because is a cancellation and is an internal process ... I guess that it does not depend from the account (sim, playback or real).

      Thanks and have nice day!

      Comment


        #4
        Originally posted by NinjaTrader_Jesse View Post
        Hello ClauTrade,

        When you call CancelOrder the order state of the order will change so OnOrderUpdate would be the next event to be called even if that was executed from OnExecutionUpdate based on a previous execution event.
        Hello Jesse,

        this is clean ...anyway I suppose that OCO (as it's a cancellation of order) should have same rules of CancelOrder() ... but maybe not.

        Unfortunately I have problem with OCO orders and a important difference between Playback (Replay) and Strategy Analyzer.

        * Playback: When a order is executed, the OCO cancellation of other order will be next event ... and then next event is OnExecutionUpdate. Same behavior for OCO and CancelOrder()).
        * Strategy Analyzer: When a order is executed, next event will be OnExecutionUpdate process, and then OCO cancel the other orders. I tested that CancelOrder() yes have priority like PlayBack. So, different behavior for OCO and CancelOrder()).

        I'm agree about the logical priority of the cancellation of the order, and that Playback do it with OCO too ... buy why Strategy Analyzer do not do it with OCO?

        Could you tell me about and confirm this please?
        Thanks


        Last edited by ClauTrade; 01-12-2025, 03:56 PM.

        Comment


          #5
          Hello ClauTrade,

          I am not sure I follow what you are saying, if part of an OCO pair is cancelled due to one of the orders filling you should see 1 OnExecutionUpdate for the fill of the order and OnOrderUpdate called for the other order that was cancelled. You shouldn't see OnExecutionUpdate called for the cancelled order. You also don't use CancelOrder on OCO tied orders whn one fills, you allow the order to cancel based on the OCO. Cancel order would only be used to directly cancel a working order that has not filled and not any OCO associated orders which will cancel based on OCO.

          Comment

          Latest Posts

          Collapse

          Topics Statistics Last Post
          Started by NullPointStrategies, Today, 05:17 AM
          0 responses
          51 views
          0 likes
          Last Post NullPointStrategies  
          Started by argusthome, 03-08-2026, 10:06 AM
          0 responses
          129 views
          0 likes
          Last Post argusthome  
          Started by NabilKhattabi, 03-06-2026, 11:18 AM
          0 responses
          69 views
          0 likes
          Last Post NabilKhattabi  
          Started by Deep42, 03-06-2026, 12:28 AM
          0 responses
          42 views
          0 likes
          Last Post Deep42
          by Deep42
           
          Started by TheRealMorford, 03-05-2026, 06:15 PM
          0 responses
          46 views
          0 likes
          Last Post TheRealMorford  
          Working...
          X