Indikatoren und Strategien
Value Area PRO (TPO/Volume Session VAH/VAL/POC) 📌 AP Capital Value Area PRO (TPO / Volume)
AP Capital Value Area PRO is a session-based value area indicator designed for Gold (XAUUSD), NASDAQ (NAS100), and other CFD instruments.
It focuses on where the market has accepted price during the current session and highlights high-probability interaction zones used by professional traders.
Unlike rolling lookback volume profiles, this indicator builds a true session value area and provides actionable signals around VAH, VAL, and POC.
🔹 Core Features
Session-Anchored Value Area
Value Area is built only during the selected session
Resets cleanly at session start
Levels develop during the session and can be extended forward
No repainting or shifting due to lookback changes
TPO or Volume Mode
TPO (Time-at-Price) mode – ideal for CFDs and tick-volume data
Volume mode – uses broker volume if preferred
Same logic, different weighting method
Fixed Price Bin Size
Uses a fixed bin size (e.g. 0.10 for Gold, 0.25–0.50 for NAS100)
Produces cleaner, more realistic VAH/VAL levels
Avoids distorted profiles caused by dynamic bin scaling
VAH / VAL / POC Levels
VAH (Value Area High)
VAL (Value Area Low)
POC (Point of Control) (optional)
Lines can be extended to act as forward reference levels
🔹 Trading Signals & Alerts
Value Re-Entry
Identifies false breakouts where price:
Trades outside value
Then closes back inside
Often seen before strong mean-reversion or continuation moves.
Acceptance
Detects initiative activity using:
Multiple consecutive closes outside value
Filters out weak single-candle breaks
Rejection
Flags strong rejection candles:
Large candle body
Wick outside value
Close back inside the value area
These conditions are especially effective on Gold intraday.
🔹 Optional Profile Histogram
Right-side volume/TPO histogram
Buy/sell imbalance visualization
Fully optional to reduce chart clutter and improve performance
🔹 Best Use Cases
Recommended markets
XAUUSD (Gold)
NAS100 / US100
Other index or metal CFDs
Recommended timeframes
5m, 15m, 30m
Suggested settings
Mode: TPO
Value Area: 70%
Bin size:
Gold: 0.10
NAS100: 0.25 or 0.50
🔹 How Traders Use It
Trade rejections at VAH / VAL
Look for acceptance to confirm trend days
Use re-entries to fade failed breakouts
Combine with trend filters, EMA structure, or session context
⚠️ Disclaimer
This indicator is provided for educational and analytical purposes only and does not constitute financial advice. Always manage risk appropriately.
Session VWAP Cumulative BiasThe Session VWAP Cumulative Bias indicator is designed to differentiate between "choppy" price action and true "institutional" trend days. Unlike standard VWAP indicators that only show where price is now, this tool tracks the cumulative sentiment of the entire session.
Core Functions:
Cumulative Z-Score Logic: It calculates the distance between price and VWAP (in Standard Deviations) and sums it up over the course of the day. This reveals the "weight" of the market bias—the longer price stays pinned away from the VWAP, the more extreme the histogram becomes.
Scale Protection: It includes a "Capping" mechanism that prevents morning gaps or low-volume outliers from distorting the scale, ensuring the histogram remains readable from open to close.
Momentum vs. Regime Toggles: Users can switch between VWAP Slope (measuring the speed of the average's movement) and Cumulative Bias (measuring total session dominance).
Visual price Overlay: It automatically colors the price candles and plots a session-anchored VWAP line on the main chart, providing a clear visual of when price is "fair" versus "overextended."
How to read it:
Trend Confirmation: A steadily growing "mountain" in the histogram confirms an institutional trend day where dips are being bought (or rips sold).
Mean Reversion: When price hits a new high but the Cumulative Histogram begins to round off or diverge, it signals that the "elastic band" is stretched and price is likely to return to the orange VWAP line.
Regime Shifts: A cross of the zero-line on the histogram indicates a total shift in session control from buyers to sellers (or vice versa).
4 Period Momentum Composite IndicatorThe 4‑Period Momentum Indicator blends four lookback windows (1m, 3m, 6m, 12m) into a single zero‑centered momentum line. The value recalculates from whatever candle you anchor on, giving you full control when scrolling through historical price action. Positive readings reflect upward momentum, negative readings show weakness, and zero‑line crossovers highlight potential trend shifts. Designed for multi‑timeframe use and ETF relative‑strength comparison.
Auto Fib Prev-Week Only for [4H+ Swing]Maps the previous week Fib levels:
Captures real supply & demand.
Defines where price was accepted or rejected.
Creates levels that current price must respect.
This indicator locks those levels in place and extends them forward.
What the levels represent:
- Previous Week High / Low
- Major boundaries. Breaks require momentum.
- 50% Level
- Balance point. Chop and indecision are common here.
- 61.8% Levels (Bull & Bear)
- Primary mean-reversion zones.
- Most reliable reaction levels.
- 78.6% Levels
- Last defense before trend failure or expansion.
- Extensions (1.214 → 2.618 / negatives)
- Exhaustion and target zones.
Working....
Dashboard (bottom-right)
- Nearest Sup / Res – Closest actionable level
- On Level? – Price is currently reacting at a level
- UpBreak% / DnBreak% – Probability of breaking vs rejecting
- Bias – Market posture (UP / DOWN / NEUTRAL)
- Tol – Sensitivity used for level detection
BLUF: Maps last week’s structure forward to identify high-probability reaction zones and whether price is more likely to revert or break.
Relative Strength SpreadSPY vs IWM Relative Strength Spread Indicator
The SPY vs IWM Relative Strength Spread indicator measures leadership between large-cap and small-cap equities by comparing the percent performance of SPY (S&P 500) against IWM (Russell 2000) over a user-defined lookback period.
The indicator plots a zero-centered histogram in a separate pane, making relative strength shifts immediately visible.
How It Works
The indicator calculates the percent change of SPY and IWM over the same lookback window.
It then subtracts IWM’s percent change from SPY’s percent change.
The result is plotted as a histogram pinned to the 0% line.
This design removes long-term drift and ensures that:
Positive values indicate SPY is outperforming IWM
Negative values indicate IWM is outperforming SPY
How to Read the Histogram
Above Zero (Green Bars)
Large-cap stocks are leading → typically associated with risk-on stability and institutional flow into SPY-weighted names.
Below Zero (Red Bars)
Small-cap stocks are leading → often signals risk appetite expansion and speculative participation.
Crosses of the Zero Line
Mark potential leadership transitions between large caps and small caps.
Why This Indicator Is Useful
Identifies market regime shifts (risk-on vs risk-off behavior)
Confirms or filters trend strength in equities
Helps time rotations between large-cap and small-cap exposure
Works consistently across all timeframes
Because the calculation is based on percent change, the histogram remains normalized and comparable regardless of price level or timeframe.
Best Use Cases
As a market internals / breadth confirmation tool
As a bias filter for SPY, IWM, or index futures
To spot early leadership changes before price trends fully develop
John Trade AlertsImagine you are watching a ball bounce up and down on a graph.
This script is like a set of rules that says:
When to start playing
When to stop playing
When you got some prize levels
and it yells to you (alerts) when those things happen.
The main ideas
Breakout Buy (ball jumps high)
There is a line drawn high on the chart called the breakout level.
If the price (the ball) closes above that line, and some extra “good conditions” are true (enough volume, uptrend, etc.),
the script says: “We entered a Breakout trade now.”
Pullback Buy (ball dips into a box)
There is a zone (a small box) between a low line and a high line: the pullback zone.
If the price closes inside that zone, and the pullback looks “healthy” (not too much volume, still above a moving average, etc.),
the script says: “We entered a Pullback trade now.”
Stops (when to get out if it goes wrong)
For each entry type (Breakout or Pullback), there is a red stop line under the price.
If the price falls below that stop line, the script says:
“Stop hit, we’re out of the trade.”
Hard Support / Invalidation (big no‑no level)
There is a special hard support line.
The script also looks at the 1‑hour chart in the background.
If a 1‑hour candle closes below that hard support, it says:
“Hard invalidation – idea is broken, get out.”
Targets (prize levels)
Above the current price there are several orange lines: Target 1, 2, 3A, 3B, 4A, 4B.
If the price goes up and crosses one of these lines, the script says:
“Target X reached!”
Trend and Volume “health checks”
It checks if the short‑term average price (SMA20) is going up → “uptrend.”
It can check if price is above a long‑term average (SMA200).
For breakouts, it checks if volume is stronger than usual (good push).
For pullbacks, it prefers quieter than usual volume (calm dip).
It can also check an Anchored VWAP line (a special average price from a chosen starting time) and only trade if price is above that too.
Remembering if you are “in a trade”
The script keeps a little memory:
Are we currently in a position (inPos) or not?
Was it a Breakout or a Pullback entry?
What is our entry price and active stop?
When it gets a new entry signal, it turns inPos to true, picks the right stop, and draws that stop line.
When a stop or hard invalidation happens, it sets inPos to false again.
It can also “forget” and reset at the start of a new trading day if you want.
Alerts
When:
you get a Breakout entry
or a Pullback entry
or a Stop is hit
or the hard support is broken on 1‑hour
or a Target is reached
the script sends a message you can use in TradingView alerts (pop‑ups, email, webhook, etc.).
Things you see on the chart
Teal line: Breakout level
Green lines: Pullback zone low & high
Red line: Active stop (only when you’re “in” a trade)
Orange lines: Targets 1, 2, 3A, 3B, 4A, 4B
Blue line: Anchored VWAP (if you turn it on)
Purple faint line: SMA20 (short‑term trend)
Gray faint line: SMA200 (long‑term trend)
Little label near the last bar that says:
if you’re IN or Flat
which type of entry (Breakout/Pullback)
what your current stop is
So in kid words:
It draws important lines on the chart.
It watches the price move like a ball.
When the ball does something special (jump above, fall below, hit a prize line),
it shouts to you with alerts.
It remembers if you’re in the game or not, and where your safety line (stop) is.
Daily Inputs - The Prometheus InitiativeDaily ES inputs from the Prometheus Initiative is a clean, customizable overlay indicator designed specifically for ES (S&P 500 E-mini futures) day traders who rely on manually selected key price levels each session.
Instead of spending time manually drawing horizontal lines every day, this tool lets you quickly input the daily price levels directly in the settings and instantly see them plotted as horizontal lines across your chart.
Key Features:
• 15 fully editable price inputs with customizable settings.
Why this indicator was created:
Manually drawing 10–15 lines each morning is time-consuming. This indicator was developed to eliminate that friction — allowing fast, accurate plotting of levels so you can focus on execution rather than drawing tools. The largest benefit is that you can toggle the indicator on/off to keep a clean chart as to not interfere with your existing visual levels.
Perfect for:
- ES / NQ futures traders
- Anyone who wants a clean, no-nonsense way to visualize custom horizontal levels
How to use:
1. Add to your chart
2. Open Settings → Enter the daily levels provided
3. Watch price interact with the levels!
Note: This is a manual input tool. Levels do NOT auto-calculate. It's meant to reflect the exact levels posted each day.
Happy trading! 📈
Feel free to leave feedback or suggestions in the comments.
Disclaimer: This indicator is for educational/visual purposes only. Trading futures involves substantial risk of loss and is not suitable for all investors.
Dynamic Zone TraderDynamic Zone Trader - MACD-based trading system with adaptive stop loss and take profit zones.
This indicator generates buy/sell signals from MACD histogram crossovers and automatically adjusts position sizing based on market conditions.
Key Features:
Detects breakout trades and expands targets to capture larger moves
Identifies choppy/ranging conditions and tightens stops to reduce risk
Shows supply and demand zones based on pivot highs/lows
Displays three take profit levels (TP1, TP2, TP3) that scale with trade quality
Entry signals filtered by 50 EMA to trade with the trend
Signal strength score displayed on each entry marker
How It Works:
The indicator analyzes recent price structure and movement to classify each trade:
Breakout trades (breaking recent highs/lows) get 1.6x larger zones
Normal trades get standard 1.0x sizing
Choppy weak signals get 0.75x smaller zones
This allows you to take bigger positions on high-conviction setups while limiting risk during low-quality trades.
Settings:
MACD parameters (default 8/21/5)
Base stop loss: 60 ticks
Base take profit: 80 ticks
EMA filter: 50 period
Optional ADX trend filter
Adjustable breakout detection sensitivity
Works on any timeframe and instrument, but optimized for index futures like NQ/MNQ.
RSI Swing Indicator// This source code is subject to the terms of the Mozilla Public License 2.0 at mozilla.org
//
// DESCRIPTION:
// This is an improved version of the original RSI Swing Indicator created by BalintDavid.
// It highlights swing moves between RSI overbought/oversold extremes and updates swing labels
// as price pushes to new highs or lows inside the same RSI regime.
//
// HOW TO USE:
// 1) Set the RSI source, length, and overbought/oversold levels in Inputs.
// 2) Watch the swing lines connect the last oversold to overbought (and vice-versa).
// 3) Labels show structure: HH (higher high), LH (lower high), HL (higher low), LL (lower low).
// 4) Enable "Show only last connecting line" to keep just the most recent connection.
//
// CONTACT:
// ronbelson@gmail.com
//
Week High/LowThis indicator plots the Previous Week High and Low as two horizontal dashed lines.
It is designed to appear only on the Daily (D) and Weekly (W) timeframes, ensuring a clean higher-timeframe context without lower-timeframe noise.
The levels are calculated from the completed weekly candle and automatically update at the start of each new week.
These levels serve as weekly liquidity references, commonly used to assess premium/discount zones, potential stop-run areas, and higher-timeframe market reactions.
Chart This in GoldProduces a historical line chart in the bottom pane to reflect how many units of spot gold (XAU) could be exchanged for one unite of the underlying asset.
MLMatrixLibOverview
MLMatrixLib is a comprehensive Pine Script v6 library implementing machine learning algorithms using native matrix operations. This library provides traders and developers with a toolkit of statistical and ML methods for building quantitative trading systems, performing data analysis, and creating adaptive indicators.
How It Works
The library leverages Pine Script's native matrix type to perform efficient linear algebra operations. Each algorithm is implemented from first principles, using matrix decomposition, iterative optimization, and statistical estimation techniques. All functions are designed for numerical stability with careful handling of edge cases.
---
Library Contents (34 Sections)
Section 1: Utility Functions & Matrix Operations
Core building blocks including:
• identity(n) - Creates n×n identity matrix
• diagonal(values) - Creates diagonal matrix from array
• ones(rows, cols) / zeros(rows, cols) - Matrix constructors
• frobeniusNorm(m) / l1Norm(m) - Matrix norm calculations
• hadamard(m1, m2) - Element-wise multiplication
• columnMeans(m) / rowMeans(m) - Statistical aggregations
• standardize(m) - Z-score normalization (zero mean, unit variance)
• minMaxNormalize(m) - Scale values to range
• fitStandardScaler(m) / fitMinMaxScaler(m) - Reusable scaler parameters
• addBiasColumn(m) - Prepend column of ones for regression
• arrayMedian(arr) / arrayPercentile(arr, p) - Array statistics
Section 2: Activation Functions
Numerically stable implementations:
• sigmoid(x) / sigmoidMatrix(m) - Logistic function with overflow protection
• tanhActivation(x) / tanhMatrix(m) - Hyperbolic tangent
• relu(x) / reluMatrix(m) - Rectified Linear Unit
• leakyRelu(x, alpha) - Leaky ReLU with configurable slope
• elu(x, alpha) - Exponential Linear Unit
• Derivatives for backpropagation: sigmoidDerivative, tanhDerivative, reluDerivative
Section 3: Linear Regression (OLS)
Ordinary Least Squares implementation using the normal equation (X'X)⁻¹X'y:
• fitLinearRegression(X, y) - Fits model, returns coefficients, R², standard error
• fitSimpleLinearRegression(x, y) - Single-variable regression
• predictLinear(model, X) - Generate predictions
• predictionInterval(model, X, confidence) - Confidence intervals using t-distribution
• Model type stores: coefficients, R-squared, residuals, standard error
Section 4: Weighted Linear Regression
Generalized least squares with observation weights:
• fitWeightedLinearRegression(X, y, weights) - Solves (X'WX)⁻¹X'Wy
• Useful for downweighting outliers or emphasizing recent data
Section 5: Polynomial Regression
Fits polynomials of arbitrary degree:
• fitPolynomialRegression(x, y, degree) - Constructs Vandermonde matrix
• predictPolynomial(model, x) - Evaluate polynomial at points
Section 6: Ridge Regression (L2 Regularization)
Adds penalty term λ||β||² to prevent overfitting:
• fitRidgeRegression(X, y, lambda) - Solves (X'X + λI)⁻¹X'y
• Lambda parameter controls regularization strength
Section 7: LASSO Regression (L1 Regularization)
Coordinate descent algorithm for sparse solutions:
• fitLassoRegression(X, y, lambda, maxIter, tolerance) - Iterative soft-thresholding
• Produces sparse coefficients by driving some to exactly zero
• softThreshold(x, lambda) - Core shrinkage operator
Section 8: Elastic Net (L1 + L2 Regularization)
Combines LASSO and Ridge penalties:
• fitElasticNet(X, y, lambda, alpha, maxIter, tolerance)
• Alpha balances L1 vs L2: alpha=1 is LASSO, alpha=0 is Ridge
Section 9: Huber Robust Regression
Iteratively Reweighted Least Squares (IRLS) for outlier resistance:
• fitHuberRegression(X, y, delta, maxIter, tolerance)
• Delta parameter defines transition between L1 and L2 loss
• Downweights observations with large residuals
Section 10: Quantile Regression
Estimates conditional quantiles using linear programming approximation:
• fitQuantileRegression(X, y, tau, maxIter, tolerance)
• Tau specifies quantile (0.5 = median, 0.25 = lower quartile, etc.)
Section 11: Logistic Regression (Binary Classification)
Gradient descent optimization of cross-entropy loss:
• fitLogisticRegression(X, y, learningRate, maxIter, tolerance)
• predictProbability(model, X) - Returns probabilities
• predictClass(model, X, threshold) - Returns binary predictions
Section 12: Linear SVM (Support Vector Machine)
Sub-gradient descent with hinge loss:
• fitLinearSVM(X, y, C, learningRate, maxIter)
• C parameter controls regularization (higher = harder margin)
• predictSVM(model, X) - Returns class predictions
Section 13: Recursive Least Squares (RLS)
Online learning with exponential forgetting:
• createRLSState(nFeatures, lambda, delta) - Initialize state
• updateRLS(state, x, y) - Update with new observation
• Lambda is forgetting factor (0.95-0.99 typical)
• Useful for adaptive indicators that update incrementally
Section 14: Covariance and Correlation
Matrix statistics:
• covarianceMatrix(m) - Sample covariance
• correlationMatrix(m) - Pearson correlations
• pearsonCorrelation(x, y) - Single correlation coefficient
• spearmanCorrelation(x, y) - Rank-based correlation
Section 15: Principal Component Analysis (PCA)
Dimensionality reduction via eigendecomposition:
• fitPCA(X, nComponents) - Power iteration method
• transformPCA(X, model) - Project data onto principal components
• Returns components, explained variance, and mean
Section 16: K-Means Clustering
Lloyd's algorithm with k-means++ initialization:
• fitKMeans(X, k, maxIter, tolerance) - Cluster data points
• predictCluster(model, X) - Assign new points to clusters
• withinClusterVariance(model) - Measure cluster compactness
Section 17: Gaussian Mixture Model (GMM)
Expectation-Maximization algorithm:
• fitGMM(X, k, maxIter, tolerance) - Soft clustering with probabilities
• predictProbaGMM(model, X) - Returns membership probabilities
• Models data as mixture of Gaussian distributions
Section 18: Kalman Filter
Linear state estimation:
• createKalman1D(processNoise, measurementNoise, ...) - 1D filter
• createKalman2D(processNoise, measurementNoise) - Position + velocity tracking
• kalmanStep(state, measurement) - Predict-update cycle
• Optimal filtering for noisy measurements
Section 19: K-Nearest Neighbors (KNN)
Instance-based learning:
• fitKNN(X, y) - Store training data
• predictKNN(model, X, k) - Classify by majority vote
• predictKNNRegression(model, X, k) - Average of k neighbors
• predictKNNWeighted(model, X, k) - Distance-weighted voting
Section 20: Neural Network (Feedforward)
Multi-layer perceptron:
• createNeuralNetwork(architecture) - Define layer sizes
• trainNeuralNetwork(nn, X, y, learningRate, epochs) - Backpropagation
• predictNN(nn, X) - Forward pass
• Supports configurable hidden layers
Section 21: Naive Bayes Classifier
Gaussian Naive Bayes:
• fitNaiveBayes(X, y) - Estimate class-conditional distributions
• predictNaiveBayes(model, X) - Maximum a posteriori classification
• Assumes feature independence given class
Section 22: Anomaly Detection
Statistical outlier detection:
• fitAnomalyDetector(X, contamination) - Mahalanobis distance-based
• detectAnomalies(model, X) - Returns anomaly scores
• isAnomaly(model, X, threshold) - Binary classification
Section 23: Dynamic Time Warping (DTW)
Time series similarity:
• dtw(series1, series2) - Compute DTW distance
• Handles sequences of different lengths
• Useful for pattern matching
Section 24: Markov Chain / Regime Detection
Discrete state transitions:
• fitMarkovChain(states, nStates) - Estimate transition matrix
• predictNextState(transitionMatrix, currentState) - Most likely next state
• stationaryDistribution(transitionMatrix) - Long-run probabilities
Section 25: Hidden Markov Model (Simple)
Baum-Welch algorithm:
• fitHMM(observations, nStates, maxIter) - EM training
• viterbi(model, observations) - Most likely state sequence
• Useful for regime detection
Section 26: Exponential Smoothing & Holt-Winters
Time series smoothing:
• exponentialSmooth(data, alpha) - Simple exponential smoothing
• holtWinters(data, alpha, beta, gamma, seasonLength) - Triple smoothing
• Captures trend and seasonality
Section 27: Entropy and Information Theory
Information measures:
• entropy(probabilities) - Shannon entropy in bits
• conditionalEntropy(jointProbs, marginalProbs) - H(X|Y)
• mutualInformation(probsX, probsY, jointProbs) - I(X;Y)
• kldivergence(p, q) - Kullback-Leibler divergence
Section 28: Hurst Exponent
Long-range dependence measure:
• hurstExponent(data) - R/S analysis
• H < 0.5: mean-reverting, H = 0.5: random walk, H > 0.5: trending
Section 29: Change Detection (CUSUM)
Cumulative sum control chart:
• cusumChangeDetection(data, threshold, drift) - Detect regime changes
• cusumOnline(value, prevCusumPos, prevCusumNeg, target, drift) - Streaming version
Section 30: Autocorrelation
Serial dependence analysis:
• autocorrelation(data, maxLag) - ACF for all lags
• partialAutocorrelation(data, maxLag) - PACF via Durbin-Levinson
• Useful for time series model identification
Section 31: Ensemble Methods
Model combination:
• baggingPredict(models, X) - Average predictions
• votingClassify(models, X) - Majority vote
• Improves robustness through aggregation
Section 32: Model Evaluation Metrics
Performance assessment:
• mse(actual, predicted) / rmse / mae / mape - Regression metrics
• accuracy(actual, predicted) - Classification accuracy
• precision / recall / f1Score - Binary classification metrics
• confusionMatrix(actual, predicted, nClasses) - Multi-class evaluation
• rSquared(actual, predicted) / adjustedRSquared - Goodness of fit
Section 33: Cross-Validation
Model validation:
• trainTestSplit(X, y, trainRatio) - Random split
• Foundation for walk-forward validation
Section 34: Trading Convenience Functions
Trading-specific utilities:
• priceMatrix(length) - OHLC data as matrix
• logReturns(length) - Log return series
• rollingSlope(src, length) - Linear trend strength
• kalmanFilter(src, processNoise, measurementNoise) - Filtered price
• kalmanFilter2D(src, ...) - Price with velocity estimate
• adaptiveMA(src, sensitivity) - Kalman-based adaptive moving average
• volAdjMomentum(src, length) - Volatility-normalized momentum
• detectSRLevels(length, nLevels) - K-means based S/R detection
• buildFeatures(src, lengths) - Multi-timeframe feature construction
• technicalFeatures(length) - Standard indicator feature set (RSI, MACD, BB, ATR, etc.)
• lagFeatures(src, lags) - Time-lagged features
• sharpeRatio(returns) - Risk-adjusted return measure
• sortinoRatio(returns) - Downside risk-adjusted return
• maxDrawdown(equity) - Maximum peak-to-trough decline
• calmarRatio(returns, equity) - Return/drawdown ratio
• kellyCriterion(winRate, avgWin, avgLoss) - Optimal position sizing
• fractionalKelly(...) - Conservative Kelly sizing
• rollingBeta(assetReturns, benchmarkReturns) - Market exposure
• fractalDimension(data) - Market complexity measure
---
Usage Example
```
import YourUsername/MLMatrixLib/1 as ml
// Create feature matrix
matrix X = ml.priceMatrix(50)
X := ml.standardize(X)
// Fit linear regression
ml.LinearRegressionModel model = ml.fitLinearRegression(X, y)
float prediction = ml.predictLinear(model, X_new)
// Kalman filter for smoothing
float smoothedPrice = ml.kalmanFilter(close, 0.01, 1.0)
// Detect support/resistance levels
array levels = ml.detectSRLevels(100, 3)
// K-means clustering for regime detection
ml.KMeansModel km = ml.fitKMeans(features, 3)
int cluster = ml.predictCluster(km, newFeature)
```
---
Technical Notes
• All matrix operations use Pine Script's native matrix type
• Numerical stability ensured through:
- Clamping exponential arguments to prevent overflow
- Division by zero protection with epsilon thresholds
- Iterative algorithms with convergence tolerance
• Designed for bar-by-bar execution in Pine Script's event-driven model
• Compatible with Pine Script v6
---
Disclaimer
This library provides mathematical tools for quantitative analysis. It does not constitute financial advice. Past performance of any algorithm does not guarantee future results. Users are responsible for validating models on their specific use cases and understanding the limitations of each method.
Thick Wick OverlayI have a hard time seeing the wick and made a simple overlay indicator to create a "thicker wick". You can change the thickness and wick color to your desired color and thickness.
Momentum Scanner: Low Float + Volume Spike + 3 Green CandlesScanner for low-float stocks with volume spikes and 3 consecutive bullish candles
Ichimoku Multi-BG System by Pranojit Dey (Exact Alignment)It shows trend of different levels with the help of Ichimoku, VWAP, SMA and Pivot. Use it as a strong confluence for any entry. Lets trade guys...
Frankfurt-USPremarket Open (0800-1000) CETThe scripts draws 2 horizontal lines:
1. 08:00 a.m. Frankfurt Open
2. 10:00 a.m. US-Premarket Open
Performance Table: Standard DCA | Last 6-12-24-48MThis indicator visualizes Standard Dollar-Cost Averaging (DCA) performance across multiple time horizons (6M, 12M, 24M, 48M).
It summarizes invested capital, current portfolio value, net profit, and return percentage in a compact table, allowing quick comparison of short- and long-term DCA outcomes.
Designed for long-term investors, it helps evaluate how consistent periodic investments perform over time without relying on market timing.
The indicator is asset-agnostic and works on any symbol supported by TradingView.
Key use cases:
Long-term portfolio tracking
DCA strategy validation
Performance comparison across periods
Educational and analytical purposes
This tool focuses on clarity and realism, avoiding over-optimization and short-term noise.
--
I hope this table helps investors better understand long-term DCA performance.
Feedback and suggestions for improvement are always welcome.
ULTIMATE Multi-TF Previous CloseULTIMATE Multi-TF Previous Close displays previous close levels across multiple timeframes in one simple, non-repainting indicator.
These levels often act as key decision points, providing natural support, resistance, and directional bias.
Ideal for day traders, swing traders, and scalpers who want higher-timeframe context without clutter.
Features include:
Yearly → 5-minute timeframe coverage
Right-extended horizontal levels
Optional labels with exact prices
Tick-accurate rounding
Designed for clarity. Built for precision.
Trading Sessions (London / New York / Tokyo / Sydney)Trading sessions for all assets with (time zone) adjustable trading sessions.






















