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 NullPointStrategies, Yesterday, 05:17 AM
      0 responses
      64 views
      0 likes
      Last Post NullPointStrategies  
      Started by argusthome, 03-08-2026, 10:06 AM
      0 responses
      139 views
      0 likes
      Last Post argusthome  
      Started by NabilKhattabi, 03-06-2026, 11:18 AM
      0 responses
      75 views
      0 likes
      Last Post NabilKhattabi  
      Started by Deep42, 03-06-2026, 12:28 AM
      0 responses
      45 views
      0 likes
      Last Post Deep42
      by Deep42
       
      Started by TheRealMorford, 03-05-2026, 06:15 PM
      0 responses
      50 views
      0 likes
      Last Post TheRealMorford  
      Working...
      X