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 Mindset, 04-21-2026, 06:46 AM
      0 responses
      93 views
      0 likes
      Last Post Mindset
      by Mindset
       
      Started by M4ndoo, 04-20-2026, 05:21 PM
      0 responses
      138 views
      0 likes
      Last Post M4ndoo
      by M4ndoo
       
      Started by M4ndoo, 04-19-2026, 05:54 PM
      0 responses
      68 views
      0 likes
      Last Post M4ndoo
      by M4ndoo
       
      Started by cmoran13, 04-16-2026, 01:02 PM
      0 responses
      123 views
      0 likes
      Last Post cmoran13  
      Started by PaulMohn, 04-10-2026, 11:11 AM
      0 responses
      73 views
      0 likes
      Last Post PaulMohn  
      Working...
      X