Fetch exact value of Crossing EMA

Forums ProRealTime English forum ProOrder support Fetch exact value of Crossing EMA

Viewing 5 posts - 1 through 5 (of 5 total)
  • #10207

    Hello community,

    I am working on a automated strategy and would ask you, if you can help me at one point in my code.

    The strategy includes some EMA’s and i tried to figure out the exactly chartposition (value) when one EMA crosses the other EMA.
    I am still stuck at this point and couldnt even find anything in the code documentation.

    I would like to share my code after backtests here, but i need this parameter for clocking up the performance in real trading and not only in backtesting.

    Does someone knows the right coding?

    Thank you very much

    Trade Wolf

    #10215

    Hello Trade Wolf,

    You can record the EMA value when you detect of the crossing of your 2 moving average:

    crosses over and crosses under refer to crosses that have already occurred, so you can get value of the EMA within a 1 period offset in the past: EMA1[1]

    I think it should make the trick. Please let us know.

     

    #10234

    Hi Nicolas,

    this sounds very good and i think this will do the job.

    But now the problem is that the execution of the BUY/SELL-Order starts with the next candle, instead of the exact moment when the EMA’s are crossing. So i will miss the correct entry point for my orders  🙁

    I hope you can tell me the solution for this, if there is anyone.

    Thank you and sorry for my ignorance.

     

    #10236

    Conditions are tested at bar close and trades are launched at next bar open. That’s how PRT deals with the code.

    It sounds logic since moving average are commonly calculated on price Close, so that’s why we need to wait the candlestick close to validate their crossing.

    #10238

    Thanks Nicolas. This makes sense.

    I will try to go on with this conditions.

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

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