Compare commits
10
Commits
68ecb4343e
...
31d560e5a1
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
31d560e5a1 | ||
|
|
77d3fb35d5 | ||
|
|
4e6b0b9e75 | ||
|
|
0a22d1fe34 | ||
|
|
eaaa57915c | ||
|
|
c6d02d7802 | ||
|
|
ba5e452af7 | ||
|
|
dc5b130862 | ||
|
|
717332196c | ||
|
|
f2384b151d |
@@ -158,3 +158,8 @@ cython_debug/
|
|||||||
# and can be added to the global gitignore or merged into this file. For a more nuclear
|
# and can be added to the global gitignore or merged into this file. For a more nuclear
|
||||||
# option (not recommended) you can uncomment the following to ignore the entire idea folder.
|
# option (not recommended) you can uncomment the following to ignore the entire idea folder.
|
||||||
#.idea/
|
#.idea/
|
||||||
|
.DS_Store
|
||||||
|
.DS_Store
|
||||||
|
.DS_Store
|
||||||
|
.DS_Store
|
||||||
|
.DS_Store
|
||||||
|
|||||||
+5
-5
@@ -274,9 +274,9 @@ def get_a_stock_kl_data(symbol, timeframe, limit=1000, start_time=None, end_time
|
|||||||
return None
|
return None
|
||||||
|
|
||||||
def add_indicators(df):
|
def add_indicators(df):
|
||||||
fast = 8
|
fast = 24
|
||||||
slow = 16
|
slow = 52
|
||||||
period = 6
|
period = 18
|
||||||
macd = ta.MACD(df, fastperiod=fast, slowperiod=slow, signalperiod=period)
|
macd = ta.MACD(df, fastperiod=fast, slowperiod=slow, signalperiod=period)
|
||||||
|
|
||||||
df['macd'] = macd['macd']
|
df['macd'] = macd['macd']
|
||||||
@@ -325,7 +325,7 @@ def add_indicators(df):
|
|||||||
|
|
||||||
def calculate_macd(df):
|
def calculate_macd(df):
|
||||||
"""计算MACD指标"""
|
"""计算MACD指标"""
|
||||||
exp1 = df['close'].ewm(span=10, adjust=False).mean()
|
exp1 = df['close'].ewm(span=12, adjust=False).mean()
|
||||||
exp2 = df['close'].ewm(span=26, adjust=False).mean()
|
exp2 = df['close'].ewm(span=26, adjust=False).mean()
|
||||||
macd = exp1 - exp2
|
macd = exp1 - exp2
|
||||||
signal = macd.ewm(span=9, adjust=False).mean()
|
signal = macd.ewm(span=9, adjust=False).mean()
|
||||||
@@ -370,7 +370,7 @@ def analyze_chan(df, timeframe='1d'):
|
|||||||
"divergence_rate": float("inf"),
|
"divergence_rate": float("inf"),
|
||||||
"bsp2_follow_1": False,
|
"bsp2_follow_1": False,
|
||||||
"bsp3_follow_1": False,
|
"bsp3_follow_1": False,
|
||||||
"min_zs_cnt": 1,
|
"min_zs_cnt": 2,
|
||||||
"bs1_peak": False,
|
"bs1_peak": False,
|
||||||
"macd_algo": "peak",
|
"macd_algo": "peak",
|
||||||
"bs_type": '1,2,3a,1p,2s,3b',
|
"bs_type": '1,2,3a,1p,2s,3b',
|
||||||
|
|||||||
@@ -81,6 +81,8 @@ class ChinaStockData:
|
|||||||
def get_popular_stocks(self):
|
def get_popular_stocks(self):
|
||||||
"""获取热门A股股票代码列表 - 扩展版本,按行业分类"""
|
"""获取热门A股股票代码列表 - 扩展版本,按行业分类"""
|
||||||
return [
|
return [
|
||||||
|
# 包装引印刷
|
||||||
|
{'symbol': '002836', 'name': '新宏泽', 'sector': '包装印刷'},
|
||||||
# 银行股
|
# 银行股
|
||||||
{'symbol': '600036', 'name': '招商银行', 'sector': '银行'},
|
{'symbol': '600036', 'name': '招商银行', 'sector': '银行'},
|
||||||
{'symbol': '000001', 'name': '平安银行', 'sector': '银行'},
|
{'symbol': '000001', 'name': '平安银行', 'sector': '银行'},
|
||||||
|
|||||||
+1398
-37
File diff suppressed because it is too large
Load Diff
Reference in New Issue
Block a user