Announcement

Collapse

Looking for a User App or Add-On built by the NinjaTrader community?

Visit NinjaTrader EcoSystem and our free User App Share!

Have a question for the NinjaScript developer community? Open a new thread in our NinjaScript File Sharing Discussion Forum!
See more
See less

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.
      JimNinjaTrader Customer Service

      Comment

      Latest Posts

      Collapse

      Topics Statistics Last Post
      Started by giulyko00, Today, 12:03 PM
      0 responses
      2 views
      0 likes
      Last Post giulyko00  
      Started by AttiM, 02-14-2024, 05:20 PM
      12 responses
      213 views
      0 likes
      Last Post DrakeiJosh  
      Started by cre8able, 02-11-2023, 05:43 PM
      3 responses
      238 views
      0 likes
      Last Post rhubear
      by rhubear
       
      Started by frslvr, 04-11-2024, 07:26 AM
      8 responses
      117 views
      1 like
      Last Post NinjaTrader_BrandonH  
      Started by stafe, 04-15-2024, 08:34 PM
      10 responses
      47 views
      0 likes
      Last Post stafe
      by stafe
       
      Working...
      X