fxDreema

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

    If custom code

    Questions & Answers
    3
    9
    1294
    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.
    • jstap
      jstap last edited by

      Hopefully someone can help, my knowledge on mq4 code is limited, I am trying to wright nested if statements, what I am trying to do is:
      if variable1=string1 then insert number into variable2, else if variable1=string2 insert a different number into variable2. This continues until match is found or value 0.0 is inserted into variable2.

      Thankyou

      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! 😊

      l'andorrà Q 2 Replies Last reply Reply Quote 0
      • l'andorrà
        l'andorrà @jstap last edited by

        @jstap This one is for real programmers. Can someone help?

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

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

          0_1623679312344_Screenshot (397).png

          I have tried to implement this code which I think will full full all my needs but I am getting compilation errors (see picture), does anyone have any way I can get this code to compile?

          Thanks

          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
          • jstap
            jstap last edited by

            This is the code:

            string Name = Symbol(), Test[] = { "EURUSD", "EURGBP", "USDJPY" };
            double Result = 0, Value[] = { 15.0, 20.0, 25.0 };

            int Count = ArraySize( Test );

            for( int i = 0; i < Count; i++ )
            {
            if( Name == Test[i] )
            {
            Result = Value[i];
            break;
            }
            }

            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
            • Q
              q8carpenter @jstap last edited by

              @jstap Hello,

              I'm not sure in what part of a strategy do you wanna add this, but there are most of the times workarounds with blocks where no custom code is required. I mean here is an example of where you can start with what you asked in the post.

              0_1623693935123_variable number.png

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

                @q8carpenter Hi thank you for your time, in this link is where I first tried to have this work and it worked as expected, link text, when I entered it into my main project it wouldn't divide the balance to change the LOT according to balance, I have now learnt that saving balance into a variable allows the needed calculations. Unfortunately I deleted that part so I will have to start again, this was all to make EA automatically start with a predetermined lot for different symbols, custom code would have been the neater option but I will have to build with lots of blocks:)

                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! 😊

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

                  @jstap I see the EA is supposed to trade non forex symbols and they are not included here:

                  0_1623766789691_01.png

                  Don't forget to specify their pip rules.

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

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

                    @l-andorrà Hi, this EA se set up for all broker pip rules, the reason I am not using acc% vs stop loss is because it closes because of an indicator, nearly all losses happen long before SL is hit so % at risk is less than what would be in EA, I am using SL just for an emergency situation

                    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
                    • jstap
                      jstap last edited by

                      For anyone that is interested, while working on another project I found some of Miro's code for inserting different timeframes into a variable, a little bit of adjusting and it works perfectly for this project. link text

                      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
                      • 1 / 1
                      • First post
                        Last post

                      Online Users

                      E
                      E
                      T
                      W
                      A

                      24
                      Online

                      146.8k
                      Users

                      22.4k
                      Topics

                      122.6k
                      Posts

                      Powered by NodeBB Forums | Contributors