fxDreema

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

    Retrive the highest open price from a group of orders

    Questions & Answers
    2
    12
    1570
    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.
    • H
      holygrailfx last edited by

      How would I go about retrieving the highest open price from a group of buy orders?

      And how would I retrieve the average open price for all these orders, balanced out for lotsize

      Thanks

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

        Now only possible with variables, but I'm currently working for new category of blocks to do exactly that

        1 Reply Last reply Reply Quote 0
        • H
          holygrailfx last edited by

          any idea for a timeline, to see if I can wait

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

            I already have it, but when I do something new, I'm normally trying different ways, because in the process I can dedide that something needs to be added ot removed

            1 Reply Last reply Reply Quote 0
            • H
              holygrailfx last edited by

              Okay I will wait for the release

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

                I uploaded this, also with other visual updates.

                So, the keyword is "Bucket". You will find this group now called "Bucket of Trades &..." and I marked it as experimental, which means that I can decide to make some changes. Very often I get better idead right after upload something 🙂

                There are 3 blocks inside. Each one selects a group of trades and there are very basic filters. Then in "Condition" you can find a new category with the keyword "Bucket" again. This is where you can choose what value you want to get from the selected group. Count, Profit, SL, TP, Lotsize... such things are now available and you can also choose to get the Total, Average, Maximum or Minimum value.

                Additionally there is some advanced option that I just decided to use. The idea here is that you can write some condition in pure MQL4, something like:
                OrderType() == OP_SELL
                which will filter only sells for the actual calculations. So, the bucket can have Buys, but with this option they can be filtered. I'm not sure if it's better to keep this option over there or directly into the Bucket-blocks, but that's why this is still experimental, I will decide.

                Also, multiple different buckets can be selected at any given time. Each of them is identified by color (which is Bucket ID). By default in "Condition" you will work with the bucket that was selected last, but if you want you can select 2 buckets (before "Condition") and compare values from both of them in "Condition" by using those colors (Bucket ID).

                I can in fact add blocks like "close", "modify stops" and everything similar to the pink blocks, but for now I don't know what new can this bring to the builder.

                1 Reply Last reply Reply Quote 0
                • H
                  holygrailfx last edited by

                  Thanks
                  I will have a look and start experimenting

                  Cheers

                  1 Reply Last reply Reply Quote 0
                  • H
                    holygrailfx last edited by

                    First observation

                    I retrieved the average price of all open buy orders adn all open sell orders
                    when I compare to iExposure it does not give the same average price

                    What is the difference in the calculations?

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

                      The Average... thing in the calculations should the mathematical average, which is the sum of all divided by their count. I don't know for iExposure, maybe it calculates some weighted values that depend on the type and the lotsize?

                      1 Reply Last reply Reply Quote 0
                      • H
                        holygrailfx last edited by

                        I checked iexposure calculates based on weighted, instead of count it use lotszies
                        which makes more sens as the number of trades is not relevant (unless they are all the same lotsize)
                        if you cahnge it for weighted it would give you the BE price of all open buy trades, which is very useful when hedging and minimizing account loss

                        let us know whether you change it or add another option

                        thansk

                        1 Reply Last reply Reply Quote 0
                        • H
                          holygrailfx last edited by

                          I am still having issues with the bucket function

                          orderlotsizes and average prices are still no calculating correctly

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

                            I think I'm gonna stop answering to question if there is no showcase included (simple project showing the problem directly). I'm really tired of imagining what exactly could be wrong 🙂

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

                            Online Users

                            M
                            E
                            E

                            16
                            Online

                            146.8k
                            Users

                            22.4k
                            Topics

                            122.6k
                            Posts

                            Powered by NodeBB Forums | Contributors