positionperf [n] not working?
Forums › ProRealTime English forum › ProOrder support › positionperf [n] not working?
- This topic has 11 replies, 3 voices, and was last updated 4 years ago by
verygrubby.
-
-
05/08/2021 at 11:28 AM #16909112345678910IF time=143000 THENBUY 1 PERPOINT AT MARKETENDIF// Stops and targetsSET STOP pLOSS 25SET TARGET pPROFIT 25graph positionperf[1]
I might have forgotten how this works, but I thought positionperf[n] was supposed to return the % performance of the nth previous closed position… ie if we graph positionperf[1], we should see the value update as each trade closes, and that value should stay there until another trade closes – ie it should never reset to no value… however you can see in the attached that it seems to reset to 0 when a trade closes, and we don’t get a value for every trade…
Is this a bug, or have I misunderstood what positionperf[n] is supposed to show?
Thanks all…
05/08/2021 at 11:54 AM #169094Hi, positionperf is with ( ) not [ ] : https://www.prorealcode.com/documentation/positionperf/
05/08/2021 at 11:58 AM #169095Doh!! That explains it – thank you.
05/08/2021 at 12:02 PM #169100Use Parentheses instead of brackets:
1graph PositionPerf(1)05/08/2021 at 12:24 PM #169104OK, same code as before, but I changed it to (). It seems to not update for all trades? eg the trades on 30th April & 6th May have not updated positionperf(1)…
05/08/2021 at 1:58 PM #169109PositionPerf only updates the current trade, when it exits PorsitionPerf is reset to 0 for the next trade AND StrategyProfit is updated adding to itself the final PositionPerf (before it is reset.
So, for the total report of Gains/Losses of CLOSED trades STRATEGYPROFIT is the system constant to refer to.
05/08/2021 at 2:18 PM #169113Yes, for positionperf – but positionperf(1) should always show the last closed trade, right? That’s what I graphed in the last picture I posted. You can see that it oscillates above and below 0 as the trades win or lose (as expected), but it seems to miss the occasional trade (eg it only updated for 6/8 trades in the picture)….
05/08/2021 at 2:25 PM #169114Sorry, should have include this picture to explain what I mean…
05/08/2021 at 2:46 PM #169122PositionPerf(1) is the positionperf of the trade the prior candle.
05/08/2021 at 2:59 PM #169125It should be the percent of gain or loss of the Nth previous position. Regardless of when you call it, it should show the gain/loss of the previous closed position. You can see from my picture that it updates each time a position closes, and the value stays the same until another position closes. It doesn’t reset to 0 (and I don’t want it to!)
My problem is that it seems to not update for various random trades…. I can’t work out why…
05/08/2021 at 3:36 PM #169126Both examples you show in your graph are in case of 2 consecutive trades being the same in points (equity curve has gone up twice in a row or down twice in a row by gain/loss for same 25pts amount), so it’s not that positionperf is not updated, it’s most likely updated to almost same percentage value (same gain in points over an asset not far off its previous value in points)
05/08/2021 at 4:15 PM #169127aha… yes, I think you are right. My brain was not properly in gear – thank you!
-
AuthorPosts
Find exclusive trading pro-tools on