Average price of open position ??

 
Hi !

I make N buys and want to calculate the average price :

( Price_1*Qty_1 + ... Price_N*Qty_N) / (Qty_1 + .. Qty_N)

Analysing history of deals is a little bit difficult to me...


Can you advice me a standard function, pls ?

Documentation on MQL5: Standard Constants, Enumerations and Structures / Indicator Constants / Price Constants
  • www.mql5.com
Standard Constants, Enumerations and Structures / Indicator Constants / Price Constants - Documentation on MQL5
 

On mq5 do not need calculate the average price.

each symbol have only one position. it is price of position.

POSITION_PRICE_OPEN


KuzMan:
Hi !

I make N buys and want to calculate the average price :

( Price_1*Qty_1 + ... Price_N*Qty_N) / (Qty_1 + .. Qty_N)

Analysing history of deals is a little bit difficult to me...


Can you advice me a standard function, pls ?



 
tuoitrecuoi:

On mq5 do not need calculate the average price.

each symbol have only one position. it is price of position.

POSITION_PRICE_OPEN


He thinks that Analysing history of deals
Reason: