fxDreema

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

    Close the least profitable trade

    Questions & Answers
    2
    8
    1285
    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

      What would be the easiest way to select the single least profitable trade and close it

      So lets say I have 5 open trades , all losers and I want to close the absolute biggest loser in pips, and keep the other 4 open
      how would I manage that, which blocks should I use?

      Thanks

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

        https://fxdreema.com/shared/X4hFHV7Qc
        http://prntscr.com/8khxc3

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

          WOW
          that is so much easier than actually programming this
          I should have found that option

          last question on this subject

          when you use terminate, does it actually stop the EA, or just the loop?
          or just waits for the next tick or bar to keep on working?

          hope I make sense

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

            This functions is used: http://docs.mql4.com/common/expertremove

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

              okay so I should use loop(break) instead I guess

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

                I think that you want to have a Script which will close the least profitable trade only when you run it manually. The difference between Expert Advisors and Scripts is that Scripts run only once, they do their job once and then they exit. But you should know that...

                Or you want to break the loop (for loops this word is used), which means that you stop the loop in the middle and continue doing the next thing after it. Only for the pink blocks I have added such block and you can find it in the bottom of that category. But if in "For each trade" you have "Not more than n trades" set to 1, it will stop after the first trade in the loop anyway.

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

                  I imagine when we select profitable last, it selects based on piure dollar values, and not pips, right?

                  Is it posisble to have a routine that selects based on per pip, not dollars?

                  Any possibility on adding this?

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

                    Yes, it looks at the profit in money.

                    If I ever do something about this, it will be some universal way of sorting, but I'm still not sure how exactly to do it

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

                    Online Users

                    C
                    M
                    J
                    5
                    C
                    E
                    S

                    26
                    Online

                    146.7k
                    Users

                    22.4k
                    Topics

                    122.6k
                    Posts

                    Powered by NodeBB Forums | Contributors