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

Works on Backtests not on live.

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

    Works on Backtests not on live.

    Hi Guys, I keep getting this error and am unsure what to try to fix it. The Strat works fine on backtest and optimise but live forward run it can't place an order.
    Im sure it will be something simple.
    2/8/2024 9:10:39 PM Default Strategy 'Simtest-1': An order has been ignored since the stop price ‘23.91’ near the bar stamped ‘01/07/2024 18:00:00’ is invalid based on the price range of the bar. This is an invalid order and subsequent orders may also be ignored.

    I looked at other posts but its not very clear.

    I did add the ability to choose days of the week to the script. could that have broken it?

    #2
    Hello BrendoApex,

    Welcome to the NinjaTrader forums!

    This is a warning (and not an error message) that an order was submitted before CurrentBar was equal to or greater than BarsRequiredToTrade. This will not disable the script but is just a warning to let you know that order was ignored.

    You can choose to set BarsRequiredToTrade to 1.
    Or you could choose to code in the conditions a requirement that CurrentBar is equal to or greater than BarsRequiredToTrade.


    To understand why the strategy is not submitting orders after BarsRequiredToTrade is met, enable TraceOrders and add a print to print the time of the bar and all values compared in the condition along with labels for each value and comparison operator.

    This forum post provides direction and videos.
    Chelsea B.NinjaTrader Customer Service

    Comment


      #3
      Thanks Chelsea, I think I have it sorted.

      Comment

      Latest Posts

      Collapse

      Topics Statistics Last Post
      Started by blar58, Today, 10:37 AM
      7 responses
      17 views
      0 likes
      Last Post NinjaTrader_Emily  
      Started by 860cam, 03-11-2021, 04:57 AM
      16 responses
      874 views
      1 like
      Last Post NinjaTrader_BrandonH  
      Started by _Zero_, 01-06-2020, 01:16 PM
      65 responses
      1,620 views
      5 likes
      Last Post rishi_833  
      Started by Rxndeyz, Yesterday, 06:23 PM
      2 responses
      9 views
      0 likes
      Last Post Rxndeyz
      by Rxndeyz
       
      Started by AngelGL, Today, 10:59 AM
      1 response
      4 views
      0 likes
      Last Post NinjaTrader_Gaby  
      Working...
      X