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 SalmaTrader, 07-07-2026, 10:26 PM
        0 responses
        47 views
        0 likes
        Last Post SalmaTrader  
        Started by CarlTrading, 07-05-2026, 01:16 PM
        0 responses
        22 views
        0 likes
        Last Post CarlTrading  
        Started by CaptainJack, 06-17-2026, 10:32 AM
        0 responses
        15 views
        0 likes
        Last Post CaptainJack  
        Started by kinfxhk, 06-17-2026, 04:15 AM
        0 responses
        21 views
        0 likes
        Last Post kinfxhk
        by kinfxhk
         
        Started by kinfxhk, 06-17-2026, 04:06 AM
        0 responses
        23 views
        0 likes
        Last Post kinfxhk
        by kinfxhk
         
        Working...
        X