Scanning for a specific bar (4am and 9:30am)

Good afternoon. I have been searching for a way to scan for specific bars.

For example, If I wanted to scan for all relative volume values over 5 at 9:30a on the 5minute timeframe, how would I do that?

I am able to use the "offset" and "Bars" functions, but I am looking for a more specialized scan.

I was able to find this snippet of code below, but I have not been able to get any further. @generic (thank you for all your help)

declare lower;
input startTime = 930;
input endTime = 935;
def startOfScan = SecondsFromTime(startTime) > 0;
def endOfScan = SecondsTillTime(endTime) > 0;
plot scanPeriod = startOfScan or endOfScan;
 
Solution
@ProfessorAR15 I think this is what you want.
Code:
input time = 930;
input length = 60;
input numDev = 5.0;

def rawRelVol = (volume - Average(volume, length)) / StDev(volume, length);
def timer = SecondsFromTime(time) == 0;
def over = if timer then if rawrelVol > numDev then 1 else 0 else over[1];

plot scan = over == 1;
@ProfessorAR15 I don't understand the request. Are you looking to scan during the 5 minutes or scan sometime after, ie. 10:00 am, and want to know what stocks had rvol higher than 5 during the first 5 minute. I won't be able to help until tomorrow after market close so I'll check back at that time.
 

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

@ProfessorAR15 I don't understand the request. Are you looking to scan during the 5 minutes or scan sometime after, ie. 10:00 am, and want to know what stocks had rvol higher than 5 during the first 5 minute. I won't be able to help until tomorrow after market close so I'll check back at that time.
Thank you, and absolutely no rush.

Going back to the rVOL example........lets say I start trading at 8am, and I have a watchlist of 75 stocks. What I want to know, is which ones had rVOL scores over 5 on the 4am bar, and ONLY the 4am bar. If a stock had a rVOL value of 5 at 4:30am, this scan would not pick it up as it's out of scope.

This can be done using standard settings if I were to do the scan at 4:05am for the last bar, but it's much more difficult do to it during regular trading hours, as the bar would need to be changed every 5 minutes in order to keep the scan at the specific time that I want.

I hope this makes more sense, please let me know if not. Thank you again!
 
@ProfessorAR15 I think this is what you want.
Code:
input time = 930;
input length = 60;
input numDev = 5.0;

def rawRelVol = (volume - Average(volume, length)) / StDev(volume, length);
def timer = SecondsFromTime(time) == 0;
def over = if timer then if rawrelVol > numDev then 1 else 0 else over[1];

plot scan = over == 1;
 
Last edited:
Solution

Similar threads

Not the exact question you're looking for?

Start a new thread and receive assistance from our community.

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