how 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:
Cond1 = (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:
ONCE Cond1 = 0 // 1=enable, 0=disable
ONCE Cond2 = 0
ONCE Cond3 = 0
ONCE Cond4 = 0
IF ADX >= 20 THEN
Cond1 = NUM1 // Optimising conditions for NUM1 = min:0, max: 1, steps 1; 0 disables and 1 turns on this condition
Elsif ADX <20 THEN
Cond1 = 0 // Return to 0 once condition no more.
IF average[20](close) > average[50](close) THEN
Cond2 = NUM2 // NUM2 = min:0, max: 1, steps 1
Elsif average[20](close) <= average[50](close) THEN
Cond2 = 0
IF STRONGUPRANGE THEN
Cond3 = NUM3 // NUM3 = min:0, max: 1, steps 1
Elsif NOT STRONGUPRANGE THEN
Cond3 = 0
IF WEAKUP THEN
Cond4 = NUM4 // NUM4 = min:0, max: 1, steps 1
Elsif NOT WEAKUP THEN
Cond4 = 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?