ml_rs Relative Strength vs a benchmark

The leadership lens: how a name performs RELATIVE to a benchmark (NIFTY or any index you feed). Raw Dorsey RS, zero-centered Mansfield RS, a leadership state, a percentile rank for scanning a basket, and an RS slope — one shared definition so “outperforming”, “leading”, and “accelerating vs the index” mean the same thing across every scan.
Design (host-fed): you fetch the benchmark with request.security / input.source and pass its close in, so the library carries no hard-wired tickers and works on any instrument/benchmark. Every read is a pure function of the two series you pass; nothing repaints.
Concept credit: Relative Strength (Dorsey’s RS line) and Mansfield’s zero-centered RS (Stan Weinstein / Mansfield) are public technical-analysis techniques — this is an original, dependency-free Pine v6 packaging. Educational; not financial advice.
Library "ml_rs"
rs(price, indexPrice)
Parameters:
price (float)
indexPrice (float)
mansfield(price, indexPrice, len)
Parameters:
price (float)
indexPrice (float)
len (simple int)
rsLeading(price, indexPrice, len)
Parameters:
price (float)
indexPrice (float)
len (simple int)
rsRank(price, indexPrice, len)
Parameters:
price (float)
indexPrice (float)
len (simple int)
rsSlope(price, indexPrice, slopeLen)
Parameters:
price (float)
indexPrice (float)
slopeLen (simple int)
Design (host-fed): you fetch the benchmark with request.security / input.source and pass its close in, so the library carries no hard-wired tickers and works on any instrument/benchmark. Every read is a pure function of the two series you pass; nothing repaints.
Concept credit: Relative Strength (Dorsey’s RS line) and Mansfield’s zero-centered RS (Stan Weinstein / Mansfield) are public technical-analysis techniques — this is an original, dependency-free Pine v6 packaging. Educational; not financial advice.
Library "ml_rs"
rs(price, indexPrice)
Parameters:
price (float)
indexPrice (float)
mansfield(price, indexPrice, len)
Parameters:
price (float)
indexPrice (float)
len (simple int)
rsLeading(price, indexPrice, len)
Parameters:
price (float)
indexPrice (float)
len (simple int)
rsRank(price, indexPrice, len)
Parameters:
price (float)
indexPrice (float)
len (simple int)
rsSlope(price, indexPrice, slopeLen)
Parameters:
price (float)
indexPrice (float)
slopeLen (simple int)
免責聲明
這些資訊和出版物並非旨在提供,也不構成TradingView提供或認可的任何形式的財務、投資、交易或其他類型的建議或推薦。請閱讀使用條款以了解更多資訊。
免責聲明
這些資訊和出版物並非旨在提供,也不構成TradingView提供或認可的任何形式的財務、投資、交易或其他類型的建議或推薦。請閱讀使用條款以了解更多資訊。