fxDreema

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

    Sum and compare multiple Profits

    Questions & Answers
    2
    2
    382
    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
      Andrest last edited by

      I need to compare the profit and loss of multiple open positions.

      In this way:
      If I have all these orders buys, with these profits / losses (in money)

      -5, -4, -3, -2, -1, 0, +1, +2, +3

      Then sum the greatest loss with benefits. When the result is => 0 close those.

      In the example:
      -5 + (+2 +3) = 0

      Then close those. Floating result is: -4, -3, -2, -1, 0, +1

      I hope you can help me and sorry for my English

      regards

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

        I made a block to do this long time ago, but there are many other things to be considered and mostly because of that it's not in the list. Eventually you will start to think "what if we arrange trades depending on OpenTime... or distance from the current price... or lot size... or something else", which is a problem for me 😄

        Someone asked for this few days ago. It's interesting how some things emerge and out of nothing many people are starting to ask for the same 🙂 I don't know, maybe I will release it. But it's not some miracle block, just to say, I was playing with these ideas before 🙂

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

        Online Users

        E
        H
        R
        A

        14
        Online

        146.7k
        Users

        22.4k
        Topics

        122.6k
        Posts

        Powered by NodeBB Forums | Contributors