EMA strategy 3 candles

Forums ProRealTime English forum ProOrder support EMA strategy 3 candles

Viewing 8 posts - 1 through 8 (of 8 total)
  • #233712

    Hello,

     

    I would like to ask a strategy that works this way:

    EMA50<EMA100<EMA200  and with a distance between them that can be defined

    buy if close crosses over ema 200 and the close of three candle before is lower than EMA50 (so price needs to crosse the three EMA in not more than 3 candles)

    the opposite for short.

    thank’s in advance

     

    Alessio

    #233713

    I did something like this but it opens also position when it shouldn’t.

     

    exit is just to try, nothing defined

    #233718
    JS

    Hi,

    Try using Close[3] instead of Close[BarIndex-3]…

    1 user thanked author for this post.
    #233720

    Hi
    You have to change c1 and c2:

    #233721

    I didn’t see your answer…
    As Roberto says, better 2 than… 🙂

    2 users thanked author for this post.
    #233772

    Thank you very much Ivan, 2 is better than one, of course! by the way I don’t understand why close[barindex3]  was not correct.

    thanks

    Alessio

    #233778

    Hi,

    Maybe you should check the Probuilder’s manual or at least here https://www.prorealcode.com/documentation/close/

    I think doing that will clarify your doubts.

    #233794

    why close[barindex–3]  was not correct.

    barindex increases by 1 for every new candle and so if your Algo has been running for 600 candles then you would have close[barindex–3] = close[597]

Viewing 8 posts - 1 through 8 (of 8 total)

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