Renko automatic trading
Forums › ProRealTime English forum › ProOrder support › Renko automatic trading
- This topic has 66 replies, 17 voices, and was last updated 4 years ago by 孫榗溢.
-
-
09/29/2020 at 2:03 PM #145834
I’m back experimenting in renko-land. I think there’s potential in this. Has anyone experimented with running simultaneous strategies with different box sizes? I.e, backtest show a nice equity curve with box size 50, then launch 5 strategies with small lot size at renko box 40, 45, 50, 55, 60? one could experiment with different trailing stop settings on each strategy too to diversify further. I get a really nice equity curve with Doctrading “Pure Renko” strategy. I still believe that having a dynamic box size is better but haven’t yet figured it out. Maybe if one look at the relationship between a moving average and the daily price with a multiplier?
I will launch some bots in demo and will let you know what the results are.
As always, any ideas would be welcome.
09/29/2020 at 2:10 PM #14583609/29/2020 at 2:16 PM #14583709/29/2020 at 3:42 PM #14585209/29/2020 at 4:44 PM #14587309/29/2020 at 5:04 PM #14587510/08/2020 at 11:57 PM #14679510/09/2020 at 6:01 AM #14680410/09/2020 at 7:31 AM #146816Only post in the language of the forum that you are posting in. For example English only in the English speaking forums and French only in the French speaking forums.
Thank you 🙂
10/09/2020 at 9:27 PM #146933@Fab28 I’m using a custom trend indicator bought from one of the guys here on the forum so the code won’t work unless you have that indicator. If I can adapt the strategy with supertrend I can post it here but at the moment it’s relying on this indicator.
10/10/2020 at 12:21 AM #14694812/08/2020 at 2:04 PM #152973That looks interesting. Can you say which custom indicator, am curious to take a look?
Thanks,
S
12/11/2020 at 12:40 AM #153295Hi @Paul and @samsampop
Sorry, I haven’t been very active recently. I revisited this code and it seems to have some potential. With minimal optimisation it still produces a good back test. It breaks all the rules, too many parameters, too little historic data etc. But I’m still interested in this kind of automatic scalping strategies. Any ideas would be welcome. The custom indicator (Perfect Trend Filter) is made by @aleale from his website.
123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286defparam cumulateorders = false// MM startequity = 1000+STRATEGYPROFITrisk=0.3TF=15if OpenDayofWeek = 0 then//OkToTrade = 0elsif OpenDayofWeek = 1 then // MondayDailyRange=max(abs(Dhigh(2)-Dlow(2)),max(abs(Dhigh(2)-Dclose(3)),abs(Dlow(2)-Dclose(3))))elsif OpenDayofWeek = 2 then // TuesdayDailyRange=max(abs(Dhigh(1)-Dlow(1)),max(abs(Dhigh(1)-Dclose(3)),abs(Dlow(1)-Dclose(3))))elseDailyRange=max(abs(Dhigh(1)-Dlow(1)),max(abs(Dhigh(1)-Dclose(2)),abs(Dlow(1)-Dclose(2))))endifDailyRange=max(abs(Dhigh(0)-Dlow(0)),DailyRange)DailyATR=wilderaverage[20*TF](DailyRange)a = (equity*risk)/(DailyATR)t = a * 100x = 0// .25 decimal position sizesincrementsize = 25while x < t dox = x + incrementsizeif x > t thenif x - t > incrementsize/2 thenx = x - incrementsizeendifPositionSize = (x/100)breakendifwend//once positionsize = 0.2timeframe (1 minute)//12:1 filter by VonasiPeriod = 12Divider = 2Filter = (close - open[Period - 1]) - (close - open[(Period / Divider) - 1])if filter > 0 thenbull = 1elsebull = 0endifif filter < 0 thenbear =1elsebear = 0endif//12:1 filter endtimeframe (2 minutes)trendfilter, ignored = CALL "$AT.IT Perfect Trend Filter"[4, 0]if close > trendfilter thentrend = 1elsetrend = -1endif// ZEX indicatortimeframe (1 minute)a1=SMI[20,6,5](close)b1=triangularaverage[5](a1)zex1=1.618*(a1-b1)////timeframe (30 seconds)//a2=SMI[12,6,5](close)//b2=triangularaverage[5](a2)//zex2=1.682*(a2-b2)////timeframe (20 seconds)//a3=SMI[12,6,5](close)//b3=triangularaverage[5](a3)//zex3=1.682*(a3-b3)timeframe (Default)//renko codeboxsize = 17 //17.1volumesize=average[21](volume)*10volumesum = volumesum+volumeonce renkoMax = ROUND(close / boxSize) * boxSizeonce renkoMin = renkoMax - boxSizeIF high > renkoMax + boxSize and volumesum-lastvolume>=volumesize THENWHILE high > renkoMax + boxSizerenkoMax = renkoMax + boxSizerenkoMin = renkoMin + boxSizelastvolume = volumesumWENDELSIF low < renkoMin - boxSize and volumesum-lastvolume>=volumesize THENWHILE low < renkoMin - boxSizerenkoMax = renkoMax - boxSizerenkoMin = renkoMin - boxSizelastvolume = volumesumWENDENDIF// trend filterif trend=1 and bull and zex1 > 0 thenbuysignal = 1elsebuysignal = 0endifif trend=-1 and bear and zex1 < 0 thensellsignal = 1elsesellsignal = 0endif//entry conditionsif not onmarket and buysignal thenbuy positionsize contract at renkoMax + boxSize stopelsif not onmarket and sellsignal thensellshort positionsize contract at renkoMin - boxSize stopendiffastrsi = rsi[2]maxposition=positionsize*2if countofposition<=maxposition thenif longonmarket and fastrsi crosses under 30 thenbuy positionsize contract at marketendifif shortonmarket and fastrsi crosses over 70 thensellshort positionsize contract at marketendifendif// stop lossMaxStopValue = round(equity*risk)set stop ploss maxstopvalue//// close long position when price reverses//if longonmarket and trend=-1 and bear=1 then//longexit2 = 1//else//longexit2 = 0//endif////// close short position when price reverses//if shortonmarket and trend=1 and bull=1 then//shortexit2 = 1//else//shortexit2 = 0//endif//////if longonmarket and longexit2=1 then//sell positionsize contract at market//sellshort positionsize contract at market//longexit2=0//endif////if shortonmarket and shortexit2=1 then//exitshort positionsize contract at market//buy positionsize contract at market//shortexit2=0//endif////if longonmarket and sellsignal then//sell at market//buy positionsize contract at market//endif////if shortonmarket and buysignal then//sellshort at market//buy positionsize contract at market//endif//timeframe (Default)//trailing stop functiontrailingstart = 13 //15.7 //trailing will start @trailinstart points profittrailingstep = 2.9 //trailing step to move the "stoploss"//reset the stoploss valueIF NOT ONMARKET THENnewSL=0ENDIF//manage long positionsIF LONGONMARKET THEN//first move (breakeven)IF newSL=0 AND close-tradeprice(1)>=trailingstart*pipsize THENnewSL = tradeprice(1)+trailingstep*pipsizeENDIF//next movesIF newSL>0 AND close-newSL>=trailingstep*pipsize THENnewSL = newSL+trailingstep*pipsizeENDIFENDIF//manage short positionsIF SHORTONMARKET THEN//first move (breakeven)IF newSL=0 AND tradeprice(1)-close>=trailingstart*pipsize THENnewSL = tradeprice(1)-trailingstep*pipsizeENDIF//next movesIF newSL>0 AND newSL-close>=trailingstep*pipsize THENnewSL = newSL-trailingstep*pipsizeENDIFENDIF//stop order to exit the positionsIF newSL>0 THENSELL AT newSL STOPEXITSHORT AT newSL STOPENDIFtimeframe (20 seconds)// reversal exitonce longexit =1once shortexit=1if longexit thenif longonmarket thenminrangedistL=1cl1=close<open and close[1]<open[1] and close[2]<open[2]cl2=(close=low or close[1]=low[1] or close[2]=low[2])cl3=(range>(close/1000)*minrangedistL or range[1]>(close[1]/1000)*minrangedistL or range[1]>(close[1]/1000)*minrangedistL)if cl1 and cl2 and cl3 thensell at marketsellshort positionsize contract at marketendifendifendifif shortexit thenif shortonmarket thenminrangedistS=1cs1=close>open and close[1]>open[1] and close[2]>open[2]cs2=(close=high or close[1]=high[1] or close[2]=high[2])cs3=(range>(close/1000)*minrangedistS or range[1]>(close[1]/1000)*minrangedistS or range[1]>(close[1]/1000)*minrangedistS)if cs1 and cs2 and cs3 thenexitshort at marketbuy positionsize contract at marketendifendifendif// Friday 22:00 Close ALL operations.IF DayOfWeek = 5 AND time = 214500 THENSELL AT MARKETEXITSHORT AT MARKETENDIFset stop %loss 0.51 user thanked author for this post.
12/11/2020 at 10:10 AM #15333212/11/2020 at 10:55 AM #153345 -
AuthorPosts
Find exclusive trading pro-tools on