Announcement
Collapse
No announcement yet.
Partner 728x90
Collapse
NinjaTrader
Backtest Optimazation Rules?
Collapse
X
-
Backtest Optimazation Rules?
If I have a strategy that has 2 parameters, lets call them A & B both can range from 1 to 100 and I want to optimize, but A must always be greater than B, is there anyway I can stop the optimizer from even trying the tests that don't fit the criteria?Tags: None
-
Hello drumuk,
Thank you for your post and welcome to the NinjaTrader Support Forum!
When setting the value you can make sure it's the max of either the other value or it's own. For example: set { greater = Math.Max(lesser, value); }
Below is an example of how to set these properties:
Code:#region Variables private int greater = 20; private int lesser = 10; #endregion protected override void Initialize() { } protected override void OnBarUpdate() { } #region Properties [Description("")] [GridCategory("Parameters")] public int Lesser { get { return lesser; } set { lesser = Math.Max(1, value); } } [Description("")] [GridCategory("Parameters")] public int Greater { get { return greater; } set { greater = Math.Max(lesser, value); } } #endregion
Latest Posts
Collapse
| Topics | Statistics | Last Post | ||
|---|---|---|---|---|
|
Started by CaptainJack, 05-29-2026, 05:09 AM
|
0 responses
321 views
0 likes
|
Last Post
by CaptainJack
05-29-2026, 05:09 AM
|
||
|
Started by CaptainJack, 05-29-2026, 12:02 AM
|
0 responses
203 views
0 likes
|
Last Post
by CaptainJack
05-29-2026, 12:02 AM
|
||
|
Started by charlesugo_1, 05-26-2026, 05:03 PM
|
0 responses
190 views
1 like
|
Last Post
by charlesugo_1
05-26-2026, 05:03 PM
|
||
|
Started by DannyP96, 05-18-2026, 02:38 PM
|
1 response
283 views
0 likes
|
Last Post
|
||
|
Started by CarlTrading, 05-11-2026, 05:56 AM
|
0 responses
238 views
0 likes
|
Last Post
by CarlTrading
05-11-2026, 05:56 AM
|

Comment