ml_rs Relative Strength vs a benchmark

195
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)

면책사항

해당 정보와 게시물은 금융, 투자, 트레이딩 또는 기타 유형의 조언이나 권장 사항으로 간주되지 않으며, 트레이딩뷰에서 제공하거나 보증하는 것이 아닙니다. 자세한 내용은 이용 약관을 참조하세요.