Hello everyone,
I find myself lost in what I think is a simple maths problem.
What I am trying to achieve is to find a formula that calculates the break even price of multiple open positions. basically I want to find that price where the resulting profit/loss of the open positions for a symbol is 0.
I know how to do it if there are only long or shorts but if there are long and shorts open then I feel confused.
Any help please?
Ok let’s try this
Break even for Buy positions
Avg Price=Break Even (Bid)=(Price1Lot1+Price2Lot2+Price3Lot3+PriceXLotX)/(Lot1+Lot2+Lot3+LotX)
Resulting size=(Lot1+Lot2+Lot3+LotX)
Break even for Sell positions
Avg Price=Break Even (Ask)=(Price1Lot1+Price2Lot2+Price3Lot3+PriceXLotX)/(Lot1+Lot2+Lot3+LotX)
Resulting size=(Lot1+Lot2+Lot3+LotX)
Calculating that I can find the combined buy order and sell order
now, if I have buy and sell orders open I can get the break even with:
Profit of Buy orders = Loss of Sell orders
Profit of Buy orders = (Bid - Buy Open Price) * Buy Lots * PipValue
Loss of Sell orders = (Ask - Sell Open Price) * Sell Lots * PipValue
We also know that Ask = Bid + Spread
(Bid - Buy Open Price) * Buy Lots * PipValue = (Bid + Spread - Sell Open Price) * Sell Lots * PipValue
X = Bid, we can get the ask easily once we have one of the two
PipValue can be removed
Resolving the equation
(X - BOP) * BL = (X+S-SOP) * SL
XBL - BOPBL = XSL + SSL - SOP*SL
XBL - XSL = SSL + BOPBL - SOP*SL
X = (SL*(S-SOP) + BL*BOP)/(BL-SL)
Makes Sense? Any feedback?
That should work
break even profit or loss is determined by floating profit. not pips won or lost. if you have 26 orders open and the floating profit is $10 and your costs are $10. thats break even
Hi Scmonds,
so is my formula totally wrong?
How would you translate your concept in a a mathematical formula?
If floating profit is greater than, and equal to cost close orders.
the above is in simple form, but if your looking for the formula to write the code. that will require a layered apporach
MT4 has multiple indicators to show this. iExposure is built in as standard.