notes_works/new notes/populate_indicators函数.md
zhangkun9038@dingtalk.com 4380e95e00 2025-04-07 13:07:53: ...
2025-04-07 13:08:02 +08:00

12 lines
312 B
Markdown
Raw Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

```python
# 1. 计算指标
def populate_indicators(self, dataframe: pd.DataFrame, metadata: dict) -> pd.DataFrame:
# 计算 20 周期指数均线
dataframe['ema20'] = dataframe['close'].ewm(span=20, adjust=False).mean()
return dataframe
```
参数:这里的参数
1. self