修改了macd数值

This commit is contained in:
jackyu66git
2025-10-24 23:32:46 +08:00
parent eaaa57915c
commit 0a22d1fe34
3 changed files with 5 additions and 3 deletions
Vendored
BIN
View File
Binary file not shown.
+2
View File
@@ -158,3 +158,5 @@ cython_debug/
# 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.
#.idea/
.DS_Store
.DS_Store
+3 -3
View File
@@ -325,10 +325,10 @@ def add_indicators(df):
def calculate_macd(df):
"""计算MACD指标"""
exp1 = df['close'].ewm(span=24, adjust=False).mean()
exp2 = df['close'].ewm(span=52, adjust=False).mean()
exp1 = df['close'].ewm(span=12, adjust=False).mean()
exp2 = df['close'].ewm(span=26, adjust=False).mean()
macd = exp1 - exp2
signal = macd.ewm(span=18, adjust=False).mean()
signal = macd.ewm(span=9, adjust=False).mean()
histogram = macd - signal
return {