Back to Community
Round Numbers Strategy Implementation

For UC Berkeley's Quant Decal

Clone Algorithm
21
Loading...
Backtest from to with initial capital
Total Returns
--
Alpha
--
Beta
--
Sharpe
--
Sortino
--
Information Ratio
--
Benchmark Returns
--
Volatility
--
Max Drawdown
--
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
Information Ratio 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: 516792f34021d74ce762807f
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.
6 responses

The Implementation is not done the way it works in the Excel spreadsheet.

Transactions List1 - 15 of 15 PreviousNext
DATE SECURITY TRANSACTION # SHARES PRICE $ AMOUNT
2008-10-19 17:00:00 AAPL BUY 100 $98.43 $9,843.00
2008-10-20 17:00:00 AAPL BUY 100 $91.40 $9,140.00
2008-10-22 17:00:00 AAPL BUY 100 $98.25 $9,825.00
2008-12-08 16:00:00 AAPL BUY 100 $100.08 $10,008.00
2008-12-11 16:00:00 AAPL BUY 100 $98.40 $9,840.00
2009-11-22 16:00:00 AAPL BUY 100 $205.90 $20,590.00
2009-12-02 16:00:00 AAPL BUY 100 $196.53 $19,653.00
2010-02-03 16:00:00 AAPL BUY 100 $192.03 $19,203.00
2011-11-09 16:00:00 AAPL BUY 100 $385.24 $38,524.00
2012-03-15 17:00:00 AAPL BUY 100 $585.60 $58,560.00
2012-03-22 17:00:00 AAPL BUY 100 $596.23 $59,623.00
2012-09-20 17:00:00 AAPL BUY 100 $700.73 $70,073.00
2012-10-31 17:00:00 AAPL BUY 100 $596.55 $59,655.00
2012-11-01 17:00:00 AAPL BUY 100 $576.97 $57,697.00
2013-01-21 16:00:00 AAPL BUY 100 $504.74 $50,474.00

There are only buy orders, when there should be both buy and sell orders.

Idea is to buy at close price, and sell at open next day - if going long.

Or vice versa, sell at close price and buy back again at open next day - if going short.

So no position should be more than one day.

I cloned the code, to try it on Google - but it seems like it still buys Apple
www.quantopian.com/posts/round-numbers-strategy-google-or-is-still-apple
... Weird.

Clone Algorithm
16
Loading...
Backtest from to with initial capital
Total Returns
--
Alpha
--
Beta
--
Sharpe
--
Sortino
--
Information Ratio
--
Benchmark Returns
--
Volatility
--
Max Drawdown
--
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
Information Ratio 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: 5167d9a88697cc118007b4b5
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.

Lars, to change the stock, you have to change the sid, not just the variable name.

context.goog=sid(24) should be

 context.goog=sid(26578)  

When you retype that you'll see the autocomplete that appears. We don't ask you to memorize all the sids ;)

Disclaimer

The material on this website is provided for informational purposes only and does not constitute an offer to sell, a solicitation to buy, or a recommendation or endorsement for any security or strategy, nor does it constitute an offer to provide investment advisory services by Quantopian. In addition, the material offers no opinion with respect to the suitability of any security or specific investment. Quantopian makes no guarantees as to the accuracy or completeness of the views expressed in the website. The views are subject to change, and may have become unreliable for various reasons, including changes in market conditions or economic circumstances. All investments involve risk, including loss of principal. You should consult with an investment professional before making any investment decisions.

I think there's an error with the algorithm, it only ever meets the conditions to sell.

Clone Algorithm
34
Loading...
Backtest from to with initial capital
Total Returns
--
Alpha
--
Beta
--
Sharpe
--
Sortino
--
Information Ratio
--
Benchmark Returns
--
Volatility
--
Max Drawdown
--
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
Information Ratio 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: 51686051c0b8b319018d75f7
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.

Strategy seems to work better on Google - even though it only buys and never sells :)

Clone Algorithm
16
Loading...
Backtest from to with initial capital
Total Returns
--
Alpha
--
Beta
--
Sharpe
--
Sortino
--
Information Ratio
--
Benchmark Returns
--
Volatility
--
Max Drawdown
--
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
Information Ratio 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: 5168d24616046f06774dbbb6
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.

According to google finance, if you were to buy google long across the same span from 2008 to 2013, the returns would only be 11%, therefore this alg def seems to atleast make for a better long!,