Skip to content

Commit e413b7f

Browse files
committed
Add support for adjusting how far back in history the trending strategy will go
1 parent 5109a55 commit e413b7f

File tree

1 file changed

+6
-1
lines changed

1 file changed

+6
-1
lines changed

strategies/trending.py

+6-1
Original file line numberDiff line numberDiff line change
@@ -66,7 +66,12 @@ def __init__(self, start_date, end_date, initial_position, market, params, h5fil
6666
self.addIndicator(symbol, "rsi", RSI(rsi))
6767

6868
# Backfill the indicators
69-
d = start_date - (30 * ONE_DAY)
69+
try:
70+
backfill = params['backfill']
71+
except KeyError:
72+
backfill = long_
73+
74+
d = start_date - (backfill * ONE_DAY)
7075
self.updateIndicators(d, start_date)
7176

7277
def evaluate(self, date, position, market):

0 commit comments

Comments
 (0)