Forums › ProRealTime English forum › ProOrder support › Discussion re Pure Renko strategy › Reply To: Discussion re Pure Renko strategy
05/07/2020 at 2:31 AM
#130363
This is what i’am testing. It provided some nice profits before, now it doesn’t look good in a backtest.
Goal is more to have consistent opening-trades from the backtest & live.
I removed a few lines which defined renkomax/min and didn’t expect it would work but it did.
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 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 |
//------------------------------------------------------------------------- // Hoofd code : Renko dji 5s A3.1 //------------------------------------------------------------------------- defparam cumulateorders = false defparam preloadbars = 1000 defparam flatbefore = 080000 defparam flatafter = 173000 once tradetype = 1 // [1]long&short;[2]long;[3]short boxsizeL=40 boxsizeS=30 // strategy ctime= time>=080000 and time<150000 if close > renkomax + boxsizeL and not (close < renkomin - boxsizeS) then renkomax = renkomax + boxsizeL renkomin = renkomin + boxsizeL endif if close < renkomin - boxsizeS and not (close > renkomax + boxsizeL) then renkomax = renkomax - boxsizeS renkomin = renkomin - boxsizeS endif // conditions condbuy=high > (renkomax + boxsizeL) condbuy=condbuy and open<>close and low<>close and open<>high condsell=low < (renkomin - boxsizeS) condsell=condsell and open<>close and high<>close and open<>low // entry if ctime then If (tradetype=1 or tradetype=2) then if condbuy and not longonmarket then buy 1 contract at market endif endif if (tradetype=1 or tradetype=3) then if condsell and not shortonmarket then sellshort 1 contract at market endif endif endif // trailing atr stop once trailingstoptype = 1 // trailing stop - 0 off, 1 on once steps = 0.1 // set to 0 to ignore steps once minatrdist= 1.0 once atrtrailingperiod = 14 // atr parameter once minstop = 10 // minimum trailing stop distance once sensitivityts = 0 // [0]close;[1]high/low if trailingstoptype then if barindex=tradeindex then trailingstoplong = 3 // trailing stop atr distance trailingstopshort = 3 // trailing stop atr distance else if longonmarket then if newsl>0 then if trailingstoplong>minatrdist then if newsl>newsl[1] then trailingstoplong=trailingstoplong else trailingstoplong=trailingstoplong-steps endif else trailingstoplong=minatrdist endif endif endif if shortonmarket then if newsl>0 then if trailingstopshort>minatrdist then if newsl<newsl[1] then trailingstopshort=trailingstopshort else trailingstopshort=trailingstopshort-steps endif else trailingstopshort=minatrdist endif endif endif endif // atrtrail=averagetruerange[atrtrailingperiod]((close/10)*pipsize)/1000 tgl=round(atrtrail*trailingstoplong) tgs=round(atrtrail*trailingstopshort) if not onmarket or ((longonmarket and shortonmarket[1]) or (longonmarket[1] and shortonmarket)) then maxprice=0 minprice=close newsl=0 endif // if sensitivityts then sensitivitytslong=high sensitivitytsshort=low else sensitivitytslong=close sensitivitytsshort=close endif // if longonmarket then maxprice=max(maxprice,sensitivitytslong) 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,sensitivitytsshort) 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 // if longonmarket then if newsl>0 then sell at newsl stop endif if newsl>0 then if low crosses under newsl then sell at market //when stop is rejected endif endif endif // if shortonmarket then if newsl>0 then exitshort at newsl stop endif if newsl>0 then if high crosses over newsl then exitshort at market //when stop is rejected endif endif endif endif set stop %loss .4 |