Announcement

Collapse
No announcement yet.

Partner 728x90

Collapse

Whats best to use? OnExecutionUpdate() or OnOrderUpdate() or OnExecution()

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

    Whats best to use? OnExecutionUpdate() or OnOrderUpdate() or OnExecution()

    Hi,

    I have a Strategy running that's working really well...

    Just ironing out a few things once order is ''filled"

    I'm using the ATMStrategyCreate() method for order submission...


    I see different event driven methods work with a strategy but doesn't directly say ATMStrategy and was wanting to know the best method for accessing ATMStrategy data once order filled.
    OnOrderUpdate()
    OnExecutionUpdate()
    OnExecution()


    Actually just want to catch the filled price once order filled so I can use this to manage from here..


    I see this a lot in the documentation..
    AveragePrice

    The wording Average meaning the average for a price range, to me so doesn't make sense...

    Print("The average entry price is " + Position.AveragePrice);​​ // Gets the average entry price of the strategy position

    So the average price is the filled price?
    It just doesn't seem to match whats showing on my chart trader..


    So if I use the OnExecutionUpdate() method the filled price is the price?

    protected override void OnExecutionUpdate(Execution execution, string executionId, double price, int quantity, MarketPosition marketPosition, string orderId, DateTime time)
    {


    }

    Thanks



    Last edited by traderhawk; 02-07-2023, 09:26 PM.

    #2
    OnOrderUpdate() and OnExecutionUpdate() can't be used if order was generated by ATMStrategyCreate(). You have to use GetAtmStrategyPositionAveragePrice()

    Check out SampleAtmStrategy in your strategy folder. You can see how to set atmStrategyId and orderId.
    Last edited by Leeroy_Jenkins; 02-08-2023, 01:31 AM.

    Comment


      #3
      Thanks for clarification..I new about the GetAtmStrategyPositionAveragePrice() method but thought it was better to use the OnExecutionUpdate() ..that explains why I didn't have that event triggering...lol

      Just the script documents mention..
      OnExecutionUpdate()
      Definition
      An event driven method which is called on an incoming execution of an order managed by a strategy. An execution is another name for a fill of an order.




      Last edited by traderhawk; 02-08-2023, 02:11 AM.

      Comment


        #4
        Hi, thanks for posting. The OnOrderUpdate/OnExecutionUpdate events will not trigger for strategies that submit ATM templates. Using GetAtmStrategyPositionAveragePrice() is correct.

        Kind regards,
        -ChrisL​

        Comment

        Latest Posts

        Collapse

        Topics Statistics Last Post
        Started by NullPointStrategies, Yesterday, 05:17 AM
        0 responses
        76 views
        0 likes
        Last Post NullPointStrategies  
        Started by argusthome, 03-08-2026, 10:06 AM
        0 responses
        146 views
        0 likes
        Last Post argusthome  
        Started by NabilKhattabi, 03-06-2026, 11:18 AM
        0 responses
        79 views
        0 likes
        Last Post NabilKhattabi  
        Started by Deep42, 03-06-2026, 12:28 AM
        0 responses
        50 views
        0 likes
        Last Post Deep42
        by Deep42
         
        Started by TheRealMorford, 03-05-2026, 06:15 PM
        0 responses
        54 views
        0 likes
        Last Post TheRealMorford  
        Working...
        X