Reiner

Open Range Breakout DAX 5/15M

Category: Strategies By: Reiner Created: June 10, 2016, 4:40 PM
June 10, 2016, 4:40 PM
Strategies
27 Comments
Open Range Breakout DAX 5/15M

Hi guys,

Open range breakout systems are very popular. They are simple and reliable with volatile instruments like the DAX. I trade the ORB together with the equity curve because as all breakout systems they could have some ugly drawdown phases. These concept is very easy and is described perfectly here in the Blog. Add to the equity curve a simple moving average and trade only if the curve is above the MA could help to avoid ugly losses.

I want to share an easy ORB strategy works profitable in M5 and M15 – this is not a big thing but maybe helpful for some PRT beginners.

have fun

Reiner

// Open Range Breakout DAX 5/15M

// code-parameter
DEFPARAM FlatAfter = 173000

// window high/low calculation
ONCE StartTime = 90000
ONCE EndTime = 93000

// trading window
ONCE BuyTime = 93000
ONCE SellTime = 173000

// money management
ONCE Capital = 10000
ONCE Risk = 0.01
ONCE StopLoss = 10
ONCE equity = Capital + StrategyProfit
ONCE maxrisk = round(equity*Risk)
ONCE PositionSize = abs(round((maxrisk/StopLoss)/PointValue)*pipsize)
// fixed position size
//ONCE PositionSize = 10

//signal line
signal = Tema[5](close)

// calculate high/low and sl/tp
IF Time >= StartTime AND Time <= EndTime THEN
 IF TIME = StartTime THEN
  DailyHigh = High
  DailyLow = Low
 ENDIF
 IF High > DailyHigh THEN
  DailyHigh = High
 ENDIF
 IF Low < DailyLow THEN
 DailyLow = Low
 ENDIF

 sl = DailyHigh - DailyLow
 tp = sl

 TradeCounterLong = 0
 TradeCounterShort = 0
ENDIF

// position management
IF Time >= BuyTime AND Time <= SellTime THEN
 // Long
 IF Not LONGONMARKET AND signal CROSSES OVER DailyHigh AND TradeCounterLong = 0 THEN
 // long
  IF (Time >= 93000 AND Time <= 113000) OR (Time >= 130000 AND Time <= 171500) THEN // no trading during lunch
   BUY PositionSize CONTRACT AT MARKET
   TradeCounterLong = TradeCounterLong + 1
  ENDIF
 ENDIF
// short
 IF Not SHORTONMARKET AND signal CROSSES UNDER DailyLow AND close < DClose(1) AND TradeCounterShort = 0 THEN
  IF Time >= 93000 AND Time <= 150000 THEN // short breakouts after 1500 are not profitable
   SELLSHORT PositionSize CONTRACT AT MARKET
   TradeCounterShort = TradeCounterShort + 1
  ENDIF
 ENDIF

 // close positions
 IF Time = SellTime THEN
   IF LONGONMARKET THEN
    SELL AT MARKET
   ENDIF
  IF SHORTONMARKET AND Time = SellTime THEN
   EXITSHORT AT MARKET
  ENDIF
 ENDIF

// stops and targets
SET STOP LOSS sl
SET TARGET PROFIT tp

ENDIF

 

Download
Filename: Open-Range-Breakout-DAX-5-15M.itf
Downloads: 982
Reiner
Reiner Veteran
Developer by day, aspiring writer by night. Still compiling my bio... Error 404: presentation not found.
Author’s Profile

Comments

CanAny1Trade
8 years ago
#

Hi all, could a simple indicator be made to mark the traditional Pit based ORB? I'm trying to put together a similar indicator but struggling. I want to mark the NY Pit session (9:30 AM - 4:00 PM) each day for US500 with a vertical line and the opening 30 second range with a horizontal box. Could you or anyone help with this? Kind Regards

Francesco78
9 years ago
#

Thank you for the clarifications Nicolas, I am more aware of the meaning of the backtesting now,  after spending the weekend on it. Thank you for the amazing job of this forum.

Francesco78
9 years ago
#

how would you explain the fact that this robots stopped working pretty much at the exact period when it has been shared?

Is it just bad luck or it might be that sharing can affect negatively the profitability  of an algorithm? 

does anyone has thoughts about it?

Many thanks

 

Nicolas
9 years ago
#

Overfit on past history obviously. But it doesn't mean that it would still underperformed in the future. That is why walk-forward is important, as long as over analysis tools like MonteCarlo for instance. 

tradex
10 years ago
#

Hello,

what is the simple average period on equity curve ?

Thank you in advance

Reiner
10 years ago
#

tradex, open the settings dialog (click on wrench symbol) on the equity curve window and add a simple moving average indicator - thats all. When your backtest based on e.g. 100.000 candles set a period length of 2000 or 5000. Trade only if the equity curve is above of the average is an easy method to increase the profit probability 

ALEALE
10 years ago
#

Ok, thanks

ALEALE
10 years ago
#

HELLO REINER
ARE YOU WORKING WITH THIS STRATEGY NOW?

HEVE YOU CHANGE SOMETHING IN THE CODE?

 

THANKS

ALE

Reiner
10 years ago
#

ALE, breakout strategies work great in trend phases like last year. Unfortunately DAX is more or less catched in a range since Februar and you lost money with that kind of algos. No, I'm not trading these kind of strategies at the moment.

Hockeytrader
10 years ago
#

Hey. Been comparing the strategys performance versus the DAX volatility index. i've not done all 100 000 bars yet but so far the strategy is profitable when the $VDAX is somewhere between 15 & 25. Gonna work on this tonight and see if a can give you some kind of report.

chuks
10 years ago
#

Hey Hockeytrader

did you back test this as you said you would do ? I am based in London, so do I have to choose Dax 30 ?

thegeneral
10 years ago
#

 Hi Reiner,

                   Can the code be changed to have a €2 per point risk/gain?

thanks

Reiner
10 years ago
#

and of course select an DAX 1 Euro mini

Reiner
10 years ago
#

Hi thegeneral,

change line 22:
ONCE PositionSize = 2

best regards

Reiner

Cosmic1
10 years ago
#

Hey Reiner, Yes the 200k units comes in very handy and also causes a lot more work! Maybe it is something that can be adjusted to be workable over the long term? 

Nicolas
10 years ago
#

Please test it on demo first, as I'm not sure that plotting the MA on strategyprofit curve is working correctly with PRT-CFD. Work for sure with PRT software though. I'll ask PRT next week if it is possible now, because it were not the case when I wrote this article about this concept some weeks ago.

Daniel da Costa
10 years ago
#

Hi Nicolas! Is it possible too reference the MA in the equity curve so as too know whether too put a trade on or not?

Cosmic1
10 years ago
#

 The large versions are here:

http://postimg.org/image/obhsh0v17/

http://postimg.org/image/gmfw86o7v/

Reiner
10 years ago
#

Hi Cosmic1,

Thanks for your feedback and sorry for the late answer. I only have 100.000 candles for backtest due that reason everything before 2015 is not clear for me. It works great since last May but has some drawdowns. But many things worked over the last month because of the volatility. I go with your picture that in 2014 this idea had troubles with the described parameters.

Best regards

Reiner

Cosmic1
10 years ago
#

Hi Reiner,

Great bit of code, I will definitely by using some of it in my own strategies. With the times adjusted correctly for UK  time and 1 point spread I get the following results. Does this seem correct?

http://s33.postimg.org/gmfw86o7v/image.png

http://s33.postimg.org/obhsh0v17/image.png

Doctrading
10 years ago
#

Hello Reiner,

Thanks for this nice code, as usual !

I've tested it in M15, on the DAX (I like M15 because there is sufficient historic data).

Without spread, it's winning since late 2014

With 1 point spread, it's loosing all money if we begin the test in 2008.
Did I miss something ?

Your strategy is good and we could do something to improve it.
Best regards,

Hockeytrader
10 years ago
#

Hey Reiner. Been reading and testing the code tonight. I just wonder you have put ONCE in the beginning of every line on the money management

// money management
ONCE Capital = 10000
ONCE Risk = 0.01
ONCE StopLoss = 10
ONCE equity = Capital + StrategyProfit
ONCE maxrisk = round(equity*Risk)
ONCEPositionSize = abs(round((maxrisk/StopLoss)/PointValue)*pipsize)

 

Reiner
10 years ago
#

Hi Hockeygrader,

Thanks for your comment.

Yes of course, you have to remove some ONCE-statements if variable position sizing should be used:

equity = Capital + StrategyProfit
maxrisk = round(equity*Risk)
PositionSize = abs(round((maxrisk/StopLoss)/PointValue)*pipsize)

Sorry for the confusion.

best regards

Reiner

GraHal
10 years ago
#

Hello Reiner

This looks very interesting and inspiring, thank you so much for sharing it with us and referring us to the concept here in the Blog.

Please would it be asking too much for you to include additional code to  ... add to the equity curve a simple moving average so that the your above TS trades only if the equity curve is above the MA ... or would this be too much work for you please??

I am trying to do above myself, but not got it working so far. 

Many Thanks

GraHal 

Reiner
10 years ago
#

Hi GraHal,

with the current PRT IG version the MA plotting on strategyprofit curve is not working correctly.  I manually insert a ma in the backtest chart and decide from day to day.

best regards

Reiner

Anonymous
10 years ago
#

dOES IT PERFORM WELL ALSO ON OTHER IDEX?

 

Reiner
10 years ago
#

I have tested only the DAX

ProRealCode ProRealCode
Loading...