positionperf [n] not working?

Forums ProRealTime English forum ProOrder support positionperf [n] not working?

Viewing 12 posts - 1 through 12 (of 12 total)
  • #169091

    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…

    #169094

    Hi, positionperf is with ( ) not [ ] : https://www.prorealcode.com/documentation/positionperf/

    #169095

    Doh!! That explains it – thank you.

    #169100

    Use Parentheses instead of brackets:

     

    #169104

    OK, 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)…

     

     

    #169109

    PositionPerf 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.

     

     

    #169113

    Yes, 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)….

    #169114

    Sorry, should have include this picture to explain what I mean…

    #169122

    PositionPerf(1) is the positionperf of the trade the prior candle.

     

    #169125

    It 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…

    #169126

    Both 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)

    #169127

    aha… yes, I think you are right. My brain was not properly in gear – thank you!

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

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