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 charlesugo_1, 05-26-2026, 05:03 PM
        0 responses
        68 views
        0 likes
        Last Post charlesugo_1  
        Started by DannyP96, 05-18-2026, 02:38 PM
        1 response
        151 views
        0 likes
        Last Post NinjaTrader_ChelseaB  
        Started by CarlTrading, 05-11-2026, 05:56 AM
        0 responses
        162 views
        0 likes
        Last Post CarlTrading  
        Started by CarlTrading, 05-10-2026, 08:12 PM
        0 responses
        100 views
        0 likes
        Last Post CarlTrading  
        Started by Hwop38, 05-04-2026, 07:02 PM
        0 responses
        288 views
        0 likes
        Last Post Hwop38
        by Hwop38
         
        Working...
        X