DTR vs ATR w RVol

DTR vs ART along with Relative Volume in Percentage. So if you see RVol as 200% with input length of 10 days, today's volume is 2x compared to past 10 days. It helps if today's volume is already reached 20% or 30% within 30mins of market open, etc.
Release Notes: Added an option to choose Smoothing for ATR
Release Notes: Updated some notes
Release Notes: Updating function to work better
Release Notes: cleaning up stuff
Release Notes: There was a mis-calculation on the script where if you change chart resolution, the RVol changes. But the intention of this script is, both DTR vs ATR value and RVol should be same for the day whether you're on 1Hr chart or 3min chart or Daily chart. The idea is, we want to see what is today's DTR vs ATR and what is today's Relative Volume.
Release Notes: Update Notes:
Couple of features added:
1. When chart resolution is Daily or Intraday (D, 4H, 1H, 5min, etc), both True Range and Relative Volume shows value based on DAILY.
2. When resolution is changed to Weekly or Monthly, then both True Range and Relative Volume shows corresponding value. i.e. Weekly shows weekly true range vs past 'N' weekly ATR. Weekly Relative Volume shows relative volume of this week compared to past 'N' weeks. Likewise for Monthly. You would see change in label name. Like, Weekly chart shows WTR (Weekly True Range) and W_RVol (Weekly Relative Volume). Likewise, Daily & Intraday shows DTR & D_RVol. Monthly shows MTR (Monthly True Range) and M_RVol (Monthly Relative Volume).
3. Added a plot (by default hidden) for this specific reason: When you move the cursor to focus specific candle, then Indicator Value displays relative volume of that specific candle. This applies to Intraday as well. So if you're in 1HR chart and move the cursor to a specific candle, Indicator Value shows relative volume for that specific candlestick bar.

Hope you find this useful.
Open-source script

In true TradingView spirit, the author of this script has published it open-source, so traders can understand and verify it. Cheers to the author! You may use it for free, but reuse of this code in a publication is governed by House Rules. You can favorite it to use it on a chart.

Want to use this script on a chart?


Thanks for the script, is it possible to have the label at Top left most position .What does y=10e10 specify ?
ssksubam prap4stocks
@prap4stocks, y=10e10 is nothing but y-axis value. Y-axis is price. So highest price the chart is showing. That’s why the label is showing on the top. If you want show label on left, which is x-axis (nothing but time). So you can’t define a time or bar on left side. All you could do is, how bars left or right you want label to be placed. Negative value is left. Positive value is right. I set to -5, so it’s placed at 5 bard from last bar. Thanks.
ssksubam prap4stocks
@prap4stocks, Just to be sure I answer your question better. How do you define left? Is 2019 left or 2010 is left? It really depends on how far you want to go to left. Make sense. So the x-axis position of the label is based on current time and/or current bar. I have set my "BarsRight" value to -5 (negative 5). That means it is 5 bars left from last bar (last bar is nothing but current time active bar). Hope this helps. There is no better way to place labels using pine script currently. Like we do in TOS. But I heard some feature is coming in the future. Then we may be able to place the label in a much better way. Thanks!
prap4stocks ssksubam
@ssksubam, Thanks for reply i was looking to place this label in far left of any chart near stock Symbol and price is displayed.
I was able it with (barsRight = input(-35) and y-axis 10e10)

but its not working properly if i have multiple charts in same panel like shown in image below
ssksubam prap4stocks
@prap4stocks, yes sir. BarRight value is the only way to control x-axis location effectively for now. You got it. Thanks
prap4stocks ssksubam
@ssksubam, I got x-axis part but struggling with fixed y-axis portion if i use 10e10 the label values are not visible with multi-chart layout

as shown here:

I have to use y=close and the problem is the label is not at a fixed location

Ideally i want my label to be at left-most top side near Stock symbol label
This is great! Thanks. Would be nice to eventually get an update where it's static in a corner. (like I used to have in TOS)
@mhpapp, were you able to get a static label
Home Stock Screener Forex Screener Crypto Screener Economic Calendar How It Works Chart Features Pricing Refer a friend House Rules Help Center Website & Broker Solutions Widgets Charting Solutions Lightweight Charting Library Blog & News Twitter
Profile Profile Settings Account and Billing Referred friends Coins My Support Tickets Help Center Private Messages Chat Sign Out