Need to excludes wicks from my studies

JahnJohn

New member
I am looking for a simple Support/Resistance indicator that excludes wicks for a specific time frame - say 930 to 1030
Thanks!
 
Solution
Awesome. This works perfectly!

Is it possible to add an option for the script to show today’s price action only?

This is an aggregationperiod selectable version that is defaulted to your request in post #2 and to not use wicks as requested in post #1 and an option to limit the plots to today only as in post #3.

The image shows a 5d5m chart with the same 5m aggregation period script on a 1d1m chart

Screenshot-2022-12-10-111146.png
Ruby:
input showtodayonly = yes;
input agg           = AggregationPeriod.FIVE_MIN;
input begin         = 0930;
input end           = 1030;

def c = close(period = agg);
def o = open(period = agg);

def range  = SecondsFromTime(begin) >= 0 and SecondsTillTime(end) >= 0;
def hrange = if range[1] == 0 and range...
Awesome. This works perfectly!

Is it possible to add an option for the script to show today’s price action only?

This is an aggregationperiod selectable version that is defaulted to your request in post #2 and to not use wicks as requested in post #1 and an option to limit the plots to today only as in post #3.

The image shows a 5d5m chart with the same 5m aggregation period script on a 1d1m chart

Screenshot-2022-12-10-111146.png
Ruby:
input showtodayonly = yes;
input agg           = AggregationPeriod.FIVE_MIN;
input begin         = 0930;
input end           = 1030;

def c = close(period = agg);
def o = open(period = agg);

def range  = SecondsFromTime(begin) >= 0 and SecondsTillTime(end) >= 0;
def hrange = if range[1] == 0 and range
             then Max(c, o)
             else if range
             then Max(Max(c, o), hrange[1])
             else if SecondsFromTime(1600) <= 0
             then hrange[1]             
             else Double.NaN;
def lrange = if range[1] == 0 and range
             then Min(c, o)
             else if range
             then Min(Min(c, o), lrange[1])
             else if SecondsFromTime(1600) <= 0
             then lrange[1]             
             else Double.NaN;
def cstart = if range[1] == 0 and range
             then c
             else if SecondsFromTime(1600) <= 0
             then cstart[1]             
             else Double.NaN;
def cend   = if range[-1] == 0 and range
             then c
             else if SecondsFromTime(1600) <= 0
             then cend[1]             
             else Double.NaN;

input showlabel = yes;
AddLabel(showlabel, begin + "-" + AsPrice(end) + " H:" + AsDollars(hrange) + " L: " + AsDollars(lrange) + " CS: " + AsDollars(cstart) + " CE: " + AsDollars(cend), Color.YELLOW);

input showplot = yes;
plot xhrange = if !showplot or (showtodayonly and !IsNaN(c))
               then Double.NaN
               else hrange;
plot xlrange = if !showplot or (showtodayonly and !IsNaN(c))
               then Double.NaN
               else lrange;
plot xcstart = if !showplot or
                  (showtodayonly and !IsNaN(c))
               then Double.NaN
               else cstart;
plot xcend   = if !showplot or
                  (showtodayonly and !IsNaN(c)) or
                  (showtodayonly and GetDay() == GetLastDay() and SecondsTillTime(end) > 0)
               then Double.NaN
               else cend;

xhrange.SetPaintingStrategy(PaintingStrategy.DASHES);
xlrange.SetPaintingStrategy(PaintingStrategy.DASHES);
xcstart.SetPaintingStrategy(PaintingStrategy.DASHES);
xcend.SetPaintingStrategy(PaintingStrategy.DASHES);

input showbubbles = yes;
input bubblemover = 3;
def b = bubblemover;
def b1 = b + 1;

AddChartBubble(showbubbles and IsNaN(c[b]) and !IsNaN(c[b1]), xhrange[b], "H", xhrange.TakeValueColor());
AddChartBubble(showbubbles and IsNaN(c[b]) and !IsNaN(c[b1]), xlrange[b], "L", xlrange.TakeValueColor());
AddChartBubble(showbubbles and IsNaN(c[b]) and !IsNaN(c[b1]), xcstart[b], "CS", xcstart.TakeValueColor());
AddChartBubble(showbubbles and IsNaN(c[b]) and !IsNaN(c[b1]), xcend[b], "CE", xcend.TakeValueColor());

;
 
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
345 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