Announcement

Collapse
No announcement yet.

Partner 728x90

Collapse

ExitLong can generate enter short position?

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

    ExitLong can generate enter short position?

    Hello Support,

    I am testing my strategy, and just observe the following:
    1. Strategy was loaded, two successive EnterLong was just missed. Position is flat.

    2. Strategy then generate ExitLong, but I saw in the Execution tab, it actually generate two Sells.

    Is this expected ? Why is that so? What measures should be taken to prevent such thing from happenning?

    Also what is the difference between Sell short and Sell action?
    And what is the difference between Sell to cover and Close action?
    Under what circumstances the API calls translate to these different executions?

    Thanks.

    Regards,

    Edward K.

    #2
    Edward,

    1 and 2. Suggest you use TraceOrders = true to understand why it skipped certain trades. Likely ignored due to EntriesPerDirection limitations.

    Sell Short gets you into a short position. Sell is meant for closing a long position.

    Buy to cover is meant to close a short position. Close position is what happens when you try to do a reversal. If you were long and you did EnterShort(), you will see a "close position" which ultimately translates to a "Sell" and then the EnterShort() would be a "SellShort".

    NinjaTrader handles these under the hood all the time so you generally don't have to worry about them.
    Josh P.NinjaTrader Customer Service

    Comment


      #3
      ExitLong can generate short

      Hello Josh,

      The two missed Longs are prior to strategy being loaded. I should not say missed Longs. There is another long after strategy is loaded, but that was correctly filtered by Entries Per Direction which has been set at 2.

      At what level the Position Management is done?
      I thought as you mentioned, ninja handles these under the hood, so it should know there is no two longs position. Hence when ExitLong is called by the strategy (as it is appropriate), ninja should not generate Sell 2 quantity and hence enter a short position. It should just ignore and do nothing.

      Thanks.

      Regards.
      Edward K.

      Comment


        #4
        Positions are independent in terms of the strategy. Whether that matches your account position is a different issue. Please use Print() to check the strategy position and you will see how that matches to your account position which may or may not be different.
        Josh P.NinjaTrader Customer Service

        Comment

        Latest Posts

        Collapse

        Topics Statistics Last Post
        Started by Geovanny Suaza, 02-11-2026, 06:32 PM
        0 responses
        672 views
        0 likes
        Last Post Geovanny Suaza  
        Started by Geovanny Suaza, 02-11-2026, 05:51 PM
        0 responses
        379 views
        1 like
        Last Post Geovanny Suaza  
        Started by Mindset, 02-09-2026, 11:44 AM
        0 responses
        111 views
        0 likes
        Last Post Mindset
        by Mindset
         
        Started by Geovanny Suaza, 02-02-2026, 12:30 PM
        0 responses
        575 views
        1 like
        Last Post Geovanny Suaza  
        Started by RFrosty, 01-28-2026, 06:49 PM
        0 responses
        582 views
        1 like
        Last Post RFrosty
        by RFrosty
         
        Working...
        X