POSITIONPRICE is just the average price that you have open trades at. So if you have opened positions at:
Size 1 and Price 1000
Size 1 and Price 2000
Size 2 and Price 3000
…then your average price is (1000 + 2000 + 3000 + 3000)/4 = 2250. So POSITIONPRICE = 2250
If you then partially close by selling the position that you bought at 1000 then your POSITIONPRICE becomes (2000 + 3000 + 3000)/3 = 2667
You cannot do something such as:
set target pprofit positionprice + <profit in points>
…because SET TARGET PPROFIT requires a distance and not a price. Any time you change the value after a SET TARGET PPROFIT instruction it moves the limit orders for all open positions to the new distance. All opened trades are handled individually but with equal limit order distances from their opening price.
You should be aware that partial closure is not possible in live trading either real or demo. We can backtest with it but cannot go live with it currently.
How is this post back?
I deleted it to keep the other one in the correct forum.
Ok, I deleted the other one.
As it is stated in our online documentation, POSITIONPRICE indicates the current average position price of the whole opened orders.
Thank you for all replies. The answer to my question about the PRT manual correctness is then that the PRT 10.3 German manual is incorrect as it states that positionprice is affected only by increasing orders. That has given an entirely wrong impression of how the average price handling of mutiple orders work.
I would suggest that the V11 version of the manual is corrected and hope the editor team is aware of that.
POSITIONPRICE is affected only by increasing (additional) orders.
On your first order POSITIONPRICE is the same as TRADEPRICE, it’s only AFTER you add other orders that POSITIONPRICE does not reflect TRADEPRICE anymore.