Announcement

Collapse
No announcement yet.

Partner 728x90

Collapse

Repeated order submission calls sampleOnOrderUpdate

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

    Repeated order submission calls sampleOnOrderUpdate

    Hello,

    I've noticed that in the updated strategy sample sampleOnOrderUpdate for NT8 ExitLongStopMarket and ExitLongLimit for "MyStop" and "MyTarget" respectively are potentially called again for OrderState.Filled if previously called for OrderState.PartFilled. Should ChangeOrder be called if previously submitted/accepted/working for PartFilled? If called as done in the example, are they updating the previous logical orders or creating new logical orders? If we're tracking these orders via Order objects, do they need to be updated or OK to keep them to the initial pointer assignments during the first pass through OnOrderUpdate?

    Thanks,
    Silverm3170

    #2
    Hello silverm3170,

    In the sample it is using signal names so this will just amend the orders if there is a partial fill. You can also use ChangeOrder if you wanted as this sample demonstrates using Order objects, calling the entry method again is also acceptable. You can see in the OnBarUpdate where the stop order is being updated to breakeven, this is a similar concept to what is happening in OnOrderUpdate with the partial fill, it is just being updated for the partial fill or fill.

    You don't necessarily need to reset the variable each time you call the same order method however we do suggest doing that for good practice, this will result in uniform syntax by doing so. As long as you store your order variable once you could use that later for change order or other order tasks. Once you are done with the order make sure to set it to null to complete the logic.



    I look forward to being of further assistance.

    Comment


      #3
      I see. Thanks Jesse. So you're reassigning the order object again via the return call, i.e. stopOrder = Exit....

      Comment


        #4
        Hello silverm3170 ,

        Right, a note about that. In the sample we show the object being returned from the order method however it is generally suggested to instead assign the order objects how the entry is handled in that script. Or more specifically to observe the OnOrderUpdate/OnExecutionUpdate and then assign the variable from that point. This ensures the order was successful and has a valid state before it starts to get used in your logic. The sample is very simple so that is not really needed there and only the entry displays using this approach.


        I look forward to being of further assistance.

        Comment

        Latest Posts

        Collapse

        Topics Statistics Last Post
        Started by NullPointStrategies, Today, 05:17 AM
        0 responses
        50 views
        0 likes
        Last Post NullPointStrategies  
        Started by argusthome, 03-08-2026, 10:06 AM
        0 responses
        126 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