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
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 |
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 |
Share this
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 :PRC is also on YouTube, subscribe to our channel for exclusive content and tutorials
Grazie! it is beautiful indeed
Made good money today 🙂
IT’ s seems intersting Code
Could be more interesting if someone has a back test since before 2013 ?
It work very well, thank u so much for share it
regards
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.
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.
Thanks Pier!
Excellent! I add the SL capped at 0.8% for safety purpose. The Backtest performance is still very good .
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
Dear Pier,
Does it work on forex?
sorry, but your strategie doesn’t work.
When i implement the file, i have the error : backtest.limit.optimisation.occurrence.teasing
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?
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” .
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
This code doesn’t work on 10.3 platform(IG), neither with copy/paste nor with itf import, any suggestion?