Announcement
Collapse
No announcement yet.
Partner 728x90
Collapse
NinjaTrader
Error I've Never Seen Before - Help
Collapse
X
-
Error I've Never Seen Before - Help
Hello, in recent days I finished a strategy that trades a higher frequency then I've ever made a strategy, arbing ES and NQ prices when they get over valued relative to sdv variance, z score, CVD, and some other things I don't think contribute to the problem. The strategy runs with 5 additional data series; 2 5 second (data collection), 2 1 tick (fill resolution and cumulative delta), and a 5 minute additional data series. When I run the strategy in tick replay, it works fine and does it's job. However if I want to optimize in the strategy analyzer, it has crashed on my both times I've tried. The first time, it didn't throw any errors, I just woke up the next day with not NT running. The next night I ran it, I woke up with a single error window on my screen with "unkown header error" and my laptop background zoomed in on like 4 icons top left of my background, no applications running. I have two ideas on why this might have happened: One) Its running too frequently (every 5 seconds) and multiple times with how the optimizer works, and just can't handle all the math involved in the algorithm that many times / second. or Two) Because I run my optimization period from Jan 2019 - Dec 2020 to capture all regimes, it's just overloaded with requests from the additional 1 tick data series' for CVD and large quantities of trades during that covid shake down due to excess volume in the market. Let me know what y'all think, and if there's anything else needed from me let me know. Thanks.Tags: None
-
Hello rbeckmann05,
Thank you for your post.
What exactly is the error you are getting? Can you post a screenshot?
Computer memory is important for long resource-intensive tests that generate a large number of trades without your machine stalling. Computer processor speed is important to get optimization iterations done quickly and the number of CPU cores allows for more iterations to run simultaneously.
We should consider the following for memory consumption:
Data * Strategy resources * Number of backtest/optimization iterations * Number of trades * Keep best # of results (when optimizing).
With more complex code can come heavier calculations which may require more processing. This is further impacted by the amount of data being processed, the number of iterations in the optimization, and amount of new objects being created in each iteration.
It is important to note that the Tick Replay property implies that more PC resources are used to calculate your indicators and strategies also and as a result will lead to a performance impact. This is noted on the Tick Replay and Performance Tips help guide pages below.
Tick Replay:https://ninjatrader.com/support/help...ick_replay.htm
Performance Tips:https://ninjatrader.com/support/help...ance_tips2.htm
To improve backtests/optimization, you could reduce the amount of days being tested over to reduce the data being processed. You could also reduce the number of iterations by reducing the range of optimized parameters when running an optimization.
IsInstantiatedOnEachOptimizationIteration could be used in your script to improve the performance of Strategy Analyzer runs.
https://ninjatrader.com/support/help...antiatedoneachoptimizationiteration.htm
Objects should only be initialized in State.DataLoaded when absolutely necessary, existing objects that can be reset like arrays should be cleared / reset instead of new objects initialized.
The IncludeTradeHistoryInBacktest property can make a huge performance impact. If the script is not using the SystemPerformance collection, setting IncludeTradeHistory to false in State.Configure can dramatically improve backtest and optimization performance.
https://ninjatrader.com/support/helpGuides/nt8/NT%20HelpGuide%20English.html?includetradehistoryi nbacktest.htm
If the script is making a lot of Draw method calls, this can also have a large impact. Disabling draw method calls when the script is in the Strategy Analyzer can reduce this impact.
https://ninjatrader.com/support/helpGuides/nt8/index.html?isinstrategyanalyzer.htm
Below is a link to an example that demonstrates the effect of IsInstantiatedOnEachOptimizationIteration.
https://ninjatrader.com/support/foru...995#post802995
As far as the total utilization, there may be other factors about the machine that may come into play such as the windows power settings. NinjaTrader is designed to use all logical processors available; specifically, it creates new threads and thread pools for the operating system to manage and does not limit or throttle the CPU core usage.
-
Ok, I appreciate the help here. I'll try and run it on a buddy's desktop and see if that changes anything. If it doesn't, I'll try adjusting the settings accordingly. I was not aware keeping best number of results had a noticeable impact on the strategy analyzer's ability to run, I'll lower that as well. However for the optimization it is important to me I cover 2018-2020, so hopefully that's able to stick. Just optimized windows power setting for NT optimization, thank you for the suggestions. I'll write back again if the issues persist. And unfortunately do not have a SS of the error window, as it has only happened that first time, no other.
Comment
Latest Posts
Collapse
| Topics | Statistics | Last Post | ||
|---|---|---|---|---|
|
Started by NullPointStrategies, Yesterday, 05:17 AM
|
0 responses
55 views
0 likes
|
Last Post
|
||
|
Started by argusthome, 03-08-2026, 10:06 AM
|
0 responses
132 views
0 likes
|
Last Post
by argusthome
03-08-2026, 10:06 AM
|
||
|
Started by NabilKhattabi, 03-06-2026, 11:18 AM
|
0 responses
73 views
0 likes
|
Last Post
|
||
|
Started by Deep42, 03-06-2026, 12:28 AM
|
0 responses
45 views
0 likes
|
Last Post
by Deep42
03-06-2026, 12:28 AM
|
||
|
Started by TheRealMorford, 03-05-2026, 06:15 PM
|
0 responses
49 views
0 likes
|
Last Post
|

Comment