I don't understand exactly the value of PositionPerf
Forums › ProRealTime English forum › ProOrder support › I don't understand exactly the value of PositionPerf
- This topic has 12 replies, 4 voices, and was last updated 6 years ago by Nicolas.
Tagged: positionperf
-
-
11/28/2017 at 10:03 AM #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.
11/28/2017 at 10:17 AM #54234Hi, 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.
11/28/2017 at 10:25 AM #54235Yes, 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.
11/28/2017 at 10:49 AM #54238ok, 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)
11/28/2017 at 10:59 AM #5423911/28/2017 at 11:02 AM #54241Yes, 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).
11/28/2017 at 11:03 AM #5424211/28/2017 at 11:23 AM #54248Example of how POSITIONPERF is calculated:
123456789101112131415myMACD = MACD[12,26,9](close)long = myMACD crosses over 0exit = myMACD crosses under 0//first orderIF NOT LongOnMarket AND long THENBUY 1 CONTRACTS AT MARKETENDIFIf LongOnMarket AND exit THENSELL AT MARKETENDIFgraph positionperf coloured(100,236,45)graph (close/positionprice)-1When 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.
11/28/2017 at 4:24 PM #54287Thank 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.
11/28/2017 at 5:09 PM #5429011/29/2017 at 9:01 AM #5431910/10/2018 at 11:37 PM #82529Hi,
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,
10/11/2018 at 9:52 AM #82537 -
AuthorPosts