Final BestSmart Strategy - NajamWin Rate > 70 % Insya ALlah
script ini sudah mencakup bebrabagai indikator
Индикаторы и стратегии
Spike Volume Bar & POCThis indicator identifies volume spikes using Z-score statistical analysis and
calculates Point of Control (POC) for high-volume bars.
KEY FEATURES:
- Statistical volume spike detection using customizable Z-score threshold
- Multi-timeframe POC calculation using lower timeframe data
- Multiple volume sources (Chart, Binance, Coinbase, Bybit, OKEx)
- Smart POC line management with hit detection
- Color-coded bars for bullish/bearish high-volume periods
HOW IT WORKS:
1. Z-SCORE CALCULATION:
• Calculates rolling mean and standard deviation of volume over specified period
• Z-score = (Current Volume - Mean Volume) / Std Deviation
• Triggers when Z-score exceeds threshold (default: 2.0σ)
2. POC CALCULATION:
• For lower timeframe mode: analyzes intrabar volume distribution
• Calculates VWAP for each lower timeframe bar
• Identifies price level with highest volume concentration
• Uses statistical filtering (Z-score > 1.5) to find volume clusters
3. LINE MANAGEMENT:
• Draws horizontal lines at POC levels
• Extends lines until price touches them
• Optional: hides or grays out touched POC levels
• Maintains up to 500 active lines
UNIQUE FEATURES:
- Combines statistical volume analysis with micro-structure POC calculation
- Multi-timeframe volume profiling within single bars
- Flexible volume data sourcing for cross-exchange analysis
- Dynamic line management prevents chart clutter
USE CASES:
- Identify institutional activity and volume clusters
- Find high-probability support/resistance from volume profile
- Scalping entries at POC levels during pullbacks
- Confirmation of breakouts with volume spikes
Rolling VWAP (7D/30D/90D/365D)This indicator calculates Volume-Weighted Average Price (VWAP) across multiple
rolling time periods: 7 days, 30 days, 90 days, and 365 days.
KEY FEATURES:
- Multi-timeframe VWAP calculation using hourly and daily data
- Automatic data source selection for stablecoin pairs (USDT/USDC/USD)
- Intelligent fallback system: attempts Binance data first, then uses current chart
- Three display modes: Lines, Bands (with volatility ranges), and Horizontal Lines
- Customizable colors, labels, and text for all timeframes
HOW IT WORKS:
- VWAP = Σ(Typical Price × Volume) / Σ(Volume) over specified period
- For 7D/30D/90D: uses 60-minute intervals (168/720/2160 bars)
- For 365D: uses daily intervals
- Bands mode adds ±5% standard deviation ranges around VWAP
- Updates in real-time for Lines/Bands modes
- Updates on confirmed bars for Horizontal Lines mode
UNIQUE FEATURES:
- Smart data sourcing with automatic Binance/chart fallback for crypto pairs
- Multiple display modes in one indicator
- Rolling periods (not anchored to specific dates)
- Optimized for both liquid and illiquid trading pairs
USE CASES:
- Identify fair value zones across multiple timeframes
- Mean reversion trading strategies
- Support/resistance levels based on volume profile
- Long-term trend analysis with 365D VWAP
Combo COT + Valuation Index 1. COT Report (Commitments of Traders)
Based on CFTC’s weekly COT reports showing open positions of different market participant groups.
Displays Net Positions of 3 trader groups:
Commercials (hedgers, smart money)
Large Speculators (non-commercials)
Small Speculators (non-reportables)
Pulls data from the COT Legacy Report
Option to display short positions as negative values
📊 Use case:
Track what the major players are doing
Spot potential market reversals based on positioning shifts
📈 2. COT Index
Calculates COT Index (0–100 scale) for each group, normalized over a chosen historical period
Available for:
Commercials
Non-commercials
Non-reportables
Customizable lookback (e.g., 26, 52, 78 weeks)
🧠 Interpretation:
Index near 100: group is heavily long (possible reversal soon)
Index near 0: group is heavily short
📊 3. Seasonality Forecast
Forecasts price behavior based on historical seasonal trends
Modes:
Daily seasonality (day of year)
Weekly seasonality (week of year)
Monthly seasonality (month of year)
Uses multi-year historical data (up to 15 years) to generate average trend
Option to display a smooth seasonality line extended into the future
📆 Use case:
Anticipate seasonal uptrends/downtrends
Combine with technical analysis for optimal entries
💸 4. Valuation Index
Compares the current asset’s performance against major benchmark assets:
DXY
GOLD
BOND
BTC
Normalizes relative return to a score from –100 to +100
📊 Displays relative valuation such as:
DXY Value
GOLD Value
BOND Value
📈 Use case:
Identify whether an asset is overvalued or undervalued
Use macro valuation to support trade decisions
🧠 Key Highlights
All-in-one tool: Combines multiple advanced analytics in one script
Flexible dashboard interface with mode switching via dropdown
Ideal for traders using:
Positioning analysis (smart money flows)
Macro/fundamental overlays
Seasonal market cycles
📌 Practical Applications
Trade forex, commodities, crypto, or any asset with available COT data
Spot smart money shifts to position early
Combine with price action or indicators to confirm entries
noname_899//@version=6
// Purpose: Draw dynamic support/resistance levels using a monotonic stack of highs/lows
MTF EMA IndicatorThis indicator is a tool that supports trend-following strategies using multi-timeframe EMAs and Perfect Order. It automatically displays entry and exit signals based on Heikin-Ashi pattern recognition. Compatible with all timeframes (1min to Daily) and can be used on Heikin-Ashi charts. Works with various instruments including Gold (XAUUSD) and Forex currency pairs.
このインジケーターは、複数時間足のEMAとパーフェクトオーダーを使用したトレンドフォロー手法をサポートするツールです。平均足のパターン判定により、エントリー・決済シグナルを自動表示します。あらゆる時間足(1分足~日足)に対応し、平均足チャートでも使用可能です。ゴールド(XAUUSD)やFX通貨ペアなど、様々な銘柄で利用できます。
EMA Panel — 7/12/21 vs 147 (Cross-Over Marks + ALL) (Misu)Full Technical Description
Overview:
The EMA Subpanel — Cross-Over Tracker (7/12/21 vs 147) is designed to visualize multi-layer EMA dynamics in a dedicated subwindow, separating it from price candles.
It focuses on identifying momentum shifts and medium-term trend transitions based on interactions between short-term and long-term exponential moving averages (EMAs).
Core Logic:
Plots four EMAs: 7, 12, 21, and 147 periods on a separate panel.
Marks every crossover event where EMA7, EMA12, or EMA21 moves above EMA147.
Once all three short-term EMAs (7, 12, 21) are above EMA147 (either sequentially or simultaneously), the script labels the bar with “ALL(7/12/21 > 147)”, indicating a potential strong bullish structure.
When any of the short-term EMAs crosses below EMA147, the system resets the tracking state and waits for a new crossover sequence.
Usage Notes:
This indicator does not overlay price candles (it runs in a separate panel).
Traders can use the “ALL” signal as confirmation of multi-timeframe bullish alignment.
The logic can be inverted or expanded to detect bearish phases (e.g., “ALL”) by mirroring the crossover conditions.
Works well as a trend confirmation filter alongside price action, BOS/CHoCH structure, or volume-based models.
Alerts:
Custom alert conditions are included for:
Each individual EMA crossover above EMA147.
The completion of the full 3-line alignment (ALL event).
1m RSI NQ StrategyNQ Momentum Strategy — 1-Minute Framework
This strategy is designed for Nasdaq futures (NQ) and other highly correlated instruments such as MNQ and QQQ on short-term timeframes, particularly the 1-minute chart.
It combines RSI-based momentum detection, trend filtering through moving averages, and a volume confirmation component to identify high-probability reversal or continuation setups.
The approach focuses on capturing intraday momentum while managing risk through strict trade closure before the session ends.
Core Concepts:
1. Momentum signals: Triggered when RSI reaches overbought or oversold conditions.
2. Trend filter: Uses moving averages to ensure entries align with the dominant market bias.
3. Volume factor: Adds confirmation to filter out low-quality breakouts.
4. Repaint reduction: Incorporates 'barstate.isconfirmed' logic to minimize false or shifting signals.
4. Session management: All positions are automatically closed before session end — optimized for day trading.
Testing Summary
The framework was evaluated over October 2024 – October 2025 and demonstrated stable results and consistent signal behavior across various market phases.
Contract size: 1
The 485 trades responded consistently to RSI overbought/oversold conditions
Usage Notes:
Recommended market: NQ, MNQ, QQQ
Recommended timeframe: 1 minute
Ideal use case: Intraday and short-term trading
Please note that results may vary depending on broker data, execution latency, and personal settings. Past performance does not guarantee future returns.
Educational and research purposes only.
VRI VVI Highlighter x Smart Black GirlPurpose: a modern, visually clean indicator built to help traders identify VRI (Volume Reversal Index) and VVI (Volume Volatility Index) confirmations directly on the price chart—designed with precision and style under the Smart Black Girl collection for intuitive, confident market execution.
Core Function
Calculates VRI to detect when price and volume diverge, signaling hidden accumulation or distribution.
Calculates VVI to measure volatility strength relative to trading volume, confirming when a move has real market energy behind it.
Highlights candles where both indicators align with the market trend.
Visual Output
Green candles & upward arrows = bullish VRI/VVI confirmation.
Red candles & downward arrows = bearish VRI/VVI confirmation.
Each signal bar prints labels showing exact VRI and VVI values, keeping the chart informative and clear.
Subtle color tones maintain a professional aesthetic suitable for dark or light chart themes.
Logic
Trend filter: EMA8 vs EMA20.
Volatility filter: active only when VVI exceeds its rolling average.
Signal trigger:
Bull → VRI crosses above 0 with trend_up + volatility_active.
Bear → VRI crosses below 0 with trend_down + volatility_active.
Use Case
Ideal for traders who want to visually confirm momentum shifts without chart noise. Works well on 5m–30m timeframes for momentum entries or reversal setups.
Non-Repainting
Signals only appear after the bar closes, ensuring reliability for live or back tested analysis.
Mag 3 Indicator3 Indicators for the chart itself containing a custom color code, Moving averages and Support Resistance Zones
Trading Gorilla Entry ConfirmationTrading Gorilla Entry Confirmation with the use of price action and candle sticks behavior.
MTP - Precision Killzone 10%/90%/WINPrecision Killzone Indicator – A Data-Driven Candle Killzone Analysis Tool
The Precision Killzone Indicator is designed to help traders identify potential momentum zones based on the relationship between current and previous candle ranges. By highlighting when price action reaches the upper or lower thresholds (90% or 10%) of the prior candle, it aims to provide users with a structured approach to spotting potential continuation or reversal areas.
🔍 Key Features
90/10 Candle Zone Detection
Detects when the high or low of the current candle breaches the 90% or 10% level of the previous candle's range. This can be used to identify moments of strong momentum or potential exhaustion.
Historical Outcome Tracking
Allows users to define profit target parameters (e.g., 1:1, 1:2, or custom). The indicator then calculates historical outcome rates based on those settings.
Real-Time Visual Zones
Displays potential high-probability areas on the chart using colored zones — for example, green for possible opportunity zones and red for caution areas. These zones help traders visually interpret recent price behavior.
Multi-Timeframe Support
Works across various chart timeframes, enabling analysis from short-term scalping or intraday setups to longer-term swing trading perspectives.
Performance Dashboard
Shows aggregated statistics such as signal count, win rate (based on your chosen parameters), and pip-based results — directly on the chart for easy monitoring.
Custom Alerts & Webhook Compatibility
Set alerts when price enters specific candle zones. Supports webhook functionality for integrating with automation platforms if desired.
🧠 Objective Use Case
This tool does not generate buy/sell recommendations or guarantee performance outcomes. It is intended to assist with technical analysis by providing visual and statistical insights into how price interacts with dynamic candle zones. Traders should always combine this tool with their own strategies, market understanding, and risk management processes.
⚠️ Disclaimer
This indicator is a technical analysis tool and should be used for informational and educational purposes only. It does not constitute financial advice or guarantee any specific trading results. Past performance metrics generated by the tool are based on historical price action and do not predict future outcomes. Users are solely responsible for any trading decisions made.
📌 Note to Reviewers:
This script contains no external links, marketing content, or financial guarantees. All statistical references are user-configurable and calculated from historical chart data.
Conviction Ratio | viResearchConviction Ratio | viResearch
Conceptual Foundation and Innovation
The Conviction Ratio by viResearch is a trend strength indicator designed to measure the conviction behind market movements by analyzing price returns over a defined period. It reflects how consistently and powerfully an asset has trended within that time window. The higher the ratio, the stronger and more confident the trend.
This approach provides a clear and intuitive way to gauge whether recent price action is supported by genuine momentum or merely short-term noise. By quantifying return intensity, the indicator helps traders identify assets that are trending with conviction versus those moving without sustained direction.
Technical Composition and Calculation
The Conviction Ratio evaluates an asset’s performance by comparing its current price level to past values over a customizable lookback period. It measures how much the market has advanced or declined, translating that movement into a normalized ratio that reflects overall trend conviction.
A rising ratio indicates strong and accelerating trend strength, while a falling or negative ratio suggests fading momentum or potential reversal. This dynamic view helps traders visually assess whether a trend is strengthening, weakening, or entering a transition phase.
Features and User Inputs
To accommodate different trading styles and timeframes, the indicator offers several adjustable settings:
Period (Days): Defines how far back the indicator measures return performance, allowing users to analyze short-term bursts or longer-term trends.
Start Date: Sets the beginning of the analysis window, useful for backtesting or focusing on a specific time period.
The Conviction Ratio line changes color dynamically to reflect market conviction:
Aqua: Positive ratio, indicating strong upward trend strength.
Pink: Negative ratio, signaling weak or declining market conviction.
Practical Applications
The Conviction Ratio can be applied across all asset classes — equities, cryptocurrencies, forex, and commodities — to identify where the strongest trends are forming. It’s particularly useful for:
Measuring Trend Strength: Quickly determine how strong or sustained a trend is within the chosen timeframe.
Identifying Momentum Shifts: Spot when market conviction is increasing or fading, signaling potential trend continuation or reversal.
Comparative Analysis: Compare multiple assets to find which ones are trending with greater conviction and consistency.
Advantages and Strategic Value
The Conviction Ratio offers a simple yet powerful way to quantify trend quality. Instead of relying on price direction alone, it evaluates the strength and persistence behind that movement. This makes it an ideal tool for trend followers, momentum traders, and portfolio managers seeking to align with assets showing genuine directional confidence.
Its normalized structure ensures consistency across different volatility environments, making it suitable for both discretionary and systematic trading strategies.
Visual Cues and Interpretation
The indicator plots a smooth, color-coded ratio line centered around zero, with key reference levels at +1.0 and –1.0.
Ratios above +1.0 indicate strong, confident uptrends.
Ratios below +1.0 suggest weakening or unstable market conditions.
Ratios below 0 represent unprofitable or negative-return periods.
Sharp declines in the ratio, even from high positive levels, can serve as early warning signals of weakening momentum or potential trend reversal.
By tracking both the level and the rate of change of the ratio, traders can detect when market conviction starts to fade — often before price itself shows clear reversal signs.
Summary and Usage Tips
The Conviction Ratio | viResearch provides traders with a clean, data-driven way to interpret market strength. By focusing on return-based trend conviction, it highlights where the market is moving with genuine confidence and warns when conviction begins to erode.
Use it to confirm breakout strength, identify fading rallies, or monitor early signs of trend exhaustion. The higher the ratio, the stronger the conviction — but when it starts falling sharply, take note. It might be your first signal that the trend is losing strength.
Note: Historical results are for reference only and do not guarantee future performance.
ORDER BLOCKSThis indicator automatically detects and visualizes bullish and bearish order blocks using swing-based price action logic.
It’s designed for traders who focus on market structure, displacement, and institutional-style footprints (ICT-style logic) — without the clutter of overlapping or stale zones.
🧩 Core Logic
- Swing Structure Detection
- Identifies swing highs and lows using left/right candle logic to isolate structural turning points.
- Order Block Detection
- Bullish OB forms when price displaces upward after a swing low, confirming demand imbalance.
- Bearish OB forms when price displaces downward after a swing high, confirming supply imbalance.
- Mitigation Logic (Close-Through Deletion)
- Blocks remain active until price closes fully through the opposite side, at which point they’re considered mitigated and removed.
- No Overlap Enforcement
- Ensures order blocks never overlap in price range. When a new OB overlaps an older one, the older block is automatically deleted to keep the chart clean and structurally accurate.
⚙️ Features
- Customizable Swing Sensitivity (Left/Right Bars)
- Adjust how many candles define a swing high or low.
- Adjustable Lookback Range (Scan Back Bars)
- Determines how far back the script looks for valid OB setups.
- Dynamic OB Management
- Automatically extends valid blocks and removes broken ones.
- Visual Options
- Custom colors for bullish/bearish OBs and text labels showing candle range (%).
🧠 Trading Use
- Bullish OBs highlight potential demand zones or areas of institutional accumulation.
- Bearish OBs highlight potential supply zones or areas of institutional distribution.
- Once price closes through an OB, it’s considered mitigated — meaning the imbalance has been filled.
- Non-overlapping logic keeps only the most relevant, active zones for clean structure-based analysis.
📈 Ideal For
- ICT-style traders
- Smart money concepts (SMC)
- Price action structure traders
- Scalpers or swing traders using imbalance-based confluence
Thai Gold 96.5% (THB/บาททอง) อินดิเคเตอร์นี้คำนวณ “ราคาทองแท่ง 96.5% หน่วยบาทไทยต่อบาททอง”
จากราคาทองโลก (XAU/USD) และอัตราแลกเปลี่ยน (USD/THB) แบบเรียลไทม์
ช่วยให้เห็นความเคลื่อนไหวทองคำไทยอย่างแท้จริง
This indicator converts global gold prices (XAU/USD) and the USD/THB exchange rate
into real-time Thai gold bar prices (96.5% purity, THB per Baht of gold).
Visualize how global gold trends and currency moves drive Thailand’s gold market
— perfect for traders, investors, and analysts tracking the Thai precious metals market.
AlgebraGeoLibraryLibrary "AlgebraGeoLibrary"
Algebra & 2D geometry utilities absent from Pine built-ins.
Rigorous, no-repaint, export-ready: vectors, robust roots, linear solvers, 2x2/3x3 det/inverse,
symmetric 2x2 eigensystem, orthogonal regression (TLS), affine transforms, intersections,
distances, projections, polygon metrics, point-in-polygon, convex hull (monotone chain),
Bezier/Catmull-Rom/Barycentric tools.
clamp(x, lo, hi)
clamp to
Parameters:
x (float)
lo (float)
hi (float)
near(a, b, atol, rtol)
approximately equal with relative+absolute tolerance
Parameters:
a (float)
b (float)
atol (float)
rtol (float)
sgn(x)
sign as {-1,0,1}
Parameters:
x (float)
hypot(x, y)
stable hypot (sqrt(x^2+y^2))
Parameters:
x (float)
y (float)
method length(v)
Namespace types: Vec2
Parameters:
v (Vec2)
method length2(v)
Namespace types: Vec2
Parameters:
v (Vec2)
method normalized(v)
Namespace types: Vec2
Parameters:
v (Vec2)
method add(a, b)
Namespace types: Vec2
Parameters:
a (Vec2)
b (Vec2)
method sub(a, b)
Namespace types: Vec2
Parameters:
a (Vec2)
b (Vec2)
method muls(v, s)
Namespace types: Vec2
Parameters:
v (Vec2)
s (float)
method dot(a, b)
Namespace types: Vec2
Parameters:
a (Vec2)
b (Vec2)
method crossz(a, b)
Namespace types: Vec2
Parameters:
a (Vec2)
b (Vec2)
method rotate(v, ang)
Namespace types: Vec2
Parameters:
v (Vec2)
ang (float)
method apply(v, T)
Namespace types: Vec2
Parameters:
v (Vec2)
T (Affine2)
affine_identity()
identity transform
affine_translate(tx, ty)
translation
Parameters:
tx (float)
ty (float)
affine_rotate(ang)
rotation about origin
Parameters:
ang (float)
affine_scale(sx, sy)
scaling about origin
Parameters:
sx (float)
sy (float)
affine_rotate_about(ang, px, py)
rotation about pivot (px,py)
Parameters:
ang (float)
px (float)
py (float)
affine_compose(T2, T1)
compose T2∘T1 (apply T1 then T2)
Parameters:
T2 (Affine2)
T1 (Affine2)
quadratic_roots(a, b, c)
Real roots of ax^2 + bx + c = 0 (numerically stable)
Parameters:
a (float)
b (float)
c (float)
Returns: with n∈{0,1,2}; r1<=r2 when n=2.
cubic_roots(a, b, c, d)
Real roots of ax^3+bx^2+cx+d=0 (Cardano; returns up to 3 real roots)
Parameters:
a (float)
b (float)
c (float)
d (float)
Returns: (valid r2/r3 only if n>=2/n>=3)
det2(a, b, c, d)
det2 of
Parameters:
a (float)
b (float)
c (float)
d (float)
inv2(a, b, c, d)
inverse of 2x2; returns
Parameters:
a (float)
b (float)
c (float)
d (float)
solve2(a, b, c, d, e, f)
solve 2x2 * = via Cramer
Parameters:
a (float)
b (float)
c (float)
d (float)
e (float)
f (float)
det3(a11, a12, a13, a21, a22, a23, a31, a32, a33)
det3 of 3x3
Parameters:
a11 (float)
a12 (float)
a13 (float)
a21 (float)
a22 (float)
a23 (float)
a31 (float)
a32 (float)
a33 (float)
inv3(a11, a12, a13, a21, a22, a23, a31, a32, a33)
inverse 3x3; returns
Parameters:
a11 (float)
a12 (float)
a13 (float)
a21 (float)
a22 (float)
a23 (float)
a31 (float)
a32 (float)
a33 (float)
eig2_symmetric(a, b, d)
symmetric 2x2 eigensystem: [ , ]
Parameters:
a (float)
b (float)
d (float)
Returns: with unit eigenvectors
tls_line(xs, ys)
Orthogonal (total least squares) regression line through point cloud
Input arrays must be same length N>=2. Returns line in normal form n•x + c = 0
Parameters:
xs (array)
ys (array)
Returns: where (nx,ny) unit normal; (cx,cy) centroid.
orient(a, b, c)
orientation (signed area*2): >0 CCW, <0 CW, 0 collinear
Parameters:
a (Vec2)
b (Vec2)
c (Vec2)
project_point_line(p, a, d)
project point p onto infinite line through a with direction d
Parameters:
p (Vec2)
a (Vec2)
d (Vec2)
Returns: where proj = a + t*d
closest_point_segment(p, a, b)
closest point on segment to p
Parameters:
p (Vec2)
a (Vec2)
b (Vec2)
Returns: where t∈ on segment
dist_point_line(p, a, d)
distance from point to line (infinite)
Parameters:
p (Vec2)
a (Vec2)
d (Vec2)
dist_point_segment(p, a, b)
distance from point to segment
Parameters:
p (Vec2)
a (Vec2)
b (Vec2)
intersect_lines(p1, d1, p2, d2)
line-line intersection: L1: p1+d1*t, L2: p2+d2*u
Parameters:
p1 (Vec2)
d1 (Vec2)
p2 (Vec2)
d2 (Vec2)
Returns:
intersect_segments(s1, s2)
segment-segment intersection (closed segments)
Parameters:
s1 (Segment2)
s2 (Segment2)
Returns: where kind: 0=no, 1=proper point, 2=overlap (ix/iy=na)
circumcircle(a, b, c)
circle through 3 non-collinear points
Parameters:
a (Vec2)
b (Vec2)
c (Vec2)
intersect_circle_line(C, p, d)
intersections of circle and line (param p + d t)
Parameters:
C (Circle2)
p (Vec2)
d (Vec2)
Returns: with n∈{0,1,2}
intersect_circles(A, B)
circle-circle intersection
Parameters:
A (Circle2)
B (Circle2)
Returns: with n∈{0,1,2}
polygon_area(xs, ys)
signed area (shoelace). Positive if CCW.
Parameters:
xs (array)
ys (array)
polygon_centroid(xs, ys)
polygon centroid (for non-self-intersecting). Fallback to vertex mean if area≈0.
Parameters:
xs (array)
ys (array)
point_in_polygon(px, py, xs, ys)
point-in-polygon test (ray casting). Returns true if inside; boundary counts as inside.
Parameters:
px (float)
py (float)
xs (array)
ys (array)
convex_hull(xs, ys)
convex hull (monotone chain). Returns array of hull vertex indices in CCW order.
Uses array.sort_indices(xs) (ascending by x). Ties on x are handled; result is deterministic.
Parameters:
xs (array)
ys (array)
lerp(a, b, t)
linear interpolate between a and b
Parameters:
a (float)
b (float)
t (float)
bezier2(p0, p1, p2, t)
quadratic Bezier B(t) for points p0,p1,p2
Parameters:
p0 (Vec2)
p1 (Vec2)
p2 (Vec2)
t (float)
bezier3(p0, p1, p2, p3, t)
cubic Bezier B(t) for p0,p1,p2,p3
Parameters:
p0 (Vec2)
p1 (Vec2)
p2 (Vec2)
p3 (Vec2)
t (float)
catmull_rom(p0, p1, p2, p3, t, alpha)
Catmull-Rom interpolation (centripetal form when alpha=0.5)
t∈ , returns point between p1 and p2
Parameters:
p0 (Vec2)
p1 (Vec2)
p2 (Vec2)
p3 (Vec2)
t (float)
alpha (float)
barycentric(A, B, C, P)
barycentric coordinates of P wrt triangle ABC
Parameters:
A (Vec2)
B (Vec2)
C (Vec2)
P (Vec2)
Returns:
point_in_triangle(A, B, C, P)
point-in-triangle using barycentric (boundary included)
Parameters:
A (Vec2)
B (Vec2)
C (Vec2)
P (Vec2)
Vec2
Fields:
x (series float)
y (series float)
Line2
Fields:
p (Vec2)
d (Vec2)
Segment2
Fields:
a (Vec2)
b (Vec2)
Circle2
Fields:
c (Vec2)
r (series float)
Affine2
Fields:
a (series float)
b (series float)
c (series float)
d (series float)
tx (series float)
ty (series float)
OscLibraryLibrary "OscLibrary"
Non‑native oscillators & math for Pine v6: Ehlers Super Smoother & Roofing, Hilbert/homodyne period,
DSP biquads (LP/HP/BP/Notch), Goertzel power, Haar detail (wavelet‑style), robust z/Fisher, FRAMA,
Laguerre filter + Laguerre RSI, Autocorrelation Periodogram dominant period, DPO, WaveTrend‑style.
clamp(x, lo, hi)
Clamp to
Parameters:
x (float)
lo (float)
hi (float)
tanh(x)
Parameters:
x (float)
f_atan2_custom(y, x)
Parameters:
y (float)
x (float)
wrap_pi(ang)
Wrap angle to (-pi, pi]
Parameters:
ang (float)
scale_minmax(x, len)
Window min‑max scale to
Parameters:
x (float)
len (simple int)
zscore_robust(x, len)
Robust z‑score using rolling median & MAD
z = (x - median) / (1.4826 * MAD)
Parameters:
x (float)
len (simple int)
fisher_rank(x, len)
Fisher transform of rolling percent‑rank (no simplifications)
Parameters:
x (float)
len (simple int)
ift_rsi(x, rsiLen, smoothLen)
Classic IFT of RSI
Parameters:
x (float)
rsiLen (simple int)
smoothLen (simple int)
biquad_lp(x, f0_cpb, Q)
2‑pole low‑pass
Parameters:
x (float)
f0_cpb (float)
Q (float)
biquad_hp(x, f0_cpb, Q)
2‑pole high‑pass
Parameters:
x (float)
f0_cpb (float)
Q (float)
biquad_bp(x, f0_cpb, Q)
2‑pole band‑pass (constant skirt gain)
Parameters:
x (float)
f0_cpb (float)
Q (float)
biquad_notch(x, f0_cpb, Q)
2‑pole notch
Parameters:
x (float)
f0_cpb (float)
Q (float)
ssf(x, period)
Ehlers Super Smoother (2‑pole low‑lag LP)
Parameters:
x (float)
period (simple int)
highpass_ehlers(x, cutoffPeriod)
Ehlers high‑pass (first stage of Roofing)
Parameters:
x (float)
cutoffPeriod (simple int)
roofing(x, hpCutoff, lpPeriod)
Roofing filter: HP (long‑cycle reject) → Super Smoother
Parameters:
x (float)
hpCutoff (simple int)
lpPeriod (simple int)
hilbert_quadrature(src)
Short Hilbert quadrature on a smoothed series
Parameters:
src (float)
homodyne_period(src, floorP, ceilP)
Homodyne instantaneous period (bars) with smoothing
Parameters:
src (float)
floorP (simple int)
ceilP (simple int)
sine_leadsine(src)
Sine & lead‑sine oscillator from HT phase
Parameters:
src (float)
goertzel_power(x, f0_cpb, r)
Goertzel single‑bin spectral power (forgetting r∈(0,1))
Parameters:
x (float)
f0_cpb (float)
r (float)
frama_alpha(x, length, fast, slow)
FRAMA alpha via fractal dimension (Ehlers)
Parameters:
x (float)
length (simple int)
fast (simple int)
slow (simple int)
frama(x, length, fast, slow)
FRAMA smoother (EMA with alpha from FD)
Parameters:
x (float)
length (simple int)
fast (simple int)
slow (simple int)
laguerre(x, gamma)
4‑element Laguerre filter (gamma in [0,1))
Parameters:
x (float)
gamma (float)
laguerre_rsi(x, gamma)
Laguerre RSI (bounded 0..1)
Parameters:
x (float)
gamma (float)
acf_dominant_period(x, minP, maxP, corrLen)
Dominant period from normalized autocorrelation peaks
Uses Pearson correlation as normalized ACF proxy over 'corrLen' bars.
minP/maxP bound the search range. corrLen should be >= maxP*2.
Parameters:
x (float)
minP (simple int)
maxP (simple int)
corrLen (simple int)
dpo(x, length)
Detrended Price Oscillator (centered SMA lag)
Parameters:
x (float)
length (simple int)
wavetrend(h, l, c, chLen, avgLen)
WaveTrend‑style oscillator (inputs explicit)
Parameters:
h (float)
l (float)
c (float)
chLen (simple int)
avgLen (simple int)
rescale(x, fromLo, fromHi, toLo, toHi, clip)
Rescale x from to . Handles reversed domains; optional clipping.
Parameters:
x (float)
fromLo (float)
fromHi (float)
toLo (float)
toHi (float)
clip (simple bool)
zscore_std(x, len)
Classic rolling z-score using SMA/STD (sample stdev). Guard zero-variance.
Parameters:
x (float)
len (simple int)
ema_alpha(x, alpha)
EMA with dynamic alpha ∈ . No simplifications; stable init.
Parameters:
x (float)
alpha (float)
zlema(x, length)
Zero-Lag EMA (ZLEMA). Uses lag = round((L-1)/2) and exact 2*x - x prefilter.
Parameters:
x (float)
length (simple int)
hullma(x, length)
Hull Moving Average (HMA) with round() for half and sqrt windows per standard definition.
Parameters:
x (float)
length (simple int)
pct_change(x, len)
Relative change over len bars. Uses exact previous value (sign-preserving); guards zero.
Parameters:
x (float)
len (simple int)
normalize_by_atr(delta, atrLen)
Normalize a delta by ATR(len) → "ATR units" (volatility-normalized). Guards zero ATR.
Parameters:
delta (float)
atrLen (simple int)
smoothstep(x, edge0, edge1)
Smoothstep gate: x∈ → with C1 continuity; robust to equal edges.
Parameters:
x (float)
edge0 (float)
edge1 (float)
biquad_lp_period(x, period_bars, Q)
Parameters:
x (float)
period_bars (float)
Q (float)
biquad_hp_period(x, period_bars, Q)
Parameters:
x (float)
period_bars (float)
Q (float)
biquad_bp_period(x, centerPeriod_bars, Q)
Parameters:
x (float)
centerPeriod_bars (float)
Q (float)
biquad_notch_period(x, centerPeriod_bars, Q)
Parameters:
x (float)
centerPeriod_bars (float)
Q (float)
biquad_bp_between(x, periodLow_bars, periodHigh_bars)
Band-pass by specifying low/high periods (pass between 1/pHigh and 1/pLow).
Computes center f0 = sqrt(fLo*fHi) and Q = f0 / BW (constant-skirt RBJ form).
Parameters:
x (float)
periodLow_bars (float)
periodHigh_bars (float)
angle_diff(a, b)
Parameters:
a (float)
b (float)
rad2deg(r)
Parameters:
r (float)
deg2rad(d)
Parameters:
d (float)
MathLibraryLibrary "MathLibrary"
Algebra & 2D geometry utilities absent from Pine built-ins.
Rigorous, no-repaint, export-ready: vectors, robust roots, linear solvers, 2x2/3x3 det/inverse,
symmetric 2x2 eigensystem, orthogonal regression (TLS), affine transforms, intersections,
distances, projections, polygon metrics, point-in-polygon, convex hull (monotone chain),
Bezier/Catmull-Rom/Barycentric tools.
clamp(x, lo, hi)
clamp to
Parameters:
x (float)
lo (float)
hi (float)
near(a, b, atol, rtol)
approximately equal with relative+absolute tolerance
Parameters:
a (float)
b (float)
atol (float)
rtol (float)
sgn(x)
sign as {-1,0,1}
Parameters:
x (float)
hypot(x, y)
stable hypot (sqrt(x^2+y^2))
Parameters:
x (float)
y (float)
method length(v)
Namespace types: Vec2
Parameters:
v (Vec2)
method length2(v)
Namespace types: Vec2
Parameters:
v (Vec2)
method normalized(v)
Namespace types: Vec2
Parameters:
v (Vec2)
method add(a, b)
Namespace types: Vec2
Parameters:
a (Vec2)
b (Vec2)
method sub(a, b)
Namespace types: Vec2
Parameters:
a (Vec2)
b (Vec2)
method muls(v, s)
Namespace types: Vec2
Parameters:
v (Vec2)
s (float)
method dot(a, b)
Namespace types: Vec2
Parameters:
a (Vec2)
b (Vec2)
method crossz(a, b)
Namespace types: Vec2
Parameters:
a (Vec2)
b (Vec2)
method rotate(v, ang)
Namespace types: Vec2
Parameters:
v (Vec2)
ang (float)
method apply(v, T)
Namespace types: Vec2
Parameters:
v (Vec2)
T (Affine2)
affine_identity()
identity transform
affine_translate(tx, ty)
translation
Parameters:
tx (float)
ty (float)
affine_rotate(ang)
rotation about origin
Parameters:
ang (float)
affine_scale(sx, sy)
scaling about origin
Parameters:
sx (float)
sy (float)
affine_rotate_about(ang, px, py)
rotation about pivot (px,py)
Parameters:
ang (float)
px (float)
py (float)
affine_compose(T2, T1)
compose T2∘T1 (apply T1 then T2)
Parameters:
T2 (Affine2)
T1 (Affine2)
quadratic_roots(a, b, c)
Real roots of ax^2 + bx + c = 0 (numerically stable)
Parameters:
a (float)
b (float)
c (float)
Returns: with n∈{0,1,2}; r1<=r2 when n=2.
cubic_roots(a, b, c, d)
Real roots of ax^3+bx^2+cx+d=0 (Cardano; returns up to 3 real roots)
Parameters:
a (float)
b (float)
c (float)
d (float)
Returns: (valid r2/r3 only if n>=2/n>=3)
det2(a, b, c, d)
det2 of
Parameters:
a (float)
b (float)
c (float)
d (float)
inv2(a, b, c, d)
inverse of 2x2; returns
Parameters:
a (float)
b (float)
c (float)
d (float)
solve2(a, b, c, d, e, f)
solve 2x2 * = via Cramer
Parameters:
a (float)
b (float)
c (float)
d (float)
e (float)
f (float)
det3(a11, a12, a13, a21, a22, a23, a31, a32, a33)
det3 of 3x3
Parameters:
a11 (float)
a12 (float)
a13 (float)
a21 (float)
a22 (float)
a23 (float)
a31 (float)
a32 (float)
a33 (float)
inv3(a11, a12, a13, a21, a22, a23, a31, a32, a33)
inverse 3x3; returns
Parameters:
a11 (float)
a12 (float)
a13 (float)
a21 (float)
a22 (float)
a23 (float)
a31 (float)
a32 (float)
a33 (float)
eig2_symmetric(a, b, d)
symmetric 2x2 eigensystem: [ , ]
Parameters:
a (float)
b (float)
d (float)
Returns: with unit eigenvectors
tls_line(xs, ys)
Orthogonal (total least squares) regression line through point cloud
Input arrays must be same length N>=2. Returns line in normal form n•x + c = 0
Parameters:
xs (array)
ys (array)
Returns: where (nx,ny) unit normal; (cx,cy) centroid.
orient(a, b, c)
orientation (signed area*2): >0 CCW, <0 CW, 0 collinear
Parameters:
a (Vec2)
b (Vec2)
c (Vec2)
project_point_line(p, a, d)
project point p onto infinite line through a with direction d
Parameters:
p (Vec2)
a (Vec2)
d (Vec2)
Returns: where proj = a + t*d
closest_point_segment(p, a, b)
closest point on segment to p
Parameters:
p (Vec2)
a (Vec2)
b (Vec2)
Returns: where t∈ on segment
dist_point_line(p, a, d)
distance from point to line (infinite)
Parameters:
p (Vec2)
a (Vec2)
d (Vec2)
dist_point_segment(p, a, b)
distance from point to segment
Parameters:
p (Vec2)
a (Vec2)
b (Vec2)
intersect_lines(p1, d1, p2, d2)
line-line intersection: L1: p1+d1*t, L2: p2+d2*u
Parameters:
p1 (Vec2)
d1 (Vec2)
p2 (Vec2)
d2 (Vec2)
Returns:
intersect_segments(s1, s2)
segment-segment intersection (closed segments)
Parameters:
s1 (Segment2)
s2 (Segment2)
Returns: where kind: 0=no, 1=proper point, 2=overlap (ix/iy=na)
circumcircle(a, b, c)
circle through 3 non-collinear points
Parameters:
a (Vec2)
b (Vec2)
c (Vec2)
intersect_circle_line(C, p, d)
intersections of circle and line (param p + d t)
Parameters:
C (Circle2)
p (Vec2)
d (Vec2)
Returns: with n∈{0,1,2}
intersect_circles(A, B)
circle-circle intersection
Parameters:
A (Circle2)
B (Circle2)
Returns: with n∈{0,1,2}
polygon_area(xs, ys)
signed area (shoelace). Positive if CCW.
Parameters:
xs (array)
ys (array)
polygon_centroid(xs, ys)
polygon centroid (for non-self-intersecting). Fallback to vertex mean if area≈0.
Parameters:
xs (array)
ys (array)
Vec2
Fields:
x (series float)
y (series float)
Line2
Fields:
p (Vec2)
d (Vec2)
Segment2
Fields:
a (Vec2)
b (Vec2)
Circle2
Fields:
c (Vec2)
r (series float)
Affine2
Fields:
a (series float)
b (series float)
c (series float)
d (series float)
tx (series float)
ty (series float)
MALibraryLibrary "MALibrary"
sma(src, len)
sma
Parameters:
src (float)
len (int)
ema(src, len)
ema
Parameters:
src (float)
len (simple int)
wma(src, len)
wma
Parameters:
src (float)
len (int)
rma(src, len)
rma
Parameters:
src (float)
len (simple int)
vwma(src, len)
vwma
Parameters:
src (float)
len (int)
hma(src, len)
hma
Parameters:
src (float)
len (simple int)
alma(src, len, offset, sigma)
alma
Parameters:
src (float)
len (int)
offset (simple float)
sigma (simple float)
lsma(src, len)
lsma
Parameters:
src (float)
len (int)
rolling_median(src, len)
rolling_median
Parameters:
src (float)
len (int)
fibma(src, len)
fibma
/ Guessed implementation for 'FIB' ribbons (WMA to differ from GMMA).
Parameters:
src (float)
len (int)
dema(src, len)
dema
Parameters:
src (float)
len (simple int)
tema(src, len)
tema
Parameters:
src (float)
len (simple int)
t3(src, len, vFactor)
t3
Parameters:
src (float)
len (simple int)
vFactor (float)
ehma(src, len)
ehma
Parameters:
src (float)
len (simple int)
zlema(src, len)
zlema
Parameters:
src (float)
len (simple int)
zlhma(src, len)
zlhma
Parameters:
src (float)
len (simple int)
dwma(src, len)
dwma
Parameters:
src (float)
len (int)
dswma(src, len)
dswma
Parameters:
src (float)
len (simple int)
emm(src, len1, len2)
emm
Parameters:
src (float)
len1 (int)
len2 (simple int)
swma_sine(src, len)
swma_sine
Parameters:
src (float)
len (int)
pwma_parabolic(src, len)
pwma_parabolic
Parameters:
src (float)
len (int)
gaussma(src, len, sigmaF)
gaussma
Parameters:
src (float)
len (int)
sigmaF (float)
nlwma(src, len, power)
nlwma
Parameters:
src (float)
len (int)
power (float)
sincma(src, len, cutoff)
sincma
Parameters:
src (float)
len (int)
cutoff (float)
spma_15(src)
spma_15
Parameters:
src (float)
cgma(src, len)
cgma
Parameters:
src (float)
len (int)
fsma(src, len, harmonics)
fsma
Parameters:
src (float)
len (int)
harmonics (int)
sema_centered(src, len, useRepaint)
sema_centered
Parameters:
src (float)
len (simple int)
useRepaint (bool)
zpdf(src, len, cutoff, useRepaint)
zpdf
/ Zero-lag (windowed-sinc) filter. When useRepaint=true, returns the centered value via historical shift (no future indexing).
Parameters:
src (float)
len (int)
cutoff (float)
useRepaint (bool)
swma_centered(src, len, useRepaint)
swma_centered
Parameters:
src (float)
len (int)
useRepaint (bool)
mcginley(src, len)
mcginley
Parameters:
src (float)
len (int)
vidya(src, len, len_vol)
vidya
Parameters:
src (float)
len (int)
len_vol (int)
kama(src, len, fast, slow)
kama
Parameters:
src (float)
len (int)
fast (int)
slow (int)
gma_geo(src, len)
gma_geo
Parameters:
src (float)
len (simple int)
super_smoother(src, len)
super_smoother
Parameters:
src (float)
len (int)
laguerre(src, gamma)
laguerre
Parameters:
src (float)
gamma (float)
laguerre_adaptive(src, len)
laguerre_adaptive
Parameters:
src (float)
len (int)
itl(src)
itl
Parameters:
src (float)
decycler(src, len)
decycler
Parameters:
src (float)
len (int)
dcfma(src, len)
dcfma
Parameters:
src (float)
len (int)
frama(src, len)
frama
Parameters:
src (float)
len (int)
arma_adaptive(src, len)
arma_adaptive
Parameters:
src (float)
len (int)
ass(src, len)
ass (Adaptive Super Smoother)
Parameters:
src (float)
len (int)
azlema(src, len)
azlema
Parameters:
src (float)
len (int)
kfma(src, q, r)
kfma
Parameters:
src (float)
q (float)
r (float)
albma(src, min_len, max_len, atr_len)
albma (NEW)
/ Adaptive Lookback MA using ATR; higher ATR → shorter lookback.
Parameters:
src (float)
min_len (int)
max_len (int)
atr_len (simple int)
fdima(src, len)
fdima
Parameters:
src (float)
len (int)
nma(src_ma, len)
nma
Parameters:
src_ma (float)
len (int)
cma_corrected(src_ma, g)
cma_corrected
Parameters:
src_ma (float)
g (float)
rfma(src, len)
rfma
Parameters:
src (float)
len (simple int)
rsdma(src, len)
rsdma
Parameters:
src (float)
len (int)
sdama(src, len)
sdama
Parameters:
src (float)
len (int)
corma(src, ext_src, len)
corma
Parameters:
src (float)
ext_src (float)
len (int)
evma(src, len)
evma
Parameters:
src (float)
len (simple int)
vama(src, len)
vama (NEW)
/ Volume-Adjusted Moving Average (VIDYA-style using relative volume).
Parameters:
src (float)
len (int)
ivwma(src, len)
ivwma
Parameters:
src (float)
len (int)
vrocma(src, len1, len2)
vrocma
Parameters:
src (float)
len1 (int)
len2 (int)
vtwap(len)
vtwap
Parameters:
len (int)
gvwma(src, len)
gvwma
Parameters:
src (float)
len (int)
pvdma(src, len)
pvdma
Parameters:
src (float)
len (int)
hampel_mean(src, len, thr, k, ma_type)
hampel_mean
Parameters:
src (float)
len (simple int)
thr (float)
k (float)
ma_type (string)
hlma(len)
hlma
Parameters:
len (simple int)
hlmma(len)
hlmma
Parameters:
len (simple int)
mpma(len)
mpma
Parameters:
len (int)
hvma(len)
hvma
Parameters:
len (int)
ema_slope(src, len)
ema_slope
Parameters:
src (float)
len (simple int)
chARTronics Relative Strength LineRelative Strength Line (O’Neil Inspired)
This line measures a stock’s performance versus a benchmark index (commonly NIFTY 500), inspired by William O’Neil’s methodology in How to Make Money in Stocks. When the line rises, the stock is outperforming the market; when it falls, the stock is lagging.
Unlike raw price movement, the Relative Strength Line filters out market noise to reveal true leadership. New highs in this line—especially ahead of price breakouts—often signal institutional accumulation and the emergence of a potential market leader.
Traders use it to:
Identify early strength before price confirms
Validate breakout quality and momentum
Distinguish leaders from laggards in uncertain markets
When the line trends upward while price consolidates, it’s often the quiet clue that a powerful move is building beneath the surface.
Asia & London High/Low + Midnight Open“Marks Asia & London session highs/lows and NY midnight open — essential for intraday traders tracking session liquidity.”






















