fxDreema

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

    Need help with the execution of my exact entry/exit

    General Discussions
    2
    4
    664
    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.
    • F
      Feliziano7 last edited by

      Hello everyone!

      I am trying to build an EA, that does the following:

      • On candle close, if the 2 EMA crossed the 7 EMA to the upside, buy now (once)
      • stay in the trade UNTIL the 2 crossed the 7 on candle close (since it could cross multiple times during a candle and I really want the confirmation that the close of the candle caused the EMA's to stay crossed)
      • the same vice-versa (so sell if 2 crosses 7 below etc...)

      I added a "take profit" if you will, which should set a trailing stop once the unrealized profit reaches point A and close the trade once it reaches point B

      Here is the project: https://fxdreema.com/shared/ND7gRSW3b

      I encountered various problems which the EA and I hope somebody can help me out since I really can't find the (probably obvious) solution:

      • sometimes the EMA opens up trades if the EMAs crossed during the last candle, so not with candle close, but also it it happened during the opening, which is a problem since I plan on using this EMA on high volatile pairs
      • the "take profit" and "set trailing stop" does not work at all
      • I also found some problems with my take on "close trades", since sometimes they simply kept on going

      Unfortunately, I could not find a mistake pattern ...

      I put all my blocks in the "On Tick" Event since my TP did not trigger in the "On Trade" Event

      I would be very glad if somebody would take the time to help me out!

      Cheers

      roar 1 Reply Last reply Reply Quote 0
      • roar
        roar @Feliziano7 last edited by roar

        @feliziano7 why the counters here?
        0_1598725190583_3cdfc9c9-686f-4eae-8179-71c5b711993a-image.png

        Otherwise I dont see anything wrong here, you'll have to provide some screenshots explaining whats happening and what you expected

        Need small help? Tag me in your post
        Need big help? https://www.fiverr.com/big_algo/automate-your-winning-strategy-in-mql4-or-mql5

        1 Reply Last reply Reply Quote 0
        • F
          Feliziano7 last edited by

          I encountered the problem with high volatile pairs (f.e. XAUUSD) that the EA opens up a trade as it should, but when my TP was hit within the same candle, it opened up another trade immediately.

          For Example:
          The EA should open a buy trade if the X EMA and Y EMA crossed to the upside on candle close id 1.
          Now, my trade opened, reached TP within some minutes, but checked the condition again and opened up another trade since the condition is still true.
          So I added the counters that the EA opens up just one trade per change of short-time trend and the counter will reset after the EMAs cross again in the other direction.

          Question:
          Does the "check profit (unrealized)" work on demo account? That is one thing I imagine could cause the trades not to close ...

          Thanks for your relply!

          roar 1 Reply Last reply Reply Quote 0
          • roar
            roar @Feliziano7 last edited by roar

            @feliziano7 ok, makes sense! You could also use "check type (last closed)" == buy/sell.

            Mql4 makes no difference between demo and real. Your trades dont close because you have set a group number in the entry logic but no group number in closing blocks. Remove the group # or set the same number everywhere:
            0_1599042722261_6f1c378e-e83f-4df2-a1a2-e45cb4a2f484-image.png

            Need small help? Tag me in your post
            Need big help? https://www.fiverr.com/big_algo/automate-your-winning-strategy-in-mql4-or-mql5

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

            Online Users

            A
            J
            L
            S
            E

            14
            Online

            146.8k
            Users

            22.4k
            Topics

            122.6k
            Posts

            Powered by NodeBB Forums | Contributors