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/25/2021 at 12:15 PM #17619508/25/2021 at 12:26 PM #176197
Do as shown in my pic.
But optimizing conditions doesn’t make sense, as they are logical (boolean) values returned when conditions are met or not met, you can’t change the returned value for:
1c1 = close CROSSES OVER Average[20,0](close)this way (setting start=0, end=1 and step 1), it simply can’t work as the optimizer tells you (which one is the best, 0 or 1?):
1c1 = v1//close CROSSES OVER Average[20,0](close)rather, you can optimize 20 (the number pf periods) and 0 (the type of MA) because they are values of your choice that you want to optimize to make crossovers being tested differently each time, but when a crossover occurs…. it simply occurs even if the optimizer tells you that it would be better not to!
As to the above example, simply run the optimizer 3 times, commenting out two of the three lines at at a time to see what results any one of those conditions yields.
08/30/2021 at 8:40 PM #176496Hello,
To illustrate my previous messages with concrete example, here is a strategy that was recently published, with different conditions.
The variable strategy is fixed to 2 in the code, but you can delete it and transform it into an optimization variable to make it vary and test several conditions in the same system.
@nonetheless don’t be freaked out, this is my very first code published, lol!08/30/2021 at 10:23 PM #176504this is my very first code published
I’m sure it’s wonderful, but what instrument do you run it on – equities?
08/31/2021 at 5:57 AM #176510yes, equities on a daily timeframe
1 user thanked author for this post.
04/29/2022 at 1:05 PM #192419how can I code that so that it can be used in the optimiser?
Currently the way i do that is select two variables for each condition in the optimiser, one would turn-it on, and another one that is just so extreme that it would actually never trigger that indicator or that makes it always true – so its like the way to enter / omit each different condition or indicator from your strategy in a back test to optimise what ones (or combination of indicators) works best,
for example:
1234Cond1 = (ADX[14] >= NUM1) // [min 19, max 200, step181]Cond2 = Average[20](close) > Average[NUM2](close) // [min50, max100050, step 1000000],set stop %loss NUM3 // [min 2, max 110, step 108],Another thing i’ve tried to do is to do loops like below, which seems to work with certain conditions BUT i think i’m still getting errors with some conditions. For conditions ive coded myself it works wonderfully, same results as if i inout or delete that conditions from my BUY conditions myself one by one. But it appears the in-built indicators within PRT is where the errors occur. Probably due to the type of variable’s or something in the blackbox algorithms ? So would like to figure out how to improve this approach to optimisation:
1234567891011121314151617181920212223242526ONCE Cond1 = 0 // 1=enable, 0=disableONCE Cond2 = 0ONCE Cond3 = 0ONCE Cond4 = 0IF ADX >= 20 THENCond1 = NUM1 // Optimising conditions for NUM1 = min:0, max: 1, steps 1; 0 disables and 1 turns on this conditionElsif ADX <20 THENCond1 = 0 // Return to 0 once condition no more.IF average[20](close) > average[50](close) THENCond2 = NUM2 // NUM2 = min:0, max: 1, steps 1Elsif average[20](close) <= average[50](close) THENCond2 = 0IF STRONGUPRANGE THENCond3 = NUM3 // NUM3 = min:0, max: 1, steps 1Elsif NOT STRONGUPRANGE THENCond3 = 0IF WEAKUP THENCond4 = NUM4 // NUM4 = min:0, max: 1, steps 1Elsif NOT WEAKUP THENCond4 = 0/// etc....., and i just continue with as many loops as you want, for every indicator or condition that i want to test, for every sell condtions eg. trailing, stoplose, PSAR trailing, etc..and leave it to run overnight.
By the way Ive tried it before but the PRT program has always closed down before i wake up and lost all the information too. It is as if it has a kill switch at like 5am every day or something?. Any suggestions how to force it to stay open overnight whilst i sleep?
1 user thanked author for this post.
-
AuthorPosts
Find exclusive trading pro-tools on