ssksubam

DTR vs ATR

This script shows DTR vs ATR (Today's True Range vs 14 days Avg True Range) along with percentage. The label automatically changes color based on percent value. <=70 is GREEN, >=90 is RED and between 70 & 90 is ORANGE.

The location of the script not stick to one place. There is no such a functionality to keep it static at one location (like top right corner). But I think that feature is coming soon. I may be wrong.
Release Notes: This script shows DTR vs ATR (Today's True Range vs 14 days Avg True Range) along with percentage. The label automatically changes color based on percent value. <=70 is GREEN, >=90 is RED and between 70 & 90 is ORANGE.

The location of the label won't stick at one place. There is no such a functionality to keep it static at one location (like top right corner) currently. But I think that feature is coming soon. I may be wrong. Currently the label will be located top of the chart (y-axis) and numbers of bars left or right (x-axis) depending on input value. By default 5 bars left from last bar.
Release Notes: Fixed an issue where if we have a Heikin Ashi chart (or Renko, Kagi, PriceBreak etc), daily high/low were not calculated based on real OHLC.
Release Notes: Modified the script to allow folks to choose whether they want ATR smoothed based off of EMA, SMA, RMA or WMA. But you will have to modify the script. I have added comment above the specific line so that you can modify the script. There is no option add a input / drop-down menu since I calculate ATR based on Daily candles and also this script is modified to work with other candlestick charts like Heikin Ashi. There is a limitation that you cannot have "security" function under 'if' condition
Release Notes: Little update to choose Smoothing Type (have to edit the script).
Release Notes: Now added option to choose smoothing from drop-down menu. Enjoy
Release Notes: Another little update.
Release Notes: Updating some notes and removing unwanted lines
Release Notes: Updating function and cleaning stuff
Remove from Favorite Scripts Add to favorite indicators

Comments

Thank you for this it's exactly what I was looking for. Is there any way to make it show values for forex pairs?
Reply
Thank you~!
Reply
wonderful script. quick question, i see you have the study info to determine the ATR from RMA, is there anyway to change in the pinecode for SMA input instead? its causing my ATR vaules to be off. :) thanks so much.
Reply
AMae AMae
Reply
@AMae, my ATR vd DTR script on ToS gives exact same result. Not sure what you mean by values are off. Can you explain about RMA/SMA part?
Reply
AMae ssksubam
@ssksubam, sure. if you were to go to indicators and just add "average true range" , once added. go to settings and then "input" and "smoothing" drop box. lmk if you can make sense of it :)
Reply
@AMae, got it. I can't add a drop-down menu due to some limitation. But now you can edit the script. Updated the script and published it. You can change the Smoothing to sma, rma, ema or wma (you will need to edit the script). Around line number 20 where I calculate avg_atr.
Reply
@AMae, Now added option to choose smoothing from drop-down menu. Enjoy
Reply
AMae ssksubam
@ssksubam,WOW !! that's amazing!!! i was completely happy with editing the script myself. i never expected you to go through all that trouble!!! THANK YOU SOO MUCH! youre just WONDERFUL!!!
Reply
Hi @ssksubam ! Wonderfull job, very useful. I do have a question. How can I change in the pine code where the indicator is located on my screen? I want to adjust it, so that it is depicted lower, but still above the chart. I have 4 screens in one and an indicator in a bar below. As is, then the DTR ATR is only half visible (cant share a picture here unfortunately).
Reply
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