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 CarlTrading, 03-31-2026, 09:41 PM
        1 response
        81 views
        1 like
        Last Post NinjaTrader_ChelseaB  
        Started by CarlTrading, 04-01-2026, 02:41 AM
        0 responses
        42 views
        0 likes
        Last Post CarlTrading  
        Started by CaptainJack, 03-31-2026, 11:44 PM
        0 responses
        64 views
        2 likes
        Last Post CaptainJack  
        Started by CarlTrading, 03-30-2026, 11:51 AM
        0 responses
        66 views
        0 likes
        Last Post CarlTrading  
        Started by CarlTrading, 03-30-2026, 11:48 AM
        0 responses
        54 views
        0 likes
        Last Post CarlTrading  
        Working...
        X