long-short when Moving average changed color

Forums ProRealTime English forum ProOrder support long-short when Moving average changed color

  • This topic has 23 replies, 5 voices, and was last updated 7 years ago by avatarDave.
Viewing 15 posts - 1 through 15 (of 24 total)
  • #23141

    how can i tell t0 backtest that must BUY when Quadruple Exponential Moving Average is green and sell when Quadruple Exponential Moving Average is red?

    Thanks in advance

     

    #23192

    Hi Enzo, Nicolas did this for me a couple of weeks ago, https://www.prorealcode.com/topic/place-orders-when-a-curve-change-colour/ it is for a single ma but i’m sure the condition could be added to incorperate all types of ma as per the indicator. hope it helps.

    dave

     

     

     

     

    1 user thanked author for this post.
    #23221

    thanks so much DAVe!!!

    #23248

    HI, SOME TIME WORKS ..SOME TIMES NOT….WHY?   LOOK AT THE PIC

     

    THANKS

    THE CODE IS:

     

    #23275

    Sorry Enzo, I’m out of my office until later but try this for a buy condition:-

    C2=indicator 3>indicator 3[1] and indicator 3[1]<indicator3[2]

    Dave

    #23284

    >> For clarity of messages on ProRealCode’s forums, please use the “insert code PRT” button to separate the text of the code part! Thank you! <<

    #23286

    hi DAVE, i tried..but it is the same….very strange

     

    #23288

    from 1984 to dicember 2006 ok…from dicember 2006 to now  it is crazy

    #23292

    // Definizione dei parametri del codice
    DEFPARAM CumulateOrders = false // Posizioni cumulate disattivate

    // Condizioni per entrare su posizioni long

    indicator3 = CALL “MM Quatruple EXP”[cinq, uno](close)

    c2 = indicator3 > indicator3[1] and indicator3[1] < indicator3[2]

    IF c2 THEN
    BUY 1 CONTRACT AT MARKet

    // Condizioni per entrare su posizioni short

    indicator8 = CALL “MM Quatruple EXP”[cinq, uno](close)

    c5 = indicator8 < indicator8[1] and indicator8[1]> indicator8[2]

    IF c5 THEN
    SELLSHORT 1 CONTRACT AT MARKET
    ENDIF

    #23352

    I’ve had a look and yes it does act strangely?, I think it is something mathematical with the indicator as the line of code I posted above works fine with regular ma’s, is a quatruple ma critical to what you are doing?.

    #23379

    @Enzo
    I’d like people to use the button INSERT PRT CODE please! I already kindly ask it to you in my previous post. Thanks.

    #23391

    sorry Nicolas..you are right…now i understood how can i do it..

     

    #23393

    hi Dave, i wanted insert the Qema for to trade only short when the principal trend was down and only long when the principal trend was Up…

    principal trend  with EMA 75  and ema 195  on daily TF.

     

    anyway thanks a lot

    #23466

    did a quick test with just an exponential ma not qema, 10K acc £10/point from 01-01-2015 to 01-01-2017.   157% not bad!. optimised came back with ema25 & ema235 with 245%.

     

    Dave

    #23605

    thanks Dave, it seem to good for to be real 🙂 anyway my strategy is rudimental, it need position size, and stop loss …. but the Qema problems does not make me get on with TS

     

     

Viewing 15 posts - 1 through 15 (of 24 total)

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