Back to Community
Channel Stocks from Website

The website has several filters you can apply, and I've always been intrigued by the ChannelUp and ChannelDown filters. Here's the ChannelUp filter:,sh_price_o5. It makes sense that you would have made money if you had bought/shorted those beautiful charts a year ago, but do you still want to own/short them going forward?

I put together a program outside of Quantopian that "screen-scrapes" the first 30 securities from those filters (including $5 min price and 400k min vol) and loads them into a .csv file available on the web - with data starting 6/18/17. For the record, I tried something similar before I found Quantopian, so I have data from 12/14-2/16, but it is only on the top 10 securities in the list and doesn't seem to backtest that well.

This will take some time to see if there is really anything there, but for now I wanted to see if anyone was interested in trying to help improve it. Basically, I grab a list from the .CSV on the web (separate list for longs and shorts, but in 1 file), then I wait to actually take a position in the security until the bollinger band tells me it is a decent entry point. If it disappears from the list or the bollinger band says it is a good exit point, I close the position.

Results seem promising over the last month, but I am no expert here and am still trying to wrap my head around all Q has to offer. Anybody want to play around with it and try to make it better? In 6 months to a year we will have a better idea whether or not there is really anything there...

Clone Algorithm
Backtest from to with initial capital
Total Returns
Max Drawdown
Benchmark Returns
Returns 1 Month 3 Month 6 Month 12 Month
Alpha 1 Month 3 Month 6 Month 12 Month
Beta 1 Month 3 Month 6 Month 12 Month
Sharpe 1 Month 3 Month 6 Month 12 Month
Sortino 1 Month 3 Month 6 Month 12 Month
Volatility 1 Month 3 Month 6 Month 12 Month
Max Drawdown 1 Month 3 Month 6 Month 12 Month
# Backtest ID: 5989e81d05b8944fb9ca75e2
There was a runtime error.
3 responses

Simple and effective.

Is there a script you're using to pull and upload the .csv data? How can I create my own custom csv?

I have found VBA and VBScript useful for this sort of thing even though Microsoft ditched it a long time ago. You should be able to use some code that is similar to the link below to download an HTML page, and then you just need to parse it and save the results to a CSV:

Cool, but what about instead of scraping vinfiz just recreating the channel detection in Quantopian? It's probably not as easy, but will give you more options.

I think the basic logic is you need to identify the peaks and valleys, run linear regressions on those, and if the slopes are more or less parallel and trending, then you have your channel up or down. Probably you want to also check for peak/valley points that are outliers.

I hacked together a naive attempt at recreating peak and valley trend lines as a response to this post, just as a rough proof of concept. (In my example I simply buy at the low end of the channel and sell at the high -- doesn't work so well.) In my example I keep track of the peak and valley points on the fly, but you could rewrite it to use pipeline.