Change the MACD indicator to Zero Lag MACD

Forums ProRealTime English forum ProOrder support Change the MACD indicator to Zero Lag MACD

Viewing 15 posts - 1 through 15 (of 18 total)
  • #219089

     

    Hello,

    This is my first time posting here and I am slowly getting to grips with the world of coding. I used the simple programming option to create an algorithm that uses the MACD and have had some good results depending on the timeframe; currently I’, on a 10 minute on the S&P 500. I have since read that there are alternatives to the standard MACD and would like to see whether anyone would be able to help me modify the code to use the Zero Lag MACD. I would also be more than grateful for any other suggestions or changes that I should try to implement.

    Thank you

    #219097

    Well done ErrorCodeT !

    Try your code on DJI 3 min TF over 10K bars using SL and TP with separate values for Buy and SellShort.

    #219098

    Hello, thank you for the suggestion. I’ll try out DJI as soon as I’m home and on the laptop.

    In regards for separate SL and TP for buy and sell short, how would you code this please?

    #219099

    As below, where A19 and A20 are variable values to be optimised as min = 0.1  max = 1  step = 0.1 .

    Do same fo SellShort.

    I could attach my version, but you will be more chuffed if you do it yourself?

    #219100

    Thank you, I’ll get on with finding out about optimisation. I presume the optimisation function will find the best combination.

    I certainly would be more chuffed if I did it myself but equally grateful for your version too.

    #219101

    I assumed you had used the Optimiser to arrive at these values MACDline[37,77,9](close) as these are not standard MACD parameters.

    Do below (as you won’t need them) when you follow my example (with % SL and % TP)  in previous post.

     

     

     

    #219102

    It was a code I got from a friend that used these values, it proved good results and I thought I’d modify it with short trades as well.

    Do you know if can just type ZeroLagMACD to use that indicator instead of the current lines?

    #219103

    ZeroLagMACD is not a standard / default PRT Indicator and so you would need to …

    1.   Include code for MACDZeroLag into the strategy (easiest way maybe).
      OR
    2. Add the MACDZeroLag as an Indicator to your Platform  and then you would need to ‘call’ the MACDZeroLag as below (more complex) …

       

    3.   Here is a link to the  MACDZeroLag Indicator.

    https://www.prorealcode.com/prorealtime-indicators/zerolag-macd/

    You have a lot of excitement to get through tonight when you get home!!?? 😉

     

    1 user thanked author for this post.
    #219104

    The call of MACDZeroLag may need to be something like this …

    It be best to get familiar with the PRT default MACD and use of the Optimiser etc before getting too ambitious?

    #219109

    Classic, ‘Don’t run before you can walk.’

    #219193

    I used your (ErrorCodeT) code and tried to add the suggestions of GraHal. Looks good in the short perspective (10k bars @3min) but I find it hard to get a good equity curve over longer times..

    1 user thanked author for this post.
    #219196

    Thank you for taking the time to look at the code. What would you suggest I do to improve the equity curve over a longer time?

    Thanks

    #219198

    I’ve also imported the file and can’t seem to get any trades executing. I must be doing something completely wrong as I’d be more than happy with the above results.

    #219214

    lnskrlssn .itf file has position size set at 0.2 at Line 12.  This works for backtest on Demo Account (I think? ) but for backtesting on Live Account position size min = 1.

    #219217

    Ah my bad, IGs minimum for DOW in Sweden is 0.2 but I think that its higher in other countries, at least for you guys in UK.

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

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