Breakout DAX 15Min

Breakout DAX 15Min
Firstly, a big thank you to Nicolas for this great site and for originally introducing us to the CAC Breakout using the same code here.

I set about testing this strategy on other markets due to the fact you can backtest 8 years of data with 200,000 units on the 15Min time-frame. The other massive plus is no fake profits and only 26, 0 bars in 1500 trades! :)

In this version I am using a fixed position size but you can activate the re-invest system if you are happy with that. It makes for an interesting ride!

I stuck to the rules of not over optimising/curve fitting by using an IN/OUT sample as documented here. This ran from July 2008 - Jan 2014.

The results above are £1 Per Point, £1000 Start and 1.5 Spread.

I am live trading this with real money with minimum stakes to test. IG have now reduced the PPP from £2 to £1 just recently. This is very handy for forward live testing.

All times in the code are UK so please adjust to your timezone.

I have some more of these ported to other markets but need to spend a little more time getting them right before posting in the library. Expect them soon.

I have not had enough time to test different time frames. Maybe I will try that next if time allows.

Good luck and enjoy your weekend.

// Main code : Breakout ProOrder EN DAX
// We do not store data until the system starts.
// If it is the first day that the system is launched and if it is afternoon,
// it will wait until the next day for defining sell and buy orders.

//All times are UK Time Zone

DEFPARAM PreLoadBars = 0

// Position is closed at 20h00 PM
DEFPARAM FlatAfter = 200000

// No new position will be initiated after the 16:00PM candlestick. Any existing orders cancelled at 16:30pm
LimitHour = 161500

// Market scan begin with the 15 minute candlestick that closed at 8:30AM
StartHour = 081500

// The 24th-31st days of December will not be traded because the market closes early.
IF (Month = 5 AND Day = 1) OR (Month = 12 AND (Day = 24 OR Day = 25 OR Day = 26 OR Day = 30 OR Day = 31)) THEN
TradingDay = 0
TradingDay = 1

// Variables that would be adapted to your preferences
if time = 074500 then
//PositionSize = max(1,1+ROUND((strategyprofit-1000)/1000)) //gain re-invest trade volume
PositionSize = 1 //constant trade volume over the time
MaxAmplitude = 170
MinAmplitude = 22
OrderDistance = 9
PourcentageMin = 19

// Variable initilization once at system start
ONCE StartTradingDay = -1

// Variables that can change in intraday are initiliazed
// at first bar on each new day
IF (Time <= StartHour AND StartTradingDay <> 0) OR IntradayBarIndex = 0 THEN
BuyTreshold = 0
SellTreshold = 0
BuyPosition = 0
SellPosition = 0
StartTradingDay = 0
ELSIF Time >= StartHour AND StartTradingDay = 0 AND TradingDay = 1 THEN

// We store the first trading day bar index
DayStartIndex = IntradayBarIndex
StartTradingDay = 1
ELSIF StartTradingDay = 1 AND Time <= LimitHour THEN

// For each trading day, we define each 15 minutes
// the higher and lower price value of the instrument since StartHour
// until the buy and sell tresholds are not defined
IF BuyTreshold = 0 OR SellTreshold = 0 THEN
HighLevel = Highest[IntradayBarIndex - DayStartIndex + 1](High)
LowLevel = Lowest [IntradayBarIndex - DayStartIndex + 1](Low)

// Spread calculation between the higher and the
// lower value of the instrument since StartHour
DaySpread = HighLevel - LowLevel

// Minimal spread calculation allowed to consider a significant price breakout
// of the higher and lower value
MinSpread = DaySpread * PourcentageMin / 100

// Buy and sell tresholds for the actual if conditions are met
IF DaySpread <= MaxAmplitude THEN
IF SellTreshold = 0 AND (Close - LowLevel) >= MinSpread THEN
SellTreshold = LowLevel + OrderDistance
IF BuyTreshold = 0 AND (HighLevel - Close) >= MinSpread THEN
BuyTreshold = HighLevel - OrderDistance

// Creation of the buy and sell orders for the day
// if the conditions are met
IF SellTreshold > 0 AND BuyTreshold > 0 AND (BuyTreshold - SellTreshold) >= MinAmplitude THEN
IF BuyPosition = 0 THEN
IF LongOnMarket THEN
BuyPosition = 1
BUY PositionSize CONTRACT AT BuyTreshold STOP
IF SellPosition = 0 THEN
IF ShortOnMarket THEN
SellPosition = 1

// Conditions definitions to exit market when a buy or sell order is already launched
IF LongOnMarket AND ((Time <= LimitHour AND SellPosition = 1) OR Time > LimitHour) THEN
SELL AT SellTreshold STOP
ELSIF ShortOnMarket AND ((Time <= LimitHour AND BuyPosition = 1) OR Time > LimitHour) THEN

// Maximal risk definition of loss per position
// in case of bad evolution of the instrument price
Risk disclosure:

No information on this site is investment advice or a solicitation to buy or sell any financial instrument. Past performance is not indicative of future results. Trading may expose you to risk of loss greater than your deposits and is only suitable for experienced investors who have sufficient financial means to bear such risk.

ProRealTime ITF files and other attachments : How to import ITF files into ProRealTime platform?

New! PRC is also now on YouTube, subscribe to our channel for exclusive content and tutorials

  1. criscolci • 176 days ago #

    Great work! thanks for sharing

  2. Pjotterd • 173 days ago #

    Just asking, do I have to set a profit stop?

  3. Cosmic1 • 171 days ago #

    @Pjotterd You don’t have to but you can uncomment that part, Line 112. I am not running it with one.

    @GraHal Yes all Nicolas’ hard work. Simply a port from me.

  4. Cosmic1 • 171 days ago #

    A shame today’s fall was not captured but it fell outside of spec. Must be trusting in the backtest and IN/OUT sample. A good week overall for this strat though so cannot complain.

  5. traderollie • 168 days ago #

    Hi, I am going to use this system tomorrow with £1 trades. I’ll post my results. Do you have a direct email by any chance?



  6. Vish • 154 days ago #

    Hi … Thanks a lot for sharing this strategy. I have backtested this and works fine on DAX. Only concern is bigger position size. It does not seem to behave well if I have a position size of 10 (for e.g.) Can you suggest if this strategy is supposed to work only with small position sizes ? 

  7. Cosmic1 • 151 days ago #

    Hi Vish,

    All works ok here.  I started it just now with 10k starting pot and £10pp. Ends up at £104,000 from Sept 2008 to present day.

  8. Vish • 148 days ago #

    Thanks Cosmic. It works for me too. That was a silly mistake. Last week went quite well with this strategy on live trading. Anyone here likes to share to share results how they are getting on with it in live environment.

  9. Cosmic1 • 147 days ago #

    Hi Vish, Yes it was a good Thursday and Friday where between DAX and DOW breakout +800 points were added. As we know there could be drawdown but it’s nice to have a bit of a buffer built up now.

  10. JakeDB • 134 days ago #

    I cannot get my time conversions correct for Sydney Australia to get any data for this code. 

    Not sure what i am doing wrong

  11. Cosmic1 • 134 days ago #

    @JadeDB What times are you putting in?

Register or


avatar avatar avatar avatar avatar avatar avatar avatar avatar avatar avatar avatar avatar avatar
Related users ' posts
iramirez55 thanks for all
Elsborgtrading By adding the inside bar breakout failure candle, which is the next bar after the inside bar...
Wing Yes, investigate as much as you want. For more insight, you can view the linet1, linet2 etc....
CKW Hi Wing, Thanks for your sharing. I am still trying to breakdown & understand your code...
Wing Hello CKW. No, the parameter, 7 in this case, is used when calling the RSI indicator to ide...
alemaliz Hello Raul vg the minimum stop on the Dax and mini 1 and not to 18 points how do you insert ...
Raul Vg Hi alemaliz, In the IG broker, the minimum trailing stop is 5 with the open market.  
Nicolas For everyone information, a discussion thread is ongoing here:
pascal3431 Salut Doc , Je ne vois pas ce qui fait office de stop dans ce code .. un retour dans le nua...
Doctrading Bonjour, Il s'agit juste d'une stratégie où on est toujours en position : soit à l'achat / ...
pascal3431 Bonjour, après quelques essais sur EUR/USD au M15 en rajoutant(car sinon on est en perte) u...
Doctrading Nice Job ! Here is my version of the code :  KBO = 0 Tenkansen = (highest[9](high)+lowe... The code dose not work   Syntax error: line 2, character 12One of the following chara... why do I get error ond line whit DAX? Eihter cod works. Can you chare the file?
Elsborgtrading Hi Triss. the File is in the post for download. There is nothing wrong with the code. Your e...
4 months ago
maxxb a ok quindi potrei anche non aver sbagliato nulla ... grazie ..  
sunandsea12345 scusate sono nuovo del forum ,dove posso chiedere come posso generare un codice che mi perme...
ALE Ciao Puo andare nel forum Supporto pro order In fondo troverai lo spazio per inserire un ...
ALE Hello Traderfed, because it run many operations over the past three years, instead of havin...
fepabe Ciao Ale, porta pazienza ma facendo copia incolla del codice non mi restituisce alcun valore...
arke Hi Cosmic, I saw that you are able to do a backtest on DAX in 15Min timeframe till 6 years ...
5 months ago
enzo_52 Hi Ale, so you have the same results with german 30 mini 1e cash TF 1h?  
ALE no, only with TF 15m
enzo_52 Grazie tante, Thanks so much 
5 months ago
century hi, can we have more explanations please ? about parameters and time unit ? thanks
Nicolas Line 10: Volume of current candlestick must be at least 1.5 higher than the previous one and...
6 months ago
Cosmic1 Hi Yngve, Amplitude relates to the range of the price action for the given times stipulated...
GAMMA I try as per your advise and change the time to usa time still no luck, may be I am doing so...
Cosmic1 Post the code you are using, will try and figure it out. What broker?
Elsborgtrading Hi Nicolas, and thanks for updating the file. When I backtest the code now I get a complete...
Elsborgtrading Hi Nicolas. I made a mistake. a FTSE chart had sneaked under the DAX and when backtesting I ...
Nicolas "set stop loss" are individual for each order with IG.
Philip Raphael Hey! Thank so much for sharing this wonderful indicator! I have always tried to code a simil...
CKW Hi Philip, What do you mean "Years" are not defined ? candle? If to code yearly candle size...
dakaodo Years not defined was probably b/c Phillip copied and pasted the code into PRT instead of im...
zilliq The reasons why I think it's time consuming and we loose time to try to do backests and Auto...
filiprb Hello Zilliq, You don't need a system to produce a walk forward test. You can easily create...
Philip Raphael It is incredible! Thanks for sharing, Doctrading!
Doctrading Hello, As I said, I didn't use spread for the screenshot as I don't trade Gold and I don't ...
smurfy Hi, I had been losing on gold and after I manually go through the 5min chart using IG and w...
8 months ago
Pathfinder DAX 4H
Pathfinder DAX 4H
djtaktik Hello reiner, How do you explain that pathfinder have good results on DAX but not on the CA...
Nicolas You should join and read the forum thread about this strategy. There are plenty of different...
Reiner Hi djtaktik and welcome, I have answered your question in the related Pathfinder forum beca...
9 months ago
tradex Hello, what is the simple average period on equity curve ? Thank you in advance
Reiner tradex, open the settings dialog (click on wrench symbol) on the equity curve window and add...
Daniel da Costa Hi Nicolas! Is it possible too reference the MA in the equity curve so as too know whether t...
finplus Bonjour, j'ai retesté hier sur la paire AUD/USD timeframe 1 heure sur mon compte réel chez I...
finplus Bonsoir, j'ai de nouveau aujourd'hui lancé la stratégie en réel sur mon compte IG sur la pai...
AleX 0 improvments, I tried a lot of modified version but no one was working. I think that only w...