Announcement

Collapse
No announcement yet.

Partner 728x90

Collapse

Stop Loss or Take Profit causing Strategy Analyzer not to backtest full time frame.

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

    Stop Loss or Take Profit causing Strategy Analyzer not to backtest full time frame.

    Hi all. When I run a strategy in the Strategy Analyzer, and set a stop loss for some reason it will only backtest for the first month or so. If I remove the stop loss it will backtest the full range I set.

    Image attached, I am asking to backtest 01 Jan 2023 to 11 Sep 2023.

    With stop loss off, it will run the full date range. But with stop loss on it's only going up to 02 Feb 2023.

    Does anyone know what would cause this to happen? I've spent hours googling and looking on the forum and can't seem to find the answer.

    Click image for larger version

Name:	Backtest.png
Views:	124
Size:	687.8 KB
ID:	1268594



    #2
    Hello kawaura.yoshiharu,

    Thanks for your post.

    What version of NinjaTrader are you using? Please provide the entire version number. This can be found under Help -> About (Example: 8.?.?.?)

    Is this a strategy that you programmed? Or, was it created by a third-party developer?

    Are you using Exit methods or Set methods for the stop loss in the strategy?

    Do you see any error messages appearing in the Log tab of the Control Center when running a backtest? If so, what does the error report?

    Please send me a reduced exported copy of the strategy and the exact steps you use to reproduce the behavior so I may investigate this matter further.

    ​Note that a reduced copy refers to a copy of the script that contains the minimum amount of code needed to reproduce the issue. All other code is commented out or removed.

    To create a copy of your script to modify, open a New > NinjaScript Editor, select your script, right-click in the Editor, select 'Save as', name the script, and click OK.​

    To export the strategy, go to Tools > Export > NinjaScript AddOn.

    I look forward to assisting further.
    <span class="name">Brandon H.</span><span class="title">NinjaTrader Customer Service</span><iframe name="sig" id="sigFrame" src="/support/forum/core/clientscript/Signature/signature.php" frameborder="0" border="0" cellspacing="0" style="border-style: none;width: 100%; height: 120px;"></iframe>

    Comment

    Latest Posts

    Collapse

    Topics Statistics Last Post
    Started by Hwop38, 05-04-2026, 07:02 PM
    0 responses
    164 views
    0 likes
    Last Post Hwop38
    by Hwop38
     
    Started by CaptainJack, 04-24-2026, 11:07 PM
    0 responses
    319 views
    0 likes
    Last Post CaptainJack  
    Started by Mindset, 04-21-2026, 06:46 AM
    0 responses
    246 views
    0 likes
    Last Post Mindset
    by Mindset
     
    Started by M4ndoo, 04-20-2026, 05:21 PM
    0 responses
    350 views
    0 likes
    Last Post M4ndoo
    by M4ndoo
     
    Started by M4ndoo, 04-19-2026, 05:54 PM
    0 responses
    179 views
    0 likes
    Last Post M4ndoo
    by M4ndoo
     
    Working...
    X