From 5f495f91fcbd1a07e62839f85ca22d08ff1675df Mon Sep 17 00:00:00 2001 From: Scott Sanderson Date: Mon, 5 Oct 2015 11:30:26 -0400 Subject: [PATCH] DOC: Restructure example slightly. --- zipline/pipeline/factors/factor.py | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/zipline/pipeline/factors/factor.py b/zipline/pipeline/factors/factor.py index 2973f301..377b9ed0 100644 --- a/zipline/pipeline/factors/factor.py +++ b/zipline/pipeline/factors/factor.py @@ -502,9 +502,6 @@ class CustomFactor(RequiredWindowLengthMixin, CustomTermMixin, Factor): lowest_lows = nanmin(axis=0) out[:] = highest_highs - lowest_lows - # Doesn't require passing inputs or window_length because they're - # pre-declared as defaults - ten_day_range = TenDayRange() class MedianValue(CustomFactor): ''' @@ -520,7 +517,12 @@ class CustomFactor(RequiredWindowLengthMixin, CustomTermMixin, Factor): out[:} = data.nanmedian(axis=0) - # Values for `inputs` and `window_length` must be passsed explitly. + # Doesn't require passing inputs or window_length because they're + # pre-declared as defaults for the TenDayRange class. + ten_day_range = TenDayRange() + + # Values for `inputs` and `window_length` must be passsed explitly to + # MedianValue. median_close_10 = MedianValue([USEquityPricing.close], window_length=10) median_low_15 = MedianValue([USEquityPricing.low], window_length=15) """