Announcement

Collapse

Looking for a User App or Add-On built by the NinjaTrader community?

Visit NinjaTrader EcoSystem and our free User App Share!

Have a question for the NinjaScript developer community? Open a new thread in our NinjaScript File Sharing Discussion Forum!
See more
See less

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.
      JesseNinjaTrader Customer Service

      Comment

      Latest Posts

      Collapse

      Topics Statistics Last Post
      Started by yertle, Yesterday, 08:38 AM
      7 responses
      28 views
      0 likes
      Last Post yertle
      by yertle
       
      Started by bmartz, 03-12-2024, 06:12 AM
      2 responses
      21 views
      0 likes
      Last Post bmartz
      by bmartz
       
      Started by funk10101, Today, 12:02 AM
      0 responses
      6 views
      0 likes
      Last Post funk10101  
      Started by gravdigaz6, Yesterday, 11:40 PM
      1 response
      9 views
      0 likes
      Last Post NinjaTrader_Manfred  
      Started by MarianApalaghiei, Yesterday, 10:49 PM
      3 responses
      11 views
      0 likes
      Last Post NinjaTrader_Manfred  
      Working...
      X