hi,
how to get the value of Gains & losses curve c when the trade is still open ?
tks you @GraHal,
So I tried it and it’s like working nice, so this means :
– PositionPerf = 0 ==> the position is still flat ?
– PositionPerf = 0,2 ==> mean the position are +20% grain ?
– PositionPerf = 1,4 ==> mean the position are +140% grain ?
// Achète si le trade précédent a fait au moins 20% de gains
IF NOT ONMARKET AND PositionPerf(1) > 0.2 THEN
BUY 1000 CASH AT MARKET
ENDIF
PositionPerf = 0,2 ==> mean the position are +20% grain ?
20% gain of what? 🙂
PositionPerf = 0.01 means PositionPerf is 1% as defined here …
POSITIONPERF
“PositionPerf = 0,2 ==> mean the position are +20% grain ?” Yes.
If you want the percentage of the trade still open you have to multiply *100 positionPerf:
graph positionPerf*100
20% gain of what? 🙂
0,2 it’s mean +20% from the price entry of the last position, and I do some math and the PRT software use the Close price to calculate this value, let give an other exemple and tell me if I’m wrong,
for exemple I have an entry price at 118 and if my PositionPerf[0] now it’s at 0,053 so it’s mean the close prie now is normaly at 124,
Entry Price = 118
PositionPerf = 0,053
Entry Price x PositionPerf x 100 = 118 x 0,053 x 100 = 124,25 = Close[0]
correct me pls if I’m wrong,
the idea is to get price of equity even we are in position, not just after close the trade ?
If you need to know the PositionPerf while a candle is forming, then you have to resort to MTF and use a a smaller TF.
correct me pls if I’m wrong,
The link below defines PositionPerf (which isn’t how think it works! 🙂 )
https://www.prorealcode.com/documentation/positionperf/
JSParticipant
Senior
The “PositionPerf” in PRT is calculated as follows:
PositionPerf = (Close – PositionPrice) / PositionPrice * 100
If you need to know the PositionPerf while a candle is forming, then you have to resort to MTF and use a a smaller TF.
Thank you for your answer, I understand the idea of going down to smaller units of time, however what is the smallest unit of time that can be used, is it possible for example units in Tick or does it depend on the Stocks processed,
If you have a link you can share from the forum it would be appreciated
what is the smallest unit of time that can be used
I’ve never used < 1 second … never found the need?
I’ve never got a strategy to work consistently at < 5 sec TF.
Ticks cannot be used, use 1-second TF.
Calculation of POSITIONPERF, topic with explanation: https://www.prorealcode.com/topic/i-dont-understand-exactly-the-value-of-positionperf/
Also in order to get the current floating profit of orders, you can use this code snippet:
//floating profit
floatingprofit = (((close-positionprice)*pointvalue)*countofposition)/pipsize //actual trade gains
A new instruction with the current STRATEGYPROFIT (strategyprofit + floating) will also be added with a lot of other new ones.