fxDreema

    • Register
    • Login
    • Search
    • Back to the main page
    • Categories
    • Recent
    • Tags
    • Popular
    • Search

    EA based on MACD Divergence & MA Crossover

    Questions & Answers
    3
    4
    2026
    Loading More Posts
    • Oldest to Newest
    • Newest to Oldest
    • Most Votes
    Reply
    • Reply as topic
    Log in to reply
    This topic has been deleted. Only users with topic management privileges can see it.
    • M
      mustafafr010 last edited by

      I want to make an EA in which first appears MACD Divergence and then follows in few candles MA Crossover.

      How can I build this sequence.

      1 Reply Last reply Reply Quote 0
      • J
        josecortesllobat last edited by

        There are two specific blocks addressed for the MACD Divergence

        0_1531412114378_94e1606f-e9cf-467e-b146-6e8eb093dcde-image.png

        You can begin to build your project using those blocks.

        M 1 Reply Last reply Reply Quote 0
        • M
          mustafafr010 @josecortesllobat last edited by

          @josecortesllobat
          That am aware. What I'm asking is the sequence of conditions.

          First the MACD divergence then the crossover. I was able to use the "Flag" block to save the macd divergence event then the crossover but now the issue is that even if the divergence has occurred far long ago, the ea will still consider it as condition being fulfilled.

          I need to know now how to set number of candles behind the macd divergence can be considered valid and also i want to add that when the reverse divergence occurs before the second condition gets fulfilled the ea should invalidate the first divergence and start over.

          1 Reply Last reply Reply Quote 0
          • fxDreema
            fxDreema last edited by

            Well, I'm not sure that I will recommend to use these divergence blocks. The truth is that I made them somewhere in 2011 or 2012 and they remained the same since them, even I don't know how they work now 🙂

            Otherwise you can play with some Variables and giving some state of the strategy that way. Let's say you have one variable with type "int", such variable can have any integer value - 0, 1, 2, 3... - you decide which number means what. Those Flags block are pretty much the same thing, so you decide. I guess you need to need to reset the Variable/Flag after certain number of candles. So, what if you actually use a Variable that is from type "datetime" and you store the Time of the event in it? Then you can compare that time with the current time and decide whether the signal was too old or not.

            1 Reply Last reply Reply Quote 0
            • 1 / 1
            • First post
              Last post

            Online Users

            J
            P
            L
            F

            13
            Online

            146.7k
            Users

            22.4k
            Topics

            122.6k
            Posts

            Powered by NodeBB Forums | Contributors