fxDreema

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

    Partial close (50%) for odd number lot size

    Questions & Answers
    5
    11
    3157
    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.
    • K
      kmfoster79 last edited by

      How do I partially close an odd number lot size? In testing it only works for even numbers. I'm trying to figure out if there's a way to adjust the variable but I'm having trouble. Here's what I have so far. https://fxdreema.com/shared/c4bu20U9

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

        As far as I know, you cannot unless your broker allows it.

        (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.

        1 Reply Last reply Reply Quote 0
        • E
          eklonsousa @kmfoster79 last edited by

          @kmfoster79 You will need to normalize the lot size for de the partial close.

          K 1 Reply Last reply Reply Quote 0
          • K
            kmfoster79 @eklonsousa last edited by

            @eklonsousa Do you mean in the EA or when I place the order, only use even number lots?

            E 1 Reply Last reply Reply Quote 0
            • E
              eklonsousa @kmfoster79 last edited by

              @kmfoster79 You need to use the function "Normalize" for the lot to be closed.

              Ex: You have the variables as LotSize, Lot1_Close.

              Then you will calculate the size of the Lot1_Close based on a % of the LotSize.

              Let's say that Lot1_Close will close 50% of the LotSize, that in that example is 0.05.
              So 50% of 0.05 would be 0.025, but it's not possible. You need to use it that code to get the correct lot that would be 0.03.

              "Lot1_Close = NormalizeDouble(Lot1_Close,2)"

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

                @eklonsousa You mean doing it with a custom code block, Right?

                (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.

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

                  @l-andorrà Yes, that's right.

                  I'm doing this with one of my EAs. Like this:

                  https://fxdreema.com/shared/BhC5kekB

                  This is only the Partial close side.

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

                    Very interesting. Thank you.

                    (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.

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

                      I think the issue is that when the lot size is not valid and needs to be rounded to the nearest valid value, the EA rounds it to the nearest... maybe from the up side. I think it all happens in one of my functions called AlignLots in which I have this row of code:

                      lots = MathRound(lots/LotStep)*LotStep;
                      

                      LotStep is the minimum lot step, normally 0.01 or 0.1. MathRound is described like this:

                      The function returns a value rounded off to the nearest integer of the specified numeric value.

                      E 1 Reply Last reply Reply Quote 0
                      • E
                        eklonsousa @fxDreema last edited by

                        @fxdreema

                        In this case it will only calculate the initial lote size, right?

                        I mean, it will calculate the lote size based on something as stop loss size.

                        The issue is when you try to partial close an odd lote size.

                        1 Reply Last reply Reply Quote 0
                        • afgmarkets
                          afgmarkets @eklonsousa last edited by

                          @eklonsousa Hello! And where do you get the lot step value? Maybe on Markes Properties? Thank you!

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

                          Online Users

                          B
                          A
                          J
                          D
                          E

                          12
                          Online

                          146.7k
                          Users

                          22.4k
                          Topics

                          122.6k
                          Posts

                          Powered by NodeBB Forums | Contributors