Reverse Engineering of the Zero Lag MACD

Forums ProRealTime English forum ProBuilder support Reverse Engineering of the Zero Lag MACD

Tagged: 

Viewing 14 posts - 1 through 14 (of 14 total)
  • #88596

    Hello,

    For those using this indicator to trade, it may be useful to know in advance at which price the MACD will cross its signal line. Please find the code here below. If someone knows how to draw text on the right hand of the chart and not on the last candle, please shoot.

     

     

    4 users thanked author for this post.
    #88604

    Thanks for sharing the code but it is not possible to draw to the right of the current barindex with PRT unfortunately.

    #88609

    It’s what I thought thx for confirming Vonasi

    #88653

    You can’t draw objects in the future, but you can add blank space in a text string:

     

    2 users thanked author for this post.
    #119326

    Thank you all for sharing this code.

    I have the segment in the graphic, but cannot see the price tag on the scale on the right, even if marked in the indicator parameters.

    Is there anything to modify please ?

    #119329

    Change the last line with:

     

    1 user thanked author for this post.
    #119330

    Perfect ! Thanks again guys for your quick answers 😉

    #125627

    Hi dear,

    Thank’s for sharing !

    I’m not using PRT but MT4 instead… I’m beginner with MQL4 langage but I’ve tried to code it, it gives me something but the line isn’t really smoothed lol.

    So I don’t know if it’s normal or not…

    I joined a screenshot of my result (it gives me the pink line).

    And following my MQL4, maybe somebody knows this langage and could help me to analyze it :

     

    double fastMultiplier = (2.0 / (MACD_fastAvg + 1.0) );
    double slowMultiplier = (2.0 / (MACD_slowAvg + 1.0) );
    double signalMultiplier = (2.0 / (MACD_sigAvg + 1.0) );

    //Print(“Fast Multiplier [” + fastMultiplier + “]”);
    //Print(“Slow Multiplier [” + slowMultiplier + “]”);
    //Print(“Signal Multiplier [” + signalMultiplier + “]”);

    double prevEMAShort = 0.0;
    double prevEMALong = 0.0;
    double prevEMASignal = 0.0;

    double priceMACD = 0.0;

    if(i==0)
    {

    prevEMAShort = SimpleMA(i,MACD_fastAvg,close);
    prevEMALong = SimpleMA(i,MACD_slowAvg,close);
    prevEMASignal = SimpleMA(i,MACD_sigAvg,close);

    } else {

    prevEMAShort = ExtZeroLagShortDevBuffer[i-1];
    prevEMALong = ExtZeroLagLongDevBuffer[i-1];
    prevEMASignal = ExtZeroLagSignalDevBuffer[i-1];

    }

    double EMAShort1 = (close[i] – prevEMAShort) * fastMultiplier + prevEMAShort;
    double EMAShort2 = (EMAShort1 – prevEMAShort) * fastMultiplier + prevEMAShort;
    double DifferenceShort = EMAShort1 – EMAShort2;
    double ZeroLagShort = EMAShort1 + DifferenceShort;
    ExtZeroLagShortDevBuffer[i] = ZeroLagShort;

    double EMALong1 = (close[i] – prevEMALong) * slowMultiplier + prevEMALong;
    double EMALong2 = (EMALong1 – prevEMALong) * slowMultiplier + prevEMALong;
    double DifferenceLong = EMALong1 – EMALong2;
    double ZeroLagLong = EMALong1 + DifferenceLong;
    ExtZeroLagLongDevBuffer[i] = ZeroLagLong;

    double ZeroLagMACD = ZeroLagShort – ZeroLagLong;

    double Signal1 = (ZeroLagMACD – prevEMASignal) * signalMultiplier + prevEMASignal;
    double Signal2 = (Signal1 – prevEMASignal) * signalMultiplier + prevEMASignal;
    double DifferenceSignal = Signal1 – Signal2;
    double SignalMACD = Signal1 + DifferenceSignal;
    ExtZeroLagSignalDevBuffer[i] = SignalMACD;

    double macdValue = SignalMACD;
    priceMACD = (macdValue+((1-slowMultiplier)*prevEMALong)-((1-fastMultiplier)*prevEMAShort))/(fastMultiplier-slowMultiplier);

    ExtReverseZeroLagMacdBuffer[i]=NormalizeDouble(priceMACD, InpDecimalAccurate);

    #125629

    Hello NicoMich, sorry but you can’t come on a PRT forum and expects someone is going to help you with MT4…

    1 user thanked author for this post.
    #125632

    NicoMich – Welcome to the forums. These forums are dedicated to the ProRealTime platform.  We do not discuss other programming languages. You can use the paid for programming services for other languages if you want to. The link for it can be found under the ‘Help’ menu.

    #136695

    Bonjour,

    Peux-t-on avoir ce même type de reverse lorsque la ligne du MACD ZR uniquement (non pas la ligne de signal)  devient croissante ou décroissante ?

    Merci d’avance.

    Hello,

    Can we have this same type of reverse when the MACD ZR line only (not the signal line) becomes increasing or decreasing?

    Thank you in advance.

    #136699

    @oljemace

    • Only post in the language of the forumthat you are posting in. For example English only in the English speaking forums and French only in the French speaking forums.

    Thank you 😊

    #186680

    Hello,
    Thank you for this very interesting code. On the other hand, I would like to display the indicator in relation to the data of the previous candle in order to identify the zone to break for the MACD to turn around. Could you let me know how to go about it?
    Thank you for your help

    #222162

    Well done ! and a big thank you.

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

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