Exponential moving average code required

Forums ProRealTime English forum ProOrder support Exponential moving average code required

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

    Hi, im new to PRT, i need some code just a simple exponential moving average say say a EMA5 and a EMA 27 , buy when the long cross,s over the short and sell when the short cross,s over the long and visa versa for shorting the trade, preferably when the instrument is trending strongly. A MACD may be included or a Stocastic.

    any takers??

    Cosmic surfer

     

    #5011

    Hello, what you are requesting is very easy to do with the assisted creation mode. Have you tried it?

    #5048

    Hi Nicolas, i dont fully understand the indicator language when it comes to configuring macd and moving averages…I have had a go writing my own code i need a hand fine tuning it……If you could point me in the right direction with some code that would be great.

    cheers

    Jay

    #5050

    Ok Nicolas i,ve just written some code using 2 Exponential moving averages (3/16) but the back test confirm what i am trying to eliminate when the instrument i am trading goes sideways it all goes to shit…. how can i eliminate sideways trading and just capture the majors up and down trends? I have attached a backtest. This is the code

    cheers

    Jay

     

    #5070

    Hello cosmic, first of all I see something wrong at lines 32 and 33, you are trying to test a crossover between the 2 same moving average, which will never happen.

    About trading sideways market …. well you’ll never know when it gonna happens and when you see you are in a narrowed price oscillation, you are already in it, so it’s too late 🙂 In your example, you got then 2 options : stay in position or try to filter a lot with wide period moving average (100, 200 …) to define bulls or bears territories..

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