Forums › ProRealTime English forum › ProOrder support › Discussion re Pure Renko strategy › Reply To: Discussion re Pure Renko strategy
02/25/2020 at 1:48 PM
#120440
now wondering if it could be used on a higher timeframe. Couldn’t resist! 100k tested so far on 15 min dow, spread 3.1
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 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 |
//------------------------------------------------------------------------- // main code : nneless renko dji 1m v1 //------------------------------------------------------------------------- //https://www.prorealcode.com/topic/why-is-backtesting-so-unreliable/#post-110889 defparam cumulateorders = false defparam preloadbars = 1000 timeframe (default) boxsize = 100 once renkomax = round(close / boxsize) * boxsize once renkomin = renkomax - boxsize if high > renkomax + boxsize then renkomax = renkomax + boxsize renkomin = renkomin + boxsize elsif low < renkomin - boxsize then renkomax = renkomax - boxsize renkomin = renkomin - boxsize endif ctime=hour>=4 if ctime then buy 1 contract at renkomax + boxsize stop sellshort 1 contract at renkomin - boxsize stop else exitshort 1 contract at renkomax + boxsize stop sell 1 contract at renkomin - boxsize stop endif // trailingstop splitsed so it can run on higher timeframe timeframe (15 minutes,updateonclose) // trailing atr stop once trailingstoptype = 1 // trailing stop - 0 off, 1 on once trailingstoplong = 7 // trailing stop atr relative distance once trailingstopshort = 4 // trailing stop atr relative distance once atrtrailingperiod = 14 // atr parameter value once minstop = 10 // minimum trailing stop distance // trailingstop //---------------------------------------------- atrtrail = averagetruerange[atrtrailingperiod]((close/10)*pipsize)/1000 trailingstartl = round(atrtrail*trailingstoplong) trailingstarts = round(atrtrail*trailingstopshort) // if trailingstoptype then tgl =trailingstartl tgs=trailingstarts if not onmarket or ((longonmarket and shortonmarket[1]) or (longonmarket[1] and shortonmarket)) then maxprice = 0 minprice = close newsl = 0 endif if longonmarket then maxprice = max(maxprice,close) if maxprice-tradeprice(1)>=tgl*pointsize then if maxprice-tradeprice(1)>=minstop then newsl = maxprice-tgl*pointsize else newsl = maxprice - minstop*pointsize endif endif endif if shortonmarket then minprice = min(minprice,close) if tradeprice(1)-minprice>=tgs*pointsize then if tradeprice(1)-minprice>=minstop then newsl = minprice+tgs*pointsize else newsl = minprice + minstop*pointsize endif endif endif endif timeframe (default) if trailingstoptype then if longonmarket then if newsl>0 then sell at newsl stop endif endif if shortonmarket then if newsl>0 then exitshort at newsl stop endif endif endif // stops and targets set stop %loss 2 set target %profit 2 graphonprice renkomax + boxsize graphonprice renkomin - boxsize |