I want to check different EMAs and other variables to see how if I can optimize my system,
Have tried to use a code like this:
1
// Calculation of EMA values
EMALONG = ExponentialAverage[LONG](Close)
EMAMID = ExponentialAverage[MID](Close)
EMASHORT = ExponentialAverage[SHORT](Close)
//Buying conditions
IF Not OnMarket THEN
c1 = (time >= 090000 and time <= 173000)
c2 = (EMALONG < EMAMID and EMAMID < EMASHORT)
c3 = (macdValue crosses over signalValue)
IF c1 AND c2 AND c3 THEN
buy 1 contract at market
ENDIF
However since c2 is a bunch of variables, PRT says that I have to define them, but if I do, I cant do a variable test..
I’ve tried with + instead of “and” for c2, but that dosen’t work either.
I tried to follow a youtube video by PRT:
How to optimize a trading system with ProBacktest – ProRealTime
But If I do, the system won’t follow the conditions.
I suggest that you write the missing variables in the code using the comment slashes to let them be ignored:
1
2
3
4
5
//LONG = ???
//MID = ???
//SHORT = ???
//macdValue = ???
//signalValue = ???
Then can simply define the missing variable in the optimizer as from the attached screenshot. Bear in mind that you might have to optimeze them separately to not exceed the 10000 iterations limit.
To help us continually offer you the best experience on ProRealCode, we use cookies. By clicking on "Continue" you are agreeing to our use of them. You can also check our "privacy policy" page for more information.Continue