fxDreema

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

    closing with crossover

    Questions & Answers
    3
    7
    1828
    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.
    • A
      amin last edited by

      dear admin
      I have a problem here. I am trying to make an EA that open trades with given signals, but I want to close trades with crossover of 6ma and 15ma, as I show in picture.6ma from bottom move and cross the 15ma.i want close the open trade just right there.
      I wrote something like this, but it doesn`t work. https://fxdreema.com/shared/QMhgcrLF
      could you please help me.

      SAMPLE.jpg

      ......
      SAMPLE.jpg

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

        Classic 🙂
        https://fxdreema.com/demo/mt4-wrong-closing-rule
        https://fxdreema.com/demo/mt4-events
        https://fxdreema.com/examples

        1 Reply Last reply Reply Quote 0
        • A
          amin last edited by

          dear admin
          thank you for your help. got that and solve it. but there is another problem.when the 6 ma cross the 15 ma, where the position is closed is 15-20 pip upper than crossover point. and this is not candle closing too. and this mean 20 pip loss more.
          can in eliminate this distance?
          error 1.jpg

          ......
          error 1.jpg

          1 Reply Last reply Reply Quote 0
          • M
            MIKEIKE last edited by

            I've accomplished this by creating a formula by using addition or subtraction of pips from an MA related to candle to control both entries and exits. Sometimes a crossover occurs when the candle price moves to far from the MA and an entry or exit can be late so I set condition to enter or exit if resulting formula is less than a fixed number of pips. Hope this helps.....Admin may have better suggestion though.

            1 Reply Last reply Reply Quote 0
            • M
              MIKEIKE last edited by

              Actually, your first issue can be easily solved by exiting when the candle high crosses the MA for exit I believe?

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

                Normally in "Condition", indicator values from the current candle (Candle ID = 0) are used, which means that you can detect crossover in the middle of the candle. At that very moment the crossover will be true and visible. Then, after that candle is closed, nothing will look the same as few moments before. Sometimes crossover happen and then the price goes back and at the end of the candle it looks that there was no crossing at all. Just look at the indicator while it's working - all the indicator points are staying still, but the very newest one is moving on every tick, up-down, up-down.

                1 Reply Last reply Reply Quote 0
                • A
                  amin last edited by

                  hi
                  thank you very much,

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

                  Online Users

                  M
                  F
                  J
                  F
                  M
                  N
                  H
                  K
                  W

                  17
                  Online

                  146.7k
                  Users

                  22.4k
                  Topics

                  122.6k
                  Posts

                  Powered by NodeBB Forums | Contributors