Unexpected behaviour of variable "positionprice" ?

Forums ProRealTime English forum ProOrder support Unexpected behaviour of variable "positionprice" ?

Tagged: 

Viewing 7 posts - 1 through 7 (of 7 total)
  • #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.

    #115389

    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.

    #115390

    How is this post back?

    I deleted it to keep the other one in the correct forum.

    #115391

    Ok, I deleted the other one.

    #116022

    As it is stated in our online documentation, POSITIONPRICE indicates the current average position price of the whole opened orders.

    #116416

    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.

    #116418

    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.

    1 user thanked author for this post.
Viewing 7 posts - 1 through 7 (of 7 total)

Create your free account now and post your request to benefit from the help of the community
Register or Login