fxDreema

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

    Miro1360, Please Help, Button informing the current profit. (Solved)

    Questions & Answers
    2
    15
    1464
    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.
    • XYON126
      XYON126 last edited by XYON126

      miro1360, I need help, I want to put a button that informs me of the current profit of all open operations in the Pair where the button is, at the same time if the profit is positive the button will turn green, if it is negative it will turn red and if it is "0" in gray. I say button because I do not want a text on the screen without more, I want it to be seen inside a box, so I think that a button would be the most appropriate. I have reached this point but the text, or data does not come out and I do not know how to add the open operations and if the total comes out in the current Protit of the pair. Please, Help. Thank you very much and sorry for my English.

      https://fxdreema.com/shared/lP7O4Q3Fb

      1 Reply Last reply Reply Quote 0
      • F
        FenixTrading last edited by

        Hi, try something like this:
        https://fxdreema.com/shared/fHVCdImHc

        XYON126 1 Reply Last reply Reply Quote 0
        • XYON126
          XYON126 @FenixTrading last edited by

          @fenixtrading Thank you very much but i get the button only in gray and it does not change color, nor does it give me the current profit, it stays at "0"

          1 Reply Last reply Reply Quote 0
          • F
            FenixTrading last edited by

            This version is actually working:
            https://fxdreema.com/shared/Ne8Z35hdd

            XYON126 1 Reply Last reply Reply Quote 0
            • XYON126
              XYON126 @FenixTrading last edited by

              @fenixtrading Hi Fenix! Thank you very much, it is perfect. One more question, do you know if by copying the MQL code I can pass it as an indicator instead of EA to MT4, or on the contrary, how could I pass it as an indicator?

              F 1 Reply Last reply Reply Quote 0
              • F
                FenixTrading @XYON126 last edited by

                @xyon126 You can try it by copy and paste the same code in MetaEditor.
                FxDreema should allow us to program also Indicators with the same system.

                XYON126 1 Reply Last reply Reply Quote 0
                • XYON126
                  XYON126 @FenixTrading last edited by

                  @fenixtrading OKAY! I will prove it. Is it possible to limit the decimal places that instead of leaving 6.5300000001 you get only 6.53 or 6.5?

                  1 Reply Last reply Reply Quote 0
                  • F
                    FenixTrading last edited by

                    I added a DoubleToString funcion in the button block.
                    If you prefer less digit just change the last number from 2 to 1 or even 0.

                    XYON126 1 Reply Last reply Reply Quote 0
                    • XYON126
                      XYON126 @FenixTrading last edited by

                      @fenixtrading Sorry, I'm very clumsy. Where and how should I change the double variable to string?

                      F 1 Reply Last reply Reply Quote 0
                      • F
                        FenixTrading @XYON126 last edited by

                        @xyon126 i have updated the EA
                        https://fxdreema.com/shared/QIeBYiIQc

                        Open the Button Block, check the DoubleToString funcion and change the last number. You can choose how much digit to show in the button.

                        XYON126 1 Reply Last reply Reply Quote 0
                        • XYON126
                          XYON126 @FenixTrading last edited by

                          @fenixtrading Thank you so much. Just one more thing, I have tried it in different pairs (EURUSD, EURJPY, etc) and I have found that the Profit that it gives me is not the one of the PAR where the button is but the sum of all the pairs and I need it to be only of the total of the pair, that is, if the button is in EURUSD that is only the total of the EURUSD operations and thus in each PAR that the button puts. It's possible?

                          F 1 Reply Last reply Reply Quote 0
                          • F
                            FenixTrading @XYON126 last edited by

                            @xyon126 I think it's possible, but you need different formula for the single pair. You just need to isolate a bucket of trades and calculate the netprofit.
                            Also you should create a loop for trades in the specific pair you load the EA so you can calculate and show the net profit on the button.

                            XYON126 1 Reply Last reply Reply Quote 0
                            • XYON126
                              XYON126 @FenixTrading last edited by

                              @fenixtrading How can I get the PAR where I am? I think that with the Block "Set" Current Market "for next Blocks" with a variable that gives the previous data it would be possible too. What do you think?

                              F 1 Reply Last reply Reply Quote 0
                              • F
                                FenixTrading @XYON126 last edited by FenixTrading

                                @xyon126
                                It could be interesting to know how you open and manage the trades on a certain pair.
                                Let's say you manage your trades with loop event, this version should work on a single pair.

                                https://fxdreema.com/shared/XDEgW6J2c

                                XYON126 1 Reply Last reply Reply Quote 0
                                • XYON126
                                  XYON126 @FenixTrading last edited by

                                  @fenixtrading
                                  Hello! It does not work, what gives is the historical not the current Profit. I just tried it.

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

                                  Online Users

                                  S
                                  P
                                  C
                                  E
                                  K
                                  M

                                  15
                                  Online

                                  146.7k
                                  Users

                                  22.4k
                                  Topics

                                  122.6k
                                  Posts

                                  Powered by NodeBB Forums | Contributors