Doctrading

The "DAX Donchian Breakout" strategy

Category: Strategies By: Doctrading Created: March 18, 2018, 6:01 PM
March 18, 2018, 6:01 PM
Strategies
8 Comments
The "DAX Donchian Breakout" strategy

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

 

Download
Filename: DAX-Donchian-Breakout-strategy.itf
Downloads: 1244
Doctrading
Doctrading Master
Hello, I'm Marc. Nice to meet you.
Author’s Profile

Comments

lisamitch50
6 years ago
#

Morning all, Just backtested on quite a few instruments, worked well on backtesting, but tell me - How do you then implement the cross strategy? it tells me which crossing strategy was best (For what i am looking for {Drawdown / gains / % winners etc}, but not what average that is.?? I see that that for example, MAType was 14 and MATypeV2 61 worked for me the best on the instrument i want to use it on, but - 14 i a Fractal Adaptive Moving Average and 61 is a Zero Lag BMT?? Do i copy and paste the chosen code for each strategy Number? I would love to chat about this a LOT more. Thanks.

richyowen
6 years ago
#

Hi, great code thanks. Very new to this forum. Is there a way to add a 100point target on any position taken?

ak5hay2
6 years ago
#

Works like crazy on bitcoin. Use different timeframes. Thanks a lot Doc!!!

magicT
8 years ago
#

I did a copy and paste of this code and PRT 10.3 returns a synthax mistake: OneTradePerDay = IntradayBarIndex iMACD[1] Can you clean this error please ? Thanks.

Glen Marquis
8 years ago
#

This will work as there is plenty of room for the Target before the Stop, yet the Stop would be hit first far more frequently, hence the equity curve nothing at all as per real time.

JanWd
8 years ago
#

Hey Doctrading, I tried your code, optimising the A and V and the RSI period, see below. Seem to work very promising, but only for one year, from april 2017 to april 2018 It does NOT gain a profit for a period before that period, from april 2016 to april 2017 the net result is zero (1,8 point spread) This poverly performance further back in the past happen very often with my algo models as well, ---> how do you deal with this phenomenon ? Looking forward for your thoughts, Thanks, Jan =============================== Your code optimised with 3 variables, speaks for itself: //https://www.prorealcode.com/prorealtime-trading-strategies/dax-donchian-breakout-strategy/ // ALLEMAGNE 30 // H1 DEFPARAM CumulateOrders = False // TAILLE DES POSITIONS N = 1 // MACD histogramme iMACD = MACD[12,26,9](close) // Donchian // Pour le DAX : A = 9 et V = 7 A= a1//9 default, variable optimization V = v1//7default, variable optimization DonchianSupA = highest[A](high) DonchianInfA = lowest[A](low) DonchianSupV = highest[V](high) DonchianInfV = lowest[V](low) iRSI= RSI[R](close) //4 default, variable optimization OneTradePerDay = IntradayBarIndex 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 and OneTradePerDay 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 and OneTradePerDay THEN sellshort N shares at market ENDIF exitshort at DonchianSupV stop

Daniel da Costa
9 years ago
#

Thanks Doc! Where can you find a service for Dax with a 1 point spread?

Doctrading
9 years ago
#

Hello. I suggest you : ProRealTime CFD, or IG. Best regards,

ProRealCode ProRealCode
Loading...