We’ve had 0 / zero real trades up to now so it’s still early days.
There’s been problems related to the variable minimum distance stop settings used by IG!
Hello, Why not use a virtual stop
Go on … tell us what a virtual stop is? 🙂
PaulParticipant
Master
@fifi743 you got me curious too!
@GraHal maybe we should do more testing, meaning more different barnumbers for entry1 to 4 so we can pick a entry-type which is reliable regardless of the bar-number and results.
so we can pick a entry-type which is reliable regardless of the bar-number and results.
Yeah but as backtest does not perform same as Live (which is a nonsense in itself!?) then how can we prove what is reliable other than Live Forward Test … which would take for ever as so few trades?
I guess if we don’t use stop entry then backtest results should be closer to Live results and so more reliable?
If I recall correctly, my 5 min version is an at market entry … hopefully there should be would be no Issues re minimum distance
// ================trailing atr stop VIRTUAL==================
if enabletsvir then
//
once stepsvir=0
once minatrdistvir=0
once atrtrailingperiodvir = 2 // atr parameter
once minstopvir = 10 // minimum distance
if barindex=tradeindex then
trailingstoplongvir = 5 // trailing stop atr distance
trailingstopshortvir = 5 // trailing stop atr distance
else
if longonmarket then
if newslvir>0 then
if trailingstoplongvir>minatrdistvir then
if newslvir>newslvir[1] then
trailingstoplongvir=trailingstoplongvir
else
trailingstoplongvir=trailingstoplongvir-stepsvir
endif
else
trailingstoplongvir=minatrdistvir
endif
endif
endif
if shortonmarket then
if newslvir>0 then
if trailingstopshortvir>minatrdistvir then
if newslvir<newslvir[1] then
trailingstopshortvir=trailingstopshortvir
else
trailingstopshortvir=trailingstopshortvir-stepsvir
endif
else
trailingstopshortvir=minatrdistvir
endif
endif
endif
endif
//
atrtrailvir=averagetruerange[atrtrailingperiodvir]((close/10)*pipsize)/1000
trailingstartlvir=round(atrtrailvir*trailingstoplongvir)
trailingstartsvir=round(atrtrailvir*trailingstopshortvir)
tglvir=trailingstartlvir
tgsvir=trailingstartsvir
//
if not onmarket or ((longonmarket and shortonmarket[1]) or (longonmarket[1] and shortonmarket)) then
maxpricevir=0
minpricevir=close
newslvir=0
endif
//
if longonmarket then
maxpricevir=max(maxpricevir,close)
if maxpricevir-tradeprice(1)>=tglvir*pointsize then
if maxpricevir-tradeprice(1)>=minstopvir then
newslvir=maxpricevir-tglvir*pointsize
else
newslvir=maxpricevir-minstopvir*pointsize
endif
endif
endif
//
if shortonmarket then
minpricevir=min(minpricevir,close)
if tradeprice(1)-minpricevir>=tgsvir*pointsize then
if tradeprice(1)-minpricevir>=minstopvir then
newslvir=minpricevir+tgsvir*pointsize
else
newslvir=minpricevir+minstopvir*pointsize
endif
endif
endif
//
if longonmarket and close <newslvir and newslvir>0 then
sell at market
endif
if shortonmarket and close>newslvir and newslvir>0 then
exitshort at market
endif
I have two trailing stops Whoever moves the stop And the other if it is closed is above or below the newslvir
Above added as Log 196 here …
Snippet Link Library
PaulParticipant
Master
Thanks fifi! The virtual stop is implemented as I thought. The original ts still running with atrtrailingperiod=14 and the virtual with value 2. Also the test de nombre de bar negative ajouter makes a difference. Total results is a bit the same, but the equitycurve has a nicer shape!
I’am working on something to drop the stop for entry. But it’s not there yet.
PaulParticipant
Master
@fifi, with importing I noticed tick by tick wasn’t enabled, so I did the test again and with target profit disabled.
your average loss dropped quite a bit. Will test to to see what difference it brings to the market version.
Unfortunately I don’t understand the benefit of the virtual trailing stop and see very little difference. Maybe it shows more with live trading.
Good-morning Paul,
To avoid errors of stops too close.
The value remains in the variable
There may be more difference in lower time frame.
Hello,
Entry type = 1 I reduced the hour to 21
I have placed two different stops depending on the trading hours.
To be checked so as not to have an error
Today I’m at 271 points for Stop
PaulParticipant
Master
Hi Fifi43
Thanks I will look into this. I found irregularities when using barindex numbers. Because when there is no data, everything shifts a bar! Doesn’t happen too much on 1 hour timeframe, but it could be more often on lower timeframes and I want it to be universal.
So I’m testing a way too quickly and efficiently optimise time using hour & any minutes. Also looking in your nicely coded FILTRE_Prise_Position if it could be of use for profittaking.
@Grahal
Did you figure out the exact reason of the difference ? As I am also getting a different equity curve and number of trades. I believe it is the timezone. I only 100 K bars to test, so I can’t compare exactly to the latest from fifi. But if I change the timezone to be inline with the others, I get exactly the same drawdown (869.80) and similar profit profile per month.
Optimizing barnumber might not give you the same result.
@Grahal : Disregard my previous comment. It will give you exactly the same result.