beeb

DAX 30 - Morning range breakout with order size increase

Category: Strategies By: beeb Created: March 8, 2018, 1:33 PM
March 8, 2018, 1:33 PM
Strategies
18 Comments
DAX 30 - Morning range breakout with order size increase

This automatic trading robot use the morning range from 7 o’clock to 9 o’clock of the Dax 30 on a 1 minute timeframe basis. If the price breaks the range up or down, a trade with fixed StopLoss and TakeProfit is set.

This strategy is another version of the famous Open Range Breakout methodology applied on DAX.

DEFPARAM FLATBEFORE=090100
// Festlegen der Code-Parameter
DEFPARAM CumulateOrders = false // Kumulieren von Positionen deaktiviert

// einmalige werte

once size = 1
once profi = 20
once in = 1
once korrek = 1
sl = 35
// Verhindert das Trading an bestimmten Wochentagen
daysForbiddenEntry = OpenDayOfWeek = 6 OR OpenDayOfWeek = 0
noEntryAfterTime = 100000
timeEnterAfter = time < noEntryAfterTime

// einen trade nur
IF (CurrentTime = 010000) then
 onetrade = 0
ENDIF
// Bedingungen zum Einstieg in Long-Positionen
IF (CurrentTime = 085900) then
 high7 = HIGHEST[120](high)
 low7 = LOWEST[120](low)
ENDIF
IF (close > high7) AND (CurrentTime >= 090100) then
 onetrade = 1
ENDIF

IF  (CurrentTime >= 090100) AND not daysForbiddenEntry AND (onetrade = 0) AND timeEnterAfter THEN
 BUY size CONTRACT AT high7 STOP
ENDIF
IF (LONGONMARKET = 1) then
 onetrade = 1
 in = 1
 korrek = 0
 //l1 = POSITIONPRICE + 0.0008
 l2 = POSITIONPRICE - sl
 //sell at l1 LIMIT
 sell at l2 stop
ENDIF

// Bedingungen zum Einstieg in Short-Positionen
IF close < low7 AND (CurrentTime >= 090100) then
 onetrade = 1
ENDIF
IF (CurrentTime >= 090100) AND not daysForbiddenEntry AND (onetrade = 0) AND timeEnterAfter THEN
 SELLSHORT size CONTRACT AT low7 STOP
ENDIF
IF (SHORTONMARKET = 1) then
 onetrade = 1
 in = 1
 korrek = 0
 //s1 = POSITIONPRICE - 0.0008
 s2 = POSITIONPRICE + sl
 //EXITSHORT at s1 LIMIT
 EXITSHORT at s2 STOP
ENDIF

// korrektur
IF (LONGONMARKET < 1) AND (SHORTONMARKET < 1) then
 in = 0
ENDIF

IF in = 0 and korrek = 0 then
 d1 = POSITIONPERF(1) > 0
 d2 = POSITIONPERF(1) < 0
 IF d1 and size > 1 then
  size = size - 1
  korrek = 1
 ELSIF d2 then
  size = size + 1
  korrek = 1
 ENDIF
ENDIF


// Stops und Targets
SET STOP pLOSS 60
SET TARGET pPROFIT sl

// Performance
IF STRATEGYPROFIT > profi then
 size = 1
 profi = profi + 20
ENDIF

 

 

Download
Filename: DAX-open-range-breakout-automated-trading-strategy.png
Downloads: 454
Download
Filename: DAX-1-min-mor-steigerung.itf
Downloads: 803
beeb
beeb Average
Code artist, my biography is a blank page waiting to be scripted. Imagine a bio so awesome it hasn't been coded yet.
Author’s Profile

Comments

drysheep
7 years ago
#

Hi all, did anyone test this strategy recently? As i dont get a single trade in the backtest. Any Ideas? Thanks in advance

reb
reb
8 years ago
#

Hello have you used this strat since last year ? live or Back test ? What are the results ?

beeb
8 years ago
#

Yes last Year. But only back test

fserra
8 years ago
#

Ciao, scusami ma non mi esegue il back test, da cosa può dipendere? Grazie

vlongobardo67
8 years ago
#

hi Beeb, I imported the file in my platform but is does open any order. What is wrong , what should I check ? Thanks Vincenzo

Dominik
8 years ago
#

// Stops und Targets SET STOP pLOSS 0 SET STOP PTRAILING 45 SET TARGET pPROFIT 55

Dominik
8 years ago
#

Hallo beeb, ich schreibe kurz auf Deutsch und falls es von Wert ist übersetze ich es gerne. Vielen Dank für Deine Strategie ... sieht schon mal super aus. Habe eben anstatt dem SL einen 45 TrailingStop verwendet und TP = 55 (hat mir die Analyse so raus geworfen). Durch den Trailing Stop finden keine so großen Abbrüche mehr statt. Sollte doch real dann auch funktionieren ...oder??? Es sei denn ich habe etwas übersehen. Beste Grüße Dominik

beeb
8 years ago
#

Hallo Dominik, das mit dem deutsch schreiben kommt mir sehr gelegen. Komme auch aus Deutschland. Also mit deinen werten komme ich auf eine kleine Verbesserung was den Gewinn angeht aber auch auf einen Max. Drawdown von 890,20 € . Wenn ich die werte so lasse auf einen Drawdown von 0 €. und die Ratio ist auch minimal besser 0,03 punkte, ist aber denke ich bei dem unterschied zu vernachlässigen. Man kann sicher noch an ein paar schrauben drehen und kitzelt noch ein bisschen Performanz raus. Es gilt nur die richtigen Regler zu finden ;-) Gruß Benny

dreif123
8 years ago
#

hi beeb, i watched your BOut strategy and i like it very much. your code allows only one trade. (long or short). what has to be changed in your code, if i like to have maximum 2 trades , so one short and one long, if the events of your code will be matched. thx for your support

noisette
8 years ago
#

sorry, I was wrong in my previous message: it's not possible to have both conditions at the same time

noisette
8 years ago
#

Thank you for this code that seems to work well. But, if i'm not wrong, we can have buy and short conditions at the same time. So how can the code "decide" between sell and short?

JanWd
9 years ago
#

Mr Beep, nice strategy you have build ! I played around with your code, and made my own variation on your code, see below, just an alternative way of coding (less static) I am not convinced (yet) about the reliability of the outcomes : if using the code on 100.000 bars, it shows no profit for the first 50.000 bars, I personnally am afraid of overfitting. Maybe you have a different opinion. Your question : " For the SL / TP I’m still testing myself and I’m not sure how to improve the performance. Do you have an idea how to do that? ===> An good option is to use "Variable optimalization", for the optimal Take Profit values for short and long positions, could also be used for number of highest and lowest bars to be taken (instead of 120 bars) See also page 30 of the manual, https://www.prorealtime.com/en/pdf/probacktest.pdf Kind regards, APPENDIX DEFPARAM CumulateOrders = true // Kumulieren von Positionen aktiviert Defparam FLATAFTER = 163000 // Verhindert das Trading nach xx:xx Uhr DaysForbiddenEntry = (DayOfWeek = 6 OR DayOfWeek = 0) // Verhindert das Trading an bestimmten Wochentagen Handelszeit = (Time >= 90000 and Time high7 then // Bedingungen zum Einstieg in Long-Positionen BUY size CONTRACTS AT high7 STOP sl = round((77/10000 * close)) // stop loss SET STOP pLOSS sl pll = round((VARIABLE OPTIMIZATION 3 PL/10000 * close)) // take profit long SET TARGET pPROFIT pll else // Bedingungen zum Einstieg in Short-Positionen IF close < low7 then SELLSHORT size CONTRACTS AT low7 STOP sl = round((77/10000 * close)) // stop loss SET STOP pLOSS sl pss = round(VARIABLE OPTIMIZATION 4 PS/10000 * close) // take profit short SET TARGET pPROFIT pss ENDIF endif endif

JanWd
9 years ago
#

Was meinst du mit dieser Kode ? IF (LONGONMARKET = 1) then onetrade = 1 in = 1 korrek = 0 //l1 = POSITIONPRICE + 0.0008 l2 = POSITIONPRICE - sl //sell at l1 LIMIT sell at l2 stop ENDIF

Stefan Martinali
9 years ago
#

In the buy long if statement, shouldnt you enter long if onetrade = 1 instead of 0 (row 30)?

mr blue
9 years ago
#

I have a similar approach running - but yours is also very smart - thanks for sharing!

beeb
9 years ago
#

Thanks

Robin von Bauhn
9 years ago
#

Thank you for sharing! Although I have a couple of questions: Why 1 min? Since the range is based over 2h and you enter with stop orders you might as well use 15m to get a larger sample size? And why a fixed sl/tp? Especially with a small sample size all you do is increase risk of curvefitting? Best regards, R

beeb
9 years ago
#

Hello, nice that you like the strategy. For 1 minute I have chosen to avoid the first minute in the DAX at 9 o'clock, because this is often very turbulent. The entrance is at 9 clock 1. For the SL / TP I'm still testing myself and I'm not sure how to improve the performance. Do you have an idea how to do that? Best Regards Beeb

ProRealCode ProRealCode
Loading...