How to plot a horizontal line at the ATR level?

ATR is a distance which requires a starting point and an ending point when applied to upper chart studies.

This, for example, would center ATR around the center of each bar;

Code:
plot x = hl2 + (ATR() * 0.5);
plot y = hl2 - (ATR() * 0.5);
x.setpaintingStrategy(paintingStrategy.HORIZONTAL);
y.setpaintingStrategy(paintingStrategy.HORIZONTAL);

But it depends on where you want to anchor it from, etc.

What, exactly, do you consider to be the ATR level?
 

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

I would like to have a horizontal line at the last level of "CLOSE - ATR" instead of the continuous line shown here as a dotted white line.
.
The doted line is the continuous line drawn with the following script:


Here is the image:
2022-01-18-TOS-CHARTS.png
Code:
input ATRLength = 14;
input averagetype = AverageType.WILDERS;
input BasePeriod = AggregationPeriod.DAY;
input showlabel = yes;

Def ATR = (MovingAverage (averagetype, TrueRange(high(period = BasePeriod)[1], close(period = BasePeriod)[1], low(period = BasePeriod)[1]), ATRLength));

plot line = CLOSE(period = BasePeriod)[1]- ATR;

line.SetDefaultColor(Color.WHITE);
line.SetStyle(Curve.SHORT_DASH);
line.SetLineWeight(1);
 
Last edited:
@ronviv1
Code:
input ATRLength = 14;
input averagetype = AverageType.WILDERS;
input BasePeriod = AggregationPeriod.thirty_MIN;
input showlabel = yes;

Def ATR = (MovingAverage (averagetype, TrueRange(high(period = BasePeriod)[1], close(period = BasePeriod)[1], low(period = BasePeriod)[1]), ATRLength));

plot line = CLOSE(period = BasePeriod)[1]- ATR;

line.SetDefaultColor(Color.WHITE);
line.SetStyle(Curve.SHORT_DASH);
line.SetLineWeight(1);

def barNum = if !IsNaN(BarNumber()) then Barnumber() else Double.NaN;
def numBars = HighestAll(barNum);

def FinalBar= fold c = 0 to numbars while !IsNaN(GetValue(close, -c)) do GetValue(BarNumber(), -c);
def FinalATR = fold a = 0 to AbsValue(FinalBar) while !IsNaN(GetValue(close, -a)) do GetValue(line[-1], -a);

plot DayATR = if FinalATR>1 then FinalATR else Double.NaN;
DayATR.SetStyle(Curve.LONG_DASH);
DayATR.AssignValueColor(Color.LIME);
 
Last edited:
@Svanoy, thank you for your help with code for ATR horizontal line.

Is it possible to create the similar code to plot a horizontal line at 20-Day EMA value?

I tried to modify ATR code but could not succeed. Thank you.
 
Here is the modified code for 20-Day EMA, but it does plot EMA but will not plot a horizontal line at the final value!


Code:
input price = close;
input length = 20;
input displace = 0;

plot EMA = ExpAverage(price[-displace], length);

plot line = EMA;

EMA.SetDefaultColor(GetColor(1));


def barNum = if !IsNaN(BarNumber()) then Barnumber() else Double.NaN;
def numBars = HighestAll(barNum);

def FinalBar= fold c = 0 to numbars while !IsNaN(GetValue(close, -c)) do GetValue(BarNumber(), -c);
def FinalEMA = fold a = 0 to AbsValue(FinalBar) while !IsNaN(GetValue(close, -a)) do GetValue(line[-1], -a);

plot DayEMA = if FinalEMA>1 then FinalEMA else Double.NaN;
DayEMA.SetDefaultColor(GetColor(1));
 
Last edited:
@ronviv1
Remove the [-1] in the definition of FinalEMA, that is only needed for ATR.
Should be:
Code:
def FinalEMA = fold a = 0 to AbsValue(FinalBar) while !IsNaN(GetValue(close, -a)) do GetValue(line, -a);
 
@ronviv1
Code:
input ATRLength = 14;
input averagetype = AverageType.WILDERS;
input BasePeriod = AggregationPeriod.thirty_MIN;
input showlabel = yes;

Def ATR = (MovingAverage (averagetype, TrueRange(high(period = BasePeriod)[1], close(period = BasePeriod)[1], low(period = BasePeriod)[1]), ATRLength));

plot line = CLOSE(period = BasePeriod)[1]- ATR;

line.SetDefaultColor(Color.WHITE);
line.SetStyle(Curve.SHORT_DASH);
line.SetLineWeight(1);

def barNum = if !IsNaN(BarNumber()) then Barnumber() else Double.NaN;
def numBars = HighestAll(barNum);

def FinalBar= fold c = 0 to numbars while !IsNaN(GetValue(close, -c)) do GetValue(BarNumber(), -c);
def FinalATR = fold a = 0 to AbsValue(FinalBar) while !IsNaN(GetValue(close, -a)) do GetValue(line[-1], -a);

plot DayATR = if FinalATR>1 then FinalATR else Double.NaN;
DayATR.SetStyle(Curve.LONG_DASH);
DayATR.AssignValueColor(Color.LIME);
@ronviv1
Code:
input ATRLength = 14;
input averagetype = AverageType.WILDERS;
input BasePeriod = AggregationPeriod.thirty_MIN;
input showlabel = yes;

Def ATR = (MovingAverage (averagetype, TrueRange(high(period = BasePeriod)[1], close(period = BasePeriod)[1], low(period = BasePeriod)[1]), ATRLength));

plot line = CLOSE(period = BasePeriod)[1]- ATR;

line.SetDefaultColor(Color.WHITE);
line.SetStyle(Curve.SHORT_DASH);
line.SetLineWeight(1);

def barNum = if !IsNaN(BarNumber()) then Barnumber() else Double.NaN;
def numBars = HighestAll(barNum);

def FinalBar= fold c = 0 to numbars while !IsNaN(GetValue(close, -c)) do GetValue(BarNumber(), -c);
def FinalATR = fold a = 0 to AbsValue(FinalBar) while !IsNaN(GetValue(close, -a)) do GetValue(line[-1], -a);

plot DayATR = if FinalATR>1 then FinalATR else Double.NaN;
DayATR.SetStyle(Curve.LONG_DASH);
DayATR.AssignValueColor(Color.LIME);
Thank you so much for this. I see the horizontal line to the downside, but is it possible to add an additional horizontal line for the upper boundary of ATR?
 
@Wardo21 I assume this is what you're wanting.
9HMuqtg.png

Code:
input ATRLength = 14;
input averagetype = AverageType.WILDERS;
input BasePeriod = AggregationPeriod.thirty_MIN;
input showlabel = yes;

Def ATR = (MovingAverage (averagetype, TrueRange(high(period = BasePeriod)[1], close(period = BasePeriod)[1], low(period = BasePeriod)[1]), ATRLength));

plot line = CLOSE(period = BasePeriod)[1]- ATR;
line.SetDefaultColor(Color.WHITE);
line.SetStyle(Curve.SHORT_DASH);
line.SetLineWeight(1);

plot line1 = CLOSE(period = BasePeriod)[1]+ ATR;
line1.SetDefaultColor(Color.WHITE);
line1.SetStyle(Curve.SHORT_DASH);
line1.SetLineWeight(1);

def barNum = if !IsNaN(BarNumber()) then Barnumber() else Double.NaN;
def numBars = HighestAll(barNum);

def FinalBar= fold c = 0 to numbars while !IsNaN(GetValue(close, -c)) do GetValue(BarNumber(), -c);
def FinalATRDn = fold a = 0 to AbsValue(FinalBar) while !IsNaN(GetValue(close, -a)) do GetValue(line[-1], -a);
def FinalATRUp = fold b = 0 to AbsValue(FinalBar) while !IsNaN(GetValue(close, -b)) do GetValue(line1[-1], -b);

plot DayATRDn = if FinalATRDn>1 then FinalATRDn else Double.NaN;
DayATRDn.SetStyle(Curve.LONG_DASH);
DayATRDn.AssignValueColor(Color.LIME);

plot DayATRUp = if FinalATRUp>1 then FinalATRUp else Double.NaN;
DayATRUp.SetStyle(Curve.LONG_DASH);
DayATRUp.AssignValueColor(Color.LIME);
 
@Wardo21 I assume this is what you're wanting.
9HMuqtg.png

Code:
input ATRLength = 14;
input averagetype = AverageType.WILDERS;
input BasePeriod = AggregationPeriod.thirty_MIN;
input showlabel = yes;

Def ATR = (MovingAverage (averagetype, TrueRange(high(period = BasePeriod)[1], close(period = BasePeriod)[1], low(period = BasePeriod)[1]), ATRLength));

plot line = CLOSE(period = BasePeriod)[1]- ATR;
line.SetDefaultColor(Color.WHITE);
line.SetStyle(Curve.SHORT_DASH);
line.SetLineWeight(1);

plot line1 = CLOSE(period = BasePeriod)[1]+ ATR;
line1.SetDefaultColor(Color.WHITE);
line1.SetStyle(Curve.SHORT_DASH);
line1.SetLineWeight(1);

def barNum = if !IsNaN(BarNumber()) then Barnumber() else Double.NaN;
def numBars = HighestAll(barNum);

def FinalBar= fold c = 0 to numbars while !IsNaN(GetValue(close, -c)) do GetValue(BarNumber(), -c);
def FinalATRDn = fold a = 0 to AbsValue(FinalBar) while !IsNaN(GetValue(close, -a)) do GetValue(line[-1], -a);
def FinalATRUp = fold b = 0 to AbsValue(FinalBar) while !IsNaN(GetValue(close, -b)) do GetValue(line1[-1], -b);

plot DayATRDn = if FinalATRDn>1 then FinalATRDn else Double.NaN;
DayATRDn.SetStyle(Curve.LONG_DASH);
DayATRDn.AssignValueColor(Color.LIME);

plot DayATRUp = if FinalATRUp>1 then FinalATRUp else Double.NaN;
DayATRUp.SetStyle(Curve.LONG_DASH);
DayATRUp.AssignValueColor(Color.LIME);
You are an amazingly intelligent, beautiful human being! Thank you!
 
You are an amazingly intelligent, beautiful human being! Thank you!
@Wardo21 I assume this is what you're wanting.
9HMuqtg.png

Code:
input ATRLength = 14;
input averagetype = AverageType.WILDERS;
input BasePeriod = AggregationPeriod.thirty_MIN;
input showlabel = yes;

Def ATR = (MovingAverage (averagetype, TrueRange(high(period = BasePeriod)[1], close(period = BasePeriod)[1], low(period = BasePeriod)[1]), ATRLength));

plot line = CLOSE(period = BasePeriod)[1]- ATR;
line.SetDefaultColor(Color.WHITE);
line.SetStyle(Curve.SHORT_DASH);
line.SetLineWeight(1);

plot line1 = CLOSE(period = BasePeriod)[1]+ ATR;
line1.SetDefaultColor(Color.WHITE);
line1.SetStyle(Curve.SHORT_DASH);
line1.SetLineWeight(1);

def barNum = if !IsNaN(BarNumber()) then Barnumber() else Double.NaN;
def numBars = HighestAll(barNum);

def FinalBar= fold c = 0 to numbars while !IsNaN(GetValue(close, -c)) do GetValue(BarNumber(), -c);
def FinalATRDn = fold a = 0 to AbsValue(FinalBar) while !IsNaN(GetValue(close, -a)) do GetValue(line[-1], -a);
def FinalATRUp = fold b = 0 to AbsValue(FinalBar) while !IsNaN(GetValue(close, -b)) do GetValue(line1[-1], -b);

plot DayATRDn = if FinalATRDn>1 then FinalATRDn else Double.NaN;
DayATRDn.SetStyle(Curve.LONG_DASH);
DayATRDn.AssignValueColor(Color.LIME);

plot DayATRUp = if FinalATRUp>1 then FinalATRUp else Double.NaN;
DayATRUp.SetStyle(Curve.LONG_DASH);
DayATRUp.AssignValueColor(Color.LIME);
I've been struggling to create a scan that will identify when price is greater than or equal to the yellow DayATRUP line. Would you be able to assist me with this?
 
@ronviv1
Code:
input ATRLength = 14;
input averagetype = AverageType.WILDERS;
input BasePeriod = AggregationPeriod.thirty_MIN;
input showlabel = yes;

Def ATR = (MovingAverage (averagetype, TrueRange(high(period = BasePeriod)[1], close(period = BasePeriod)[1], low(period = BasePeriod)[1]), ATRLength));

plot line = CLOSE(period = BasePeriod)[1]- ATR;

line.SetDefaultColor(Color.WHITE);
line.SetStyle(Curve.SHORT_DASH);
line.SetLineWeight(1);

def barNum = if !IsNaN(BarNumber()) then Barnumber() else Double.NaN;
def numBars = HighestAll(barNum);

def FinalBar= fold c = 0 to numbars while !IsNaN(GetValue(close, -c)) do GetValue(BarNumber(), -c);
def FinalATR = fold a = 0 to AbsValue(FinalBar) while !IsNaN(GetValue(close, -a)) do GetValue(line[-1], -a);

plot DayATR = if FinalATR>1 then FinalATR else Double.NaN;
DayATR.SetStyle(Curve.LONG_DASH);
DayATR.AssignValueColor(Color.LIME);
Great Code Svanoy. I'm looking to plot horizontal lines based on the opening price for the current day for +1 +2 -1 -2 ATR's so I can have potential targets. adding a name for each line would be great too. I currently use the 14-day period ATR. TOS standard I think. Appreciate any input. Thx.
 
@jrwlkr not sure if this is what you want, let me know.
Ruby:
input ATRLength = 14;
input averagetype = AverageType.WILDERS;
input BasePeriod = AggregationPeriod.thirty_MIN;
input time = 0930;

def ATR = (MovingAverage (averagetype, TrueRange(high(period = BasePeriod)[1], close(period = BasePeriod)[1], low(period = BasePeriod)[1]), ATRLength));

def DayOpen = if SecondsTillTime(time) == 0 then open(period = BasePeriod) else DayOpen[1];
def ATRLine = if SecondsTillTime(time) == 0 then close(period = BasePeriod) - ATR else ATRLine[1];

plot LineATR = DayOpen;
LineATR.SetPaintingStrategy(PaintingStrategy.DASHES);
LineATR.AssignValueColor(Color.LIME);

def UpLine1 = DayOpen + AbsValue(DayOpen-ATRLine);
plot Line1ATR = UpLine1;
Line1ATR.SetPaintingStrategy(PaintingStrategy.DASHES);
Line1ATR.AssignValueColor(Color.LIME);

def UpLine2 = Line1ATR + AbsValue(DayOpen-ATRLine);
plot Line2ATR = UpLine2;
Line2ATR.SetPaintingStrategy(PaintingStrategy.DASHES);
Line2ATR.AssignValueColor(Color.LIME);

def DnLine1 = DayOpen - AbsValue(DayOpen-ATRLine);
plot Line3ATR = DnLine1;
Line3ATR.SetPaintingStrategy(PaintingStrategy.DASHES);
Line3ATR.AssignValueColor(Color.LIME);

def DnLine2 = Line3ATR - AbsValue(DayOpen-ATRLine);
plot Line4ATR = DnLine2;
Line4ATR.SetPaintingStrategy(PaintingStrategy.DASHES);
Line4ATR.AssignValueColor(Color.LIME);

AddChartBubble(LineATR<>LineATR[1],LineATR,"Day Open",color.LIME);
AddChartBubble(Line1ATR<>Line1ATR[1],Line1ATR,"+1 ATR",color.LIME,yes);
AddChartBubble(Line2ATR<>Line2ATR[1],Line2ATR,"+2 ATR",color.LIME,yes);
AddChartBubble(Line3ATR<>Line3ATR[1],Line3ATR,"-1 ATR",color.LIME,no);
AddChartBubble(Line4ATR<>Line4ATR[1],Line4ATR,"-2 ATR",color.LIME,no);
 
@jrwlkr not sure if this is what you want, let me know.
Ruby:
input ATRLength = 14;
input averagetype = AverageType.WILDERS;
input BasePeriod = AggregationPeriod.thirty_MIN;
input time = 0930;

def ATR = (MovingAverage (averagetype, TrueRange(high(period = BasePeriod)[1], close(period = BasePeriod)[1], low(period = BasePeriod)[1]), ATRLength));

def DayOpen = if SecondsTillTime(time) == 0 then open(period = BasePeriod) else DayOpen[1];
def ATRLine = if SecondsTillTime(time) == 0 then close(period = BasePeriod) - ATR else ATRLine[1];

plot LineATR = DayOpen;
LineATR.SetPaintingStrategy(PaintingStrategy.DASHES);
LineATR.AssignValueColor(Color.LIME);

def UpLine1 = DayOpen + AbsValue(DayOpen-ATRLine);
plot Line1ATR = UpLine1;
Line1ATR.SetPaintingStrategy(PaintingStrategy.DASHES);
Line1ATR.AssignValueColor(Color.LIME);

def UpLine2 = Line1ATR + AbsValue(DayOpen-ATRLine);
plot Line2ATR = UpLine2;
Line2ATR.SetPaintingStrategy(PaintingStrategy.DASHES);
Line2ATR.AssignValueColor(Color.LIME);

def DnLine1 = DayOpen - AbsValue(DayOpen-ATRLine);
plot Line3ATR = DnLine1;
Line3ATR.SetPaintingStrategy(PaintingStrategy.DASHES);
Line3ATR.AssignValueColor(Color.LIME);

def DnLine2 = Line3ATR - AbsValue(DayOpen-ATRLine);
plot Line4ATR = DnLine2;
Line4ATR.SetPaintingStrategy(PaintingStrategy.DASHES);
Line4ATR.AssignValueColor(Color.LIME);

AddChartBubble(LineATR<>LineATR[1],LineATR,"Day Open",color.LIME);
AddChartBubble(Line1ATR<>Line1ATR[1],Line1ATR,"+1 ATR",color.LIME,yes);
AddChartBubble(Line2ATR<>Line2ATR[1],Line2ATR,"+2 ATR",color.LIME,yes);
AddChartBubble(Line3ATR<>Line3ATR[1],Line3ATR,"-1 ATR",color.LIME,no);
AddChartBubble(Line4ATR<>Line4ATR[1],Line4ATR,"-2 ATR",color.LIME,no);


Thank you so much, but I'm not getting the exact results I was expecting. The ATR calculation is not exactly right based on how TOS calculates it, but it's close enough. It is displaying +1 ATR but it's below not above the opening price, +2 ATR is way off, it's about twice the current price and then a line appears at 0 without a label. The -1, -2 ATR's appear as negative price numbers but are also way off. It also looks like you're trying to plot the open too, but not sure, that's not plotting, don't really need it anyway. I wish I could show you a picture but I can't figure out how to paste a picture here without being a link. If you know how I can show you what I'm seeing. I'm going to try to modify it and see if I can figure it out.
 
Last edited:
@jrwlkr use imgur to upload pics and put the BB link in your post.
Also, did you adjust the aggregation input to match your chart aggregation?
Yes, I modified it to daily. So I'm displaying it on 2min or 5min chart but want to use the daily ATR over a 14day period. I'm thinking it has to do with the calculation of the open, mostly because that's the only thing that is not being plotted, although it could be the "0" line but the bubble isn't on that line, but not sure. If I switch to the day chart, it shows the -1, -2 a little better but shows no +1 +2 at all, but the numbers still don't seem correct. I only want to plot the current day anyway. I've also tried using the ATR study from TOS and that changed it, but still not correct at all.


 
Last edited:
@jrwlkr Made some changes, yeah, my bad on the math there. Don't know how I got that messed up.
But also using a Daily ATR on a 5 min chart is not going to work, try a 30 min ATR for a 5 min chart.
FPheGuY.png

Ruby:
input ATRLength = 14;
input averagetype = AverageType.WILDERS;
input BasePeriod = AggregationPeriod.thirty_MIN;
input time = 0930;

def today = if (GetDay() == GetLastDay()) and (SecondsFromTime(time) >= 0) then 1 else 0;

def ATR = MovingAverage(averageType, TrueRange(high(period = baseperiod), close(period = baseperiod), low(period = baseperiod)), atrlength);

def DayOpen = if SecondsTillTime(time) == 0 then open else DayOpen[1];
def ATRLine = if SecondsTillTime(time) == 0 then ATR else ATRLine[1];


plot LineATR = if today then DayOpen else Double.NaN;
LineATR.SetPaintingStrategy(PaintingStrategy.DASHES);
LineATR.AssignValueColor(Color.LIME);

def UpLine1 = if today then DayOpen + ATRLine else Double.NaN;
plot Line1ATR = UpLine1;
Line1ATR.SetPaintingStrategy(PaintingStrategy.DASHES);
Line1ATR.AssignValueColor(Color.LIME);

def UpLine2 = if today then Line1ATR + ATRLine else Double.NaN;
plot Line2ATR = UpLine2;
Line2ATR.SetPaintingStrategy(PaintingStrategy.DASHES);
Line2ATR.AssignValueColor(Color.LIME);

def DnLine1 = if today then DayOpen - ATRLine else Double.NaN;
plot Line3ATR = DnLine1;
Line3ATR.SetPaintingStrategy(PaintingStrategy.DASHES);
Line3ATR.AssignValueColor(Color.LIME);

def DnLine2 = if today then Line3ATR - ATRLine else Double.NaN;
plot Line4ATR = DnLine2;
Line4ATR.SetPaintingStrategy(PaintingStrategy.DASHES);
Line4ATR.AssignValueColor(Color.LIME);

AddChartBubble(IsNAN(LineATR[1]) and !IsNaN(LineATR),LineATR,"Day Open",color.LIME);
AddChartBubble(IsNAN(Line1ATR[1]) and !IsNaN(Line1ATR),Line1ATR,"+1 ATR",color.LIME,yes);
AddChartBubble(IsNAN(Line2ATR[1]) and !IsNaN(Line2ATR),Line2ATR,"+2 ATR",color.LIME,yes);
AddChartBubble(IsNAN(Line3ATR[1]) and !IsNaN(Line3ATR),Line3ATR,"-1 ATR",color.LIME,no);
AddChartBubble(IsNAN(Line4ATR[1]) and !IsNaN(Line4ATR),Line4ATR,"-2 ATR",color.LIME,no);
 
@jrwlkr Made some changes, yeah, my bad on the math there. Don't know how I got that messed up.
But also using a Daily ATR on a 5 min chart is not going to work, try a 30 min ATR for a 5 min chart.
FPheGuY.png

Ruby:
input ATRLength = 14;
input averagetype = AverageType.WILDERS;
input BasePeriod = AggregationPeriod.thirty_MIN;
input time = 0930;

def today = if (GetDay() == GetLastDay()) and (SecondsFromTime(time) >= 0) then 1 else 0;

def ATR = MovingAverage(averageType, TrueRange(high(period = baseperiod), close(period = baseperiod), low(period = baseperiod)), atrlength);

def DayOpen = if SecondsTillTime(time) == 0 then open else DayOpen[1];
def ATRLine = if SecondsTillTime(time) == 0 then ATR else ATRLine[1];


plot LineATR = if today then DayOpen else Double.NaN;
LineATR.SetPaintingStrategy(PaintingStrategy.DASHES);
LineATR.AssignValueColor(Color.LIME);

def UpLine1 = if today then DayOpen + ATRLine else Double.NaN;
plot Line1ATR = UpLine1;
Line1ATR.SetPaintingStrategy(PaintingStrategy.DASHES);
Line1ATR.AssignValueColor(Color.LIME);

def UpLine2 = if today then Line1ATR + ATRLine else Double.NaN;
plot Line2ATR = UpLine2;
Line2ATR.SetPaintingStrategy(PaintingStrategy.DASHES);
Line2ATR.AssignValueColor(Color.LIME);

def DnLine1 = if today then DayOpen - ATRLine else Double.NaN;
plot Line3ATR = DnLine1;
Line3ATR.SetPaintingStrategy(PaintingStrategy.DASHES);
Line3ATR.AssignValueColor(Color.LIME);

def DnLine2 = if today then Line3ATR - ATRLine else Double.NaN;
plot Line4ATR = DnLine2;
Line4ATR.SetPaintingStrategy(PaintingStrategy.DASHES);
Line4ATR.AssignValueColor(Color.LIME);

AddChartBubble(IsNAN(LineATR[1]) and !IsNaN(LineATR),LineATR,"Day Open",color.LIME);
AddChartBubble(IsNAN(Line1ATR[1]) and !IsNaN(Line1ATR),Line1ATR,"+1 ATR",color.LIME,yes);
AddChartBubble(IsNAN(Line2ATR[1]) and !IsNaN(Line2ATR),Line2ATR,"+2 ATR",color.LIME,yes);
AddChartBubble(IsNAN(Line3ATR[1]) and !IsNaN(Line3ATR),Line3ATR,"-1 ATR",color.LIME,no);
AddChartBubble(IsNAN(Line4ATR[1]) and !IsNaN(Line4ATR),Line4ATR,"-2 ATR",color.LIME,no);
Thanks, really appreciate it. Works perfectly with the Daily ATR, it's exactly what I'm looking for.
 

Similar threads

Not the exact question you're looking for?

Start a new thread and receive assistance from our community.

87k+ Posts
310 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