From cebbe193196b1f0cb3c14cd277e3356f70550679 Mon Sep 17 00:00:00 2001 From: Jeremiah Lowin Date: Tue, 19 May 2015 14:25:36 -0400 Subject: [PATCH] Fix code block formatting in release notes --- docs/release-notes/zipline-0.8.0.md | 36 ++++++++++++++--------------- 1 file changed, 18 insertions(+), 18 deletions(-) diff --git a/docs/release-notes/zipline-0.8.0.md b/docs/release-notes/zipline-0.8.0.md index 222e4355..686e75a3 100644 --- a/docs/release-notes/zipline-0.8.0.md +++ b/docs/release-notes/zipline-0.8.0.md @@ -71,24 +71,24 @@ data[security].stddev(3) > Also adds `context.get_market_value()`, which enables this functionality. > For example: -```python -# this is how it works today (and this still works) -# put 50% of my portfolio in AAPL -order_percent('AAPL', 0.5) -# note that if this were a fully invested portfolio, it would become 150% levered. - -# take half of my available cash and buy AAPL -order_percent('AAPL', 0.5, percent_of='cash') - -# rebalance my short position, as a percentage of my current short book -order_target_percent('MSFT', 0.1, percent_of='shorts') - -# rebalance within a custom group of stocks -tech_stocks = ('AAPL', 'MSFT', 'GOOGL') -tech_filter = lambda p: p.sid in tech_stocks -for stock in tech_stocks: - order_target_percent(stock, 1/3, percent_of_fn=tech_filter) -``` + > ```python + # this is how it works today (and this still works) + # put 50% of my portfolio in AAPL + order_percent('AAPL', 0.5) + # note that if this were a fully invested portfolio, it would become 150% levered. + > + # take half of my available cash and buy AAPL + order_percent('AAPL', 0.5, percent_of='cash') + > + # rebalance my short position, as a percentage of my current short book + order_target_percent('MSFT', 0.1, percent_of='shorts') + > + # rebalance within a custom group of stocks + tech_stocks = ('AAPL', 'MSFT', 'GOOGL') + tech_filter = lambda p: p.sid in tech_stocks + for stock in tech_stocks: + order_target_percent(stock, 1/3, percent_of_fn=tech_filter) + ``` ### Major performance enhancements to history (by Dale Jung) [PR488](https://github.com/quantopian/zipline/commit/38e8d5214d46f089020703712dc6b3f4f6ee084d)