Back to Community
Robinhood PennyStock Rotation (Using PsychSignal Data) - 100%+/Year

The following was successfully live - traded in the month of September with positive results that reflect those of the backtest.

YES: I know that this will not work with most commission models, this was designed specifically to be used with Robinhood (which it was).
Robinhood's less than exceptional execution time did not effect the algorithms live performance - likely because all orders were placed as limit orders.

Trading schedule:
Open trades at market close
Close trades at market open

Returns come from pre-market and post market movements.
This algorithm is very early alpha, using only SMA's in calculations. I stopped developing it when Quantopian decided to stop supporting interaction with brokers.

I may continue to develop this, if I do, I will combine all of my research notebooks into one and post that as well.

Clone Algorithm
181
Loading...
Backtest from to with initial capital
Total Returns
--
Alpha
--
Beta
--
Sharpe
--
Sortino
--
Max Drawdown
--
Benchmark Returns
--
Volatility
--
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: 59e548c2758ead40fbb1847b
There was a runtime error.
20 responses

The smooth consistent upwardness is Sharpe +15.

This is awesome. I've never seen a return like this with such a low max downdraw and high sharpe/sortino.

@Jacob, this is awesome. Thanks for sharing. So if I'm reading this correctly it basically holds overnight high volume securities that have growing bullish sentiment? I'm surprised how effective it is!
Do you have any intention to port this? Stocktwits probably has an api , right?

I also spent Sept frantically testing a penny stock strategy with similar backtest stats, but ran into problem after problem until the order history grew so large it crashed the sync process between q and RH.

I have not been able to review any live trades, but I am sure there is still an issue with fills and penny stocks - much like the results Charles Witt got between his backtest and live trading due to volume/fill.

I see a lot of partial fills/zero fills in the log.

I think it has more to do with how quantopian fills the backtest vs the actual volume for that bar/entry point.

@jacob I didn't know you could do volume>1000000 ... I thought you need either .latest or take an sma or something along those lines.

Man, this would be a tax nightmare with so many buys/sells going through!

But with the amount of trades you could probably call this a business...

@Jacob, Hi & many thanks. Output looks EXTREMELY impressive. I look forward to going through it in detail. Cheers, best wishes, Tony.

How are you guys still able to support live trading through quantopian?

@jason.
I can't speak for anyone else, but personally i didn't trade thru Quantopian, so recent changes have no impact for me.

This algorithm reminds me of the usual problem we have seen many times in this forum with greatly performing algorithms that work well only with low volume stocks. They work well when backtesting but not in live trading. This is because the current slippage model doesn't simulate well low volume stocks and because there is a longstanding bug. If someone feels like adding an additional filter to the pipeline (Q1500US, Q3000US or even increasing the volume filter to 'volume>10000000') and see if the stellar results persist, that it would be interesting to know and we could then trust the results. Having live traded this algorithm only one month doesn't confirm much

@Luca,
Thanks for your comment. As i'm new here & haven't had time to read all the posts, there's lots that you have seen & i haven't yet.

I have 2 different sets of interests, one aligned with Quantopian in terms of algos for funds, the other in terms of personal trading, and i'm careful not to confuse the two. Trading low volume, relatively illiquid stocks can be a viable strategy for personal trading, especially in stocks about which one has some specialist knowledge (in my case resource stocks), as long as one remains fully aware of the limitations. Personally I don't think increasing the volume filter is the best answer, but certainly having a valid slippage model is a key part of getting it right. I looked at this topic (outside of Quantopian) in the context of options and avoiding option series where the bid-ask spread is so wide that they can almost never become profitable trades. Although bid-ask is very dependent on the market-maker and supply-demand variability, i did find some rough-but-reasonable first order approximations to typical bid-ask spread in % as a function of dollar-volume liquidity in the underlying. Presumably it should not be too difficult for Q to allow users to input their own models of % slippage as a function of average daily dollar-volume liquidity. Who should I address this issue to at Q?

Agree about the 1-month part. "Necessary but not sufficient condition", but at least a good start.
;-)

@Tony I agree with what you say. To be clear I am just saying that the value of a backtest is lost when we are trading low volume stocks because they are not well modelled. If your algorithm works with high volume stocks is very likely you can get the same performance in live trading, otherwise you simply don't know. It might work or it might not, but we cannot say that from the backtest results unfortunately.

Regarding the creation of a custom slippage model it is very easy do to, we have the API for that. I did many times to make my backtests more reliable for live trading purpose

@Luca and Tony....This may or may not be relevant to what you are discussing. I did notice that results go down significantly when you increase the amount of money you start back test with. I also noticed some worse fills. Ex: Starting with $100k I saw a fill in stock @ 4.77 When I increased starting capital to $500k ,and had to sell more shares, the fill was @4.12. Is it possible the program understands where it can get fills ?

@mitch tullman
Hi Mitch, thanks. i'm not yet familiar enough with it to know exactly how the program actually handles the impact of volume on price, but what you describe is certainly consistent with what one should expect, and with how things behave in reality with low volume stocks, i.e. sell a few shares and get a good price, then that buyer has taken all he/she wants and so disappears, and the next buyer along says "no, i won't pay that much", and so the price you can get drops because there just isn't anyone else there to buy at that time. It's even worse with options!

Hi! I might be a lil late to the party to trade with Quantopian and Robinhood, but what is your currently broker that you use or current bridge that you use to trade wiht algos? Thank you

Can somebody explain to me how a string like this is evaluated in Python?

                    (bull_1 > sma_bull_2 < sma_bull_3  < sma_bull_4 < sma_bull_5 < sma_bull_6 > 0)&\  

I would have thought it would be the same as this, but it is most definitely not:

                    (bull_1 > sma_bull_2)&\  
                    (sma_bull_2 < sma_bull_3)&\  
                    (sma_bull_3 < sma_bull_4)&\  
                    (sma_bull_4 < sma_bull_5)&\  
                    (sma_bull_5 < sma_bull_6)&\  
                    (sma_bull_6 > 0)&\  

Perhaps something to do with the alternating direction of the comparison operators. So what is actually going on? I'm still trying to wrap my head around what this algorithm is actually basing its prediction on.

@Alex B, Quantopian stopped supporting Robinhood almost a year ago and there is no drop-in replacement. There's a brokerage called Alpaca that plans to support zipline-live, so some Quantopian algorithms should work there, but not this one as it depends on a dataset only available for free on the Q platform.

(bull_1 > sma_bull_2 < sma_bull_3 < sma_bull_4 < sma_bull_5 < sma_bull_6 > 0)&\

Added pipeline preview. Taking a look at the first in the log, ROX, bull_1 > sma_bull_2 is true. All of the others are progressively lower. But on other stocks making it thru the screen, bull_1 is less than sma_bull_2. Commented that line out and the number of stocks (123) is the same, looks always true, not screening anything, at least on the first day.

Part of that output

2017-01-03 05:45 log_data:285 INFO Rows: 123  Columns: 6  
                          min              mean               max  
    bull_1                0.3     1.86302981301              2.88  
sma_bull_2          0.6536365     1.76088001626            2.6825  
sma_bull_3     0.748333333333     1.70504029268     2.39399333333  
sma_bull_4            0.56125     1.68422944106             2.505  
sma_bull_5              0.449     1.61604912683         2.1195966  
sma_bull_6     0.374166666667     1.60739960298     2.08599716667  
2017-01-03 05:45 log_data:300 INFO _ _ _   bull_1   _ _ _  
    ... bull_1 highs  
                     bull_1  sma_bull_2  sma_bull_3  sma_bull_4  sma_bull_5  \  
Equity(28312 [ROX])   2.880    2.473333    2.393993    2.307995    1.846396  
Equity(15814 [HMY])   2.815    2.241667    1.816111    1.900416    1.880833  
Equity(41783 [PME])   2.780    2.397727    2.205152    1.653864    1.323091  
Equity(10179 [HHS])   2.740    1.925000    1.653333    1.240000    0.992000   

                     sma_bull_6  
Equity(28312 [ROX])    1.694080  
Equity(15814 [HMY])    1.874444  
Equity(41783 [PME])    1.102576  
Equity(10179 [HHS])    0.826667  
Clone Algorithm
5
Loading...
Backtest from to with initial capital
Total Returns
--
Alpha
--
Beta
--
Sharpe
--
Sortino
--
Max Drawdown
--
Benchmark Returns
--
Volatility
--
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: 5b54eb3d1c9dfa42ad76e99e
There was a runtime error.

thanks, Blue. You're absolutely right. Tried backtest with that line commented out and it performs identically.

:) Here's what happens when you trim some of the fat. (87 sortino ratio!) I have a hard time believing most of this isn't due to quirks in the Quantopian backtester, but I'll take Jacob at his word that he traded it and it held up.

Clone Algorithm
15
Loading...
Backtest from to with initial capital
Total Returns
--
Alpha
--
Beta
--
Sharpe
--
Sortino
--
Max Drawdown
--
Benchmark Returns
--
Volatility
--
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: 5b5654a10afad543a132ed38
There was a runtime error.