We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 41af1af commit 7aaeb65Copy full SHA for 7aaeb65
pyindicators/indicators/macd.py
@@ -57,8 +57,9 @@ def macd(
57
58
# Calculate the MACD line
59
data[macd_column] = \
60
- data[f"EMA_MACD_TEMP_{short_period}"] \
61
- - data[f"EMA_MACD_TEMP_{long_period}"]
+ data[
+ f"EMA_MACD_TEMP_{short_period}"
62
+ ] - data[f"EMA_MACD_TEMP_{long_period}"]
63
64
# Calculate the Signal Line
65
data = ema(data, macd_column, signal_period, signal_column)
@@ -94,9 +95,8 @@ def macd(
94
95
data = data.with_columns(
96
(
97
pl.col(
- f"EMA_MACD_TEMP_{short_period}")
98
- - pl.col(f"EMA_MACD_TEMP_{long_period}"
99
- )
+ ) - pl.col(f"EMA_MACD_TEMP_{long_period}")
100
).alias(macd_column)
101
)
102
0 commit comments