Skip to content

Commit

Permalink
0.8.11 update ts cache(waditu#65)
Browse files Browse the repository at this point in the history
  • Loading branch information
zengbin93 committed Dec 26, 2021
1 parent 69816e8 commit 5f297db
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions czsc/data/ts_cache.py
Original file line number Diff line number Diff line change
Expand Up @@ -167,7 +167,7 @@ def pro_bar(self, ts_code, start_date, end_date, freq='D', asset="E", adj='qfq',
kline = kline.sort_values('trade_date', ignore_index=True)
kline['trade_date'] = pd.to_datetime(kline['trade_date'], format=self.date_fmt)

for bar_number in (1, 2, 3, 5, 10, 20):
for bar_number in (1, 2, 3, 5, 8, 13, 21, 34, 55, 89, 144, 233, 377):
# 向后看
n_col_name = 'n' + str(bar_number) + 'b'
kline[n_col_name] = (kline['close'].shift(-bar_number) / kline['close'] - 1) * 10000
Expand Down Expand Up @@ -261,7 +261,7 @@ def pro_bar_minutes(self, ts_code, sdt, edt, freq='60min', asset="E", adj=None,
for col in ['open', 'close', 'high', 'low']:
kline[col] = kline.apply(lambda x: x[col] * adj_map[x['trade_date']], axis=1)

for bar_number in (1, 2, 3, 5, 10, 20):
for bar_number in (1, 2, 3, 5, 8, 13, 21, 34, 55, 89, 144, 233, 377):
# 向后看
n_col_name = 'n' + str(bar_number) + 'b'
kline[n_col_name] = (kline['close'].shift(-bar_number) / kline['close'] - 1) * 10000
Expand Down

0 comments on commit 5f297db

Please sign in to comment.