Custom Study Not Filtering Out Non Matching Results.

Damisco

New member
Hello all, this is my first post on the forum. Hopefully its in the right place!

I've run into confusion on several occasions as I learn to build scanners that have custom study filters. In my scanner I've got this thinkscript:
Code:
def currentRVOL = volume(period = AggregationPeriod.DAY) / Average(volume(period = AggregationPeriod.DAY), 30);
def previousRVOL = volume(period = AggregationPeriod.DAY)[1] / Average(volume(period = AggregationPeriod.DAY)[1], 30);


plot filter = currentRVOL >= 4 * previousRVOL;

All I'm hoping for here is to remove all results with where the currenRVOL is not greater than 4. To try and prove this out I've made a watchlist column using the same calculation.
Code:
def currentRVOL = volume(period = AggregationPeriod.DAY) / Average(volume(period = AggregationPeriod.DAY), 30);
def previousRVOL = volume(period = AggregationPeriod.DAY)[1] / Average(volume(period = AggregationPeriod.DAY)[1], 30);

def filter = currentRVOL >= 4 * previousRVOL;

AddLabel(yes, Round(currentRVOL, 2),
    if filter then Color.GREEN else Color.RED);


However, when I pull up the results of my scanner in a watchlist with this column I see many results below 4. I can't figure out how to get it to drop those results.

Some things of note:

1. I know RVOL has some complications when calculating pre-market and I'm okay figuring that out on my own (unless some wizard knows off hand how I can account for both pre-market and intraday)
2. I've used the AggregationPeriod.DAY intentionally just to ensure there wasn't a difference in the timeframe between the scanner study and watchlist column. (I believe I can use the button in the filter set to day and get the same result).


Any help would be greatly appreciated thanks all!
 
Solution
Hello all, this is my first post on the forum. Hopefully its in the right place!

I've run into confusion on several occasions as I learn to build scanners that have custom study filters. In my scanner I've got this thinkscript:
Code:
def currentRVOL = volume(period = AggregationPeriod.DAY) / Average(volume(period = AggregationPeriod.DAY), 30);
def previousRVOL = volume(period = AggregationPeriod.DAY)[1] / Average(volume(period = AggregationPeriod.DAY)[1], 30);


plot filter = currentRVOL >= 4 * previousRVOL;

All I'm hoping for here is to remove all results with where the currenRVOL is not greater than 4. To try and prove this out I've made a watchlist column using the same calculation.
Code:
def currentRVOL = volume(period =...
Hello all, this is my first post on the forum. Hopefully its in the right place!

I've run into confusion on several occasions as I learn to build scanners that have custom study filters. In my scanner I've got this thinkscript:
Code:
def currentRVOL = volume(period = AggregationPeriod.DAY) / Average(volume(period = AggregationPeriod.DAY), 30);
def previousRVOL = volume(period = AggregationPeriod.DAY)[1] / Average(volume(period = AggregationPeriod.DAY)[1], 30);


plot filter = currentRVOL >= 4 * previousRVOL;

All I'm hoping for here is to remove all results with where the currenRVOL is not greater than 4. To try and prove this out I've made a watchlist column using the same calculation.
Code:
def currentRVOL = volume(period = AggregationPeriod.DAY) / Average(volume(period = AggregationPeriod.DAY), 30);
def previousRVOL = volume(period = AggregationPeriod.DAY)[1] / Average(volume(period = AggregationPeriod.DAY)[1], 30);

def filter = currentRVOL >= 4 * previousRVOL;

AddLabel(yes, Round(currentRVOL, 2),
    if filter then Color.GREEN else Color.RED);


However, when I pull up the results of my scanner in a watchlist with this column I see many results below 4. I can't figure out how to get it to drop those results.

Some things of note:

1. I know RVOL has some complications when calculating pre-market and I'm okay figuring that out on my own (unless some wizard knows off hand how I can account for both pre-market and intraday)
2. I've used the AggregationPeriod.DAY intentionally just to ensure there wasn't a difference in the timeframe between the scanner study and watchlist column. (I believe I can use the button in the filter set to day and get the same result).


Any help would be greatly appreciated thanks all!
you are only using filter to change the color. not the value.
if you dont want to see small values, add an if-then with filter to control Round(currentRVOL, 2)

addlabel(yes, (if filter then Round(currentRVOL, 2) else 0),...
 
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
330 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