fxDreema

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

    Need some advice regarding this

    Questions & Answers
    2
    7
    1038
    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.
    • Zackry
      Zackry last edited by

      Hello need some advice on this:
      I am trying to calculate lot size based on previous trade's unrealized loss along with the new trade's take profit.
      Let say trade A is running in 20 pips loss, so open a trade B with predetermined take profit of "10 pips" and when the trade B hit the take profit ea should close trade A as well so the trade A loss will be 30 pips and the trade B profit will be 10 pips but the lot size of the trade B needs to be calculated in such a way that it should recover the loss of trade A and even out the 30 pip loss in 10 pips (to do this the lot size of trade B definetly needs to be more than the lot size of trade A.)
      Any ideas?

      roar 1 Reply Last reply Reply Quote 0
      • roar
        roar @Zackry last edited by roar

        @zackry
        In English:
        lot B is bigger when loss A or lot A is bigger, and smaller when tp B is
        bigger.

        In math:
        lot B = (loss A * lot A) / tp B

        In computer:
        https://fxdreema.com/shared/pCTJzt5D
        0_1563815885965_d75203e5-04a3-45dc-9454-35111d8006e4-image.png
        0_1563815899472_f35aa33d-4900-4850-9a93-60c2308642e4-image.png

        Hope my math checks out lol

        Need small help? Tag me in your post
        Need big help? https://www.fiverr.com/big_algo/automate-your-winning-strategy-in-mql4-or-mql5

        Zackry 2 Replies Last reply Reply Quote 0
        • Zackry
          Zackry @roar last edited by

          @roar thanks bro I will test it with the rest of the ea and will update here,

          1 Reply Last reply Reply Quote 0
          • Zackry
            Zackry @roar last edited by

            @roar what would be the mq4 alternate for this:lotsize = (PositionGetDouble(POSITION_VOLUME)

            roar 1 Reply Last reply Reply Quote 0
            • roar
              roar @Zackry last edited by

              @zackry Oh, yes thats mql5 there.

              OrderLots() should work for mql4:
              https://docs.mql4.com/trading/orderlots

              Need small help? Tag me in your post
              Need big help? https://www.fiverr.com/big_algo/automate-your-winning-strategy-in-mql4-or-mql5

              Zackry 1 Reply Last reply Reply Quote 0
              • Zackry
                Zackry @roar last edited by

                @roar in that case there wont be any need for POSITION_VOLUME right?

                roar 1 Reply Last reply Reply Quote 0
                • roar
                  roar @Zackry last edited by

                  @zackry Thats right -
                  lotsize = (OrderLots()*losspips)/tpPips;

                  Need small help? Tag me in your post
                  Need big help? https://www.fiverr.com/big_algo/automate-your-winning-strategy-in-mql4-or-mql5

                  1 Reply Last reply Reply Quote 0
                  • 1 / 1
                  • 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