Backtesting and definition of differens EMAs.

Forums ProRealTime English forum ProOrder support Backtesting and definition of differens EMAs.

Viewing 2 posts - 1 through 2 (of 2 total)
  • #237637

    Hi,

    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:

    // 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.

    Anyone know a way around this?

    Thank you!

    / Victor

    #237647

    I suggest that you write the missing variables in the code using the comment slashes to let them be ignored:

    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.

    1 user thanked author for this post.
Viewing 2 posts - 1 through 2 (of 2 total)

Create your free account now and post your request to benefit from the help of the community
Register or Login