Announcement

Collapse
No announcement yet.

Partner 728x90

Collapse

Trade Object from Executions

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

    Trade Object from Executions

    I have an Indicator which subscribes to ExecutionUpdate, so I can track all of my Executions.
    What I want to do now is to create Trades from these Executions, which I can then export for example.

    The trade object can be created like this:
    Code:
    Trade trade = new Trade(entryExecution, exitExecution, qty);
    so every trade consists of an entry and exit execution.

    When I just use simple orders with one buy and one sell then this code could work:
    Code:
    private Execution entryExecution = null;
    private void OnExecutionUpdate(object sender, ExecutionEventArgs e)
    {
        Execution execution = e.Execution;
    
        // doesn't work with position scaling
        if (entryExecution == null)
        {
            entryExecution = execution;
        }
        else
        {
            trade = new Trade(entryExecution, execution, 1);
            entryExecution = null;
            Print("Trade: " + trade);
        }
    }​
    but when it comes to multiple orders with different quantities and position scaling, this doesn't work.

    Is there an easier way to extract trades from executions similar to the way they are displayed in the Trade Performance tab? Or do I need to manually calculate these with all the order handling metrics?

    #2
    Thanks for the reply!

    It seems like SystemPerformance only works for trades placed within a strategy. What I'm looking for are the trades that are manually placed, I want to access them in an Indicator.








    Comment


      #3
      Thanks for the answer, Brandon!

      Yes this feature would be really helpful, please add my vote to this feature request. Thank you!

      Comment


        #4
        +1

        Please add my vote.

        Comment

        Latest Posts

        Collapse

        Topics Statistics Last Post
        Started by Geovanny Suaza, 02-11-2026, 06:32 PM
        0 responses
        647 views
        0 likes
        Last Post Geovanny Suaza  
        Started by Geovanny Suaza, 02-11-2026, 05:51 PM
        0 responses
        369 views
        1 like
        Last Post Geovanny Suaza  
        Started by Mindset, 02-09-2026, 11:44 AM
        0 responses
        108 views
        0 likes
        Last Post Mindset
        by Mindset
         
        Started by Geovanny Suaza, 02-02-2026, 12:30 PM
        0 responses
        572 views
        1 like
        Last Post Geovanny Suaza  
        Started by RFrosty, 01-28-2026, 06:49 PM
        0 responses
        573 views
        1 like
        Last Post RFrosty
        by RFrosty
         
        Working...
        X