Unexpected behaviour of variable "positionprice" ?

Viewing 7 posts - 1 through 7 (of 7 total)
  • Author
    Posts
  • #115382 quote
    Johnsteed
    Participant
    Junior

    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 quote
    Vonasi
    Moderator
    Master

    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 quote
    robertogozzi
    Moderator
    Master

    How is this post back?

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

    #115391 quote
    robertogozzi
    Moderator
    Master

    Ok, I deleted the other one.

    #116022 quote
    Nicolas
    Keymaster
    Master

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

    #116416 quote
    Johnsteed
    Participant
    Junior

    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 quote
    robertogozzi
    Moderator
    Master

    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.

    Nicolas thanked this post
Viewing 7 posts - 1 through 7 (of 7 total)
  • You must be logged in to reply to this topic.

Unexpected behaviour of variable "positionprice" ?


ProOrder: Automated Strategies & Backtesting

New Reply
Author
author-avatar
Johnsteed @johnsteed Participant
Summary

This topic contains 6 replies,
has 4 voices, and was last updated by robertogozzi
6 years, 1 month ago.

Topic Details
Forum: ProOrder: Automated Strategies & Backtesting
Language: English
Started: 12/22/2019
Status: Active
Attachments: No files
Logo Logo
Loading...