You need to enable JavaScript to run this app.
优惠活动
大模型
产品
解决方案
定价
更多

为何Pine Script的ta.max/ta.min无法获取AD指标历史极值?

累积/派发(AD)指标归一化的极值计算问题

我尝试将*累积/派发指标(Accumulation/Distribution,简称AD)*归一化,生成名为“normalized ad”的新指标。使用ta.min(ad)和ta.max(ad)函数时,无法获取该指标对应的全历史最小值与最大值;但将数据导出至Excel,手动计算出极值并替换函数后,得到了预期的归一化结果。请帮忙排查极值计算错误的原因,或提供基于AD指标全历史数据集进行归一化的方法。

对应的Pine Script代码如下:

//@version=5
indicator(title="Accumulation/Distribution", shorttitle="Accum/Dist")

ad = ta.cum(close==high and close==low or high==low ? 0 : ((2*close-low-high)/(high-low))*volume) 
normalizedad = 100*(ad - ta.min(ad)) / (ta.max(ad) - ta.min(ad))
plot(normalizedad,color=color.green)
  • 预期输出:通过Excel计算得到的归一化指标曲线(计算公式已标注)
  • 实际输出:Pine Script运行后生成的指标曲线

内容的提问来源于stack exchange,提问作者Mohit

相关产品推荐
方舟 Agent Plan

超全模态模型 × Harness 升级,最新支持 Deepseek-V4.1-Flash、GLM-5.3 系列、Doubao-Seedream-5.0-pro、Kimi-K3 (部分), 限时 9.9 元起

最近更新时间:2026.08.17 02:55:34