Hello all,
I know about POSITIONPERF, which gives the % performance of the Nth last position, but is there a way of telling how many pips the previous position gained/lost?
There is TRADEPRICE, which I think is the opening of the previous order, but I want to know the realised result in pips too…
Thanks,
Geoff
Below or something similar? 🙂
Abs(Tradeprice[0]-Tradeprice[1])*pipsize
…ah, I thought TRADEPRICE was just the opening level of a position… so TRADEPRICE can be opening or closing?
so your suggestion would be the last closing – the last opening?
No you are correct … I wasn’t thinking straight! 🙂
Abs(Open[1]-Close[1])*pipsize
…and that will give the open & close of the previous bars… not the previous executed position…?
tricky isn’t it!
I think you know the answer really! 🙂
‘Reverse engineer’ Positionperf to get points change of the last trade and then multiply by pipsize for that instrument.
I was getting the formula for Positionperf and my PRT has frozen on that screen. 🙁 But anyway it is here … gain/cost.
https://www.prorealcode.com/documentation/positionperf/
Does this work?
PipsLastPos = (Positionperf[1]*TradePrice[1]/Gain)*pipsize
Nearly … you’d need to multiply TradePrice by Contract value to get Cost.
Example for a price at 1.2400
|
|
PipsLastPos = (0.1*(1.2400*10000)/20)*1
|
More later maybe, brain is hurting 🙂 and my granddaughter wants to watch Peppa Pig! 🙂 🙂