Pier

IDNR2 pattern strategy on DAX 1 h

Category: Strategies By: Pier Created: June 14, 2017, 2:24 PM
June 14, 2017, 2:24 PM
Strategies
14 Comments
IDNR2 pattern strategy on DAX 1 h

I just wrote this strategy

It works very well on dax 1 h

It is based on the IDNR pattern with 2 periods instead of 4

As filter It uses the following: the squeze of the bollinger band (band width < lowest[period]) , adx > min and atr[1] > atr[period]

As trailing stop I used a code that I found in this library

It does not seem over fitted because changing parameters the result remains good and also It seems to work quite well on FTSE MIB 1 h too

However It seem to me that It makes too few trades on the historic that I have available to be sure of its reliability

NR10 = high < high[1]  and low  > low[1]and range  < LOWEST[2](range)[1]
bbwdt =BollingerBandWidth[20](close) < lowest[17](BollingerBandWidth[20](close)[1])

// long entry
l1 = nr10
l1 = l1 and bbwdt
l1 = l1 and hour < 20
l1 = l1 and adx[10] > 17
l1 = l1 and AverageTrueRange[1](close) > AverageTrueRange[9](close)
IF not onmarket AND l1   THEN
 BUY 1 CONTRACTS AT high+1.5 stop
ENDIF

// short entry
s1 = nr10
s1 = s1 and bbwdt
s1 = s1 and hour < 20
s1 = s1 and adx[10] > 17
s1 = s1 and AverageTrueRange[1](close) > AverageTrueRange[9](close)
IF not onmarket AND s1   then
 SELLSHORT 1 CONTRACTS AT low -1.5 stop
ENDIF

// TRAILING STOP LOGIK
TGL =AverageTrueRange[14](close)*2.5
TGS=AverageTrueRange[14](close)*1.7

if not onmarket then
 MAXPRICE = 0
 MINPRICE = close
 PREZZOUSCITA = 0
ENDIF

if longonmarket then
 MAXPRICE = MAX(MAXPRICE,close)
 if MAXPRICE-tradeprice(1)>=TGL*pointsize then
  PREZZOUSCITA = MAXPRICE-TGL*pointsize
 ENDIF
ENDIF

if shortonmarket then
 MINPRICE = MIN(MINPRICE,close)
 if tradeprice(1)-MINPRICE>=TGS*pointsize then
  PREZZOUSCITA = MINPRICE+TGS*pointsize
 ENDIF
ENDIF

if onmarket and PREZZOUSCITA>0 then
 EXITSHORT AT PREZZOUSCITA STOP
 SELL AT PREZZOUSCITA STOP
ENDIF

//stop and target
SET STOP PLOSS AverageTrueRange[14](close)*2.7
SET TARGET PPROFIT AverageTrueRange[14](close)*7.2

Download
Filename: IDNR-pattern-strategy-trading-result.png
Downloads: 290
Download
Filename: IDNR2-strategy-on-DAX-1-h.itf
Downloads: 639
Pier
Pier Veteran
Operating in the shadows, I hack problems one by one. My bio is currently encrypted by a complex algorithm. Decryption underway...
Author’s Profile

Comments

mcosta
9 years ago
#

This code doesn't work on 10.3 platform(IG), neither with copy/paste nor with itf import, any suggestion?

JR1976
9 years ago
#

HI Nicolas , I tried to copy paste but not import directly and the code works well I have a question about the code, because , did't appears the equity line from 2009 . Do you have the possibility to show it ? ( the author doesn'r response) thanks Regards

gackeen
9 years ago
#

Scusa Pier, scusate tutti, sono nuovo. Ho caricato il file e mi viene restituito il messaggio "Il suo Probacktest supera il limite di occorrenze per l’ottimizzazione Walf Forward" .

bobrenard96
9 years ago
#

sorry, but your strategie doesn't work. When i implement the file, i have the error : backtest.limit.optimisation.occurrence.teasing

Nicolas
9 years ago
#

It's a platform error, nothing to deal with the code. Did you tried to download the itf file and import it rather than copy paste it?

CKW
CKW
9 years ago
#

Dear Pier,

Does it work on forex?

JR1976
9 years ago
#

Dear Pier , 

your screenshot which rappresent the backtest , is since dec 2009 , but the equity curve in other picture is from 2013

DO you have the equity line wich rappresente the algo code  before  2013  ?

nice work

 

CKW
CKW
9 years ago
#

Thanks Pier!

Excellent! I add the SL capped at 0.8% for safety purpose. The Backtest performance is still very good .

Wilko
9 years ago
#

First of all, many thanks for sharing! These shares are much appreciated.

I hate to potentially spoil the party, but the concept appeared so interesting that I decided tp test it on several other major developed market equity indices (without any spreads and/or commissions). Unfortunately I can report that it appears to be almost consistently negative, to such a degree that I am tempted to test it in reversal.

Wilko
9 years ago
#

I hate to potentially spoil the party, but the concept appeared so interesting that I decided tp test it on several other major developed market equity indices (without any spreads and/or commissions). Unfortunately I can report that it appears to be almost consistently negative, to such a degree that I am tempted to test it in reversal.

DarioMazza
9 years ago
#

 It work very well, thank u so much for share it

 

regards

JR1976
9 years ago
#

IT' s seems intersting Code 

Could be more interesting if someone has a back test since before 2013  ?

Francesco78
9 years ago
#

Made good money today :)

Francesco78
9 years ago
#

Grazie! it is beautiful indeed

ProRealCode ProRealCode
Loading...