Renko Fixed (on price)

Renko Fixed (on price)

Here is a nice little code, finally I am proud of it !

Indeed in my beginnings, it was impossible for me to create Renko on prices.

What is the point of creating a Renko, as this graph can be already displayed on ProRealTime ?  

Well, simply because PRT can not backtest from Renko ! This means that we must create ourself a corresponding indicator.

That’s the purpose of this code, so you can backtest many strategies based on Renko, at last !  

This indicator has fixed-size boxes, that’s the “why” of its name. Actually, he still uses the closing price. It would be perfect if it used the current price whatsoever at any time. But I do not see me using other than the command “close” to determine the price at a given time.   For this graph and for example, I put this on the DAX, with fixed boxes of 100 points.

Share this

Risk disclosure:

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 : How to import ITF files into ProRealTime platform?

PRC is also on YouTube, subscribe to our channel for exclusive content and tutorials

  1. Doctrading • 05/06/2016 #

    I just see that there is an issue with some boxes, because of very BIG candles.
    The box remains as itself without moving, until the price crosses the other side.
    I will work on it.If someone knows the solution, it would be great.
     
    You can see attached picture at the bottom of the page :
    http://www.doctrading.fr/code-renko-fixed-sur-prix/

    • Nicolas • 05/06/2016 #

      It surely comes from the “crosses” instruction because it tests if a cross occur with a close on the previous candle, but do no test if the close is effectively above or below the tested level.

  2. Doctrading • 05/06/2016 #

    You are right.
    Just replace “crosses over” by “>” and “crosses under” by “<“, and it works !

  3. verdi55 • 05/06/2016 #

    Super short code, thank you. However, there is still a small issue when the difference of close and the old box limits is bigger than 2 * boxsize. The following improved code fixes this and makes this Renko indicator entirely identical to the built-in version :
     
    boxsize = 100

    once upbox = close
    once downbox = close - boxsize

    IF close >= upbox + boxsize THEN
    downbox = downbox + (round(((close - upbox) / boxsize) - 0.5)) * boxsize
    upbox = upbox + (round(((close - upbox) / boxsize) - 0.5)) * boxsize
    ELSIF close <= downbox - boxsize THEN
    upbox = upbox - (round(((downbox - close) / boxsize) - 0.5)) * boxsize
    downbox = downbox - (round(((downbox - close) / boxsize) - 0.5)) * boxsize
    ENDIF

    RETURN upbox as \"UP Box\", downbox as \"DOWN Box\"
     

  4. Doctrading • 05/06/2016 #

    HI ALL,

    This new code (that someone generously sent to me by email) fixes the bug :

  5. Doctrading • 05/06/2016 #

    boxSize = 20

    // On aime bien que les valeurs des Renko soient “rondes”…
    once renkoMax = ROUND(close / boxSize) * boxSize
    once renkoMin = renkoMax – boxSize

    IF close crosses over renkoMax + boxSize THEN
    WHILE close > renkoMax + boxSize
    renkoMax = renkoMax + boxSize
    renkoMin = renkoMin + boxSize
    WEND
    ELSIF close crosses under renkoMin – boxSize THEN
    WHILE close < renkoMin - boxSize
    renkoMax = renkoMax - boxSize
    renkoMin = renkoMin - boxSize
    WEND
    ENDIF

    RETURN renkoMax as "Renko Max", renkoMin as "Renko Min"

  6. Doctrading • 05/06/2016 #

    By the way… the code isn’t perfect :
    The renko will be updated only if the CLOSE is > or < the renko brick.

    Do you have any idea to make the renko display update with the CURRENT PRICE, not the close ?

    Best regards,

  7. Doctrading • 05/06/2016 #

    This new code with highs and lows seems to work :

    boxSize = 20

    // On aime bien que les valeurs des Renko soient “rondes”…
    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

    RETURN renkoMax as "Renko Max", renkoMin as "Renko Min"

  8. DonDollar • 05/06/2016 #

    Gentlemen,
    just a quick question. When I am adding this column to my code, PRT shows an error and some command with an underline:
    ELSIF low < renkoMin - boxSize THEN WHILE low < renkoMin - boxSize renkoMax = renkoMax - boxSize renkoMin = renkoMin - boxSize WEND ENDIF RETURN renkoMax as "Renko Max", renkoMin as "Renko Min"

    Any ideas why?

    Rgds,

avatar
Register or

Likes

avatar avatar avatar
Related users ' posts
Nicolas Good job Gabri, I confirm that with the new ProRealTime v11, everyone will be able to use in...
Slowlyslowly can u just help me with the exact definition of percbox , mm and period to understand will a...
YvesRobert Merci beaucoup Nicolas. Existe t'il un petit programme qui permet de tracer sur la graphe en...
Nicolas Oui il y a celui ci: https://market.prorealcode.com/product/prt-renko/?lang=fr
YvesRobert Bonjour Nicolas, j'ai une question technique à te poser. Je visualise souvent le cours en RE...
Nicolas
7 years ago
stratobast Good afternoon everyone. Thanks Doctrading for your work. I have an issue while using this ...
stratobast My bad guys. I understood what was the problem. The indicator uses highs and lows for the Re...
samwarduk Has anyone tried this on Bitcoin GBP1? The results look amazing but every time mine trie...
Nicolas in order to use renko bricks in a trading strategy or in a screener, I would recommenced thi...
pp_playaflamenca I understand. I visited the page https://market.prorealcode.com/product/prt-renko/ Actua...
Nicolas renko bricks are not repainting, they are using the price movement in their definition. But ...
verdi55
8 years ago
Marcel Hi, I tested this strategy on Spot Gold with a brick size of 20 on the weekly timeframe with...
Nicolas Because the renko chart construction begin at the first price of the loaded history. So you ...
JOKAMAURICE I am learning to code. I try to understand these lines newbricksup = (round(((close - upbr...
Nicolas No. This website is about prorealtime trading platform, not MT4 sorry. However, you can ask ...
Wilko Interesting code, thanks! It will provide me with a good starting point for further developm...
Nicolas contrarian renko boxes are 2 times taller than the brick size.
Nicolas
9 years ago
Alessio Nicolas Hello, I have recently started using this platform, I would like to test a system th...
Nicolas Please use forums for trading strategies queries. Many thanks. 
PassionTrading Salut Nicolas, Je regarde cette indicateur très intéressant par le fait qu'il est superposé...
Nicolas
9 years ago
cedwimmer Hab es schon gefunden vielen Dank!:)
guidocir Hello Nicolas, I imported your code, but it doesn't draw many boxes, but just a single one...
Nicolas It depends of your settings. Try to reduce the box size or to expand the units displayed.

Top