fxDreema

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

    Getting all SL values

    Questions & Answers
    0
    10
    692
    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

      I am trying to get the combined SL value of all running trades into a variable, I have an indicator that will display values on the line, unfortunately though the value(s) aren't in a buffer, also I cannot upload it here at the moment.

      @roar do you have a way of inserting this into custom code?

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

        Is the SL in points, money or level? Average level?

        In any case, I would loop through the trades and sum the SLs

        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

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

          @roar Money looping through seems right, how would I get this value to loop through and add?

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

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

            @jstap getting the sum of pips would be easy, but money amounts requires conversion from pips to money using the lot size and tick value data...

            https://fxdreema.com/shared/V105Q7kPd

            Something like this, I didn't test it. I just tried to reverse the "risk % of equity" SL calculations in the Buy Now block.

            0_1672270040094_150974fd-a0e9-49dd-a3bd-ea45ae902562-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

            jstap 3 Replies Last reply Reply Quote 1
            • jstap
              jstap @roar last edited by

              @roar Thank you, Ill test this and see what happens.

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

                @roar Well I have to say you are a genius, I have tried to do this myself, but never quite managed it...and in 3 blocks:)

                The result did need *100 to be correct value, all good though.

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

                  @roar Could you help me? I have added code to what you have done, it now uses - numbers and + numbers, for some reason though it only works correctly for sells, have a look and see if I have done something wrong. I have tried many different combination's but the result is the same.

                  https://fxdreema.com/shared/e7EnrkXI

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

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

                    @jstap why use negative values? I'm not sure how the sum of all values now behaves

                    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

                    jstap 2 Replies Last reply Reply Quote 0
                    • jstap
                      jstap @roar last edited by

                      @roar Negative values so when cost of hitting SL is a loss, but the 1st trade is positive, the total value is the actual sum, so if in multiple trades, you could switch all off but know that regardless total trades are in a positive state, or switch off and on trail knowing all is good.

                      When I have a minute I'll convert to MT5.

                      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 @roar last edited by

                        @roar As I am sure you are aware, this uses market info, so converting to m5 is not simple 🙂 (probably the main reason why I don't use).

                        In here is the completed project: https://fxdreema.com/shared/3rOqOH3ve, I had to strip back and create separate for buys and sells, before adding the values together.

                        Hope people find this useful.

                        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

                        D
                        S
                        M
                        A

                        9
                        Online

                        146.7k
                        Users

                        22.4k
                        Topics

                        122.6k
                        Posts

                        Powered by NodeBB Forums | Contributors