Large Range Bar

tarun81

New member
Hi, I am new here. First, thank you to the moderators and the scripters for the great work you guys do.

Would it be possible if someone can code an upper indicator that will plot an arrow underneath a candle when its ATR is larger than the ATR of the last 14 bars or however many prior bars? I once saw on here where a similar script was created but it colors the bar and it only recognized the large bar when it's 2x or 3x the ATR. I already use another script that paints the bars for trend, so that script won't really work and it doesn't allow to modify the bar size to be 1.1x or 1.5x, just whole numbers.
 
Hi, I am new here. First, thank you to the moderators and the scripters for the great work you guys do.

Would it be possible if someone can code an upper indicator that will plot an arrow underneath a candle when its ATR is larger than the ATR of the last 14 bars or however many prior bars? I once saw on here where a similar script was created but it colors the bar and it only recognized the large bar when it's 2x or 3x the ATR. I already use another script that paints the bars for trend, so that script won't really work and it doesn't allow to modify the bar size to be 1.1x or 1.5x, just whole numbers.

when asking about modifying a code, try to include a link to it, so others don't have to start from scratch.

to change an input to allow fractions, have to add a trailing 0 to the default number, like
input a = 0.0;


Code:
# atr_avg

def na = double.nan;
def bn = barnumber();

input atr_avg_len = 14;

# atr
#declare lower;
input atr_length = 14;
input averageType = AverageType.WILDERS;
def ATR = MovingAverage(averageType, TrueRange(high, close, low), atr_length);
#ATR.SetDefaultColor(GetColor(8));

def atravg = average(atr, atr_avg_len);
input atr_factor = 1.0;
def large = if (atr > ( atr_factor * atravg[1])) then 1 else 0;


plot z = if large then low*0.999 else na;
z.SetPaintingStrategy(PaintingStrategy.ARROW_UP);
z.SetDefaultColor(Color.green);
z.setlineweight(3);
z.hidebubble();
#
 

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