Hello!
This is my first submission to the strategy section of this site. My goal is to build filters for market regimes that provide the biases for more short term trading strategies. This submission is a byproduct of my research:
Following is a long term system based on a very simple timing model for capital preservation.
Timeframe is monthly and 2 indicators are used:
- John Ehlers Supersmoother at the standard value of 8.
- A 40 period simple moving average. The SMA has been improved and you can check it is robust to a range of variations.
The system is always on the market. Either long or short.
It doesn’t trade very often and it is not supposed to. The very upside of this model is not the profit but the maximum risk exposure of 13.22%! Maximum drawdown is 2.58 percent!
If you think this is interesting, please critique thoroughly because it will be highly appreciated.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 |
DEFPARAM CumulateOrders = false DEFPARAM PRELOADBARS = 40 //John Ehlers’ "Super Smoother", a 2-pole Butterworth filter combined with a 2-bar SMA that suppresses the Nyquist frequency: Period = 8 Data = Close PI = 3.14159 f = (1.414*PI) / Period a = exp(-f) c2 = 2*a*cos(f) c3 = -a*a c1 = 1 - c2 - c3 if barindex>Period then S = c1*(Data[0]+Data[1])*0.5 + c2*S[1] + c3*S[2] endif c1 = (close > S) c2 = (S > S[1]) IF c1 AND c2 THEN EXITSHORT 1 CONTRACT AT MARKET BUY 1 CONTRACT AT MARKET ENDIF c3 = (close CROSSES UNDER Average[40](close)) IF c3 THEN SELL AT MARKET SELLSHORT 1 CONTRACT AT MARKET ENDIF |
Share this
No information on this site is investment advice or a solicitation to buy or sell any financial instrument. Past performance is not indicative of future results. Trading may expose you to risk of loss greater than your deposits and is only suitable for experienced investors who have sufficient financial means to bear such risk.
ProRealTime ITF files and other attachments :PRC is also on YouTube, subscribe to our channel for exclusive content and tutorials
As long as it beat buy and hold, it’s interesting! As you wrote it, it can be used to find the bias of the market regime. Could it be adapted to other securities?
For a program, please specify
the supportThe spreadThe time unit.
You need to do this at the beginning of the code.
Thank you.
Good question. Especially the special types of bear markets in the US can be misleading.
The exact same system even outperforms the Nikkei 225 unfortunately the risk is a lot higher and the entry in the bear market is a disaster. In cases like these I suggest to add another rule.
IF c1 AND c2 and close crosses over Average[40](close) THEN
EXITSHORT 1 CONTRACT AT MARKET
BUY 1 CONTRACT AT MARKET
ENDIF
This will reduce drawdowns a lot.
BONSOIR j ai tenté votre modification mais PRT ne l accepte pas “erreur de syntax” pouvez vous m aider a utiliser le code avec votre modif? merci cordialement
Hello arcane,
you are right.
Starting capital = 10.000,-€
Spread = 1
Timeframe : Monthly
Hi,
just a question about the long term strategies (like this):
did you test how much the equity line is modified by overnight interest ?
I’m very interested to know what are your results in such sense.
Thx a lot.
bye
Hi DEIO,
since I trade with IG CFDs overnight commissions can be excluded from the equation if forward contracts are used.
Especially on the S&P 500 you can go for a half a year without rolling over once. You have to do this manually though.
hi Derek,
so you mean that you are using CASH contract as US 500 Cash (mini or full doesn’t matter) and this
kind of CFD doesn’t involve nightly payments on the cash account ?
When you say that you have to do this manually, what exactly you do and when it is necessary ?
thx for the patience.
bye
It’s a CFD on the futures contract. That’s why there is no commission and IG calls it a Forward.
IG offers a automatic rollover into the next future/forward but this will cost more spread or slippage. For example when trading the US500 Jun-17 contract in January with minimum contract size this was no problem at all. But it could be.
With long-term contracts it’s less of a problem though (but should not be neglected).
Clarification:
Automatic rollover will be into the nearest forward but I prefer the farthest forward because of the costs. So I rollover manually if it is feasible.
Hallo Derek, ich bin neu hier,
wo finde ich die beiden Indikatoren? kansst du sie als itf posten, bitte? ich möchte die Indis zur Kontrolle im Chart sehen, danke.
gatowman