CKWParticipant
Veteran
Hi Guys,
May I check with you guys how do you code market the Highest Gain / Loss of the day?
Eg. DAX 5 Mins
HighestGain = Dhigh(0) – Dclose(1)
Highestloss = Dlow(0) – Dclose(1)
Above coding are working on indicator (means result expected) but I noticed not really work on Probacktest. (Do you have the same issue Or maybe I am wrong?)
Very appreciate if can you share me how do you code it? 🙂
Br,
Ckw
Correct me if I’m wrong, but you want to know what is the maximum and minimum distance the instrument has met in a 5 minutes timeframe for instance?
About the fact that you think it did not work with probacktest, did you try to GRAPH your 2 variables to see what they returned?
CKWParticipant
Veteran
Hi Nicholas,
I want to know the highest + / – changes so vs yesterday price close. I am using Dax 5 Mins as example.
I tried to Graph using indicator mode, it shows correct value es expected
Dclose(1) = yesterday close
Dhigh(0) = The highest High of current day
Dlow(0) = The lowest Low of current day
BUT when I do the same on Probacktest. Apparently, it gives different result.
Before giving you another way to retrieve this values, did you add these specific lines into your probacktest code and verify them on chart after have launched a backtest?
graph Dclose(1) coloured(255,0,0) //= yesterday close
graph Dhigh(0) coloured(0,200,0) //= The highest High of current day
graph Dlow(0) coloured(0,200,100) //= The lowest Low of current day
Sorry to insist, but I expect this to work correctly .. that’s why I don’t understand 🙂
CKWParticipant
Veteran
Hi Nicholas,
Graph feature is new to me. Glad to know from you such feature will be useful for debugging. (I am using IG PRT 10.2)
I will try tonight
br, CKW
CKWParticipant
Veteran
Hi Nicholas,
I tested with your advice. However, this is what i found out & worth to share here.
The confusing part is on Monday IF your strategy is sensentive to the market changes 🙂
For Mon Dclose(1),
This value is taken from the close price of 00:55:00 on Mon but not last friday. In consequence, Dhigh(0) – Dclose(1) result will not be the same as the one in PRT chart “Prev Day Close”. The correct way to code is “Dhigh(0) – Dclose(2)” (Dclose(2) is the close price of last friday 23:55:00, which is the last candle of friday)
For Tues – Fri,
Dclose(1) is taken from the close price of 00:55:00.We can keep it as “Dhigh(0) – Dclose(1)”.
Br,
CKW