Announcement

Collapse
No announcement yet.

Partner 728x90

Collapse

How can I match buy and sell execution objects (txns) under Executions Property?

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

    How can I match buy and sell execution objects (txns) under Executions Property?

    Hi,

    With Ninja Script, I can see list of all buys and sells under Executions property.

    The issue I am running into is how to match the sell executions with buy executions, which sell transaction corresponds to which buy transaction. I don't see any common ID or key that connects buys and sells.

    I have tried looking for a purchase just prior to said sale that contains the same number of contracts, but this is not deterministic since, for example, an order with quantity 10 generates 10 purchase executions with quantity 1, for the 10 sales executions later I would always select the same purchase execution.

    For the same reason, I think using Executions.OrderID is not deterministic either

    Which is better way to link these executions using Executions property? How can I match the buy and sell executions using Executions property?

    Thanks in advance!!

    P.D.1: It looks like ID # 1993 or # 1994 suggestion are related with this!!
    P.D.2: I'm using NinjaTrader 8
    Last edited by JoseFRS; 06-23-2021, 01:17 AM.

    #2
    Originally posted by JoseFRS View Post
    Hi,

    With Ninja Script, I can see list of all buys and sells under Executions property.

    The issue I am running into is how to match the sell executions with buy executions, which sell transaction corresponds to which buy transaction. I don't see any common ID or key that connects buys and sells.

    I have tried looking for a purchase just prior to said sale that contains the same number of contracts, but this is not deterministic since, for example, an order with quantity 10 generates 10 purchase executions with quantity 1, for the 10 sales executions later I would always select the same purchase execution.

    For the same reason, I think using Executions.OrderID is not deterministic either

    Which is better way to link these executions using Executions property? How can I match the buy and sell executions using Executions property?

    Thanks in advance!!

    P.D.1: It looks like ID # 1993 or # 1994 suggestion are related with this!!
    P.D.2: I'm using NinjaTrader 8
    Sorry: Subject of Post must be "How can I match buy and sell execution objects (txns) under Executions Property?"

    Comment


      #3
      Hello JoseFRS,

      Thank you for the post.

      The executions collection simply contains the executions however that won't allow you to pair any trades together. There is currently no supported means to pair the trades yourself, that is a feature of the main platform and strategies.

      You can see the following link for an unsupported sample of building a trade performance collection, as this is not documented we really can't provide any help on that in case of problems.
      I would like to augment the functionality of the chart trader buttons to include some database logging and a check of my prior trades before accepting the click event e.g. checking my recent trade history before actually submitting the order via the "Buy Market" or "Sell Market" buttons. Is there a way to


      I look forward to being of further assistance.

      Comment

      Latest Posts

      Collapse

      Topics Statistics Last Post
      Started by Geovanny Suaza, 02-11-2026, 06:32 PM
      0 responses
      633 views
      0 likes
      Last Post Geovanny Suaza  
      Started by Geovanny Suaza, 02-11-2026, 05:51 PM
      0 responses
      364 views
      1 like
      Last Post Geovanny Suaza  
      Started by Mindset, 02-09-2026, 11:44 AM
      0 responses
      105 views
      0 likes
      Last Post Mindset
      by Mindset
       
      Started by Geovanny Suaza, 02-02-2026, 12:30 PM
      0 responses
      567 views
      1 like
      Last Post Geovanny Suaza  
      Started by RFrosty, 01-28-2026, 06:49 PM
      0 responses
      568 views
      1 like
      Last Post RFrosty
      by RFrosty
       
      Working...
      X