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:	115
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 NullPointStrategies, Today, 05:17 AM
    0 responses
    49 views
    0 likes
    Last Post NullPointStrategies  
    Started by argusthome, 03-08-2026, 10:06 AM
    0 responses
    126 views
    0 likes
    Last Post argusthome  
    Started by NabilKhattabi, 03-06-2026, 11:18 AM
    0 responses
    66 views
    0 likes
    Last Post NabilKhattabi  
    Started by Deep42, 03-06-2026, 12:28 AM
    0 responses
    42 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