Announcement

Collapse
No announcement yet.

Partner 728x90

Collapse

How to determine if Execution is Buy or Sell?

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

    How to determine if Execution is Buy or Sell?

    The Executions tab has a "Action" column for the executions but the Execution data structure https://ninjatrader.com/support/help...?execution.htm does not have this field. The Order field for the structure is not always available. How would I determine whether the Execution is buy or sell without the Order object?

    #2
    Hi ntbone, thanks for your post.

    The Execution object will have an Order object as a property and there you can get the order action. If you can't or do not want to use that, you would either need to create specific Signal Names for the executions so you can identify them through a string literal or use the MarketPosition property.

    Kind regards,

    -ChrisL

    Comment


      #3
      The documentation states that not all Executions may have an Order object so getting that information from there may not always be possible. I do see the documentation for MarketPosition but it is not clear how a MarketPosition of Long or Short applies to an execution. Execution are Buy/Sell operations. The Action column shows Buy/Sell not Long/Short.

      Comment


        #4
        Hi ntbone, thanks for your reply.

        The marketPosition parameter will report long for a buy execution and short for a sell execution. The Execution object will not have an Order object when its a ExitOnSessionClose execution or an execution from a NinjaScript submitted ATM. In that case, the signal name will be important, and you will know to check this if the Order object == Null.

        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