fxDreema

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

    Trying (and failing) to create a simple EA...appealing to all FXDreema gurus!

    Questions & Answers
    5
    40
    7806
    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
      SirBoyce last edited by

      Hi All,

      I really hope someone can help me with this! I am trying to create what I think should be a relatively simple EA (for the M15 chart) that does the following:

      Executes a BUY trade when all the following conditions are true of the previous candle close:

      • Previous candle is a bull candle
      • The previous bull candle closed above the slow EMA
      • On previous candle close the MACD histogram bar is above the 0.00 line
      • On previous candle close the MACD histogram bar is above the MACD signal line.

      Like this:

      0_1569321410285_4e534bea-fa1d-479d-9b90-241f6a16481e-image.png

      Exits the BUY trade when the following condition is true of the previous candle close:

      • On previous candle close the MACD histogram bar is below the MACD signal line, like this:

      0_1569321614246_55d4eee6-0375-4c5d-89f7-276ea1c84a7f-image.png

      Executes a SELL trade when all the following conditions are true of the previous candle close:

      • Previous candle is a bear candle
      • The previous bear candle closed below the fast EMA
      • On previous candle close the MACD histogram bar is below the 0.00 line
      • On previous candle close the MACD histogram bar is below the MACD signal line.

      Like this:

      0_1569322001400_4e78237b-4d81-43cd-96e8-0f4f595de494-image.png

      Exits the SELL trade when the following condition is true of the previous candle close:

      • On previous candle close the MACD histogram bar is above the MACD signal line

      Your help would be massively appreciated!!!!

      Many thanks for taking a look,

      Andrew

      1 Reply Last reply Reply Quote 0
      • T
        trader.philipps last edited by

        @SirBoyce Something like this maybe?

        0_1569336982211_MACD_Test.mq4

        Project Link

        Haven't done much testing but the basics should be fulfilled.

        I like to share my knowledge, but expect the others to contribute as well.

        S 3 Replies Last reply Reply Quote 0
        • S
          SirBoyce @trader.philipps last edited by

          @trader-philipps Thanks man! Let me look into that and see what I can see!!!

          1 Reply Last reply Reply Quote 0
          • S
            SirBoyce @trader.philipps last edited by

            @trader-philipps OK, I've taken a look....and it's actually very similar to what I had done. The main difference appears to be the inclusion of the Once Per Bar blocks. I have to admit I don't really understand those (I'm new here!) but will have another go and hopefully that and a few parameter checks might actually work! I'll let you know how I get on. Thanks ever so much for this.

            1 Reply Last reply Reply Quote 0
            • l'andorrà
              l'andorrà last edited by

              The 'Once per bar' block is the way to stop your EA to be executed on every tick arriving to the platform. This is a common mistakes for rookies, don't worry about that. This of it as a funnel concentrating what you want the EA to do in a more controlled way.

              (English) I will try to help everyone in these fxDreema forums. But if you want to learn how to use the platform in depth or more quickly, I can help you with my introductory fxDreema course in English at https://www.theandorraninvestor.eu.

              (Català) Miraré d’ajudar tothom en aquests fòrums d’fxDreema. Tanmateix, si vols aprendre a fer servir la plataforma amb més profunditat o més de pressa, t’hi puc ajudar amb el meu curs d’introducció a fxDeema en català a https://www.theandorraninvestor.eu/ca.

              (Español) Intentaré ayudar a todo el mundo en estos foros de fxDreema. Sin embargo, si quieres aprender a usar la plataforma en profundidad o más deprisa, te puedo ayudar con mi curso de introducción a fxDreema en español en https://www.theandorraninvestor.eu/es.

              S 1 Reply Last reply Reply Quote 0
              • S
                SirBoyce @l'andorrà last edited by

                @l-andorrà Thanks!

                1 Reply Last reply Reply Quote 0
                • S
                  SirBoyce @trader.philipps last edited by

                  @trader-philipps Hi there. The EA you sent me was a big big help. Thanks so very much, I learned a lot. However, despite a few tweaks my end it still didn't perform as expected, particularly with regards to exiting positions.

                  I'm now trying to take things one step at a time and simply trying to get a BUY to ENTER TRADE on the desired MACD conditions....when 15min candle has CLOSED and has closed displaying the following conditions:

                  • MACD Main is above 0.000000 value...
                  • AND when MACD Main is above the MACD Signal line

                  0_1569427735191_90977dd6-23d7-49f7-9364-27661bec22f1-image.png

                  When I back tested the above (and when I changed the candle ID to 0, as well) it's clear its entering buy trades when the MACD Main line at candle close is below the Signal line, and even when the candle close is below the 0.00 Line:

                  0_1569428682252_c42150ee-4517-4744-bf45-9201cd85d204-image.png

                  Why would this be happening?

                  Cheers!

                  T 1 Reply Last reply Reply Quote 0
                  • T
                    trader.philipps @SirBoyce last edited by

                    @sirboyce Switch back to candle ID 1, please! It will help to understand what's printed on the chart and what EA did better.
                    However, if you don't want a new trade each bar that the conditions are met, you should put a no trade block in front. It's that what you are complaining about?

                    I like to share my knowledge, but expect the others to contribute as well.

                    S 1 Reply Last reply Reply Quote 0
                    • S
                      SirBoyce @trader.philipps last edited by

                      @trader-philipps Hello again! Thanks for all your help on this, it is very much appreciated. I'm getting there I promise 🙂

                      The no trade block was not the issue I was trying to resolve, I simply wanted to see that the buys were entering on the conditions I had set. However, your advise to switch the candle ID was spot-on.

                      It is clear from testing that a close trade on MACD main to (on a BUY, for example) below the MACD signal line is not ideal, and I am now thinking a trailing stop is the way to go to close out any trades (on testing my market entry is good but the MACD retrace is stopping me out of many trades before they have a chance to 'mature' and is also closing trades at a loss in temporarily ranging markets with lots of short-term up and down MACD movement).

                      For my BUY EA, Instead of the condition of trade close being MACD Main below MACD Signal line on previous candle close, if I wanted to use instead a trailing stop - with the initial stop less set at, say, 15 pips - and so that every time the price moves up 15 pips the stop loss shifts up by the same amount, would you mind telling me if the following parameters are correct and also where the Trailing Stop block should be placed in the EA chain???

                      0_1569522263630_1868a161-1187-49e5-b480-849417f4ff72-image.png

                      Thanks again for all the amazing advice!

                      T 1 Reply Last reply Reply Quote 0
                      • l'andorrà
                        l'andorrà last edited by

                        Could you please share your project instead of just showing a screenshot? Many relevant information is within the blocks.

                        (English) I will try to help everyone in these fxDreema forums. But if you want to learn how to use the platform in depth or more quickly, I can help you with my introductory fxDreema course in English at https://www.theandorraninvestor.eu.

                        (Català) Miraré d’ajudar tothom en aquests fòrums d’fxDreema. Tanmateix, si vols aprendre a fer servir la plataforma amb més profunditat o més de pressa, t’hi puc ajudar amb el meu curs d’introducció a fxDeema en català a https://www.theandorraninvestor.eu/ca.

                        (Español) Intentaré ayudar a todo el mundo en estos foros de fxDreema. Sin embargo, si quieres aprender a usar la plataforma en profundidad o más deprisa, te puedo ayudar con mi curso de introducción a fxDreema en español en https://www.theandorraninvestor.eu/es.

                        S 1 Reply Last reply Reply Quote 0
                        • S
                          SirBoyce @l'andorrà last edited by

                          @l-andorrà Not sure I follow. All I want to know is where should the trailing stop block be placed in the previous screenshot to enable the buy trade close to be triggered by it, and what parameters for that block to set the stop loss on trade open at 15 pips below, and trail the price moving up by 15 pips at a time. How do I share a project anyway?

                          L 1 Reply Last reply Reply Quote 0
                          • T
                            trader.philipps @SirBoyce last edited by

                            @sirboyce The trailing parameters look good. For trailing step I"d use a higher value such as 1 or 2 in that case cause I don't like too many order modifications.
                            You might also consider to user atr or a multiplier of it as a trailing distance. In order to give more room on volatile market conditions.

                            I like to share my knowledge, but expect the others to contribute as well.

                            S 2 Replies Last reply Reply Quote 0
                            • S
                              SirBoyce @trader.philipps last edited by

                              @trader-philipps Hi there. I can't get this to work properly. All I want is for a buy to open when - upon a bull candle close - the candle closes above the slow EMA & the MACD main has crossed from below to above the MACD 0.00 line & above the MACD signal line. When the buy opens, I want a stop loss of 15 pips below automatically, and for every 15 pips the price rises during the open trade...the stop loss to move up by 15 pips.

                              I had the buy opening conditions working fine, but introducing the stop loss has produced some crazy results on testing (some orders open with what appears to be a stop loss, others don't etc.).

                              If you can show me how to share my project with you, could you just show me how to do this? That would be greatly appreciated!

                              Thanks.

                              1 Reply Last reply Reply Quote 0
                              • L
                                line @SirBoyce last edited by

                                @sirboyce You can share a link so we can see the specifics of the blocks which is the proper way to diagnose the problem. Go to "projects" and then click on "create a shared copy (web link)" then post that link in this thread.

                                S 1 Reply Last reply Reply Quote 0
                                • S
                                  SirBoyce @trader.philipps last edited by

                                  @trader-philipps Just for your reference, with Trailing Stop set at 15, Trailing Step at 10, and Trailing Start at Open Price, here are some screens from testing 2nd September to 25th September:

                                  First Buy Open (should have hit a 15 pip stop loss, conditions for a profitable buy missed later on):

                                  0_1569582315962_67464043-d5e4-44ef-b180-c345ad15a7b4-image.png

                                  Buy conditions met but no Trade (would have hit TP):

                                  0_1569582937339_7e2101f5-426f-4da6-ba5c-02f4d402bc6d-image.png

                                  No S/L on Open:

                                  0_1569583064739_33a274d3-aa8b-4c61-8854-cfd8857e3371-image.png

                                  Apparent correct Buy Open, Trailing S/L and TP Reached:
                                  0_1569583249971_93dad194-a0e7-4e8b-97d5-b3bcb1c860a5-image.png

                                  1 Reply Last reply Reply Quote 0
                                  • S
                                    SirBoyce @line last edited by

                                    @line Gotcha. Thanks!

                                    https://fxdreema.com/shared/qLv0whrNb

                                    1 Reply Last reply Reply Quote 0
                                    • L
                                      line last edited by

                                      0_1569583708424_1113924b-2fd2-45ab-9223-9632df70d8fc-image.png

                                      1 Reply Last reply Reply Quote 0
                                      • L
                                        line last edited by

                                        0_1569583761736_b6cee22d-4a15-4979-8360-dafde8c2490e-image.png

                                        1 Reply Last reply Reply Quote 0
                                        • L
                                          line last edited by

                                          Try those changes and see if it works.

                                          1 Reply Last reply Reply Quote 0
                                          • L
                                            line last edited by line

                                            Made some mods on it and it made some profit.

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

                                            Online Users

                                            E
                                            A
                                            L
                                            S

                                            15
                                            Online

                                            146.7k
                                            Users

                                            22.4k
                                            Topics

                                            122.6k
                                            Posts

                                            Powered by NodeBB Forums | Contributors