Calculate average entry price

 
Hey all!

I've found that the most common method used for the average price calculation is:

Sum of (Volume * entry price) / Sum of (Volume)

This works just fine if all the trades are long or short. I read that if you do have long and short trades (https://www.forexfactory.com/thread/502181-how-to-calculate-average-price-for-open-orders), the volume part for long trades should remain positive and the volume for short trades should be negative. I do believe I'm missing something, as for example, lets say:

-Long 10 lots at price $10
-Short 5 lots at price $15

Following the equation, we have:

(10 * $10) + (-5 * $15) = $100 - $75 = $25

So, the other part would be:
10 - 5 = 5

In summary, the formula should return = $25 / 5 = $5

Which, I think doesn't make much sense to have an average entry cost (having a net long group of active trades) of $5 given that we bought 10 lots at a price of $10, then shorted 5 lots at a price of $15.

Am I missing something?

I know this doesn't make much sense for stocks or markets that require a netting of all trades, therefore, having a long and a short in the same asset wouldn't make sense, but for FX markets where most brokers allow to have both long and short trades in the same pair, I do believe I'm missing something.

Thanks in advance!
 
Fernando Jose Velasco Borea:
Hey all!

I've found that the most common method used for the average price calculation is:

Sum of (Volume * entry price) / Sum of (Volume)

This works just fine if all the trades are long or short. I read that if you do have long and short trades (https://www.forexfactory.com/thread/502181-how-to-calculate-average-price-for-open-orders), the volume part for long trades should remain positive and the volume for short trades should be negative. I do believe I'm missing something, as for example, lets say:

-Long 10 lots at price $10
-Short 5 lots at price $15

Following the equation, we have:

(10 * $10) + (-5 * $15) = $100 - $75 = $25

So, the other part would be:
10 - 5 = 5

In summary, the formula should return = $25 / 5 = $5

Which, I think doesn't make much sense to have an average entry cost (having a net long group of active trades) of $5 given that we bought 10 lots at a price of $10, then shorted 5 lots at a price of $15.

Am I missing something?

I know this doesn't make much sense for stocks or markets that require a netting of all trades, therefore, having a long and a short in the same asset wouldn't make sense, but for FX markets where most brokers allow to have both long and short trades in the same pair, I do believe I'm missing something.

Thanks in advance!


The average price is the one at which you would breakeven if you close the position at that price.

The 5 lots you shorted, acted as take profit on your long position of 10 lots, you are still long 5 lots,

but since you got some profit on your shorts, the market would have to go below 5$ to make your long position

go negative.

The opposite is if you shorted below the long price, that would be a partial stop and the average price of your long position would go up.

 
Alexandre Borela #:


The average price is the one at which you would breakeven if you close the position at that price.

The 5 lots you shorted, acted as take profit on your long position of 10 lots, you are still long 5 lots,

but since you got some profit on your shorts, the market would have to go below 5$ to make your long position

go negative.

The opposite is if you shorted below the long price, that would be a partial stop and the average price of your long position would go up.

Thanks!

So, if I got what you mean, $5.00 would be the price at which I'd break even, given the short trade?

For instance, let's assume the short trades is not to close part of the long, but an independent position.

That means that, the profits generated by the short trade opened at $15, shall the market reach $5, would be enough to cover the losses generated by the long trade placed at $10?

Breaking it down:

Short trade at $15 by 5 units

Long trade at $10 by 10 units

Short trade PL at $5: $50 ($10 move on 5 units)
Long trade PL at $5: -$50 ($5 move on 10 units)

Net PL (without considering commissions): $0.00

I'm assuming the above is correct, right?
 
Fernando Jose Velasco Borea #:
Thanks!

So, if I got what you mean, $5.00 would be the price at which I'd break even, given the short trade?

For instance, let's assume the short trades is not to close part of the long, but an independent position.

That means that, the profits generated by the short trade opened at $15, shall the market reach $5, would be enough to cover the losses generated by the long trade placed at $10?

Breaking it down:

Short trade at $15 by 5 units

Long trade at $10 by 10 units

Short trade PL at $5: $50 ($10 move on 5 units)
Long trade PL at $5: -$50 ($5 move on 10 units)

Net PL (without considering commissions): $0.00

I'm assuming the above is correct, right?

Yes correct. If you the orders you sent were on the same symbol, they are not independent even thou some brokers show them as such with the excuse that "they allow you to hedge" but it's wrong,

real hedging would require separate symbols, in your example you would actually be long 5 lots after the short(10-5),

after that, if you short 7 lots, your position would flip and you would be short 2 lots(Closing the remaining 5 long and creating a 2 lot short).

 
Alexandre Borela #:

Yes correct. If you the orders you sent were on the same symbol, they are not independent even thou some brokers show them as such with the excuse that "they allow you to hedge" but it's wrong,

real hedging would require separate symbols, in your example you would actually be long 5 lots after the short(10-5),

after that, if you short 7 lots, your position would flip and you would be short 2 lots(Closing the remaining 5 long and creating a 2 lot short).

Thanks for the help!

So, in the example I posted, buying 10 lots at $10 and then selling ("shorting") 5 lots at $15, would technically be the same as buying 5 lots at $5?

I'm making that assumption since the net side would be a net long basket with it's BE point at $5.
 
Fernando Jose Velasco Borea #:
Thanks for the help!

So, in the example I posted, buying 10 lots at $10 and then selling ("shorting") 5 lots at $15, would technically be the same as buying 5 lots at $5?

I'm making that assumption since the net side would be a net long basket with it's BE point at $5.
Yes.
 
Fernando Jose Velasco Borea #:
Thanks for the help!

So, in the example I posted, buying 10 lots at $10 and then selling ("shorting") 5 lots at $15, would technically be the same as buying 5 lots at $5?

I'm making that assumption since the net side would be a net long basket with it's BE point at $5.

BE is you "breakeven" point. It is not profit or loss, it is when you P/L is 0.00.  This is your average price. average of trades that are either all buys or all sells, OR some in both directions, and open at the same time, is a very common trading strategy in FX. It is my main "bread winner".

While your assumpution is correct, Breaking it down into its "net long basket" is over-thinking it. You can get indicators and eas that can do those sort of math calculations.

 
Thanks both of you! I understand it clearly now :)