Discussion re Pure Renko strategy
Forums › ProRealTime English forum › ProOrder support › Discussion re Pure Renko strategy
- This topic has 345 replies, 24 voices, and was last updated 4 years ago by bertrandpinoy.
Tagged: renko
-
-
05/19/2020 at 12:57 PM #132272
hello Paul would you share your version? cordially
05/19/2020 at 1:56 PM #132278a.tm. it’s basically the same as posted by AlexF minus/plus what I mentioned.
however I used an slightly updated breakeven stop, with the option to choose points or percentage. The way I ‘ve it, with stoploss of 0.4%, if atr distance is 1 or greater, the stoploss moves to -0.2%
12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970// breakeven stop atronce breakevenstoptype = 1 // breakeven stop - 0 off, 1 ononce bestoplong = 1 // breakeven stop atr relative distanceonce bestopshort = 1 // breakeven stop atr relative distanceonce beatrperiod = 14 // atr parameter valueonce beminstop = 0 // minimum breakeven stop distanceonce bepointsorperct= 0 //[0]percentage [1]pointsbepointstokeep = -0.2 // positive or negative //not use once//----------------------------------------------beatr = averagetruerange[beatrperiod]((close/10)*pipsize)/1000//beatr=averagetruerange[beatrperiod]((close/1)*pipsize) // (forex)bestopl = round(beatr*bestoplong)bestops = round(beatr*bestopshort)if breakevenstoptype thenif bepointsorperct thenbepointstokeep=bepointstokeepelsebepointstokeep=(tradeprice(1)/100)*bepointstokeepbepointstokeep=bepointstokeependifif not onmarket or ((longonmarket and shortonmarket[1]) or (longonmarket[1] and shortonmarket)) thenbemaxprice = 0beminprice = closebenewsl = 0endifif longonmarket thenbemaxprice = max(bemaxprice,close)if bemaxprice-tradeprice(1)>=bestopl*pointsize thenif bemaxprice-tradeprice(1)>=beminstop thenbenewsl=tradeprice(1)+bepointstokeep*pipsizeelsebenewsl=tradeprice(1)- beminstop*pointsizeendifendifendifif shortonmarket thenbeminprice = min(beminprice,close)if tradeprice(1)-beminprice>=bestops*pointsize thenif tradeprice(1)-beminprice>=beminstop thenbenewsl = tradeprice(1)-bepointstokeep*pipsizeelsebenewsl = tradeprice(1) + beminstop*pointsizeendifendifendifif longonmarket thenif benewsl>0 thensell at benewsl stopendifif benewsl>0 thenif low crosses under benewsl thensell at market //when stop is rejectedendifendifendifif shortonmarket thenif benewsl>0 thenexitshort at benewsl stopendifif benewsl>0 thenif high crosses over benewsl thenexitshort at market //when stop is rejectedendifendifendifendif2 users thanked author for this post.
06/16/2020 at 12:04 PM #13610906/16/2020 at 12:06 PM #13611006/16/2020 at 12:10 PM #13611106/16/2020 at 6:04 PM #136188Interesting system. Running AlexF version on backtest (no breakeven) with a percentage stop loss of 0.25 significantly improves the performance, all be it on the very limited data period available.
1234567891011// Condizioni per entrare su posizioni longIF tradeon AND entrylong THENBUY 0.5 CONTRACTS AT MARKETSET STOP %LOSS 0.25ENDIF// Condizioni per entrare su posizioni shortIF tradeon AND entryshort THENSELLSHORT 0.5 CONTRACTS AT MARKETSET STOP %LOSS 0.25ENDIF1 user thanked author for this post.
06/16/2020 at 9:48 PM #13619806/22/2020 at 7:24 PM #136817here’s some code for a fast timeframe.
For i.e. 5 seconds tf I use 0.5% stoploss, but prefer a faster exit for a loss. A faster exit results likely in a lower winchance though. But live creates often more max losses then a short backtest.
First code is a familiar one, created 2 variations.
12345678910111213141516171819202122232425262728293031323334353637383940414243// support & resistenceonce supportresistance = 0 // exit [0-1-2]//timeframe(30 seconds)if supportresistance thenpivotbar = 20lookback = 20barlookback = pivotbar + 1if low[pivotbar] < lowest[lookback](low)[barlookback] thenif low[pivotbar] = lowest[barlookback](low) thensupportprice = low[pivotbar]endifendifif high[pivotbar] > highest[lookback](high)[barlookback] thenif high[pivotbar] = highest[barlookback](high) thenresistanceprice = high[pivotbar]endifendifendiftimeframe(default)if supportresistance=1 thenif ((longonmarket and shortonmarket[1]) or (longonmarket and not onmarket[1])) thensup=supportpriceendifif ((shortonmarket and longonmarket[1]) or (shortonmarket and not onmarket[1])) thenres=resistancepriceendifelsif supportresistance=2 thensup=supportpriceres=resistancepriceendifif supportresistance=1 or supportresistance=2 thenif longonmarket thensell at sup stopendifif shortonmarket thenexitshort at res stopendifendifgraphonprice subgraphonprice rescode below is created from scratch. It takes the lowest low before a long entry for xx periods and starts recording new highs. There are 2 ways of exits. If you want a clear break you can set a breakvalue.
123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051// exitpivotonce exitpivot=2 // exit [0-1-2]//if exitpivot=1 or exitpivot=2 thenduration=360 // 720 = 1 hour lookback on 5sbreakvalue=0//if not onmarket thenprell=0prehh=0endifif longonmarket thenprehh=highest[max(1,(barindex-tradeindex))](high)endifif ((longonmarket and shortonmarket[1]) or (longonmarket and not onmarket[1])) thenprell=lowest[duration](low)endifif shortonmarket thenprell=lowest[max(1,(barindex-tradeindex))](low)endifif ((shortonmarket and longonmarket[1]) or (shortonmarket and not onmarket[1])) thenprehh=highest[duration](high)endifif onmarket thenfibpivot=(prehh-prell)*0.618elsefibpivot=0endifif exitpivot=1 thenif longonmarket thensell at (prehh-fibpivot)-breakvalue stopendifif shortonmarket thenexitshort at (prell+fibpivot)+breakvalue stopendifendifif exitpivot=2 thenif longonmarket thensell at prell-breakvalue stopendifif shortonmarket thenexitshort at prehh+breakvalue stopendifendifendifgraphonprice prehhgraphonprice prellgraphonprice prell+fibpivot coloured(255,0,0,255) as "short exit"graphonprice prehh-fibpivot coloured(0,0,255,255) as "long exit"06/25/2020 at 9:27 AM #137096So @Paul from all of your post what do you think is best running? AlexF orginal or do you have another 5s itf?
1 user thanked author for this post.
06/25/2020 at 4:31 PM #137152It takes the lowest low before a long entry
Forgive the daft question … am I missing something, there is no Buy or Sellshort?
Do I need to read earlier posts to get in the zone?? 🙂
06/25/2020 at 6:40 PM #137166Link to Paul’s 2 x Exit Strategies added as Log 226 here …
1 user thanked author for this post.
06/25/2020 at 7:01 PM #137167Thanks GraHal. Tested the plugin codes on alex version and results go down, regardless I’ve been using the plugins a.t.m. On the first code I used graphonprice sub which should be sup.
@franro, at the moment none of the codes here are good enough for me. Alex version doesn’t have a hardcoded stoploss. Very difficult timeframe!1 user thanked author for this post.
06/26/2020 at 4:01 AM #137198using atr trailingstop, but now includes a option to take profit near, at or above biglines
biglines can be defined with factor i.e. 50 every 50 points, 100 = every 100 points.
distance to take profit can be set. So if taken profit at every 100 lines (if trailingstop is active), it’s possible to take it say 15 points earlier profit.
Not really happy a.t.m. how things are rounded up/down and affect startlevel. Setup for 5s timeframe.
123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162once trailingstoptype = 1once biglineclose = 1 // depended on trailing stop// trailing atr stoponce tsatrperiod = 14 // ts atr parameteronce tsminstop = 10 // ts minimum stop distanceif tradetype=1 thenonce tsincrements = 0.0025 // set to 0 to ignore tsincrements //0.0025once tsminatrdist = 1once tssensitivity = 1 // [0]close;[1]high/lowelsif (tradetype=2 or tradetype=3) thenonce tsincrements = 0 // set to 0 to ignore tsincrementsonce tsminatrdist = 0once tssensitivity = 1 // [0]close;[1]high/lowendifif trailingstoptype thenif barindex=tradeindex thenif tradetype=1 thentrailingstoplong = 2 // ts atr distancetrailingstopshort = 2 // ts atr distanceelsif (tradetype=2 or tradetype=3) thentrailingstoplong = 4 // ts atr distancetrailingstopshort = 4 // ts atr distanceendifelseif longonmarket thenif tsnewsl>0 thenif trailingstoplong>tsminatrdist thenif tsnewsl>tsnewsl[1] thentrailingstoplong=trailingstoplongelsetrailingstoplong=trailingstoplong-tsincrementsendifelsetrailingstoplong=tsminatrdistendifendifendifif shortonmarket thenif tsnewsl>0 thenif trailingstopshort>tsminatrdist thenif tsnewsl<tsnewsl[1] thentrailingstopshort=trailingstopshortelsetrailingstopshort=trailingstopshort-tsincrementsendifelsetrailingstopshort=tsminatrdistendifendifendifendiftsatr=averagetruerange[tsatrperiod]((close/10)*pipsize)/1000//tsatr=averagetruerange[tsatrperiod]((close/1)*pipsize) // (forex)tgl=round(tsatr*trailingstoplong)tgs=round(tsatr*trailingstopshort)if not onmarket or ((longonmarket and shortonmarket[1]) or (longonmarket[1] and shortonmarket)) thentsmaxprice=0tsminprice=closetsnewsl=0endifif tssensitivity thentssensitivitylong=hightssensitivityshort=lowelsetssensitivitylong=closetssensitivityshort=closeendifif longonmarket thentsmaxprice=max(tsmaxprice,tssensitivitylong)if tsmaxprice-tradeprice(1)>=tgl*pointsize thenif tsmaxprice-tradeprice(1)>=tsminstop thentsnewsl=tsmaxprice-tgl*pointsizeelsetsnewsl=tsmaxprice-tsminstop*pointsizeendifendifendifif shortonmarket thentsminprice=min(tsminprice,tssensitivityshort)if tradeprice(1)-tsminprice>=tgs*pointsize thenif tradeprice(1)-tsminprice>=tsminstop thentsnewsl=tsminprice+tgs*pointsizeelsetsnewsl=tsminprice+tsminstop*pointsizeendifendifendifif longonmarket thenif tsnewsl>0 thensell at tsnewsl stopendifif tsnewsl>0 thenif low crosses under tsnewsl thensell at marketendifendifendifif shortonmarket thenif tsnewsl>0 thenexitshort at tsnewsl stopendifif tsnewsl>0 thenif high crosses over tsnewsl thenexitshort at marketendifendifendifif biglineclose thencurrentprice = round(tradeprice(1))mpmod = 100factor = 100 // defines linesabovelevel0 = currentprice mod mpmodstartlevel = currentprice - abovelevel0distance=0 //positive = more profit or negative = less profitif distance<0 thendistancel=distancedistances=-distanceelsif distance>0 thendistancel=distancedistances=-distanceelsedistancel=distancedistances=distanceendiflevel10up = (startlevel + (1*factor))+distancellevel20up = (startlevel + (2*factor))+distancellevel30up = (startlevel + (3*factor))+distancellevel10down = (startlevel - (1*factor))+distanceslevel20down = (startlevel - (2*factor))+distanceslevel30down = (startlevel - (3*factor))+distancesif longonmarket thenif tsnewsl>0 thensell at startlevel limitsell at level10up limitsell at level20up limitsell at level30up limitendifendifif shortonmarket thenif tsnewsl>0 thenexitshort at startlevel limitexitshort at level10down limitexitshort at level20down limitexitshort at level30down limitendifendifendifendifgraphonprice startlevelgraphonprice level10down coloured(255,0,0,255)graphonprice level20down coloured(255,0,0,255)graphonprice level10up coloured(0,0,255,255)graphonprice level20up coloured(0,0,255,255)1 user thanked author for this post.
06/26/2020 at 7:40 AM #137204Above added as Log 227 here …
06/26/2020 at 3:20 PM #137260@Paul If you wanna use a fast tf system, I strongly suggest to DO NOT use a fixed stoploss. It will be hit too much often and you will end compounding small losses and not getting good wins.
I suggest to code an hard exit stop loss, i.e. a signal that invalidate your entry, not necessarily the opposite of your signal, even something different like macd crossing 0.
This is what I use on my few intraday systems and it’s working.
2 users thanked author for this post.
-
AuthorPosts
Find exclusive trading pro-tools on