Formula to get the right lot size to recover my open losing trade

 
Hi guys i just want to ask if whats the formula and what do you call it, on getting the right lot size that i need to use. For example i have an open buy with -$500. I want to open a sell on the current price with a TP of 80pips to breakeven my losing buy trade, how will i know what lot size i need to use on my sell order to breakeven my -$500 dollar in 80pips? Thanks guys
 
mark692: Hi guys i just want to ask if whats the formula and what do you call it, on getting the right lot size that i need to use. For example i have an open buy with -$500. I want to open a sell on the current price with a TP of 80pips to breakeven my losing buy trade, how will i know what lot size i need to use on my sell order to breakeven my -$500 dollar in 80pips? Thanks guys

Here is the math, but since I do not know your math level, I don't know if it will be complicated for you.

PS! You will also have to make use of Tick Size and Tick Value in your calculations, if you want to get the results in $USD, instead of "point-lot".

Forum on trading, automated trading systems and testing trading strategies

Any great idea about HEDGING positions welcome here

Fernando Carreiro, 2018.09.17 21:17

For those of you that want to learn to see the "light" and not fall into the trap of "hedging" and Grid strategies, here is the basic math:

How to Calculate the Net Resulting Equivalent Order:


Learn to do your research properly! Do not be blinded by false promises. Do the math!


 

Also, the same logic is required when calculation your Risk based on your Stop-Loss.

Forum on trading, automated trading systems and testing trading strategies

any suggestions for getting the required lot size for certain risk percentage ?

William Roeder, 2021.03.18 15:26

Risk depends on your initial stop loss, lot size, and the value of the symbol. It does not depend on margin and leverage. No SL means you have infinite risk. Never risk more than a small percentage of your trading funds, certainly less than 2% per trade, 6% total.

  1. You place the stop where it needs to be — where the reason for the trade is no longer valid. E.g. trading a support bounce the stop goes below the support.

  2. AccountBalance * percent/100 = RISK = OrderLots * (|OrderOpenPrice - OrderStopLoss| * DeltaPerLot + CommissionPerLot) (Note OOP-OSL includes the spread, and DeltaPerLot is usually around $10/pip but it takes account of the exchange rates of the pair vs. your account currency.)

  3. Do NOT use TickValue by itself - DeltaPerLot and verify that MODE_TICKVALUE is returning a value in your deposit currency, as promised by the documentation, or whether it is returning a value in the instrument's base currency.
              MODE_TICKVALUE is not reliable on non-fx instruments with many brokers - MQL4 programming forum 2017.10.10
              Is there an universal solution for Tick value? - Currency Pairs - General - MQL5 programming forum 2018.02.11
              Lot value calculation off by a factor of 100 - MQL5 programming forum 2019.07.19

  4. You must normalize lots properly and check against min and max.

  5. You must also check FreeMargin to avoid stop out

Most pairs are worth about $10 per PIP. A $5 risk with a (very small) 5 PIP SL is $5/$10/5 or 0.1 Lots maximum.


 
Fernando Carreiro:

Here is the math, but since I do not know your math level, I don't know if it will be complicated for you.

PS! You will also have to make use of Tick Size and Tick Value in your calculations, if you want to get the results in $USD, instead of "point-lot".



Hi Sir Fernando :) the formula that you give is complicated for me, is that the net total volume that i need on the four formulas that you give?
 
mark692: Hi Sir Fernando :) the formula that you give is complicated for me, is that the net total volume that i need on the four formulas that you give?
Follow the details on William Roeder post first. That will probably suit your needs. My equations are for more advanced use for a basket of several orders. Since you only need one order with a specific T/P, it will be the same math as calculating risk based on S/L, but in this case it is the reward of T/P. The same logic applies, so read up on his post's details.
 
Fernando Carreiro:
Follow the details on William Roeder post first. That will probably suit your needs. My equations are for more advanced use for a basket of several orders. Since you only need one order with a specific T/P, it will be the same math as calculating risk based on S/L, but in this case it is the reward of T/P. The same logic applies, so read up on his post's details.

upon reading Sir William's post on his formula stop loss value is required, but the EA that I'm coding has no stop loss because its martingale Sir Fernando. hmmmm 

 
mark692:

upon reading Sir William's post on his formula stop loss value is required, but the EA that I'm coding has no stop loss because its martingale Sir Fernando. hmmmm 

Even being martingale it would need a StopLoss. wouldn't it?


If the price trend keeps going and going, what strategy will you use? keep compensating the loss using oposite trades only? with different lots? Use Hedge?

The setup will go wrong by that in a short time, there are more things involved.. 


But the worst that will happen, and it will, is that even if you keep compensating martingale using oposite positions (and considering you have positive profit all of on them, which is not true..) you will end up becoming without margin in a short time to keep this strategy going on, and to open new positions.. and  considering you will have open positions on loss.. 


I alraedy studied that deeply, created several kind of things and maths calculus to compensate, or to use hedge, to modify grids, volumes, etc.. 

the theory looks fine, until you make the math calculations and simulate it


Lets consider the situation you asked help for.

You have a $500 loss BUY position opened, you need to calculate a volume to create an oposite position, to cover the $500 loss of the first one, under a TP of 80 pips. This position need to have a volume of 6.25 lot. 

You open a SELL position of 6.25 lot, the price does not reach the 80 pips.. what about now? You are stuck with 2 positions, under loss, and you will end up being out of margin to open another.. 

You say: I could keep like this forever, since you "tied" both.. the same you loose on one, ou gain on the other. 

Where is the problem? It is on the vacuo between them.. which allocates your account margin.. make difiicult to open a 3rd one to begin a second grid of martingale, while the first one is "locked" on those 2 positions, on which the 80pips did not happed.. and god knows when it will.. 

Added to that, be prepared for big swaps every day.. and using a lot of 6.25 it will take your moneu account day by day.. making more dificult to open new positions.. and the free margins always decreasing.. 


Lets say: you decide to close both positions, and loose money before is too late.. This is what will happen: As soon as you close the first loosing one, your account balance will decrease.. the margin level will JUMP down instantly.. now you are in a much more dangerous scenario than before..


This is an avalanche of loss..

Make the calculations..  simulate it.. 

beware of the martingale illusion: everything is not like it appears to be. 


My suggestion, beyond the math calculus, is: 

You must determine a SL, even if it is a martingale technic.


I may be wrong, but I dont think I am.. 

 
mark692:upon reading Sir William's post on his formula stop loss value is required, but the EA that I'm coding has no stop loss because its martingale Sir Fernando. hmmmm 

I know that! And I have already said that the calculation for Risk and S/L, is the same as for Reward and T/P. Just invert the direction. It is the same thing!

Volume in lots = ( [Reward] * [Tick Size] ) / ( [T/P Size] * [Tick Value] )

If the Symbol is EURUSD, then [Tick Value] = $1.00, [Tick Size] = 0.00001 and [T/P Size] = 80 pips = 0.00800, [Reward] = $500.00

Volume = ($500 * 0.00001) / (0.00800 * $1) = 0.005 / 0.008 = 0.625 Lots = 0.63 Lots

 
rrocchi:

Even being martingale it would need a StopLoss. wouldn't it?


If the price trend keeps going and going, what strategy will you use? keep compensating the loss using oposite trades only? with different lots? Use Hedge?

The setup will go wrong by that in a short time, there are more things involved.. 


But the worst that will happen, and it will, is that even if you keep compensating martingale using oposite positions (and considering you have positive profit all of on them, which is not true..) you will end up becoming without margin in a short time to keep this strategy going on, and to open new positions.. and  considering you will have open positions on loss.. 


I alraedy studied that deeply, created several kind of things and maths calculus to compensate, or to use hedge, to modify grids, volumes, etc.. 

the theory looks fine, until you make the math calculations and simulate it


Lets consider the situation you asked help for.

You have a $500 loss BUY position opened, you need to calculate a volume to create an oposite position, to cover the $500 loss of the first one, under a TP of 80 pips. This position need to have a volume of 6.25 lot. 

You open a SELL position of 6.25 lot, the price does not reach the 80 pips.. what about now? You are stuck with 2 positions, under loss, and you will end up being out of margin to open another.. 

You say: I could keep like this forever, since you "tied" both.. the same you loose on one, ou gain on the other. 

Where is the problem? It is on the vacuo between them.. which allocates your account margin.. make difiicult to open a 3rd one to begin a second grid of martingale, while the first one is "locked" on those 2 positions, on which the 80pips did not happed.. and god knows when it will.. 

Added to that, be prepared for big swaps every day.. and using a lot of 6.25 it will take your moneu account day by day.. making more dificult to open new positions.. and the free margins always decreasing.. 


Lets say: you decide to close both positions, and loose money before is too late.. This is what will happen: As soon as you close the first loosing one, your account balance will decrease.. the margin level will JUMP down instantly.. now you are in a much more dangerous scenario than before..


This is an avalanche of loss..

Make the calculations..  simulate it.. 

beware of the martingale illusion: everything is not like it appears to be. 


My suggestion, beyond the math calculus, is: 

You must determine a SL, even if it is a martingale technic.


I may be wrong, but I dont think I am.. 

Hi Sir rrocchi thank you for this ideas. This will help me :)  The EA that im thinking to make is not purely martingale. If my sell trade on martingale drops my equity to a certain percentage , example -5% it will switch to other strategy that will compensate my loss or minimize my loss. 

 
Fernando Carreiro:

I know that! And I have already said that the calculation for Risk and S/L, is the same as for Reward and T/P. Just invert the direction. It is the same thing!

Volume in lots = ( [Reward] * [Tick Size] ) / ( [T/P Size] * [Tick Value] )

If the Symbol is EURUSD, then [Tick Value] = $1.00, [Tick Size] = 0.00001 and [T/P Size] = 80 pips = 0.00800, [Reward] = $500.00

Volume = ($500 * 0.00001) / (0.00800 * $1) = 0.005 / 0.008 = 0.625 Lots = 0.63 Lots

Thank you Sir Fernando :) i will analyze this formulas that you give. Thanks again :)

Reason: