fxDreema

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

    Array for distance of pips

    Questions & Answers
    2
    8
    994
    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.
    • ajmd97fx
      ajmd97fx last edited by

      Hello friends, I am making an array to show me the list of open trades of a currency.

      When I want to order them, I only see the option to do it for the one that has more or less profit or the trade that is more or less old.

      0_1612964819900_edc139f8-101e-41e1-8675-c5dd7cb75ce0-image.png

      Is there any way to order the trades according to the pips that each one has?

      Thank you very much

      ANTONIO JESUS

      ajmd97fx 1 Reply Last reply Reply Quote 0
      • ajmd97fx
        ajmd97fx @ajmd97fx last edited by

        @ajmd97fx I have seen that in mql4 there is the parameter "arrayMaximum", but I don't know how to use it.
        I would greatly appreciate someone helping me.

        Thank you very much

        ANTONIO JESUS

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

          this is the link of the shared project

          https://fxdreema.com/shared/qKHmzzDic

          ANTONIO JESUS

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

            @ajmd97fx I think sorting your array would be nice

            https://docs.mql4.com/array/arraysort

            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

            1 Reply Last reply Reply Quote 1
            • ajmd97fx
              ajmd97fx last edited by

              Yes, I think it must be that, but I don't know how to implement it, can you provide me with an example or an idea?
              thank you very much

              ANTONIO JESUS

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

                @ajmd97fx there's an example on the mql4 page:

                //--- example of sorting of one dimensional array
                double num_array[5]={4,1,6,3,9};
                //--- now array contains values 4,1,6,3,9
                ArraySort(num_array);
                //--- now array is sorted 1,3,4,6,9
                ArraySort(num_array,WHOLE_ARRAY,0,MODE_DESCEND);
                //--- now array is sorted 9,6,4,3,1

                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

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

                  @roar I am not a programmer, I have modified a bit of code following some of your examples (many thanks;))
                  according to this example I understand how to order from highest to lowest.
                  what I don't know is how to tell it to order from highest to lowest according to the number of pips in each trade

                  ANTONIO JESUS

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

                    can someone help me with this array and arraymaximum function?

                    Thank you very much

                    ANTONIO JESUS

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

                    Online Users

                    N
                    F
                    M
                    A
                    L
                    O
                    S
                    E
                    J
                    D
                    M
                    X

                    23
                    Online

                    146.6k
                    Users

                    22.4k
                    Topics

                    122.6k
                    Posts

                    Powered by NodeBB Forums | Contributors