Quantopian's community platform is shutting down. Please read this post for more information and download your code.
Back to Community
Setting Min Price and Min Volume Filters

Looking to add min price and min volume filters to my algo. However, is there a general method for identifying how far back to go, in regards to say a moving average? How many days, etc?

This would be for a closing/end of day algo.

Thanks!

6 responses

Hello Adam,

I don't quite understand your question. How would "min price and min volume filters" relate to "how far back to go, in regards to say a moving average"?

Grant

Hi Adam,

Have you looked at the set_universe( ) method? It is a built-in convenience method that allows you to set your tradable universe based on average daily dollar volume. The built-in dollar volume universe is updated quarterly. The attached example starts with allocating a $10,000 stake in each of the top 1% of stocks based on dollar volume which also pass a minimum per share price filter of $1.00 (though that filter is unlikely to kick in for that slice of the most liquid stocks). Each day the positions are rebalanced to maintain a $10,000 exposure to each of the stocks in the filtered universe.

Best,
Jess

Disclaimer

The material on this website is provided for informational purposes only and does not constitute an offer to sell, a solicitation to buy, or a recommendation or endorsement for any security or strategy, nor does it constitute an offer to provide investment advisory services by Quantopian. In addition, the material offers no opinion with respect to the suitability of any security or specific investment. No information contained herein should be regarded as a suggestion to engage in or refrain from any investment-related course of action as none of Quantopian nor any of its affiliates is undertaking to provide investment advice, act as an adviser to any plan or entity subject to the Employee Retirement Income Security Act of 1974, as amended, individual retirement account or individual retirement annuity, or give advice in a fiduciary capacity with respect to the materials presented herein. If you are an individual retirement or other investor, contact your financial advisor or other fiduciary unrelated to Quantopian about whether any given investment idea, strategy, product or service described herein may be appropriate for your circumstances. All investments involve risk, including loss of principal. Quantopian makes no guarantees as to the accuracy or completeness of the views expressed in the website. The views are subject to change, and may have become unreliable for various reasons, including changes in market conditions or economic circumstances.

@Jess For the average daily dollar volume calculation in set_universe(), does it use data for the past quarter? I believe that's whats mentioned in the documentation, just wanted to confirm.

Thanks!

@Grant Basically i wanted to set some minimum filters in my algo to screen an index. Goal being to exclude stocks that have demonstrated a min price lower than say $5 and volume under 500K. The question was how far to look back to ensure the stock has been above those min thresholds. I was thinking maybe 30 days, 1 quarter, etc. I was thinking of calculative a moving avg based on the timeframe..and determine if the stock is above those thresholds.

Does that make sense?

@Adam - you are correct, each quarter's dollar volume universe is based on the ranking using the prior quarter's data, with the reconstitution happening on the last day of the quarter.

@Jess Had a question on initial screen of my stock universe. Basically i'm trying to determine if it makes more sense to rank them based on Market Cap....or say the avg daily dollar volume metric. For instance if i want to identify more liquid/active stocks, which filter would be more applicable? Are there example for when to use either/or?

If I did implement the avg daily dollar volume, would it be unnecessary to include any min price/min volume filters. It seems it would be somewhat redundant if i did.

I've been back and forth with this one...any input would be greatly appreciated!