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 CarlTrading, 05-11-2026, 05:56 AM
        0 responses
        56 views
        0 likes
        Last Post CarlTrading  
        Started by CarlTrading, 05-10-2026, 08:12 PM
        0 responses
        34 views
        0 likes
        Last Post CarlTrading  
        Started by Hwop38, 05-04-2026, 07:02 PM
        0 responses
        195 views
        0 likes
        Last Post Hwop38
        by Hwop38
         
        Started by CaptainJack, 04-24-2026, 11:07 PM
        0 responses
        359 views
        0 likes
        Last Post CaptainJack  
        Started by Mindset, 04-21-2026, 06:46 AM
        0 responses
        281 views
        0 likes
        Last Post Mindset
        by Mindset
         
        Working...
        X