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 lightsun47, Today, 03:51 PM
      0 responses
      4 views
      0 likes
      Last Post lightsun47  
      Started by 00nevest, Today, 02:27 PM
      1 response
      8 views
      0 likes
      Last Post 00nevest  
      Started by futtrader, 04-21-2024, 01:50 AM
      4 responses
      44 views
      0 likes
      Last Post futtrader  
      Started by Option Whisperer, Today, 09:55 AM
      1 response
      13 views
      0 likes
      Last Post bltdavid  
      Started by port119, Today, 02:43 PM
      0 responses
      8 views
      0 likes
      Last Post port119
      by port119
       
      Working...
      X