Quantopian's community platform is shutting down. Please read this post for more information and download your code.
Back to Community
Robinhood Gold

Yesterday when checking my Robinhood account I noticed that Robinhood is offering a new service: Robinhood Gold. Gold gives you access to funds on margin as well as extended market hours. Are there any plans for Quantopian to make use of these new features? My Robinhood account is now GOLD, but I don't have access to the funds on margin, nor the extended market hours with my live-trading algorithm, as far as I can tell.

7 responses

Bumping for all to see :)

Integration with RobinHood Gold could improve market returns and enable use of leverage >1 for those margin investors out there.

Where's the love on this...

Robinhood+Quantopian Integration Public Enemy #1

I'm currently live trading a Robinhood Gold account. The numbers on the dashboard take a little bit of interpretation (eg the cash will be negative if you dip into your margin buying power which makes sense). You can get 'access' to the margin buying power funds by simply ordering more than your available cash. Something like this:

# set fixed additional gold buying power in variable 'context.robinhood_gold_buying_power'  
net_cash = context.portfolio.cash + context.robinhood_gold_buying_power  
order_value(stock, net_cash)

The above will order stock worth all the buying power you have left (ie cash + margin). Note that this is an example only. Real trading should probably calculate actual shares to order and use a LimitOrder.

I rely on the 'context.portfolio' variables and not on the 'context.account' variables. 'context.portfolio.cash' will have your Robinhood actual cash value and will be negative by any amount you dip into your margin. 'context.portfolio.portfolio_value' will have your Robinhood total equity value PLUS the portfolio.cash. If that cash is negative (because you've dipped into your margin) then it will effectively be subtracted from the equity value. To get the effective portfolio value (ie the amount you have INCLUDING the added Robinhood buying power) simply add the buying power.

# set fixed additional gold buying power in variable 'context.robinhood_gold_buying_power'  
effective_portfolio_value = context.portfolio.portfolio_value + context.robinhood_gold_buying_power  
order_value(stock, effective_portfolio_value * .5)

The above will order stock worth 50% of the total buying power (ie portfolio value + margin). Note that this is an example only. Real trading should probably calculate actual shares to order and use a LimitOrder.

The built in 'order_target_percent' won't take into account the added buying power. It probably shouldn't be used in live trading.

You don't get access to after hours trading but you can use the added buying power.

You're the man, Dan.

Q says that Robinhood Gold isn't supported but, from what I can tell, that is mostly because the 'context.account' data isn't well integrated (ie buying_power, maintenance_margin_requirement etc). For that reason I don't use those and always use the 'context.portfolio' values instead.

On a base level, Robinhood views your Quantopian algorithm pretty much the same as your smart phone. If you can place an order on your smart phone (ie order more than your cash but less than your net buying power) then you can place an order via your algorithm.

One detail your algorithm should address is ensuring you don't drop under your margin maintenance requirements. I do this every day by rebalancing to keep my 'net_cash > 0.0'. Robinhood gives you some leeway on this before issuing a margin call, but I prefer to be on the safe side and always keep a positive net_cash. For this reason, it may be a good idea to not order your entire buying power and maintain a bit of a cushion.

I think you need to be careful in regards to if your algo is computing "cash" IE if you were to be computing context.portfolio.cash / share price to get how many shares you could buy you would end up with a negative number - thus resulting in the algo trying to short instead of purchase long

Dan, I was able to implement this with ease. Thanks for the smack upside the head. So simple!