Announcement

Collapse
No announcement yet.

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.

    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.

        Comment

        Latest Posts

        Collapse

        Topics Statistics Last Post
        Started by NullPointStrategies, Today, 05:17 AM
        0 responses
        38 views
        0 likes
        Last Post NullPointStrategies  
        Started by argusthome, 03-08-2026, 10:06 AM
        0 responses
        124 views
        0 likes
        Last Post argusthome  
        Started by NabilKhattabi, 03-06-2026, 11:18 AM
        0 responses
        64 views
        0 likes
        Last Post NabilKhattabi  
        Started by Deep42, 03-06-2026, 12:28 AM
        0 responses
        41 views
        0 likes
        Last Post Deep42
        by Deep42
         
        Started by TheRealMorford, 03-05-2026, 06:15 PM
        0 responses
        46 views
        0 likes
        Last Post TheRealMorford  
        Working...
        X