[{"data":1,"prerenderedAt":-1},["ShallowReactive",2],{"indicator-wma-zh":3},"# 加权移动平均线 (WMA)\n\n> WMA 的 StratCraft 指标页面。\n\n**Route**: `\u002Findicators\u002Fwma\u002F`\n\n## 作用\n\nWMA 给较新的价格分配比旧价格更大的权重。它的反应速度介于 SMA 和 EMA 之间，广泛用于趋势系统。\n\n## 公式\n\n`WMA = (n*P1 + (n-1)*P2 + ... + 1*Pn) \u002F (n*(n+1)\u002F2)`\n\n## 参数\n\n- `period` - 默认 `30`\n\n## C++23 API\n\n```cpp\n#include \u003Cnonabt\u002Findicators\u002Fwma.hpp>\nauto wma = std::make_unique\u003Cnonabt::WMA>(data().close(), 30);\n```\n\n## 常见用法\n\n- 将 WMA 用作更平滑的趋势线。\n- 用于加权交叉系统。\n- 与其他平均线结合使用以减少滞后。\n\n## 实际模式\n\n当你想要一个反应比 SMA 快但又不需要完全达到 EMA 特性的移动平均线时，通常会使用 WMA。\n"]