Unexpected behaviour of variable "positionprice" ?
Forums › ProRealTime English forum › ProOrder support › Unexpected behaviour of variable "positionprice" ?
- This topic has 6 replies, 4 voices, and was last updated 4 years ago by robertogozzi.
Tagged: POSITIONPRICE
-
-
12/22/2019 at 8:01 PM #115382
PRT Version 10.3: According to the Prorealtime manual about programming of trading systems, the variable positionprice should be affected only if the position is enlarged, what means if additional shares/contracts/lots are added to an existing position.
However during testing with ProOrder AutoTrading a graph including the variable positionprice reveals that positionprice changes as well if the position is partially closed. This behaviour differs from the manual and would imply that positionprice is ALWAYS the – weighted by individual trade’s sizes – averaged value of yet open individual trades.
For systems which use position close statements with predefined profit like
set target pprofit positionprice + <profit in points>
is evidently very important that the behaviour of the variable positionprice is exactly clear.
==> The question is hence, is the Prorealtime manual incorrect, or is ProOrder’s behaviour unexpected (maybe subject of bug fxing then)?
Thank you for clarification.
12/22/2019 at 9:49 PM #115389POSITIONPRICE 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.
12/22/2019 at 10:40 PM #115390How is this post back?
I deleted it to keep the other one in the correct forum.
12/22/2019 at 10:42 PM #115391Ok, I deleted the other one.
01/06/2020 at 11:31 AM #116022As it is stated in our online documentation, POSITIONPRICE indicates the current average position price of the whole opened orders.
01/11/2020 at 11:48 AM #116416Thank 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.
01/11/2020 at 11:55 AM #116418POSITIONPRICE 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.
1 user thanked author for this post.
-
AuthorPosts
Find exclusive trading pro-tools on