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
-
-
02/25/2020 at 11:10 AM #120404
edit : new topic from https://www.prorealcode.com/topic/why-is-backtesting-so-unreliable/
According to IG Status Page … all trading platforms are now sorted!! See attached.
This Renko code is the only code I am still getting Rejects / Stoppages on (up to now anyway!?).
Only major difference I can see between this System and my others is the use of While, Wend? Maybe While. Wend has recently become a non-approved term anymore??
@Nonetheless would it be easy for you to re-code without While, Wend? I know the code is a DocTrading code so maybe it not easy for you either?If one of our coding wizards might be able to help it would be much appreciated?
Below is the code of the System that is showing +£1.8K profit since October (see attached).
1234567891011121314151617181920212223242526272829//-------------------------------------------------------------------------// Main code : Nneless Renko DJI 1M v1//-------------------------------------------------------------------------//https://www.prorealcode.com/topic/why-is-backtesting-so-unreliable/#post-110889// Definition of code parametersDEFPARAM CumulateOrders = False // Cumulating positions deactivated// The system will cancel all pending orders and close all positions at 0:00. No new ones will be allowed until after the "FLATBEFORE" time.//DEFPARAM FLATBEFORE = 143000// Cancel all pending orders and close all positions at the "FLATAFTER" time//DEFPARAM FLATAFTER = 210000boxSize = 110 //50once renkoMax = ROUND(close / boxSize) * boxSizeonce renkoMin = renkoMax - boxSizeIF high > renkoMax + boxSize THENWHILE high > renkoMax + boxSizerenkoMax = renkoMax + boxSizerenkoMin = renkoMin + boxSizeWENDELSIF low < renkoMin - boxSize THENWHILE low < renkoMin - boxSizerenkoMax = renkoMax - boxSizerenkoMin = renkoMin - boxSizeWENDENDIFbuy 1 CONTRACT at renkoMax + boxSize stopsellshort 1 CONTRACT at renkoMin - boxSize stop// Stops and targetsSET STOP PLOSS 75SET TARGET PPROFIT 15002/25/2020 at 11:58 AM #120416maybe this?
1234567IF high > renkoMax + boxSize THENrenkoMax = renkoMax + boxSizerenkoMin = renkoMin + boxSizeELSIF low < renkoMin - boxSize THENrenkoMax = renkoMax - boxSizerenkoMin = renkoMin - boxSizeENDIF3 users thanked author for this post.
02/25/2020 at 12:19 PM #120422Hahaha … nice one Paul!
Your change works (same profits etc) and System has NOT been rejected!
Feeling guilty now that I didn’t persevere with the code.
I had heard others on here mention While, Wend and the terms are on here under approved probuilder language documentation and so I doubted this would be the Issue, but seems it is!
Now I can try my other forks piling up ready to be Forward Tested!
Onward and Upward!
Thank You
Grahal1 user thanked author for this post.
02/25/2020 at 12:29 PM #120423showing +£1.8K profit since October
That is not too shabby at all, thanks to DocTrading (and also to Paul!) who did the heavy lifting…
02/25/2020 at 1:42 PM #120437@nonetheless it would make sense / logical to ask the Mods to change the name of this Topic to …
Discussion re Pure Renko strategy
https://www.prorealcode.com/prorealtime-trading-strategies/pure-renko-strategy/
Also there may be ‘some mileage‘ in checking out the other two Renko Systems in the Library?
I keep meaning to, but my self-build is limiting my time for a while, sorry.
https://www.prorealcode.com/prorealtime-trading-strategies/renko-automated-trading-system/
02/25/2020 at 1:48 PM #120440now wondering if it could be used on a higher timeframe. Couldn’t resist! 100k tested so far on 15 min dow, spread 3.1
123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100//-------------------------------------------------------------------------// main code : nneless renko dji 1m v1//-------------------------------------------------------------------------//https://www.prorealcode.com/topic/why-is-backtesting-so-unreliable/#post-110889defparam cumulateorders = falsedefparam preloadbars = 1000timeframe (default)boxsize = 100once renkomax = round(close / boxsize) * boxsizeonce renkomin = renkomax - boxsizeif high > renkomax + boxsize thenrenkomax = renkomax + boxsizerenkomin = renkomin + boxsizeelsif low < renkomin - boxsize thenrenkomax = renkomax - boxsizerenkomin = renkomin - boxsizeendifctime=hour>=4if ctime thenbuy 1 contract at renkomax + boxsize stopsellshort 1 contract at renkomin - boxsize stopelseexitshort 1 contract at renkomax + boxsize stopsell 1 contract at renkomin - boxsize stopendif// trailingstop splitsed so it can run on higher timeframetimeframe (15 minutes,updateonclose)// trailing atr stoponce trailingstoptype = 1 // trailing stop - 0 off, 1 ononce trailingstoplong = 7 // trailing stop atr relative distanceonce trailingstopshort = 4 // trailing stop atr relative distanceonce atrtrailingperiod = 14 // atr parameter valueonce minstop = 10 // minimum trailing stop distance// trailingstop//----------------------------------------------atrtrail = averagetruerange[atrtrailingperiod]((close/10)*pipsize)/1000trailingstartl = round(atrtrail*trailingstoplong)trailingstarts = round(atrtrail*trailingstopshort)//if trailingstoptype thentgl =trailingstartltgs=trailingstartsif not onmarket or ((longonmarket and shortonmarket[1]) or (longonmarket[1] and shortonmarket)) thenmaxprice = 0minprice = closenewsl = 0endifif longonmarket thenmaxprice = max(maxprice,close)if maxprice-tradeprice(1)>=tgl*pointsize thenif maxprice-tradeprice(1)>=minstop thennewsl = maxprice-tgl*pointsizeelsenewsl = maxprice - minstop*pointsizeendifendifendifif shortonmarket thenminprice = min(minprice,close)if tradeprice(1)-minprice>=tgs*pointsize thenif tradeprice(1)-minprice>=minstop thennewsl = minprice+tgs*pointsizeelsenewsl = minprice + minstop*pointsizeendifendifendifendiftimeframe (default)if trailingstoptype thenif longonmarket thenif newsl>0 thensell at newsl stopendifendifif shortonmarket thenif newsl>0 thenexitshort at newsl stopendifendifendif// stops and targetsset stop %loss 2set target %profit 2graphonprice renkomax + boxsizegraphonprice renkomin - boxsize2 users thanked author for this post.
02/25/2020 at 2:08 PM #120447it would make sense / logical to ask the Mods to change the name of this Topic to … Discussion re Pure Renko strategy
Yes, absolutely … how do I go about that? I’m waving my arms but guess they can’t see me.
02/25/2020 at 2:11 PM #120448wondering if it could be used on a higher timeframe
Hey, my thoughts exactly! The 1m TF always seemed wrong. Now it’s really starting to look interesting…
02/25/2020 at 2:19 PM #12045002/25/2020 at 2:23 PM #120451how do I go about that?
@Vonasi or @RobertoGozzi might check out all the action on this Topic and now – as OP – you are asking for the title to be changed, they may sort it for us?Now Paul is onboard I can see us having all sorts Renko versions in this Topic so Mods please …
New Topic Required …
Renko Systems
02/25/2020 at 9:15 PM #120503there’s a bug at monday 00.00.00 where there shouldn’t be an entry. With the bug the results are better though.
pics are with spread 100k & 200k
123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118//-------------------------------------------------------------------------// main code : nneless renko dji 15min v1//-------------------------------------------------------------------------//https://www.prorealcode.com/topic/why-is-backtesting-so-unreliable/#post-110889defparam cumulateorders = falsedefparam preloadbars = 1000timeframe (default)once bugfix=0 // [1] activate bugfix monday time 00.00.00once boxsize = 100once renkomax = round(close / boxsize) * boxsizeonce renkomin = renkomax - boxsizeif high > renkomax + boxsize thenrenkomax = renkomax + boxsizerenkomin = renkomin + boxsizeelsif low < renkomin - boxsize thenrenkomax = renkomax - boxsizerenkomin = renkomin - boxsizeendifcondbuy=1condsell=1ctime=hour>=3if bugfix thenif dayofweek=5[1] and (hour[1]=22 or hour[1]=21) thenskipmondayfirsthour=0elseskipmondayfirsthour=1endifelseskipmondayfirsthour=1endifif ctime thenif skipmondayfirsthour thenif condbuy thenbuy 1 contract at renkomax + boxsize stopendifif condsell thensellshort 1 contract at renkomin - boxsize stopendifendifendif// trailingstop splitsed so it can run on higher timeframetimeframe (15 minutes,updateonclose)// trailing atr stoponce trailingstoptype = 1 // trailing stop - 0 off, 1 ononce trailingstoplong = 7 // trailing stop atr relative distanceonce trailingstopshort = 4 // trailing stop atr relative distanceonce atrtrailingperiod = 14 // atr parameter valueonce minstop = 10 // minimum trailing stop distance// trailingstop//----------------------------------------------atrtrail = averagetruerange[atrtrailingperiod]((close/10)*pipsize)/1000trailingstartl = round(atrtrail*trailingstoplong)trailingstarts = round(atrtrail*trailingstopshort)//if trailingstoptype thentgl =trailingstartltgs=trailingstartsif not onmarket or ((longonmarket and shortonmarket[1]) or (longonmarket[1] and shortonmarket)) thenmaxprice = 0minprice = closenewsl = 0endifif longonmarket thenmaxprice = max(maxprice,close)if maxprice-tradeprice(1)>=tgl*pointsize thenif maxprice-tradeprice(1)>=minstop thennewsl = maxprice-tgl*pointsizeelsenewsl = maxprice - minstop*pointsizeendifendifendifif shortonmarket thenminprice = min(minprice,close)if tradeprice(1)-minprice>=tgs*pointsize thenif tradeprice(1)-minprice>=minstop thennewsl = minprice+tgs*pointsizeelsenewsl = minprice + minstop*pointsizeendifendifendifendiftimeframe (default)if trailingstoptype thenif longonmarket thenif newsl>0 thensell at newsl stopendifendifif shortonmarket thenif newsl>0 thenexitshort at newsl stopendifendifendif// stops and targetsset stop %loss 2set target %profit 2graphonprice renkomax + boxsizegraphonprice renkomin - boxsize3 users thanked author for this post.
02/26/2020 at 11:52 AM #120545Sadly the robustness test is a bust for this one. Odd because I had thought that Renko bars were time independent and that it might perform better than most. 🤔
02/26/2020 at 1:03 PM #12055102/26/2020 at 1:05 PM #120552Here’s an interesting development. Starting with the 1m version that @Grahal was running I added a trailing stop, tweaked the boxsize, stop and TP — ran it on daily TF for a 20 year back test.
Very low % win but the stop loss is just .1% so it works even with lots of small losses. WF is as good as it gets, robustness checks out…
1 user thanked author for this post.
02/26/2020 at 1:10 PM #120555 -
AuthorPosts
Find exclusive trading pro-tools on