Test input conditions in the optimizer
Forums › ProRealTime English forum › ProOrder support › Test input conditions in the optimizer
- This topic has 20 replies, 6 voices, and was last updated 2 years ago by SkippyTrader.
-
-
08/24/2021 at 8:10 PM #176132
Hello, if I want to check different input conditions with the optimization of other conditions at the same time in the optimizer, how can I do that? Is that possible? I have pre-defined different conditions and am currently always optimizing my strategies with each condition individually. Which of course costs a lot of time. So, as an example, do I want to optimize SL, TP or other conditions at the same time with cond1 or cond2 or cond3 … to find out which cond is currently the best … how can I code that so that it can be used in the optimizer?
08/24/2021 at 8:33 PM #176134You can run any number of variables in the optimizer up to a max number of permutations. You just have to insert a variable in your condition for the value you want to test (eg. the period of a moving average). Then you can run it along with any other variables (stop, target, trail etc) all at once.
I often set it up with 2-3000 permutations and leave it to run overnight.
08/24/2021 at 8:44 PM #176135Yes … misunderstanding. Explained differently, as an example: cond1 = engulfing, cond2 = lowerhigh and cond3 = Close <EMA200 … how can I automatically compare these with one another in the optimizer and optimize my numerical values? Does that work? The examples are just examples.
08/24/2021 at 9:08 PM #17613808/24/2021 at 9:45 PM #176141compare these with one another
you mean to ascertain which is most effective? you can’t do that in the optimizer, only the operative values.
to compare them you would have to enter (or omit) them one by one to see which had the best effect.
08/24/2021 at 10:02 PM #17614508/24/2021 at 10:06 PM #176146not that I know of!
08/25/2021 at 6:49 AM #176149Hello,
To compare different conditions in a strategy, I personally use an int optimization variable, like “strategy”, in ProBacktest module.
Example123456if strategy=1 thenentry=engulfingelsif strategy=2 thenentry=breakoutetc...endifThis can be used in combination of other optimization variables, under the limit of combinations of course
Is this what you want to implement?
Fabrice1 user thanked author for this post.
08/25/2021 at 9:12 AM #17616008/25/2021 at 9:35 AM #176164Yes, “strategy” can be a variable that varies between 1 and X with increment of 1, to test different sub-strategies: entries, SL, TP (1 SL distance vs. 1.5 or 2), BE or not. etc…
And then we use this variable in different locations in the code when needed to make some comparison and test alternative signals.
Only thing is to note somewhere what are the meaning of the sub-strategies so that we can quickly retrieve which condition is best when the table of results is generated, and it shows that strategy=5 has better gains than strategy=9 for instance.
08/25/2021 at 9:41 AM #17616508/25/2021 at 10:09 AM #176166What exactly do you want to achieve phoentzs?
08/25/2021 at 10:11 AM #176167To compare different conditions in a strategy, I personally use an int optimization variable, like “strategy”
it’s an interesting way of doing things, but do you find that it actually saves time? the optimizer is still just running them separately, one at a time, as you would do manually. Not so much optimizing as automating part of the test process … but you still have to write all the code and run each one. not sure if it will get you ahead of the game. Perhaps if you add the operative variables as well and ran it overnight – could be worth trying.
08/25/2021 at 10:22 AM #176178@robertogozzi As described above. If I want to compare operational conditions in the optimizer with numerical values such as SL, TP or breakeven at the same time, how can I write the conditions so that they can be processed in the optimizer? As a simple example … we have a breakout strategy and want to compare what works best: cond1 = engulfing, cond2 = higherhigh, cond3 = lowerlow and so on … what works best should be the result.
08/25/2021 at 11:44 AM #176189To compare different conditions in a strategy, I personally use an int optimization variable, like “strategy”
it’s an interesting way of doing things, but do you find that it actually saves time? the optimizer is still just running them separately, one at a time, as you would do manually. Not so much optimizing as automating part of the test process … but you still have to write all the code and run each one. not sure if it will get you ahead of the game. Perhaps if you add the operative variables as well and ran it overnight – could be worth trying.
It may not save time for sure. I am not into running backtests overnight yet, so I don’t face such challenges.
The main idea is to manage several alternative conditions in the same file, instead of creating several trading systems. In the end, you can reuse the conditions as a template to create other trading systems quickly, based on other indicators. It’s more an organization efficiency than pure strategy optimization.
@phoentzs if we take some examples in your library, it could be something like this.
Example of alternative1234567891011121314151617....c4 = (indicator5 CROSSES OVER indicator6)IF strategy = 2 THENc4 = (indicator5 CROSSES UNDER indicator6)ENDIFIF c4 THENSELL AT MARKETENDIF....lossValue = 75IF strategy = 3 THENlossValue = 150ENDIF// Stops und TargetsSET STOP pLOSS lossValueIt’s basic IF ELSE statements.
1 user thanked author for this post.
-
AuthorPosts
Find exclusive trading pro-tools on