你知道如何在0到100之间把无限的振荡器变成有限的振荡器吗?
例如,如何绑定动量指示器
mom = close - close[10]
plot(mom, color=#2962FF, title="MOM")发布于 2022-10-17 09:55:48
您可以使用解释为normalize()的这里函数。
// ————— When the scale of the signal to rescale is unknown (unbounded).
// Min/Max of signal to rescale is determined by its historical low/high.
normalize(_src, _min, _max) =>
// Normalizes series with unknown min/max using historical min/max.
// _src : series to rescale.
// _min, _min: min/max values of rescaled series.
var _historicMin = 10e10
var _historicMax = -10e10
_historicMin := min(nz(_src, _historicMin), _historicMin)
_historicMax := max(nz(_src, _historicMax), _historicMax)
_min + (_max - _min) * (_src - _historicMin) / max(_historicMax - _historicMin, 10e-10)https://stackoverflow.com/questions/74095425
复制相似问题