fxDreema

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

    Help Bulding MA crossover EA

    General Discussions
    2
    4
    3611
    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.
    • S
      samhtrader last edited by

      Hi there,
      I am trying to build an EA that opens a trade when a bar opens above or below an MA & only once. On the first bar only and not on every bar that opens after it. So basically one trade after every cross of the MA.
      I created one but seem to open on every bar after a trade is closed. How do I stop it from doing that. I also need allot of work on the trailing stop side.
      Thanks for any help.

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

        You are working with >. Try with x>.

        But I don't like the way your blocks are connected. Please, take a look at these:
        https://fxdreema.com/demo/mt4-wrong-closing-rule
        https://fxdreema.com/demo/mt4-once-per-bar

        1 Reply Last reply Reply Quote 0
        • S
          samhtrader last edited by

          Thank you for your response.
          just to clarify, you are saying if I add (X>) that will not allow another trade because as long as price stays over EMA there is no cross over and no new trade will initiate.

          I need help with the next strep.
          For example, when price crosses over the EMA, I want it to look at the Custom indicator I have added before openning a buy. In the indicator there is a trade line and an RSI line. The RSI line should cross above the trade line as the price crosses over the EMA or no trade. I have loaded the indicator into FxDreema, but need to know what to use and how to set it up? Do I use it in condition box & how?
          I also have the same indicator that issues an alert signal. Which would be better to use?
          Thanks.

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

            When you have x>, this means that the Condition block does 2 checks - one > for the current candle and another < for the previous candle. More info here: https://fxdreema.com/demo/mt4-crossover-indicators This means that the x> state... I mean the time period where both checks are true... can be up to 1 candle long. When that candle is closed, this x> is no more true. While if you use >, this remains true for all candles where one of the lines is above the other, until they cross.

            But because x> remains true for multiple ticks (while the current exists), "Once per bar" is used to catch only the first one.

            If you have 2 blocks with different indicators connected one after another and if x> (or x<) is used, then better don't expect both crossovers to happen at the same candle. Instead, leave x> (or x<) only in one Condition and in the other use > or <. You know, if now MAx is > than MAy, this means that MAx crossed MAy some time ago.

            There is another kind of crossover as well - https://fxdreema.com/demo/mt4-price-vs-indicator

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

            Online Users

            S
            A
            R
            B
            N
            M
            A
            T
            V
            M
            A
            A
            R
            S

            24
            Online

            146.7k
            Users

            22.4k
            Topics

            122.6k
            Posts

            Powered by NodeBB Forums | Contributors