AGAIG Renko Charting Labels For ThinkOrSwim

AGAIG RENKO CHARTING LABELS

Many traders use Renko Charting for determining direction. However, on TOS it is sometimes onerous trying to count bricks (they don’t size larger/smaller on TOS) and so I have taken the parameters of RENKO and developed a chart label that lets you know if RENKO is in an upward trend, static, or in a lower trend including how many bars movement has made.
goMQHgK.png


This indicator behaves like a scorecard that only refreshes on the actual event, rather than a live counter. On a flip the label resets to 1 and the label switches color/direction immediately according to the Renko parameters. You can turn the bricks on/off in the “Added studies and strategies” by going to the AGAIG_RenkoCurrentLabel and click on the wheel on the right and on “show brick line” dropdown click on Yes or No.

The label is best suited for at-a-glance monitoring.

Indicator Link: http://tos.mx/!u688FL6H
Code:
# Renko Direction Label (live count of current trend by AGAIG)
declare upper;

input boxSize = 1.0;
input showBrickLine = yes;
input LabelSize     = fontsize.large;
input LabelLocation = location.bottom_left;

def price = close;

rec brick = CompoundValue(1,
    if IsNaN(brick[1])
    then Round(price / boxSize) * boxSize
    else if price - brick[1] >= boxSize
         then brick[1] + boxSize * Floor((price - brick[1]) / boxSize)
    else if brick[1] - price >= boxSize
         then brick[1] - boxSize * Floor((brick[1] - price) / boxSize)
    else brick[1],
    Round(price / boxSize) * boxSize
);

rec dir = CompoundValue(1,
    if brick > brick[1] then 1
    else if brick < brick[1] then -1
    else dir[1],
    0
);

def changed = dir != dir[1] and !IsNaN(dir[1]);

rec barsInTrend = CompoundValue(1,
    if changed then 1
    else barsInTrend[1] + 1,
    1
);

# --- Optional brick overlay line ---
plot Renko = if showBrickLine then brick else Double.NaN;
Renko.SetPaintingStrategy(PaintingStrategy.SQUARES);
Renko.SetLineWeight(3);
Renko.AssignValueColor(
    if dir == 1 then Color.GREEN
    else if dir == -1 then Color.RED
    else Color.GRAY
);

# --- Label: live count of the current (just-started) trend ---
AddLabel(
    dir != 0,
    "RENKO " + (if dir == 1 then "UP" else "DOWN") + " " + barsInTrend + " bars",
    if dir == 1 then Color.GREEN
    else if dir == -1 then Color.RED
    else Color.YELLOW, LabelLocation, LabelSize
);
@Pooze
 
Last edited by a moderator:

Join useThinkScript to post your question to a community of 21,000+ developers and traders.

Similar threads

Not the exact question you're looking for?

Start a new thread and receive assistance from our community.

87k+ Posts
1376 Online
Create Post

Similar threads

Similar threads

The Market Trading Game Changer

Join 2,500+ subscribers inside the useThinkScript VIP Membership Club
  • Exclusive indicators
  • Proven strategies & setups
  • Private Discord community
  • ‘Buy The Dip’ signal alerts
  • Exclusive members-only content
  • Add-ons and resources
  • 1 full year of unlimited support

Frequently Asked Questions

What is useThinkScript?

useThinkScript is the #1 community of stock market investors using indicators and other tools to power their trading strategies. Traders of all skill levels use our forums to learn about scripting and indicators, help each other, and discover new ways to gain an edge in the markets.

How do I get started?

We get it. Our forum can be intimidating, if not overwhelming. With thousands of topics, tens of thousands of posts, our community has created an incredibly deep knowledge base for stock traders. No one can ever exhaust every resource provided on our site.

If you are new, or just looking for guidance, here are some helpful links to get you started.

What are the benefits of VIP Membership?
VIP members get exclusive access to these proven and tested premium indicators: Buy the Dip, Advanced Market Moves 2.0, Take Profit, and Volatility Trading Range. In addition, VIP members get access to over 50 VIP-only custom indicators, add-ons, and strategies, private VIP-only forums, private Discord channel to discuss trades and strategies in real-time, customer support, trade alerts, and much more. Learn all about VIP membership here.
How can I access the premium indicators?
To access the premium indicators, which are plug and play ready, sign up for VIP membership here.
Back
Top