Bonjour,
J’ai un bout de code que je désire backtester, mais je n’arrive pas à identifier les variables n && n2 qu’il contient pour lancer mon backtest. Auriez-vous une idée ? Ci-dessous le code :
//variables
//n2, exit, 10, 30, 2
//n, open, 5, 20,2
t1 = Time = 081000
if t1 then
t = high
l = low
endif
t2 = Time > 081000 AND Time <= 240000
if t2 and close crosses over t+n then
buy 1 share at market nextbaropen
endif
if longonmarket and close < tradeprice-n2 or close >tradeprice + n2 then
sell at market nextbaropen
endif
if t2 and close crosses under l-n then
sellshort 1 share at market nextbaropen
endif
if shortonmarket and close >tradeprice+n2 or close <tradeprice-n2 then
exitshort at market nextbaropen
endif
D’avance merci pour vos lumières
DEFPARAM CUMULATEORDERS = False
//variables
n2 = 45 //exit, 10, 30, 2
n = 10 //open, 5, 20,2
t1 = Time = 081000
if t1 then
t = high[1]
l = low[1]
endif
t2 = Time > 081000 AND Time <= 240000
if t2 and close crosses over t+n then
buy 1 share at market
endif
if longonmarket and close < tradeprice-n2 or close >tradeprice + n2 then
sell at market
endif
if t2 and close crosses under l-n then
sellshort 1 share at market
endif
if shortonmarket and close >tradeprice+n2 or close <tradeprice-n2 then
exitshort at market
Endif
…
Hello GraHal,
Thanks for your input, but still I can’t figure what 10, 30, 2 and 5, 20, 2 stands for or what they are based on.
Could you please enlighten me ? Also, Why would you use 45 and 20 ?
[FR] Merci pour votre contribution. Cependant, je ne comprends toujours pas sur quoi sont basés ou ce que représentent 10, 30, 2 et 5, 20, 2.
Pourriez-vous m’éclairer ? Aussi, pourquoi utilisez-vous 45 et 20 ?
Je suppose que vous n’avez pas écrit le code?
Avez-vous regardé l’une des vidéos de formation ou lu le manuel PRT sur l’utilisation d’Optimize ??
Ci-dessous, un lien vers une vidéo traitant de l’optimisation … d’où proviennent les 10, 30, 2 et 5, 20, 2.
https://www.prorealcode.com/blog/video-tutorials/how-to-optimize-a-trading-system-with-probacktest-prorealtime/
https://www.prorealcode.com/blog-list-view/
https://www.prorealtime.com/en/pdf/probacktest.pdf
Vous trouverez ci-joint le .itf que vous pouvez essayer