I don't understand exactly the value of PositionPerf

Forums ProRealTime English forum ProOrder support I don't understand exactly the value of PositionPerf

Tagged: 

Viewing 13 posts - 1 through 13 (of 13 total)
  • #54232

    I am trying to automate a system with ProOrder where it has to do an action if the profit of the trade reaches a value.

    I tried with positionperf and I know that the value of it is given in % of the ratio gain/loss, but I cannot find how it exactly calculates the profit of the trade.

    Let me explain the values I found on different backtests:

    Starting capital: 3000 €

    After strategy worked some candles, I get a total capital of 7097 €, that means a benefit of 4097 €.

    However, PositionPerf gives a value in this point of 0,02783 and I suppose it means 2,783%. Ratio gain/loss should be 4097/3000=1,3656, factor of capitals should be 2,3656 (=1+1,3656).

    Ratio total capital/gain would be 7097/4097=1,7322

    But nothing to do with 0,02783.

    Other values with the same starting capital:

    3738 € -> 0,01772

    3223€ -> 0,00215

    6385 € -> 0,02726

    5767 € -> 0,01332

    4843 € -> 0,02810

    Could somebody explain me the way to calculate PositionPerf, so that I can define correctly the rules of ProOrder?

    Thanks in advance.

    #54234

    Hi, positionperf gives the performance of the last position, or the previous N-th position if used like this: positionperf(N). You seem to be considering the total of all your positions when you make your comparisons with starting capital, but you need to look at capital just before entering the considered position and performance of the position just after exiting it.

    https://www.prorealcode.com/documentation/positionperf/

    #54235

    Yes, you are right, but I suppose I’m doing well. I only am referring to the present position, so I wrote PositionPerf which means the same than PositionPerf(0). And the values I gave are all in the same position, so that the starting capital is always the same: 3000 €. Only the gain varies on each candle. I also wrote the instruction GRAPH positionperf in order to see in every moment the value of positionperf. And I also read the definition of the link you gave, but there is no explanation or example on how the calculation is made.  

    #54238

    ok, gain 4097 from starting 3000, I didn’t think it was the same position all along, I assumed you had several positions opened and closed in between, my bad assumption then. And I need more coffee, haven’t used positionperf for ages as it’s not in my current codes and I’m talking without seeing screen captures of your tests, but wouldn’t it be comparison of levels of the instrument traded rather than comparison of capital levels? (as in, regardless of how much you had to start with, if for example ibex goes up 5% between your long entry and your exit, modified by leverage used, that’s the perf of the position)

    #54239

    PositionPerf returns the performance in price percentage from the open price of the last N order to actual Close, not in money.

    1 user thanked author for this post.
    #54241

    Yes, I would also need more coffee today to understand the calculations :-)).

    And yes, the calculations are only to see how much is the gain in the present position in order to increase, for example, the number of buy orders (cumulated).

    #54242

    I know, @Nicolas, but if you see my first post, I am unable to see how it is calculated, even in %.

    Perhaps you could give me an example to see it.

     

    #54248

    Example of how POSITIONPERF is calculated:

    When ON MARKET , the green line (POSITIONPERF) is the same as the black line which is calculated with (Close/PositionPrice)-1

    2 users thanked author for this post.
    #54287

    Thank you Nicolas.

    But this is only an example of graphing the PositionPerf curve, which I already did. 

    It is not an example of how PositionPerf calculates the profit/loss of the present trade.

    I need to understand how it mathematically calculates the values of this curve regarding the initial capital and/or gain of the trade.

     

    #54290

    You haven’t looked carefully at my code, the PositionPerf is calculated the same way as the second GRAPH instruction I added at line 15:

     

    #54319

    Thanks for your explanations, Nicolas.

    I solved my problem using and graphing the value “floatingprofit” you give in the definition of positionprice, because this is exactly what I need to know to take my decisions.

    Thank you again!

    #82529

    Hi,

    Just a quick question.

    So positionperf(0) wil tell you profit/loss of the order that is currently open and positionperf(1) will tell you the profit/loss of the last order to close

    I just wanted to confirm that this is correct ?

    Kind Regards,

     

    #82537

    That’s right, it gives the current running positions performance in percentage.

     

Viewing 13 posts - 1 through 13 (of 13 total)

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