fxDreema

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

    Monitoring PnL of specific positions.

    Questions & Answers
    3
    14
    528
    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.
    • J
      Johnster last edited by

      I'm trying to monitor the last 5 positions PnL.
      Screenshot 2025-03-30 at 09.21.26.png
      This only outputs the last position value... the SUM of the last 5 is my desired output. I'm breaking my head.
      Anyone?

      Johnster.

      1 Reply Last reply Reply Quote 0
      • J
        Johnster last edited by

        Tried different variations for "for each position".
        I'm expecting it to output loop values, not single values.
        Looking for PnL (Profit) in that loop.

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

          every n trades empty, above set variable to 0, in formula block underneath take variable, save currently loaded trade profit back into the same variable from a loop value

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

            Tried empty, let me try "0".

            1 Reply Last reply Reply Quote 0
            • J
              Johnster last edited by Johnster

              "0" gives same result. Only last (Newest) value, not the loop (5 newest sum) value... sigh

              J 1 Reply Last reply Reply Quote 0
              • J
                Johnster @Johnster last edited by

                @Johnster Screenshot 2025-03-30 at 11.16.23 1.png

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

                  Add a shared link to see how it's all set up

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

                    See my 1st post above...

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

                      Not a picture a shared liunk, and the latest you have updated

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

                        Def. a bug.
                        Just build the thing multiple times... sigh.

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

                          So add a shared link to see possible problems. I have used FX for years, and bugs are normality a miss placed block or function

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

                            @Johnster your variable "s1_buy_newest_profit" will be updated with a new value for each position on each iteration of the loop so it will only have the last value when the loop completes.
                            Declare a new double variable as "temp" and put it where "s1_buy_newest_profit" is in the modify variables block.
                            Add a new formula block after the modify variables block
                            Put "s1_buy_newest_profit" as the left operand
                            Put "temp" as the right operand
                            Add the 2 together and put the result back into your "s1buy_newest_profit" variable that will become be the result of the sum of the loops.

                            1 Reply Last reply Reply Quote 0
                            • A
                              albyxx last edited by

                              I forgot to add that you will need to set the variable "s1_buy_newest_profit" to zero in a modify variables block before the for each position block.

                              1 Reply Last reply Reply Quote 0
                              • J
                                Johnster last edited by

                                @albyxx that might work... might try that later, as I went for build multiple times solution already....

                                Thanks @jstap and albyxx.

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

                                Online Users

                                D
                                E
                                J
                                T
                                J

                                20
                                Online

                                146.7k
                                Users

                                22.4k
                                Topics

                                122.6k
                                Posts

                                Powered by NodeBB Forums | Contributors