Hi all,
Here is one of my simple strategies. With a little help from someone, here is the code with optimization.
The strategy is using Donchian breakout, with MACD, RSI and moving average as trending indicators.
The code is so simple that I won’t write a long description.
Seems to be effective !
Best regards,
This strategy is suitable for : DAX, H1 (1 point spread, tick by tick)
// ALLEMAGNE 30
// H1
DEFPARAM CumulateOrders = False
// TAILLE DES POSITIONS
N = 2
// MACD histogramme
iMACD = MACD[12,26,9](close)
// Donchian
// Pour le DAX : A = 9 et V = 7
A= 9
V = 7
DonchianSupA = highest[A](high)
DonchianInfA = lowest[A](low)
DonchianSupV = highest[V](high)
DonchianInfV = lowest[V](low)
iRSI= RSI[4](close)
// ACHAT
ca1 = iMACD > iMACD[1]
ca2 = iMACD >= 0
ca3 = close crosses over DonchianSupA[1]
ca4 = iRSI > 63
ca5 = close >= average[50]
IF ca1 AND ca2 AND ca3 and ca4 and ca5 THEN
buy N shares at market
ENDIF
sell at DonchianInfA stop
// VENTE
cv1 = iMACD < iMACD[1]
cv2 = iMACD <= 0
cv3 = close crosses under DonchianInfV[1]
cv4 = iRSI < 31
cv5 = close <= average[500]
IF cv1 AND cv2 AND cv3 and cv4 and cv5 THEN
sellshort N shares at market
ENDIF
exitshort at DonchianSupV stop