fxDreema

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

    Store how many orders open at the same time

    Questions & Answers
    4
    29
    4878
    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.
    • A
      ambrogio last edited by

      As the title says, how to know how many orders (e.g. buys) are open in the backtest at the same time? (without reading the report of course)

      0_1577970266956_Cattura.png

      1 Reply Last reply Reply Quote 0
      • l'andorrà
        l'andorrà last edited by

        You can create acounter variable and then count how many trades are open by using a 'For each trade' block. You modify the variable at every pip on the orange dot of the block.

        (English) I will try to help everyone in these fxDreema forums. But if you want to learn how to use the platform in depth or more quickly, I can help you with my introductory fxDreema course in English at https://www.theandorraninvestor.eu.

        (Català) Miraré d’ajudar tothom en aquests fòrums d’fxDreema. Tanmateix, si vols aprendre a fer servir la plataforma amb més profunditat o més de pressa, t’hi puc ajudar amb el meu curs d’introducció a fxDeema en català a https://www.theandorraninvestor.eu/ca.

        (Español) Intentaré ayudar a todo el mundo en estos foros de fxDreema. Sin embargo, si quieres aprender a usar la plataforma en profundidad o más deprisa, te puedo ayudar con mi curso de introducción a fxDreema en español en https://www.theandorraninvestor.eu/es.

        A 2 Replies Last reply Reply Quote 0
        • A
          ambrogio @l'andorrà last edited by

          @l-andorrà Thank you, in fact this is my problem, unfortunately my 52-year-old dried-up brain is not what I had in high school, I need an example 😄

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

            To be more precise, the maximum number of orders opened simultaneously

            A 1 Reply Last reply Reply Quote 0
            • A
              ambrogio @l'andorrà last edited by ambrogio

              @l-andorrà https://fxdreema.com/shared/rf0OwR56c
              What is missing is: stop counting when orders are closed by condition and how to determine what was the maximum of open orders until closing

              A T 2 Replies Last reply Reply Quote 0
              • A
                ambrogio @ambrogio last edited by

                @ambrogio said in Store how many orders open at the same time:

                @l-andorrà https://fxdreema.com/shared/rf0OwR56c
                What is missing is: stop counting when orders are closed by condition and how to determine what was the maximum of open orders until closing

                update https://fxdreema.com/shared/FrIzIIdac

                1 Reply Last reply Reply Quote 0
                • T
                  trader.philipps @ambrogio last edited by

                  @ambrogio Take a look here, I think in my example I do similar things https://fxdreema.com/forum/topic/8455/how-can-i-collect-the-latest-open-positions-in-the-event-of-a-trend-change/5

                  I like to share my knowledge, but expect the others to contribute as well.

                  S 1 Reply Last reply Reply Quote 0
                  • l'andorrà
                    l'andorrà last edited by

                    Trader.philipps example should be useful for you, ambrogio. And don't be ashamed to be 52. I'm 51 and I can understand you, believe me :D.

                    (English) I will try to help everyone in these fxDreema forums. But if you want to learn how to use the platform in depth or more quickly, I can help you with my introductory fxDreema course in English at https://www.theandorraninvestor.eu.

                    (Català) Miraré d’ajudar tothom en aquests fòrums d’fxDreema. Tanmateix, si vols aprendre a fer servir la plataforma amb més profunditat o més de pressa, t’hi puc ajudar amb el meu curs d’introducció a fxDeema en català a https://www.theandorraninvestor.eu/ca.

                    (Español) Intentaré ayudar a todo el mundo en estos foros de fxDreema. Sin embargo, si quieres aprender a usar la plataforma en profundidad o más deprisa, te puedo ayudar con mi curso de introducción a fxDreema en español en https://www.theandorraninvestor.eu/es.

                    A T 2 Replies Last reply Reply Quote 0
                    • A
                      ambrogio @l'andorrà last edited by

                      @l-andorrà 😄

                      1 Reply Last reply Reply Quote 0
                      • T
                        trader.philipps @l'andorrà last edited by

                        @l-andorrà 49 only .. I lost as a noob 😄

                        I like to share my knowledge, but expect the others to contribute as well.

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

                          I see we're in good company.!!!! 😄 😄 😄

                          1 Reply Last reply Reply Quote 1
                          • A
                            ambrogio @trader.philipps last edited by ambrogio

                            @trader-philipps Please take a look at this example, in this case always the count is incremented https://fxdreema.com/shared/w1ZUoXluc
                            But I need as in this picture

                            0_1578173974153_3Cattura.PNG

                            Calmly is not urgent 😉

                            T 1 Reply Last reply Reply Quote 0
                            • T
                              trader.philipps @ambrogio last edited by trader.philipps

                              @ambrogio What exactly you want to count (and what not)?

                              In your example you increase the variable each time a trade is closed by 1

                              0_1578177274908_614e5a4c-6008-45d3-8580-8f21ba318456-image.png

                              But you want to know how many orders are currently open, right?

                              The idea is that the number of open orders only change if a new trade is opened or an existing trade is closed.

                              That's why I use the 2 blocks Trade created and Trade closed on the onTrade tab.

                              0_1578177516873_27e4e198-ea3b-495e-a207-c1805a6c0510-image.png

                              In the screenshot case I have 1 For Each trade for Buys and one for sells. If you just need the total number of both, you just need 1 For each trade block.

                              Important: Re-set the counter variable on white dot to 0. So it will start the calculation each time by 0.

                              Than you just add 1 to the counter variable each time the modify Cariabkes block is called (for each trade).

                              I like to share my knowledge, but expect the others to contribute as well.

                              1 Reply Last reply Reply Quote 0
                              • A
                                ambrogio @ambrogio last edited by

                                @ambrogio said in Store how many orders open at the same time:

                                To be more precise, the maximum number of orders opened simultaneously

                                @trader-philipps I need to know the maximum number of orders opened at the same time, in the example above is 19 buy orders, all that is less than 19 I do not need. If later I have a series of 32 orders open at the same time, at that point the number that interests me is 32 and the 19 I no longer need

                                T 1 Reply Last reply Reply Quote 0
                                • T
                                  trader.philipps @ambrogio last edited by

                                  @ambrogio Okay, so you need something like a high watermark? Will that ever be re-set?

                                  By logic you'd do the same as metioned above, but would create another counter variable. This you would only update, if the condition is true that the current counter for open orders is bigger than the high watermark variable. Do you need an example?

                                  I like to share my knowledge, but expect the others to contribute as well.

                                  A 1 Reply Last reply Reply Quote 0
                                  • A
                                    ambrogio @trader.philipps last edited by

                                    @trader-philipps Hi! Thanks to your suggestion, I came up with it. This works for me, please take a look, is it too complicated in your opinion?

                                    https://fxdreema.com/shared/wSLuBbqnd

                                    T 1 Reply Last reply Reply Quote 0
                                    • T
                                      trader.philipps @ambrogio last edited by

                                      @ambrogio Well, it's not exactly as I would do it. With your approach you wouldn't check for update if a trade gets closed for any other reason by the broker (eg. TP or SL is hit or margin call, etc.). Hence I'd do on both events on the onTrade tab (order opened and order closed) a calculation loop over all currently open trades. Hence your counter would always be up to date.

                                      Check this out!

                                      0_1578224579756_a42f3eac-b4a0-4948-a64e-f9053227d81e-image.png

                                      I like to share my knowledge, but expect the others to contribute as well.

                                      A 1 Reply Last reply Reply Quote 0
                                      • A
                                        ambrogio @trader.philipps last edited by

                                        @trader-philipps ok, thank you, talk later

                                        T 1 Reply Last reply Reply Quote 0
                                        • T
                                          trader.philipps @ambrogio last edited by

                                          @ambrogio Ok. Keep in mind that if you closed the terminal while trades were open, you may want to run the check as well. Alternatively you may store the value of max_orders_buy to a terminal variable (mus be unique per EA instance!) as well and read that variable if existing on the onInit tab.

                                          I like to share my knowledge, but expect the others to contribute as well.

                                          A 1 Reply Last reply Reply Quote 0
                                          • A
                                            ambrogio @trader.philipps last edited by

                                            @trader-philipps Thank you very much, it is much better. But please, explain me why in the pass block #40 you put 0 value at V1 variable and why on the white dot? It's the same to reset V1 variable to 0 value? 😄

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

                                            Online Users

                                            F
                                            R
                                            S
                                            D
                                            V
                                            O

                                            15
                                            Online

                                            146.7k
                                            Users

                                            22.4k
                                            Topics

                                            122.6k
                                            Posts

                                            Powered by NodeBB Forums | Contributors