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

strategy analyzer stops when testing a strategy

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

    strategy analyzer stops when testing a strategy

    strategy analyzer stops when testing a strategy...only happens with this strategy, will show no results it stops testing 5 seconds in

    #2
    Hello rickyblah12,

    Thank you for your post.

    Do you receive any errors either on screen or in the log tab of the Control Center when this occurs? If so, what is the text of the error?

    Generally if other strategies work, it would likely be an error in the strategy you are testing that would cause a backtest to stop. Is the strategy one you created yourself?

    Thanks in advance; I look forward to assisting you further.
    Kate W.NinjaTrader Customer Service

    Comment


      #3
      Yes.
      3/16/2020 7:36:26 PM Default Strategy 'BEMATUNES/-1': A BuyToCover stop order placed at '3/8/2020 6:35:32 PM' has been ignored since the stop price is less than or equal to the close price of the current bar. This is an invalid order and subsequent orders may also be ignored. Please fix your strategy.
      3/16/2020 7:36:27 PM Default Indicator 'ATR': Error on calling 'OnBarUpdate' method on bar 0: You are accessing an index with a value that is invalid since it is out-of-range. I.E. accessing a series [barsAgo] with a value of 5 when there are only 4 bars on the chart.


      Comment


        #4
        Hello rickyblah12,

        Thank you for your reply.

        Does your strategy use an ATR in it? If so, that would be the first thing I would look at - whether you've checked to see if you have enough bars to calculate that ATR. As far as the initial error, this is occurring because the strategy is either trying to place or modify a stop order to at or below the current bar close price. What I would recommend with that error is to add some prints so you can see in the NinjaScript Output window what the prices of stops are being modified to, and then take action to adjust your logic for placing stops based on that.

        This forum post goes into great detail on how to use prints to help figure out where issues may stem from — this should get you going in the correct direction. You can even add these using the Strategy Builder.



        If you run into issues like we saw here, the above information will allow you to print out all values that may be evaluating differently than you may expect. With the printout information you can assess what is different between the two.

        Please let us know if we may be of further assistance to you.
        Kate W.NinjaTrader Customer Service

        Comment

        Latest Posts

        Collapse

        Topics Statistics Last Post
        Started by Tradereh2020, Today, 06:29 AM
        1 response
        9 views
        0 likes
        Last Post NinjaTrader_LuisH  
        Started by ryan_21, Yesterday, 08:46 PM
        2 responses
        6 views
        0 likes
        Last Post ryan_21
        by ryan_21
         
        Started by Salahinho99, 05-05-2024, 04:13 AM
        8 responses
        65 views
        0 likes
        Last Post NinjaTrader_ChelseaB  
        Started by Seneca, 08-25-2020, 08:31 AM
        3 responses
        5,946 views
        0 likes
        Last Post NinjaTrader_LuisH  
        Started by slightly, Today, 12:49 AM
        1 response
        10 views
        0 likes
        Last Post NinjaTrader_LuisH  
        Working...
        X