Hi
The South African concept looks interesting and I thought exotic but the index is surprisingly heavy in global names, perhaps there is a requirement for a local company to be used the trade there?
Looking at the back tests, while the larger data set is great for validating systems one of my pet hates is results that are shown over huge time frames as the equity curve tends to straighten out, you get a huge return and may lose site of what you are trying to achieve.
The system (for Dax at £1 per point) has a 300% return (based on £10K bank) over 10 years given the assumptions used about the spread and funding costs at the time and leverage of 1:20, however the index itself without any leverage is up around 220% over the same period without any leverage and presumably less risk. (I understand that you would not have needed £10k to open the positions)
I don’t have the data to calculate this but I would expect that of you had bought long term options on the Dax that it would have been possible to capture many multiples of the 220% return with an even lower risk than that of using CFDs/spreadbets
The system is profitable in periods and merits further work but in its present form it may not be the best use of capital given the time in the market and not showing a significant out performance of the underlying market in spite of leverage
PaulParticipant
Master
@Robo Futures Trader Perhaps I shouldn’t have called it a strategy, it’s more a concept where you can build from.
Its goal is to quickly find regular market behaviour at a specific TF and at a specific intradaybar, without messing with time optimising.
ps with hindsight you could say indeed buy&hold would’ve been be much more profitable than any or most intraday systems.
@GraHal
I took a different approach. The code to prevent long/short on one bar didn’t work so removed that. To spot quickly that just filter a report on the number of bars. A few trades with 0 bars is oke.
So you can use the original
if longtrading or (longtrading and shorttrading) then
if intradaybarindex=barnumberlong then
breakvaluelong=high //experiment!
endif
endif
if shorttrading or (longtrading and shorttrading) then
if intradaybarindex=barnumbershort then
breakvalueshort=low //experiment!
endif
endif
and for entry
if hour<=23 then
once minstopdistance=10
if longtrading then
if intradaybarindex >= barnumberlong then
if trendup and tradecount then
if ((breakvaluelong+breakpoint)-close)>=minstopdistance then
buy 1 contract at breakvaluelong+breakpoint stop
tradecounter=tradecounter+1
else
buy 1 contract at close+(minstopdistance+breakpoint) stop
tradecounter=tradecounter+1
endif
endif
endif
endif
if shorttrading then
if intradaybarindex >= barnumbershort then
if trenddown and tradecount then
if (close-(breakvalueshort-breakpoint))>=minstopdistance then
sellshort 1 contract at breakvalueshort-breakpoint stop
tradecounter=tradecounter+1
else
sellshort 1 contract at close-(minstopdistance-breakpoint) stop
tradecounter=tradecounter+1
endif
endif
endif
endif
endif
I’am trying to minimise the negative results from the important error you found. Hopefully this comes close, but at the same time it could be coded wrong!
Thank you for the latest improvement @Paul.
Do you get the same as me … the profit falls??
The attached equity curves are shown as …
- v1p + mindistv2 (6.23K)
- v1p +mindistv1 (10.6K
- v1p (10.6K)
PaulParticipant
Master
@GraHal Yes results go down. Maybe it’s because it’s calculated correctly unfortunately? I’am still not sure.
Here’s a test update to the existing version. Basics is the same but it tests various ways of entries (and the original) with the minimum distance in mind. DAX 1 hour timeframe (100k bars) and this with spread=4 because the time of entry is expensive!
To cover a bit the minimum distance, I put breakpoint=5 and with the original settings it has the best results. No trend detection yet. (entrytype=1, barnumber=3)
If going for stoploss 2% instead of 1, results increase more.
PaulParticipant
Master
added a nice addition to the trend detection system thanks to @nonetheless ! (from other topic)
Changed medianprice to totalprice and that worked good! Kept both.
// trend detection
if tds=0 then
trendup=1
trenddown=1
else
if tds=1 then
trendup=(Average[50](close)>Average[50](close)[1])
trenddown=(Average[85](close)<Average[85](close)[1])
else
if tds=2 then
bbup=BollingerUp[20](close)
bbdn=BollingerDown[20](close)
bbav=(bbup+bbdn)/2
trendup=bbav>bbav[1]
trenddown=bbav<bbav[1]
else
if tds=3 then
Period= 3
inner = 2*weightedaverage[round( Period/2)](typicalprice)-weightedaverage[Period](typicalprice)
HULL = weightedaverage[round(sqrt(Period))](inner)
trendup = HULL > HULL[1]
trenddown = HULL < HULL[1]
else
if tds=4 then
Period= 2
inner = 2*weightedaverage[round( Period/2)](totalprice)-weightedaverage[Period](totalprice)
HULL = weightedaverage[round(sqrt(Period))](inner)
trendup = HULL > HULL[1]
trenddown = HULL < HULL[1]
endif
endif
endif
endif
endif
pic below with stoploss 1% comparable to first pic above.
with the original settings it has the best results.
You have over twice the number of trades as me and over twice the profit … any ideas how that can be?
PaulParticipant
Master
Yes timezone. Perhaps your strategy should be one bar number less or more?
Perhaps your strategy should be one bar less?
Yes I optimised the barnumber and it gave = 2 as highest profit. Which is logical as I am 1 hour less than you.
I just tried barnumber =3 and it gives < 2K profit. So the difference in our results is not due to timezone.
I even just re-imported a new v2p file and ONLY changed barnumber = 2 to see if I had changed anything else but it still gives me about half the trades you show over 100k bars.
Weird eh? Must be some simple reason??
PaulParticipant
Master
here’s a new one. Since the 10 points difference is so important I made an adjustment to be dependent on the breakpoint number.
So if breakpoint =10 or higher, the minstopdistance=0
breakpoint=7, minstopdisntance=3
breakpoint=0, minstopdistance=10
If you select i.e. entrytype=1, then minstopdistance is ignored, which isn’t the best/reliable way.
pic is with stoploss 2% & with entrytype1, breakpoint5, barnumber3, trend4, spread4
So if breakpoint =10 or higher, the minstopdistance=0
I have been amending your 10’s to 15 as – although the Rejection message states minimum distance = 10 – I doubt that min distance = 10 at all and it could be anything from 10 to ????
Has anybody had any version so far take a trade overnight?
I guess we will get there in the end by trial and error (1 trial every 24 hours in this case) and your excellent coding Paul.
It’s a pity IG can’t / don’t see the efforts we have to go to, just to get Systems to NOT be Rejected!!??
@paul v3 looks amazing! congrats 🙂
PaulParticipant
Master
Thanks GraHal & Francesco!
Indeed it states 10 and in reality it could fluctuate a bit which impact the results if entrytype=1 is used. I don’t even want to think what it would do to the equity-curve! 🙂
But don’t keep focussing on that 2 or 3 hourly bar! It has more options. You don’t need to have the best and highest payout when searching for a bar. I think if you have a reasonable result on a specific bar with MANY trades, it gives reason to dig further. Potential interesting times are around8-9am and 5.30 pm for the dax. It’s possible to use multi time frames on this and I think minimum 15 minutes. Also it’s not necessary to use stop orders, but market orders can be used too. But at this moment the code is a bit messy, so I have the find the right setup.
We managed to place Stops this morning so maybe you have got the code and levels correct now Paul?
Works well on TF = 5 mins also … just as you thought!
Best on 5min or 1h in your opinion guys?