Announcement

Collapse
No announcement yet.

Partner 728x90

Collapse

Ignored Limit Longs when closing an open position

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

    Ignored Limit Longs when closing an open position

    Hello everyone,

    I have a strange behavior:


    When I have an open SHORT Position an I close this position with:

    ExitShort(Convert.ToInt32(CurrentPositionSize));

    And I then send following new Limit-Longs immediately, these Longs are ignored.
    EnterLongLimit(BarsInProgress, true, Convert.ToInt32(Math.Ceiling(orderQuantity)), entryPrice, i + "/" + j);

    OnOrderUpdate is also not been triggered with the EnterLongLimit.

    What to do, to get the Limit Longs now?

    Thanks in advance.
    Airwave
    NinjaTrader Ecosystem Vendor - Airwave

    #2
    Hello Airwave,

    For a situation where the position needs to change after the action you are doing you would need to wait at least 1 bar to do that. OnBarUpdate would need to be called again for the position to have updated. If you wanted to immediately enter again you would need to include the limit order in a condition which is checking that the strategy is flat. The alternative would be to use OnExecutionUpdate and watch for the Exit to fill and then you could submit the new entry.

    Please let me know if I may be of further assistance.

    Comment


      #3
      Thanks Jesse for clarification.

      I followed your suggestion to put in a queue and checking for FLAT.

      Thanks
      Airwave
      NinjaTrader Ecosystem Vendor - Airwave

      Comment

      Latest Posts

      Collapse

      Topics Statistics Last Post
      Started by CarlTrading, 03-31-2026, 09:41 PM
      1 response
      47 views
      0 likes
      Last Post NinjaTrader_ChelseaB  
      Started by CarlTrading, 04-01-2026, 02:41 AM
      0 responses
      23 views
      0 likes
      Last Post CarlTrading  
      Started by CaptainJack, 03-31-2026, 11:44 PM
      0 responses
      33 views
      1 like
      Last Post CaptainJack  
      Started by CarlTrading, 03-30-2026, 11:51 AM
      0 responses
      51 views
      0 likes
      Last Post CarlTrading  
      Started by CarlTrading, 03-30-2026, 11:48 AM
      0 responses
      42 views
      0 likes
      Last Post CarlTrading  
      Working...
      X