Narrow Range Candle w/ability to set required range -- indicator

3AMBH

Active member
2019 Donor
Hello: I am looking for an indicator that will alert me with an arrow when a bar is printed with a range of .50 or less. If possible I would like to be able to set the range I am looking for from .50 down to .05 & in between. When a bar prints my selected ranger an arrow will appear. Basically it will be an Inside Bar Indicator with the ability to set the size of the bar I am looking for. Hope someone can help with this. Thank you

I have made an edit to my original request after rethinking it. I want to find narrow range bars less than .50 in range. Its that simple. if possible I want to know the range of the bar...is it .48, or .30 or etc,etc.
 
Last edited:
Solution
Hello: I am looking for an indicator that will alert me with an arrow when a bar is printed with a range of .50 or less. If possible I would like to be able to set the range I am looking for from .50 down to .05 & in between. When a bar prints my selected ranger an arrow will appear. Basically it will be an Inside Bar Indicator with the ability to set the size of the bar I am looking for. Hope someone can help with this. Thank you

I have made an edit to my original request after rethinking it. I want to find narrow range bars less than .50 in range. Its that simple. if possible I want to know the range of the bar...is it .48, or .30 or etc,etc.


this will compare bar heights to a number that the user enters. default is...
Hello: I am looking for an indicator that will alert me with an arrow when a bar is printed with a range of .50 or less. If possible I would like to be able to set the range I am looking for from .50 down to .05 & in between. When a bar prints my selected ranger an arrow will appear. Basically it will be an Inside Bar Indicator with the ability to set the size of the bar I am looking for. Hope someone can help with this. Thank you

I have made an edit to my original request after rethinking it. I want to find narrow range bars less than .50 in range. Its that simple. if possible I want to know the range of the bar...is it .48, or .30 or etc,etc.


this will compare bar heights to a number that the user enters. default is 0.5.
draw an arrow if the bar height is less than the number.

i added a couple of other things, to be reference numbers.

can choose wicks or body height. whichever is picked, is also used for the average.
show a label, with a bar height average. default length is 20.
show a label, for ATR.

the arrow is drawn using this formula. low*0.998.
i do this because i don't like shapes touching the bars. i think this makes them a little easier to see.


Ruby:
# narrow_range_00b
def na = double.nan;
input bar_height_limit = 0.50;
input candle_levels = {default "wick" , "body" };

def highx;
def lowx;
switch (candle_levels) {
case "wick":
  highx = high;
  lowx = low;
case "body":
  highx = max( open, close);
  lowx = min( open, close);
}

def bar_ht = highx - lowx;
def issmallbar = if ( bar_ht <= bar_height_limit ) then 1 else 0;

input show_small_bar_arrow = yes;
plot z2 = if (show_small_bar_arrow and issmallbar) then low*0.998 else na;
z2.SetPaintingStrategy(PaintingStrategy.ARROW_UP);
z2.SetDefaultColor(Color.white);
z2.setlineweight(2);
z2.hidebubble();
#

#----------------------------
# bar ht avg
input show_height_average_label = yes;
input ht_avg_len = 20;
def ht_avg = round(average(bar_ht, ht_avg_len),2);
addlabel(show_height_average_label, ht_avg_len + " bar, height average " + ht_avg, color.yellow);

# ---------------------------------------------

# ATR
input show_atr_label = yes;
input length = 14;
input averageType = AverageType.WILDERS;
def ATR1 = MovingAverage(averageType, TrueRange(high, close, low), length);
def atr2 = round(atr1,2);
addlabel(show_atr_label, "ATR " + atr2, color.yellow);
#
 
Solution

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