I'm attaching simple strategy code and screenshots to articulate the problem. Basically after optimization finished and I'm clicking in each result, but the summary below never reflects what I'm selecting, and actually showing something random which is not even available in the list of results. Please take look, and let me know if you need any other details which can help you to investigate the problem, I will be happy to assist.
Announcement
Collapse
No announcement yet.
Partner 728x90
Collapse
NinjaTrader
[CRITICAL BUG] Strategy Analyzer Optimization - totally random behavior
Collapse
X
-
[CRITICAL BUG] Strategy Analyzer Optimization - totally random behavior
Hello guys,
I'm attaching simple strategy code and screenshots to articulate the problem. Basically after optimization finished and I'm clicking in each result, but the summary below never reflects what I'm selecting, and actually showing something random which is not even available in the list of results. Please take look, and let me know if you need any other details which can help you to investigate the problem, I will be happy to assist.
4 PhotosTags: None
-
Hello Ryan, with Sample-MA-Crossover it is working as expected. But as you see in simple code I've attached it is very easy to reproduce. Hope it helps.
Comment
-
Hello login_dejavu,
This is going to be an expected behavior. NinjaTrader performs a "details run" which processes OnBarUpdate for the specified parameters in the optimization iteration to generate the trade performance results. If you add a print in OnBarUpdate, you will see this happen each time you switch viewing optimization iterations. Since you are getting a new random number in OnBarUpdate, each run will have different random values than what the strategy used to generate the results initially.
Because of the above, it would not be advised to use random numbers in the strategy while maintaining the expectation that the value would be consistent between each "details run" of OnBarUpdate.
If you have any additional questions, please let me know.JimNinjaTrader Customer Service
Comment
-
Hi Jim, but wait, optimization happens on Input parameter, in my case it is "Iterator". Random number is used to generate entry signal. My expectation to see in summary best results selected based on "Optimized On/OptimizationFitnesses" function. I would understand your explanation if I would use random number to generate "Iterator" property itself, but this is no the case here.
Could you clarify please.
Comment
-
Hello login_dejavu,
When the strategy runs the first time, best optimization iterations are listed from the backtest. Whenever you switch to view a new optimization iteration, OnBarUpdate runs again for the details run. Since you are generating random numbers in OnBarUpdate, the details run will be generating different trades than when the backtest was first run. NinjaTrader is expecting the strategy to use parameters set from the optimizer for consistency between backtests and details runs. If the logic used Iterator instead of random.Next, we would see consistent results.
I have made a demo to help clarify.
Demo - https://drive.google.com/file/d/11zK...w?usp=drivesdk
Please let me know if there is anything else we can do to help.JimNinjaTrader Customer Service
Comment
-
Uhhh, now it make sense. I always believed that when I see list of results and I click through them only UI binding changed to render specific one because I was expecting we already have all the required data to display, I did not know that when I click it kind of re-run it again.
Thanks for the video and your effort! And thanks for the best retail platform available on the market!
Comment
Latest Posts
Collapse
Topics | Statistics | Last Post | ||
---|---|---|---|---|
Started by brunoviveiros, 02-17-2020, 05:31 AM
|
4 responses
63 views
0 likes
|
Last Post Today, 06:25 AM | ||
Started by volIQ, 03-27-2024, 04:28 PM
|
3 responses
21 views
0 likes
|
Last Post
by RJay
Today, 05:41 AM
|
||
Started by Nickgiaco, 02-26-2024, 10:23 AM
|
2 responses
72 views
0 likes
|
Last Post Today, 05:12 AM | ||
Started by Johndc, Today, 04:39 AM
|
0 responses
8 views
0 likes
|
Last Post
by Johndc
Today, 04:39 AM
|
||
Started by johntraderuser2, Today, 02:34 AM
|
0 responses
11 views
0 likes
|
Last Post Today, 02:34 AM |
Comment