Hi all !
Here is a very simple code, but very effective, in order to trade the DAX.
It’s a Day trading strategy, but it is designed for H4 timeframe.
It concerns the 3 candles : from 9AM to 21PM.
We go long at 09AM if :
close > 200 moving average
MACD > 0
We close positions at 21PM.
Stop loss and take profit : 1% and 3%
That’s all !
As you see, this very simple trend following strategy is positive (with spread : 1 point), on the last 10 years.
It is’nt before, but I think the DAX CFD trading hours were different.
It should be easy to improve this code, I’ve already made some improvements.
But I prefer giving you the basic and simple (but effective !) code.
// PARAMETRES
DEFPARAM CumulateOrders = False
DEFPARAM flatafter = 210000
// TAILLE DES POSITIONS
// INDICATEURS
MM = Average[200](close)
iMACD = MACD[12,26,9](close)
// ACHAT
ca1 = close > MM
ca2 = iMACD > 0
IF ca1 AND ca2 AND time >= 090000 THEN
BUY AT MARKET
ENDIF
// VENTE
cv1 = close < MM
cv2 = iMACD < 0
IF cv1 AND cv2 AND time >= 090000 THEN
SELLSHORT AT MARKET
ENDIF
// Stop et objectifs
SET STOP %LOSS 1
SET TARGET %PROFIT 3