fxDreema

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

    Any reason why this is closing sells?

    Questions & Answers
    2
    8
    376
    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.
    • C
      Castlemaine last edited by

      0fd0d292-8ae4-4e04-be8a-19ec794e4396-image.png

      1 Reply Last reply Reply Quote 0
      • C
        Castlemaine last edited by

        Also @roar you are the loop master, maybe you can help me! I have the following variables:
        openSells: current open profit/loss on sell positions
        openBuys: current open profit/loss on sell positions
        MaxSells: Highest value of sell profits reached
        MaxBuys: Highest number of buy profits reached.

        I'm trying to get the EA to do the logic:

        If OpenBuys > (MaxBuys - MaxSells)
        Close all BUY trades, starting with the least profitable, until OpenBuys =< (MaxBuys - MaxSells)

        I managed to get similar logic working with a simple loop in another project (https://fxdreema.com/shared/a3cD1cAjb) but when I use it in my main project it either gets stuck in the loop OR just closes everything, buys and sells

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

          Remove the 'for each' trade' block. The 'close trades' block is a loop itself. Your structure is combining a loop unto another loop. That is probably the reason why it's not working correctly.

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

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

            @l-andorrà Thanks, I tried it with a regular close block and still no luck, it just crashes the EA in the tester as it's stuck in an infinite loop.
            78b2a6d0-6245-48f9-8089-453429d75232-image.png

            To be honest I already have data the variables I need: When I have a X amount of loss in BUY trades and Y amount of profit hedged in SELL trades, I want to close all SELL trades, and close the equivellant amount of profit (loss) in BUY trades

            EG:

            Buys: -$200
            Sells: +$150

            Close all SELLS and equivelant value of BUYS

            Result:
            Buys: -$50
            Sells: $0

            This keeps the on-balance profit/loss the same but frees up some margin.

            but I'm struggling to find a way to do this! If you can offer some ideas that would be amazing.

            1 Reply Last reply Reply Quote 0
            • C
              Castlemaine last edited by

              I know @roar made something that does a similar thing here: https://fxdreema.com/shared/ZVBBYk4M
              but I can't seem to get it to work. I have these variables if that helps:
              image.png

              1 Reply Last reply Reply Quote 0
              • C
                Castlemaine last edited by

                original thread where ROAR posted: https://fxdreema.com/forum/topic/7555/request-suggestion-for-close-partially-group-of-trades-block?_=1685989402676 I'm going to keep playing with it but any assistance is greatly appreciated as I'm still learning!

                1 Reply Last reply Reply Quote 0
                • C
                  Castlemaine last edited by

                  I got it working based off of @roar 's project so thanks guys! it was a problem with caclulating the max open sells because when i did it with a fixed value it worked fine
                  image.png
                  Any way to get the final trade to close a partial to keep the math more precise as a bonus? thanks guys!

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

                    Congrats for making it work! What do you exactly mean by 'keep the math more precise'?

                    (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
                    • 1 / 1
                    • First post
                      Last post

                    Online Users

                    M
                    M
                    C
                    N

                    14
                    Online

                    146.7k
                    Users

                    22.4k
                    Topics

                    122.6k
                    Posts

                    Powered by NodeBB Forums | Contributors