Skip to content

Commit 2b496a7

Browse files
committed
2021-10-18
1 parent 76c25ec commit 2b496a7

File tree

7 files changed

+604
-5
lines changed

7 files changed

+604
-5
lines changed
File renamed without changes.
File renamed without changes.

Lesson1/lesson1.py Lesson1.py

+2-2
Original file line numberDiff line numberDiff line change
@@ -9,8 +9,8 @@
99
# 实例化 cerebro
1010
cerebro = bt.Cerebro()
1111

12-
daily_price = pd.read_csv("data/daily_price.csv", parse_dates=['datetime'])
13-
trade_info = pd.read_csv("data/trade_info.csv", parse_dates=['trade_date'])
12+
daily_price = pd.read_csv("Data/daily_price.csv", parse_dates=['datetime'])
13+
trade_info = pd.read_csv("Data/trade_info.csv", parse_dates=['trade_date'])
1414

1515
#%%
1616

Lesson2/lesson2.py Lesson2.py

File renamed without changes.

Lesson3/lesson3.py Lesson3.py

+1-3
Original file line numberDiff line numberDiff line change
@@ -31,14 +31,12 @@ def get_data_bytushare(code,start_date,end_date):
3131
df.index = df.trade_date
3232
df.sort_index(inplace=True)
3333
df.fillna(0.0,inplace=True)
34-
3534
return df
3635

3736
# 恒瑞医药
3837
data1 = get_data_bytushare('600276.SH','20200101','20211015')
3938
# 贵州茅台
4039
data2 = get_data_bytushare('600519.SH','20200101','20211015')
41-
4240
#%%
4341

4442
# 第1节 建议在 __init__() 中提前计算指标
@@ -284,7 +282,7 @@ class My_MACD(bt.Indicator):
284282
params = (('period_me1',12),
285283
('period_me2', 26),
286284
('period_signal', 9),)
287-
285+
288286
def __init__(self):
289287
me1 = btind.EMA(self.data, period=self.p.period_me1)
290288
me2 = btind.EMA(self.data, period=self.p.period_me2)

Lesson4.py

+601
Large diffs are not rendered by default.

Lesson4/lesson4.py

Whitespace-only changes.

0 commit comments

Comments
 (0)