mirror of
https://github.com/mihakralj/QuanTAlib.git
synced 2026-08-21 03:58:04 +00:00
- Updated BBWN, BBWP, CCV, CV, CVI, EWMA, GKV, HLV, HV, Jvolty, JVOLTYN, MASSI, NATR, RSV, RV, RVI, TR, UI, VOV, VR, YZV indicators with documentation links. - Added documentation links for Aberration, Acceleration Bands, Andrews' Pitchfork, Adaptive Price Zone, ATR Bands, Bollinger Bands, Center of Gravity, Donchian Channels, Decay Min-Max Channel, Detrended Synthetic Price, EACP, EBSW, HOMOD, Jurik Volatility Bands, Keltner Channel, MA Envelope, Min-Max Channel, Price Channel, Regression Channels, Standard Deviation Channel, Stoller Average Range Channel, Super Trend Bands, Ultimate Bands, Ultimate Channel, VWAP Bands, and VWAP with Standard Deviation Bands.
28 lines
834 B
Plaintext
28 lines
834 B
Plaintext
// The MIT License (MIT)
|
|
// © mihakralj
|
|
//@version=6
|
|
indicator("Square Root Transformation (SQRT)", "Sqrttrans", overlay=false)
|
|
|
|
//@function Applies a square root transformation (y = √x) to the input series.
|
|
//@param source series float The input series to transform. Must contain non-negative values.
|
|
//@returns series float The square root transformed series. Returns na if source < 0.
|
|
//@optimized for performance and dirty data
|
|
sqrtT(series float source) =>
|
|
if na(source)
|
|
runtime.error("Parameter 'source' cannot be na.")
|
|
if source < 0
|
|
na
|
|
else
|
|
math.sqrt(source)
|
|
|
|
// ---------- Main loop ----------
|
|
|
|
// Inputs
|
|
i_source = input(close, "Source")
|
|
|
|
// Calculation
|
|
transformedSource = sqrtT(i_source)
|
|
|
|
// Plot
|
|
plot(transformedSource, "Square Root Transformation", color=color.yellow, linewidth=2)
|