Guys, I have an apparently nice strategy on Hang seng that is purely driven by time bias.
Since I am not very confident with the instrument itself, I would be extremely grateful if someone could backtest it with 200K bars and see how the OOS behave.
The code is the following
Defparam cumulateorders = false
golong =1
goshort = 1
timegolong = 110000
timeexitlong = 60000
filterdaylong = dayofweek = 1 or dayofweek = 2 or dayofweek = 3
filterpricelong = close < (Dhigh(1)+dlow(2))/2
timegoshort = 30000
timeexitshort = 80000
filterdayshort = dayofweek = 2 or dayofweek = 4
filterpriceshort = close> (Dhigh(1)+dlow(2))/2
if goshort then
if time = timegoshort and filterpriceshort and filterdayshort then
sellshort 1 contract at market
endif
if time = timeexitshort then
exitshort at market
endif
endif
if golong then
if time= timegolong and filterdaylong and filterpricelong then
buy 1 contract at market
endif
if time = timeexitlong then
sell at market
endif
endif
set target pprofit 600
set stop ploss 700
I attach the equity curve.
Thanks a lot in advance.
Francesco
Well ALE it looks like you have written a strategy that is a very good advert for getting PRT Premium with 200K bars!
Time based strategies are not worth pursuing in my experience but I have to admit that you’d have been very happy to have traded this one over the last 100k bars. The equity curve is beautiful!
Ok thank you. How about this one on eurusd?
Defparam cumulateorders = false
golong =1
goshort = 1
timegolong = 140000
timeexitlong = 70000
filterdaylong = dayofweek = 1 or dayofweek = 2 or dayofweek = 3
filterpricelong = close < Dhigh(1)//(Dhigh(1)+dlow(2))/2
timegoshort = 70000
timeexitshort = 140000
filterdayshort = dayofweek <>0
filterpriceshort = 1//close>Dlow(1)
if goshort then
if time = timegoshort and filterpriceshort and filterdayshort then
sellshort 1 contract at market
endif
if time = timeexitshort then
exitshort at market
endif
endif
if golong then
if time= timegolong and filterdaylong and filterpricelong then
buy 1 contract at market
endif
if time = timeexitlong then
sell at market
endif
endif
Well ALE
Oooops – sorry Francesco78. I shouldn’t reply after a couple of glasses of wine!
Here is the 200K with no spread.
I can’t see a reason why you would need tick by tick on for that strategy so here is the result without tick by tick. First image is with no spread and second is with spread of just 1 (I had to change the start capital to 100k to get through the drawdown).
The interesting thing is that around 2005 it suddenly becomes a winning strategy. Around 2004 automated trading and HFT started to come online so that may be a link to the sudden improvement in performance?
Your strategy if only used since beginning of 2005. Walk Forward 70/50 x 5.
Personally I think that the drawdown is a bit big for the gain/loss ratio but at least the right side of the equity curve is much higher than the left!
I shouldn’t reply after a couple of glasses of wine!
What is the alcohol level allowed to drive a boat? 😆
What is the alcohol level allowed to drive a boat?
We don’t drive – we sail!
The level is unlimited – it is called the freedom of the sea – the only restriction is that you have to wait until the sun is under the yardarm. Most sailors have height adjustable yardarms to deal with this issue. Anyway at the moment I am house sitting for friends in the hills overlooking Kalamata bay so there is definitely no restrictions on intake!
I can’t see a reason why you would need tick by tick on for that strategy so here is the result without tick by tick. First image is with no spread and second is with spread of just 1 (I had to change the start capital to 100k to get through the drawdown). The interesting thing is that around 2005 it suddenly becomes a winning strategy. Around 2004 automated trading and HFT started to come online so that may be a link to the sudden improv
without tick to tick the results are much worst? That is puzzling. I guess the more realistic one are the 1 with tick to tick.
without tick to tick the results are much worst? That is puzzling
That is very puzzling as you only trade at the close of a candle/open of the next candle so tick by tick should make no difference at all.
It just occurred to me that I may be on a different time zone to you so my tests may not be the same as yours. I am trading on UTC+1 British Summertime.
It just occurred to me that I may be on a different time zone to you so my tests may not be the same as yours. I am trading on UTC+1 British Summertime.
Yep I am in UTC + 2 any way this strategy perform quite well, 10 year OOS. Should be taken in consideration, what do you think?
what do you think?
My main concern is that I don’t understand why it should work. You are basically shorting the EURUSD every day during the European session and going long during the US and Asian sessions on pull backs but only on Monday, Tuesday and Wednesday. I cannot think why that should always work. Also you have to factor in that you are holding overnight for up to three days a week so there will be overnight fees to cut into the already quite small gain/loss ratio.
I have not tested it on your time zone yet but will try to later today as I have rather a lot on this morning.