Multiple Time Frame Renko Overlay from TradingView


Category:
0
0

Hi Pete.

Sorry for my last post, hopefully this clears everything up.  It would be great if this code can be transferred over to ThinkOrSwim platform.  As you can see from the image on the website below, as an overlay you can assign renko brick size on top of a renko chart or a time based chart.  This way a trader will only need to look at one screen to see not only price action but clearly see a trend provided by the Renko overlay.

 

TradingView.com script, and that is it plots Multiple Time Frame Renko bands in an overlay.

 

If you scroll half way down the page you will see the code.  I also attached the code in a text file.

https://www.tradingview.com/script/N2WbdfTW-Renko-Price-Bars-Overlay/

 

Thank you for your dedication and hard work for the community!

 

Please see attached text file.

 

 

 

 

 

Marked as spam
Posted by (Questions: 1, Answers: 1)
Asked on July 9, 2018 3:39 am
1680 views
0
Private answer

Unfortunately there are some problems with this code. The time frame inputs are not connected to anything. They have no impact on the chart display. So sad to say, this is NOT a MTF version of Renko bars. In fact as I consider this concept it dawns on me that Renko bars could never be applied to multiple time frame. Because it is a range bar study. Formed by ticks on the chart. Complete independent of time.

Having said that. I received a very effective version of Renko overlay from one of my clients about a year ago. They received it as a shared item from someone else. Yet they failed to provide the name of the author. So I apologize for not being able to provide credit where credit is due.

What’s really nice about this code is how compact it is. Only 40+ lines of code. That one from TradingView is a couple hundred lines.

Here is the code as I received it. Screenshot below shows it displayed on two charts. The indicator is set to 10 tick bricks on both. The chart on the right is an actual Renko chart with the overlay. The chart on the right is a 5 min chart with the same exact overlay.

#input BrickSize = 1.25;
input BrickTicks = 10.0;
#def BrickTicks = reference ATR();
input label = Yes;
def BrickSize = BrickTicks * TickSize();
def Mortar = CompoundValue(1, if close() > Mortar[1] + BrickSize
then Mortar[1] + BrickSize
else if close() < Mortar[1] - BrickSize then Mortar[1] - BrickSize else Mortar[1] , close());
def Stack = if Mortar != Mortar[1] then Mortar[1] else Stack[1];
def mortarext = if IsNaN(close) then mortarext[1] else Mortar;
def stackext = if IsNaN(close) then stackext[1] else Stack;
plot Bricks = Mortar; plot Renko = Stack;
#plot Bricksext = mortarext;
#plot Renkoext = stackext;
input showcloud = yes;
def same=if same[1]==0 and bricks>bricks[1] and bricks>renko[1] then 1 else if same[1]==1 and max(renko,bricks)>=max(renko[1],bricks[1]) then 1 else 0;
def s1= if isnan(close) then s1[1] else same;
def s=s1;
defineglobalColor("UP", color.green);
defineglobalcolor("DN", color.red);
addcloud(if showcloud and s==1 then bricks else double.nan, renko, globalcolor("UP"),globalcolor("UP"));
addcloud(if showcloud and s==0 then renko else double.nan, bricks, globalcolor("DN"),globalcolor("DN"));
plot stoploss = if !isnan(close) then double.nan else if s==0 then max(mortarext,stackext) + ticksize() else min(mortarext,stackext) - ticksize();
#Bricks.AssignValueColor(if Bricks > Renko then Color.green else Color.red);
Bricks.AssignValueColor(if s==1 then Color.green else Color.red);
Renko.AssignValueColor(if s==1 then Color.green else Color.red);
#Bricksext.AssignValueColor(if (Bricksext) > (Renkoext) then Color.GREEN else Color.RED);
#Renkoext.AssignValueColor(if (Bricksext) > (Renkoext) then Color.GREEN else Color.RED);
AddLabel(label, "Renko: " + BrickSize, if Bricks > Renko then Color.GREEN else Color.RED);
input pricecolor = no;
AssignPriceColor(if pricecolor == no then Color.CURRENT else if s==1 then Color.green else Color.red);

 

Attachments:
Marked as spam
Posted by (Questions: 37, Answers: 4108)
Answered on July 9, 2018 8:57 am
0

Hi Pete, sorry again, I’m unfamiliar with posting in forums and did not know. I apologize for violating the rules.

As aforementioned, I am unable to get the code to work as in Line 18 s1 and same appear in red
Line 22 showcloud and Line 24 showcloud appear in red.

I would reattach the screenshot I added erroneously in the Post your Answer in the forum. I have anoxic brain injury so it’s possible I’m not seeing the choose file but it’s there? But I don’t see an attach file here in the add comment or I would re attach the screenshot of the error.

Yes I did click apply to activate it. Even before I clicked apply it was showing red. I tried time based charts and tick charts. Nothing came up on any chart.

Again, I know I keep apologizing to you and wasting your time correcting my errors in posting to this forum, but forgive me I’m not entirely all there if you know what I mean and that is why I’m looking for something like this overlay to assist me in trading.

Have a great day!

Thank you!

( at July 9, 2018 3:05 pm)
0

No worries. Try copying and pasting it again. I made some edits to correct some formatting. Website gets a mind of it’s own once in a while. There were some line breaks that did not get carried over when I copied and pasted out of Thinkorswim. One of the primary reasons I provide STUDY.ts files with my videos instead of text files.

( at July 9, 2018 3:10 pm)