Back to Community
Who needs value?! Absurd strategy herein

Value strategies do great over the long term. The downside is that they are still susceptible to bear markets so value strategies must be combined with asset allocation strategies, which require weekly/monthly/quaterly/whateverly rebalancing. It's a pain in the butt to trade frequently what are sometimes illiquid stocks.

So I looked for strategies that have:
1. SP500 correlation
2. Some outperformance, but not looking for 20% CAGR
3. Must involve a small number of liquid stocks

Small dogs of the Dow fits these criteria. For the uninitiated, Dogs of the Dow attempts to beat the Dow by a yearly rebalance of the top 10 dividend yielding companies of the Dow Industrial. Since the strategy has been tracked, it hasn't outperformed the Dow by very much. A ridiculous derivative of this strategy is the Small Dogs of the Dow. You take the dogs of the dow, but you pick the 5 with the lowest price. Not the 5 companies with the lowest valuations ratio. Just price.

Price shouldn't affect performance of stocks because they are arbitrary, but it seems to improve dogs of the dow strategy.

So I thought: Maybe this effect could be extrapolated into the general market.

In this algorithm, every 6 months, the top 5 percentiles market cap percentile will be sorted by price. This is about 500 stocks. From this, lowest N=20 are chosen. They are held for 6 months then rebalanced. That's it.

Clone Algorithm
39
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: 55ca0a02ce264d0c7182375e
There was a runtime error.
7 responses

Maybe this is an effect of concentrating risk so I ran a backtest with the highest price stock.

Clone Algorithm
39
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: 55ca0b3ee8a0070c6731275b
There was a runtime error.

This may be susceptible to the lookahead bias introduced by split-adjusted prices. For instance GOOG and AAPL would have had split-adjusted prices of just pennies ten years ago. Someone mentioned this in another thread, but I don't recall who in order to give credit...

1) I agree that there is a lookahead bias...I believe there was a lot of leverage used originally. What could one put in place of 'APPL' to make sure this algo runs across all securities not leveraged? I think it would be a lot more efficient and more realistic.

2) However, even with a do_not_order_list for leveraged etfs, it appears to try to trade one anyway. How does one go about fixing this problem?
def initialize(context):
context.formation = 2
context.port_size = 20
context.rebalance_int = 6
context.month_count = context.rebalance_int

set_slippage(slippage.VolumeShareSlippage(volume_limit=0.25, price_impact=0.1))  
set_universe(universe.DollarVolumeUniverse(floor_percentile=95.0, ceiling_percentile=100.0))  
set_do_not_order_list(security_lists.leveraged_etf_list)  



def handle_data(context,data):  

# the point in time lists allow for in/not in checks and iteration
# the list is point-in-time and allows for checks and iterations
if symbol('AAPL') not in security_lists.leveraged_etf_list:
order_target(symbol('AAPL'), 100)

# view the contents of the list
for etf in security_lists.leveraged_etf_list:
print '{s} is a leveraged etf'.format(s=etf)

Clone Algorithm
2
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: 55ccb4341758310c5c08da4a
There was a runtime error.

The algo stops running in 2014 due to attempt at trading a leveraged ETF...

any suggestions?

Also see https://www.quantopian.com/posts/historical-data-issues

@Dan
...You have two handle_data calls....