1H EURUSD with good walk forward robustness tests
Forums › ProRealTime English forum › ProOrder support › 1H EURUSD with good walk forward robustness tests
- This topic has 4 replies, 2 voices, and was last updated 6 years ago by
GraHal.
-
-
09/02/2019 at 8:58 AM #106188
This is not my code but I have modified it a bit.
Optimized it with a regular back test. (100%)
Then I did a WF with 5 periods with 70% IS.
The result looks pretty good according to what I learned the last few days about WF.
123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129DEFPARAM CumulateOrders = FALSE// Posizioni cumulate disattivateONCE trailingStopType = 1 // 0 NONE, 1 TRAILINGONCE percprofit = 0.5 // 0.5ONCE percloss = 1 // 1ONCE barlong = 15 //15ONCE barshort = 15 //15ONCE atrtrailingperiod = 200 //200ONCE minstop = 5 //5 Pipsize - least distance of the stop for IGONCE trailingstoplong = 15 //15 Trailing stop start and distanceONCE trailingstopshort = 15 // 15// FRACTALONCE CP = 120 // 120// MOVING AVERAGEONCE avgLongPeriod = 80 // 80// CUMMRSIONCE CumRsiPer = 2 // 2ONCE cumrsiEnterLongThreshold = 160 // 160ONCE cumrsiEnterShortThreshold = 60 // 60// TRAILINGSTOP//----------------------------------------------atrtrail = AverageTrueRange[atrtrailingperiod]((close/10)*pointsize)//atrtrail = AverageTrueRange[atrtrailingperiod]((close/10)*pointsize)/1000 // for indices divided for 1000trailingstartl = round(atrtrail*trailingstoplong) //trailing stop start and distancetrailingstartS = round(atrtrail*trailingstopshort)if trailingStopType = 1 THENTGL =trailingstartlTGS=trailingstartsif not onmarket thenMAXPRICE = 0MINPRICE = closePREZZOUSCITA = 0ENDIFif longonmarket thenMAXPRICE = MAX(MAXPRICE,close)if MAXPRICE-tradeprice(1)>=TGL*pointsize thenif MAXPRICE-tradeprice(1)>=MINSTOP thenPREZZOUSCITA = MAXPRICE-TGL*pointsizeELSEPREZZOUSCITA = MAXPRICE - MINSTOP*pointsizeENDIFENDIFENDIFif shortonmarket thenMINPRICE = MIN(MINPRICE,close)if tradeprice(1)-MINPRICE>=TGS*pointsize thenif tradeprice(1)-MINPRICE>=MINSTOP thenPREZZOUSCITA = MINPRICE+TGS*pointsizeELSEPREZZOUSCITA = MINPRICE + MINSTOP*pointsizeENDIFENDIFENDIFif onmarket and PREZZOUSCITA>0 thenEXITSHORT AT PREZZOUSCITA STOPSELL AT PREZZOUSCITA STOPENDIFENDIF// FILTER SETTING///BILL WILLIAM FRACTAL INDICATOR//CP=PERIODif Close[cp] >= highest[2*cp+1](Close) thenLH = 1elseLH = 0endifif Close[cp] <= lowest[2*cp+1](Close) thenLL = -1elseLL = 0endifif LH = 1 thenHIL = Close[cp]endifif LL = -1 thenLOL = Close[cp]endifPTN01 = (close CROSSES OVER HIL)PTN02 = (close CROSSES UNDER LOL)// CUMRSICUMRSI = SUMMATION[CUMRSIPER](RSI[CUMRSIPER](close))// ENTRYcumrsiFilterEnterLong = (cumrsi > cumrsiEnterLongThreshold)cumrsiFilterEnterShort = (cumrsi < cumrsiEnterShortThreshold)//MOVING AVERAGElongAvg = Average[avgLongPeriod] (close)//EnteravgFilterEnterLong = (close>longAvg)avgFilterEnterShort = (close<longAvg)//--------------------------------------------------------------------------------------------------// STRATEGY//--------------------------------------------------------------------------------------------------if (time >=100000 and time < 230000) thenIF NOT LongOnMarket AND avgFilterEnterLong AND PTN01 AND cumrsiFilterEnterLong THENBUY 1 CONTRACT AT MARKETENDIFIF NOT ShortOnMarket AND avgFilterEnterShort AND PTN02 AND cumrsiFilterEnterShort THENSELLSHORT 1 CONTRACT AT MARKETENDIFENDIF// Condizioni per uscire da posizioni longIF POSITIONPERF<0 THENIF LongOnMarket AND BARINDEX-TRADEINDEX(1)>= barLong THENSELL AT MARKETENDIFENDIFIF POSITIONPERF<0 THENIF shortOnMarket AND BARINDEX-TRADEINDEX(1)>= barshort THENEXITSHORT AT MARKETENDIFENDIFSET STOP %LOSS perclossSET TARGET %PROFIT percprofitgraph tglgraph tgs09/02/2019 at 10:26 AM #106203Strange I get better looking equity curve on DAX and DJI than I do on EURUSD over 100k bars, Spread = 2 in all images attached.
My results auger well for the strategy being robust (good on 2 Markets, maybe more? )
Why are my results on eurusd not good over 100k bars (3rd image attached). If I look at half of your equity curve over 200k bars on eurusd then yours increases steadily, mine does not!
Ill go check timezones in the code and amend to match yours in Sweden.
Thanks anyway for sharing.
I have set it going on Demo DAX 1H for now.
09/02/2019 at 10:32 AM #106208Ill go check timezones
Yeah that was it … Times at Line 104 … knocked 1 hour off (to get same as Sweden) better equity curves on all 3 Markets now!
Nice one Stefan! 🙂
1 user thanked author for this post.
09/02/2019 at 10:33 AM #10621009/02/2019 at 10:42 AM #106212knocked 1 hour off (to get same as Sweden)
I meant I set your 100000 (Sweden UTC +2) to 090000 (UTC+1 in UK)
1 user thanked author for this post.
-
AuthorPosts
