This automated trading strategy is built upon pseudo renko chart on ordinary candlesticks one.
Originally coded by request on French forums, this strategy use a combination of the renko on chart indicator available here : http://www.prorealcode.com/prorealtime-indicators/renko-boxes-on-price-chart/ and a moving average built within the close of each renko brick. The strategy consist of a simple cross over of the renko close and the moving average.
This code seems to work well on DAX on a 15 minutes timeframe. I know renko don’t deal with time, but my simple test shows that conditions which are tested only one time per bar are giving good results on this timeframe. I don’t have test much on any other instrument or other timeframe though. But it would certainly be profitable with any other ones as there are only 2 parameters to set : the brick size (20 points default size) and the moving average period (20 periods by default), which are quiet common and may not be so curve fitted..
Test were made with 1 point spread.
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 |
defparam cumulateorders = false bsize = 20 //renko size in points mmperiod = 20 //moving average period orderstime = 300 //minimum seconds between 2 orders boxsize = bsize*pipsize once topprice = close once bottomprice = close - boxsize*pipsize*2 if(close > topprice + boxsize*2) THEN topprice = close bottomprice = topprice - boxsize*2 barclose=topprice ELSIF (close < bottomprice - boxsize*2) THEN bottomprice = close topprice = bottomprice + boxsize*2 barclose = bottomprice ELSE topprice = topprice bottomprice = bottomprice ENDIF mm = average[mmperiod](barclose) if barclose=barclose[1] then mmRENKO = mmRENKO[1] else mmRENKO = mm endif if barclose crosses over mmRENKO AND ABS(time-lasttime)>orderstime then BUY 1 SHARES AT MARKET EXITSHORT AT MARKET lasttime=time endif if barclose crosses under mmRENKO AND ABS(time-lasttime)>orderstime then SELLSHORT 1 SHARES AT MARKET SELL AT MARKET lasttime=time endif |
Share this
No information on this site is investment advice or a solicitation to buy or sell any financial instrument. Past performance is not indicative of future results. Trading may expose you to risk of loss greater than your deposits and is only suitable for experienced investors who have sufficient financial means to bear such risk.
ProRealTime ITF files and other attachments :PRC is also on YouTube, subscribe to our channel for exclusive content and tutorials
Hello Nicolas,
Nice Code ! I was just looking to make my own Renko system, because I think Renko is really profitable on the long term. My manual backtests on Renko show very profitable tests with acceptable drawdown, but I haven’t test sufficient data.
I have my own trading rules for Renko, maybe I will post my own code when I create it.Best regards,
Thanks. Graphical representations that rely only on price and not time are always more accurate (renko,range,tick bars). I encourage your research in this way 🙂
This system is only a simple price over moving average. The way I changed the moving average calculation to not take time into consideration would be adapted to any other indicators, such as Supertrend, RSI and so on..
best equity curve in the site , and with spread included …..
@ nicolas : penses tu que les positions du backtest correspondent a celles qui auraient ete prise en reel ?
Yes I think it would be the same as in real time trading, it not use any kind of takeprofit, stoploss or trailing stop, just stop and reverse orders and trade open and close cannot be in the same candle.
The worst thing in this strategy is that you are always in the market and you have to deal with overnight fees which are not included.
Spread are also larger in the evening on DAX. But this strategy were made by request on forum, I saw it could gave good results, so here it is. DAX was the opened chart when I coded this strategy, anyone can test it with any other instrument with different bricks size and moving average period, it can surely give an edge on fine equity elsewhere or be part of an automated trading strategies portfolio.
ok merci !
Evening Nicolas,
Just had a quick look and backtesting a further 4 years to 2008 does not produce very good results.
I realise this system is very simple at this stage and not complete.
I do want to explore the use of renko on time based charts myself so this code will be helpful I’m sure.
Thanks.
Yes you are right this is a simple system as we are only talking about 2 “lines in the sand” that cross each other.. 🙂
Thanks Nicolas,
Very fluctuant results (very good in 5 mn, very bad in 1 mn…)
Personnaly, I never found good results with renko (signals appear very late…)
Have a nice day
Zilliq
Since it doesn’t use any hard stoploss or takeprofit, we can stick on any timeframe that give good results.
Hi all, Hello Nicolas,
I’ve just coded another Renko strategy, with the same DAX M15 (to make a comparison)
Buy I have the same problem : the test is (very) positive only after 2013. Before, results are quite bad.Do you have an idea : why ?
I wouldn’t bet on a strategy that wins for only the last 2 years, whereas it wasn’t profitable for the 5 years before…
Thanks for your advice.
Intraday randomish patterns, post subprimes crises, price random walk, curve fitted strategy maybe? Are you talking about this one or another one? Because this one haven’t been tested by myself previous this date.
Also, renko bars are point fixed and reflect price movement (20 points here), which can be a serious parametric bias. I know some people like to adapt renko bar size with division of daily ATR, this is another idea of improvement.
Yes, I was talking of your strategy, and my own code. And the results are really different according to the box size. So I think that I can’t bet on this strategy. Maybe with much improvemenets…
It’s renko bricks size. 20 points mean nothing more than 13 or 17 ones! Also, please consider that renko bricks construction begin at the very first price of the loaded history, so 20 bricks size would have been completely different if history begin 10.000 bars ago than 12.000 bars.. Equity curve of a backtest is a line on a computer screen, there’s so much more behind it.. 😉
Nicolas
Just been studying your strategy, is this something you still run live? How have your results been? Could you possibly add money management so i can reinvest the strategy profit?
Mark
I’m not trading it, this is a concept about trading renko bricks on price chart with ProOrder which is normally not possible with renko charts. Of course this strategy can be traded with the renko bricks size you want. About money management, you can add your request on forums and I’ll answer your request there. Thank you.
Hello Everyone.. I am new to Forex as well as to prerealcode. Could anyone suggest me how to use the above code in EA or anyone one has the EA with above code? Thanks in advance.
Peak.
You can download the above code in .itf file formant and import it directly into your trading platform, just follow these instructions: https://www.prorealcode.com/import-export-prorealtime-code-platform/
Thanks Nicolas. Can I get the above code in mq4 format. Many thanks in advance.
Peak.
No. This website is about prorealtime trading platform, not MT4 sorry. However, you can ask for custom coding on this page: https://www.prorealcode.com/trading-programming-services/
Interesting code, thanks! It will provide me with a good starting point for further development and testing.
One question: Why do you multiply boxsize by 2? I am sure there is a simple reason, but right now I am feeling thick-headed and not able to figure out why by myself.
Wishing you a festive christmas season!
/Fredrik
contrarian renko boxes are 2 times taller than the brick size.