DailyATR levels on 1 min chart starting from open price

warrenmac

New member
VIP
Plus
Hi. Your indicators are AWESOME. I was wondering if there is an indicator that shows the Daily ATR levels as 2 lines but on all timeframes that adjust as the day goes? I havent been able to find this. But I only want the daily ATR levels. Is this possible?
 
Solution
Thanks Bob, appreciate it. Hopefully someone will be able to do this for me. I'll make a post soon

I had some time so I created what I presume you want. The caveat is that it is more logical to use the previous days close rather that the days open, since the atr takes that into account. In any event here is the code and 2 examples from todays trade for AAPL and GOOG on a 3 minute chart:
aapl.jpg
goog.jpg


Code:
#Day Lines##############################
def AP = AggregationPeriod.DAY;
plot D_Open = open(period = AP);
D_Open.SetDefaultColor(color.yellow);
D_Open.SetPaintingStrategy(PaintingStrategy.POINTS);
D_Open.SetLineWeight(2);
D_Open.HideTitle();

plot D_High = high(period = AP);
D_High.SetDefaultColor(color.green)...
I had some time so I created what I presume you want. The caveat is that it is more logical to use the previous days close rather that the days open, since the atr takes that into account. In any event here is the code and 2 examples from todays trade for AAPL and GOOG on a 3 minute chart:View attachment 22285View attachment 22288

Code:
#Day Lines##############################
def AP = AggregationPeriod.DAY;
plot D_Open = open(period = AP);
D_Open.SetDefaultColor(color.yellow);
D_Open.SetPaintingStrategy(PaintingStrategy.POINTS);
D_Open.SetLineWeight(2);
D_Open.HideTitle();

plot D_High = high(period = AP);
D_High.SetDefaultColor(color.green);
D_High.SetPaintingStrategy(PaintingStrategy.POINTS);
D_High.SetLineWeight(2);
D_High.HideTitle();

plot D_Low = low(period = AP);
D_Low.SetDefaultColor(color.red);
D_Low.SetPaintingStrategy(PaintingStrategy.POINTS);
D_Low.SetLineWeight(2);
D_Low.HideTitle();

input AtrLngth = 14;
def tr = TrueRange (high(period = ap), close(period = ap), low(period = ap));
def AtrA = Round(ExpAverage(tr,  AtrLngth), 2);
def Atr = atra[1];
def uatr = high(period = AP)+ (atr-tr);
def datr = low(period = AP)- (atr-tr);

plot atru = (if uatr <= D_open then double.nan else uatr);
atru.SetDefaultColor(color.yellow);
atru.SetPaintingStrategy(PaintingStrategy.DASHES);
atru.SetLineWeight(3);
atru.HideTitle();

plot atrd = (if datr >= D_Open then double.nan else datr);
atrd.SetDefaultColor(color.yellow);
atrd.SetPaintingStrategy(PaintingStrategy.DASHES);
atrd.SetLineWeight(3);
atrd.HideTitle();

Addlabel(yes,"ATR_Length:" + ATRLngth + "  ATR: " + atr + "  TR: " + tr + "  Remainder: " + round((atr-tr),2),color.yellow);
This is fantastic!!! This is what I needed and I thank you!
 

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
475 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