Back to Community
Berkshire Class Ratio as a Buy Point Indicator

Here, I implemented a strategy that considers, among other factors, the ratio between Berkshire Hathaway Class A stock and Class B stock as an investment signal for both Berkshire Class B stock and SPY as introduced in this SeekingAlpha article. The strategy considers several criteria as buy points for Berkshire Hathaway:

1) Class Ratio > 1510
2) Increasing VIX
3) Volume above twice the 50-day moving average volume
4) Increasing volume

The data above identify times of strong bearishness in Berkshire Hathaway stock as well as strong overall market bearishness, providing buy point indicators.

I'm interested to see what other factors might make this more robust. Anyone have other data sources to add?

Clone Algorithm
149
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: 53178afeea708507406355c9
This backtest was created using an older version of the backtester. Please re-run this backtest to see results using the latest backtester. Learn more about the recent changes.
There was a runtime error.
4 responses

I suggest you try trading this only once a day by inserting something like the following, and make a call to it in handledata. It won't be as slow. Also, you may want to use a moving average on your vix test, rather than just the different between two days. If you are investing a million, it may be nice to invest the rest while you are waiting in bonds or something. Kudos for coming up with an interesting idea.

put in handle data

# only execute algorithm once per day
if not intradingwindow_check(context): return

def intradingwindow_check(context):
# Converts all time-zones into US EST to avoid confusion
if get_datetime().day == context.yesterday:
return False

    loc_dt = get_datetime().astimezone(timezone('US/Eastern'))  
    if loc_dt.hour >= 10 and loc_dt.minute >= 5:  
        context.yesterday = get_datetime().day  
        return True  
    else:  
        return False  

Hey Richard,

Thanks for your thoughts. While the algorithm executes on every bar, it only places an order once per day. I updated the algorithm to use a moving average on VIX as a signal, rather than looking for VIX simply increasing over the previous day. The result is a more conservative strategy - lower returns and lower volatility.

Ryan

Clone Algorithm
149
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: 5318a36eecf0c20745b99f49
This backtest was created using an older version of the backtester. Please re-run this backtest to see results using the latest backtester. Learn more about the recent changes.
There was a runtime error.

The original article doesn't seem very convincing. I mean the strategy only finds 7 buy points over 14 years. Then he measures performance based on the highest point of returns. That would be great if the trade is timed perfectly. Also BRK B split in 2010. So the 1510 ratio works in hindsight.

Hey Brent - thanks for your comments. You are right about the small number of buy points; seven points in fourteen years is a small sample size to determine a systematic signal and it's not always feasible to wait for two years for a buy signal. Quantopian's engine handles stock splits (help page). The buy point strategy also outperforms a buy-and-hold strategy that holds 50% of the portfolio in Berkshire Class B stock and 50% of the portfolio in SPY (see attached back-test).

Clone Algorithm
9
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: 531922ed007db8074aea1fe9
This backtest was created using an older version of the backtester. Please re-run this backtest to see results using the latest backtester. Learn more about the recent changes.
There was a runtime error.