Announcement

Collapse
No announcement yet.

Partner 728x90

Collapse

How to prevent NinjaTrader to close account position

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

    How to prevent NinjaTrader to close account position

    I handle orders and cancel them myself, but sometimes I got error about an order "Rejected: the order pirce is out of band". The problem is that I see my position get flat suddenly!
    I am using AdoptAccountPosition. I don't want my position gets flat. Also, I am just using EnterLong, I don't use EnterShort. I can't reproduce this problem in Simulation mode.
    How can I prevent ninja trader to stop closing my position?
    Last edited by ManTrader; 08-15-2019, 10:03 AM.

    #2
    The error is "Rejected: the order pirce is out of band". The problem is that NT8 close the account position!

    Comment


      #3
      Hello ManTrader,

      Thanks for your post.

      Native errors for order rejections will best be answered by your broker's Orders Desk. Typically errors related to banding refer to the order submission price being submitted to a level that is invalid when the broker processes it.

      NinjaScript strategies will by default stop, cancel orders, and close positions as a rejected order could completely break a strategies ability to make profit. To override this and handle rejections on your own, you could set RealtimeErrorHanldling to IgnoreAllErrors and then trap the rejections in OnOrderUpdate. The strategy will stay running and the strategy can react to rejections that occur.

      RealtimeErrorHandling - https://ninjatrader.com/support/help...orhandling.htm

      OnOrderUpdate - https://ninjatrader.com/support/help...rderupdate.htm

      Please let us know if we can be of further assistance.

      Comment

      Latest Posts

      Collapse

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