How to calculate average price for open orders - page 3

 
Fernando Carreiro #:

Haizz. Always is free code! A few dollars  can can help someone happy but =.=!

If you can do a complete file, I will give you money:D

 
Hoang Minh Trong #: If you can do a complete file, I will give you money:D

Not interested! If you want to pay someone then place a request in the Freelance section. Someone else will do it for you, but not me!

 
Fernando Carreiro #:

Not interested! If you want to pay someone then place a request in the Freelance section. Someone else will do it for you, but not me!

Ok thank you. Anyway, I think you can't afford to write this:))

 
Hoang Minh Trong #:

I dont know about MQL5:D

But I can use Excel for calculate.

Price Average is: For Lot Buy count positive,Lot Sell count negative

((Price1*Lot1 + Price2*lot2 +....)/(lot1+lot2...)=Price average

Lot averagre = lot 1+ lot2+...lotn

Ex:

Buy 1lot at 1900
Buy 1lot at 1910

Sell 5 lot at 1890

(1900*1+1910*1+1890*-5)/(1+1-5)=-1880

Lot is 1+1-5= -3

>>>> Sell 3 lot at 1880

Can you Help me, plssss

If buy lots = sell lots how do you calculate? Because it will be division by zero.

 
Theresia Yovitha Herwanda #: If buy lots = sell lots how do you calculate? Because it will be division by zero.

Then they cancel each out and you are only paying the spread for the total volume.

 
Theresia Yovitha Herwanda #:

If buy lots = sell lots how do you calculate? Because it will be division by zero.

Buy lots is plus, sell is negitive;. compute Lots weighted avere price. #3