fxDreema

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

    How to create double cross MA bot?

    Questions & Answers
    4
    21
    2338
    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.
    • G
      GTOAT777 last edited by

      Ok so for this bot I will use 2 MAs 10 & 20, every time the 10 crosses underneath the 20 BUT then crosses back up a few candles later I want to enter a trade.

      How would I go about creating that?

      Just to clarify again, for example a buy trade would be the 10 MA crosses below the 20 MA, maybe 6-7 candles later it crosses back up, I would want the bot to enter a buy trade when it crosses back up the 20 MA. The process will be reversed for a sell trade.

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

        @gtoat777 You need to use a variable to count candles after the first crossing. Each new candle after that crossing it should be added +1. That you compare that value of thet variable when the opposote crossing happens. Depending if it is higher or lower than the desired value, you condition will occur.

        (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.

        G 1 Reply Last reply Reply Quote 1
        • G
          GTOAT777 last edited by

          @l-andorrà Sometimes it might cross back over from the 2nd candle, sometimes the 4th it varies how would I input that? Also I want it to disregard the trade of it takes more than 6 candles to cross, how would I write a variable for that?

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

            @l-andorrà https://fxdreema.com/shared/1SnLGtKze let me know if this is correct

            jstap 1 Reply Last reply Reply Quote 0
            • jstap
              jstap @GTOAT777 last edited by

              @gtoat777 |Go down to area 20 in HERE, it is how to create a loop to count candles from the cross.

              Learn fxDreema Without the Wait!

              My comprehensive book, available on Amazon, is packed with examples and invaluable insights to help you fast-track your learning journey.

              The paperback and hardback editions include MT4 & MT5 QR codes for easy access to all prebuilt projects and robots, including my latest gold trading robot!

              Don’t miss out

              Click here➡️ https://mybook.to/fxDreema to get your copy today!

              Enjoy! 😊

              G 1 Reply Last reply Reply Quote 0
              • G
                GTOAT777 @jstap last edited by

                @jstap Thanks, it’s not so much on a particular number of candles before it crosses back, I’m more focused on the double cross of the MAs because sometimes it could double cross with 3, sometimes 5 and both are still excellent trading opportunities.

                Is my initial project for the double croos?

                jstap 1 Reply Last reply Reply Quote 0
                • jstap
                  jstap @GTOAT777 last edited by

                  @gtoat777 In there your firs condition becomes false when you second becomes true.

                  In HERE is an updated version, at this point is where you need to decide how many candles you use in each condition, and what conditions you use to reset. the way you had can be use to achieve this but is restricted to what happens on specific candles, or you can use the yellow dot to check different conditions, you will just need a lot of blocks and is not easily changeable in your inputs.

                  Learn fxDreema Without the Wait!

                  My comprehensive book, available on Amazon, is packed with examples and invaluable insights to help you fast-track your learning journey.

                  The paperback and hardback editions include MT4 & MT5 QR codes for easy access to all prebuilt projects and robots, including my latest gold trading robot!

                  Don’t miss out

                  Click here➡️ https://mybook.to/fxDreema to get your copy today!

                  Enjoy! 😊

                  1 Reply Last reply Reply Quote 0
                  • G
                    GTOAT777 last edited by

                    @jstap so are you saying to just copy and paste the whole of area 20 or just blocks 73-78? I appreciate the help

                    jstap 1 Reply Last reply Reply Quote 0
                    • jstap
                      jstap @GTOAT777 last edited by

                      @gtoat777 Other blocks in there are useful but not connected, 73-90 is what is required to create an EA that does what you require, you have to decide the conditions to use to make the EA, make a start and ask about any problems you are having so things can be assessed.

                      Learn fxDreema Without the Wait!

                      My comprehensive book, available on Amazon, is packed with examples and invaluable insights to help you fast-track your learning journey.

                      The paperback and hardback editions include MT4 & MT5 QR codes for easy access to all prebuilt projects and robots, including my latest gold trading robot!

                      Don’t miss out

                      Click here➡️ https://mybook.to/fxDreema to get your copy today!

                      Enjoy! 😊

                      G 2 Replies Last reply Reply Quote 0
                      • G
                        GTOAT777 last edited by

                        @jstap I'll make an attempt but currently i find the concept of conditions and variables a bit confusing, either way ill roughly do a version and send it over to you for some guidance, again i appreciate the help

                        1 Reply Last reply Reply Quote 0
                        • G
                          GTOAT777 @jstap last edited by GTOAT777

                          @jstap 0_1636912565617_30134A5B-93C9-4698-AABC-0E01C68AD302.jpeg

                          This is the general concept as you can see the this SELL example, the 10 MA crossed above the 20 and the crosses back a few candles later.

                          I would like the bot to enter the trade when it crossed back over/down, generally though I don’t care how many candles if anything I would prefer to put a limit meaning if price hasn’t crossed back over within 7 candles then don’t attempt the trade.

                          So which part in PART 20 that you sent covers which steps

                          1 Reply Last reply Reply Quote 0
                          • N
                            Nillav last edited by Nillav

                            https://fxdreema.com/shared/1SnLGtKze Este proyecto no funciona porque la tercera condición depende de la primera y nunca se produciría.
                            Para que haga lo que quieres hacer tienes que usar el Bloque "Turn on" despues de la segunda condición y dejar apagado el tercer bloque, y cuando se active la tercera condición pones un bloque "Turn Off" para reiniciar todo el programa. Con dos bloques más y separando el tercer bloque lo tienes hecho.

                            G 1 Reply Last reply Reply Quote 0
                            • G
                              GTOAT777 @Nillav last edited by

                              @nillav Thank you but where are Turn On and Turn off blocks?

                              1 Reply Last reply Reply Quote 0
                              • G
                                GTOAT777 @jstap last edited by

                                @jstap Ive gone through the part 20 stuff you sent and ill be honest i have no idea what any of that means, i'm a beginner at this FXdreema stuff so I don't know what terminology like "BOOL" means. When I click on the conditions and variables all the stuff input in there is confusing to me as of now.

                                jstap 1 Reply Last reply Reply Quote 0
                                • jstap
                                  jstap @GTOAT777 last edited by

                                  @gtoat777 bool = true/false, double = number with decimal like 0.0, int = whole number like 12,34, string = text, color = colours. this covers most. If you learn these then you'll have a good idea of when to use what.

                                  Learn fxDreema Without the Wait!

                                  My comprehensive book, available on Amazon, is packed with examples and invaluable insights to help you fast-track your learning journey.

                                  The paperback and hardback editions include MT4 & MT5 QR codes for easy access to all prebuilt projects and robots, including my latest gold trading robot!

                                  Don’t miss out

                                  Click here➡️ https://mybook.to/fxDreema to get your copy today!

                                  Enjoy! 😊

                                  G 1 Reply Last reply Reply Quote 0
                                  • G
                                    GTOAT777 @jstap last edited by

                                    @jstap ah ok thank you, looking back I think I worded my original post wrong, scrap what I said about candles the premise is basically this
                                    Part 1: X_Ma crosses below Z_Ma
                                    Part 2: When X_Ma crosses back above Z_Ma then BUY.

                                    Part 1.5
                                    Only “BOOL” I guess would be that if X_Ma has not crossed back up with 5 candles then cancel the potential trade.

                                    jstap 1 Reply Last reply Reply Quote 0
                                    • jstap
                                      jstap @GTOAT777 last edited by

                                      @gtoat777 Yes you can use a bool condition to hold a position until it's relevent or not. Basically a condition block with MA < or> MA, then a condition block with X< or X> will give you the conditions to cover this, use as many condition blocks with < or > and different candle ID's. If you need a cross one way=t then the other you will need to use something like a flag or bool conditions.

                                      Learn fxDreema Without the Wait!

                                      My comprehensive book, available on Amazon, is packed with examples and invaluable insights to help you fast-track your learning journey.

                                      The paperback and hardback editions include MT4 & MT5 QR codes for easy access to all prebuilt projects and robots, including my latest gold trading robot!

                                      Don’t miss out

                                      Click here➡️ https://mybook.to/fxDreema to get your copy today!

                                      Enjoy! 😊

                                      G 1 Reply Last reply Reply Quote 0
                                      • G
                                        GTOAT777 @jstap last edited by

                                        @jstap https://fxdreema.com/shared/N9Pp9ZJNb Ive made a rough simple version, let me know if this is correct, i did it that if the fast ma is still below the slow ma after 3 candles is TRUE but if its below 6 candles its FALSE and i linked it back to no trade. The following condition was then if the fast ma crosses back above the slow ma

                                        jstap 1 Reply Last reply Reply Quote 0
                                        • jstap
                                          jstap @GTOAT777 last edited by

                                          @gtoat777 I am unsure what you are trying to do but a constant cannot be a bool and a double at the same time, you shouldn't need a loop back to the top to achieve this.

                                          Learn fxDreema Without the Wait!

                                          My comprehensive book, available on Amazon, is packed with examples and invaluable insights to help you fast-track your learning journey.

                                          The paperback and hardback editions include MT4 & MT5 QR codes for easy access to all prebuilt projects and robots, including my latest gold trading robot!

                                          Don’t miss out

                                          Click here➡️ https://mybook.to/fxDreema to get your copy today!

                                          Enjoy! 😊

                                          G 1 Reply Last reply Reply Quote 0
                                          • G
                                            GTOAT777 last edited by

                                            @jstap hahaha my inexperience is showing, so what I was trying to program was, if it is still below the fast MA after 3 candles it’s still a go-ahead but if it’s 6 then cancel the potential trade

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

                                            Online Users

                                            A
                                            J
                                            D
                                            E

                                            24
                                            Online

                                            146.7k
                                            Users

                                            22.4k
                                            Topics

                                            122.6k
                                            Posts

                                            Powered by NodeBB Forums | Contributors