Announcement

Collapse
No announcement yet.

Partner 728x90

Collapse

{NinjaScript} - Handling Orders Error

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

    {NinjaScript} - Handling Orders Error

    Hello! Somebody knows what that means?

    Strategy 'Strategy/206666249' submitted an order that generated the following error 'Order rejected'. Strategy has sent cancel requests, attempted to close the position and terminated itself.
    04/09/2020 10:00:01 CancelAllOrders: BarsInProgress=0





    #2
    To help us to solve your problem, Can i know what submissions code are you do in your strategy ??

    Comment


      #3
      Hello fscabrera03,

      Thanks for your post.

      Orders can be rejected for a number of reasons. What is the exact reason for the order rejection? For example, was the rejection received because of a stop market/stop limit order being submitted to the other side of the market?

      Knowing the above, what order submission method caused the rejection? Also, what was the price that the order was submitted to? What were the current bid/ask prices at the time of the rejection?

      You may reproduce many occurrences that happen with realtime data using the Playback Connection, and you can use debugging prints to print out the price of your order submissions. GetCurrentBid/GetCurrentAsk can be printed to display the most recent bid/ask prices.

      Playback Connection - https://ninjatrader.com/support/help...connection.htm

      Debugging Tips - https://ninjatrader.com/support/help...script_cod.htm

      GetCurrentAsk - https://ninjatrader.com/support/help...currentask.htm

      GetCurrentBid - https://ninjatrader.com/support/help...currentbid.htm

      Another common issue we see is when Set methods are called in OnBarUpdate method explicitly resetting the stop loss before the associated Enter method is called. This is important to ensure that the stop loss is reset to a proper initial level for the next entry. Set methods prep NinjaTrader to submit target/stop when an entry order is seen as executed. Failing to do so can result in a previous value being used for the stop loss, which can result in a rejection.

      We look forward to assisting.

      Comment

      Latest Posts

      Collapse

      Topics Statistics Last Post
      Started by NullPointStrategies, Today, 05:17 AM
      0 responses
      53 views
      0 likes
      Last Post NullPointStrategies  
      Started by argusthome, 03-08-2026, 10:06 AM
      0 responses
      130 views
      0 likes
      Last Post argusthome  
      Started by NabilKhattabi, 03-06-2026, 11:18 AM
      0 responses
      70 views
      0 likes
      Last Post NabilKhattabi  
      Started by Deep42, 03-06-2026, 12:28 AM
      0 responses
      44 views
      0 likes
      Last Post Deep42
      by Deep42
       
      Started by TheRealMorford, 03-05-2026, 06:15 PM
      0 responses
      49 views
      0 likes
      Last Post TheRealMorford  
      Working...
      X