Hello,
Is it possible to create an automated trading system using Renko Bars?
If so, could you tell me how to get started please?
How do I define a renko bar instead of a normal candle?
Thank you.
Searching the forum for the word RENKO will return the info you need.
You can also browse https://www.prorealcode.com/topics-tag/renko/.
Is it possible in PRT to show the result of a backtest on a Renko chart – with the little buy/sell arrows etc. just to see if the Renko code is working as intended
Topic moved to ProOrder forum as your questions are strategy related and not indicator related. Please try to post in the most relevant forum for your topic with future questions.
I cannot find the post in the ProOrder Form. Could you post a link please?
How come you could post here without knowing where this place is?!
Is it possible in PRT to show the result of a backtest on a Renko chart – with the little buy/sell arrows etc. just to see if the Renko code is working as intended
I hope Nicolas or someone else can help you.
I posted some links and gave you a few hints on how to find info, but I never dealt with Renko bars myself.
Did you read those posts? I remember having read many times about Renko bars and TS’s.
I don’t think is possible with v10.3, but v11 should have some support for Renko charts.
It is not possible to run an automated trading strategy on renko chart, however we can simulate that kind of price representation in the code. This simple code is an example on how to achieve the same thing as the renko chart itself.
Defparam cumulateorders = false
boxSize = 40
once renkoMax = ROUND(close / boxSize) * boxSize
once renkoMin = renkoMax - boxSize
IF high > renkoMax + boxSize THEN
WHILE high > renkoMax + boxSize
renkoMax = renkoMax + boxSize
renkoMin = renkoMin + boxSize
WEND
ELSIF low < renkoMin - boxSize THEN
WHILE low < renkoMin - boxSize
renkoMax = renkoMax - boxSize
renkoMin = renkoMin - boxSize
WEND
ENDIF
buy at renkoMax + boxSize stop
sellshort at renkoMin - boxSize stop
Nicholas code added as Log 199 here …
Snippet Link Library
LéoParticipant
Average
Dear All,
I tried to add the calulation of the boxsize based on ATR but I must be missing something obvious as no trade is taken in backtest.
I tried Boxsize = Average[200](averagetruerange[14]); boxsize = averagetruerange[14] and boxsize = averagetruerange[14]*pipsize but nothin works.
If someone can point my mistake that would be helpful.
Best regards.
Alex
Defparam cumulateorders = false
boxsize = averagetruerange[14]*pipsize
once renkoMax = ROUND(close / boxSize) * boxSize
once renkoMin = renkoMax - boxSize
IF high > renkoMax + boxSize THEN
WHILE high > renkoMax + boxSize
renkoMax = renkoMax + boxSize
renkoMin = renkoMin + boxSize
WEND
ELSIF low < renkoMin - boxSize THEN
WHILE low < renkoMin - boxSize
renkoMax = renkoMax - boxSize
renkoMin = renkoMin - boxSize
WEND
ENDIF
buy at renkoMax + boxSize stop
sellshort at renkoMin - boxSize stop
Remove the pipsize multiplier.
LéoParticipant
Average
Hi Nicolas,
Thanks for your reply.
I tried also but it does not return any results.
Alex
Defparam cumulateorders = false
boxsize = averagetruerange[14]
once renkoMax = ROUND(close / boxSize) * boxSize
once renkoMin = renkoMax - boxSize
IF high > renkoMax + boxSize THEN
WHILE high > renkoMax + boxSize
renkoMax = renkoMax + boxSize
renkoMin = renkoMin + boxSize
WEND
ELSIF low < renkoMin - boxSize THEN
WHILE low < renkoMin - boxSize
renkoMax = renkoMax - boxSize
renkoMin = renkoMin - boxSize
WEND
ENDIF
buy at renkoMax + boxSize stop
sellshort at renkoMin - boxSize stop
It makes sense, the renko brick code you use seeks to fix the construction of the bricks to round numbers like the internal indicator of the platform does. Except if the ATR has a value so the rest of the division is not 0, then the code cannot fix the construction of the bricks and nothing happens. To build renko candles with the ATR, I will suggests this code:
boxsize = AverageTrueRange[14](close)
once topprice = close
once bottomprice = close - boxsize
if(high > topprice + boxsize*2) THEN
topprice = close
bottomprice = topprice - boxsize*2
ELSIF (low < bottomprice - boxsize*2) THEN
bottomprice = close
topprice = bottomprice + boxsize*2
ELSE
topprice = topprice
bottomprice = bottomprice
ENDIF
RETURN topprice as "box top", bottomprice as "bottom box"