Pine Script® Indikator
In den Scripts nach "ai" suchen
StatMap [Pro]+ |Algo Matrix|█ OVERVIEW
The StatMap + AC Dynamics represents the evolution of statistical range mapping. While the Basic version maps static volatility variance, the + edition integrates a second-order derivative engine: the AC (Average Candle) Dynamics model.
This tool combines the macro-view of the StatMap Volatility Grid (Manipulation vs. Distribution) with the micro-view of the "Market Heartbeat"—a dynamic calculation of the average expansion capability of the current asset. It answers not only "Where is the statistical limit?" but also "Does the current auction have the energy to reach it?"
█ KEY FEATURES
AC (Average Candle) Dynamics Engine :
This is the core upgrade. The AC Engine continuously samples recent price action (using a hybrid Short/Long lookback algorithm) to determine the "True Average Range" of the asset.
The Valve (Box): Projects the baseline average body size. If price is contained within this valve, the market is compressing.
The Spread (Lines): Projects expansion thresholds (33%, 50%, 66%) based on the Average Candle's capability. These act as immediate "Launchpad" or "Failure" points for intraday volatility.
Dynamic Volatility Injection (DVI) :
Unlike static grids, this tool uses a "Smart Injection" system. It records historical volatility for every specific time-bucket of the day.
Heatmap Projection: The indicator paints the active zone based on historical activity. If the current time is historically high-volatility, the zone glows Hot (Red/Orange). If low volatility, it cools (Blue).
Future Casting: It projects this volatility profile forward, allowing you to visually see when the next liquidity injection is statistically likely to occur.
Active State Machine :
The grid is alive. It utilizes a logic-gate system that automatically shifts focus based on price location:
State 0 (M1): Focus is on the immediate manipulation zone.
State 1 (M2): If M1 breaks, the logic shifts to the secondary variance level.
State 2 (D): Upon expansion, the focus shifts entirely to the Distribution limit.
Time Sector Division :
Advanced temporal analysis that slices the trading session into harmonic divisions (Div 3, 4, 6, or 9). This filters "Time vs. Price" effectiveness, highlighting sectors where the algorithm successfully "tapped" a StatMap level or "broke" structure.
Smart Visual Intelligence :
Includes an AI-like contrast management system that detects your chart theme (Light or Dark) and auto-adjusts the opacity and luminance of all levels to ensure maximum visibility with zero eye strain.
█ HOW TO USE
The AC Valve Entry :
Use the inner "AC Box" (The Valve) to time your entries. A candle close outside the AC Valve often signals that the "Average Volatility" has been exceeded, leading to an expansion toward the outer StatMap zones.
Volatility Alignment :
Before executing a trade at a Manipulation (M) level, check the Dynamic Volatility Color .
If price hits M1 but the volatility projection is "Cold" (Low Vol), the probability of a successful reversal is lower.
If price hits M1 and the zone is "Hot" (High Vol), the algorithm confirms that sufficient energy exists for a true move.
Sector Confluence :
Enable Div 4 or Div 6 sectors. If a vertical time sector line aligns with a StatMap horizontal level, this "Crosshair" represents a high-probability institutional turning point.
█ DISCLAIMER
This tool utilizes advanced statistical modeling for educational analysis. Past volatility performance is not indicative of future results. Trade responsibly.
By |Algo Matrix|
Pine Script® Indikator
Combined Ribbon & ImbalanceDescription: Combined Ribbon Trend & Volume Footprint Imbalance
This advanced TradingView Pine Script (v6) combines two powerful trading methodologies—Trend Following (MA Ribbon) and Order Flow (Volume Footprint)—into a single, cohesive strategy. The script is designed to eliminate market noise by ensuring that signals only trigger when trend momentum and aggressive buying/selling imbalances align.
Key Features:
AI-Adaptive MA Ribbon: A dynamic ribbon that can automatically adjust its length, step, and count based on higher timeframe volatility (ATR) and trend strength (ADX).
Filtered Volume Imbalance Zones: Detects "stacked imbalances" where aggressive market participants are entering. Unlike standard indicators, these zones are trend-filtered:
Buy Imbalances only appear when the Ribbon is Bullish.
Sell Imbalances only appear when the Ribbon is Bearish.
Dynamic Trendline Zones: Includes an optional filter for Wick-based Support and Resistance zones. It extends these lines until they are "mitigated" (broken) by a candle body.
High-Confluence Signals: "BUY" and "SELL" labels are only plotted when a Ribbon Flip occurs simultaneously with a Volume Imbalance on the same bar.
Customizable Order Flow: Includes CVD (Cumulative Volume Delta) divergence logic, closing strength filters, and wick location filters to ensure you only see the most high-probability imbalances.
How to Use:
Green Ribbon + Buy Imbalance: Look for Long opportunities.
Red Ribbon + Sell Imbalance: Look for Short opportunities.
Grey Zones: Market is in a "Chop Zone"—exercise caution.
⚠️ Disclaimer
Use at your own risk. This indicator is for informational and educational purposes only. Past performance does not guarantee future results. Trading involves significant risk, and you should never invest more than you can afford to lose.
🚀 Access the Script
Interested in trying the Combined Ribbon & Imbalance indicator? Send me a DM to get a FREE TRIAL!
Pine Script® Indikator
Polynomial Regression Clustering [LuxAlgo]The Polynomial Regression Clustering indicator utilizes K-Means clustering to categorize historical price data into discrete levels and fits polynomial regression curves to each identified cluster.
This tool allows traders to visualize non-linear trends within specific price regimes, providing a unique perspective on support, resistance, and price momentum.
🔶 USAGE
The indicator identifies "K" number of clusters based on the vertical distribution of price over a user-defined lookback period. Each cluster represents a group of bars that share similar price levels, and a polynomial regression line is calculated to represent the localized trend for that specific group.
🔹 Cluster Identification
The script groups price action into color-coded dots. By default, it uses the HL2 (Average price) to determine which cluster a bar belongs to. This is particularly useful for identifying historical value areas where price has spent a significant amount of time.
🔹 Polynomial Fitting
Unlike standard linear regression, which produces a straight line, the polynomial regression curves can bend to fit the data more accurately.
A Polynomial Degree of 1 will result in a standard linear regression (straight lines). A Polynomial Degree of 2 or higher allows for curves that capture parabolic moves or cyclical swings within each cluster.
🔹 Future Projections
The current active cluster (the one containing the most recent price point) can be projected into the future. This allows you to see where the localized trend for the current price regime is heading based on the mathematical fit of historical data.
🔶 DETAILS
🔹 K-Means Algorithm
The script uses an iterative K-Means algorithm to find the optimal centroids (center points) for the price levels. It calculates the distance of each price point to the nearest centroid and refines the centroid position until the clusters are stable or the maximum iterations are reached.
🔹 Regression Logic
Once price points are assigned to a cluster, the script solves for the coefficients of a polynomial equation that minimizes the distance between the line and the cluster's data points. To ensure numerical stability with higher degrees, the horizontal (time) axis is normalized before performing matrix operations.
🔶 SETTINGS
🔹 K-Means
Number of Clusters (K): Defines how many price levels the indicator should look for. Higher values create more granular levels. Lookback Period: The number of recent bars used to perform the clustering and regression calculation. Max Iterations: The maximum number of refinement steps for the K-Means algorithm.
🔹 Regression
Polynomial Degree: Controls the "bend" of the regression lines. Higher degrees allow for more complex curves. Extend All Fits to Current Bar: When enabled, the regression lines for all historical clusters are extended to the rightmost edge of the chart. Project Current Cluster into Future: Extends the current regime's regression line into the future (empty space) using a dashed line.
🔹 Visual Style
Show Regression Lines: Toggles the visibility of the polynomial curves. Show Cluster Dots: Toggles the visibility of the colored dots on each price bar. Dot Size: Adjusts the size of the cluster dots. Cluster Colors: Customizable colors for each of the identified clusters.
Pine Script® Indikator
stelaraX - DPOstelaraX – DPO
stelaraX – Detrended Price Oscillator (DPO) is a cycle-based indicator designed to remove long-term trend components from price action. By isolating short- to medium-term price cycles, it helps traders focus on market rhythm and cyclical turning points rather than overall trend direction.
This indicator is part of the stelaraX ecosystem, focused on clean technical analysis and AI-supported chart evaluation
stelarax.com
Core logic
The Detrended Price Oscillator subtracts a displaced simple moving average from the current price. This displacement shifts the moving average back in time, effectively removing the dominant trend component.
Key principles:
* the lookback period defines the dominant cycle length
* the moving average is shifted backward by half the period plus one
* values above zero indicate price above the detrended mean
* values below zero indicate price below the detrended mean
* oscillations highlight cyclical highs and lows
The DPO is not designed to follow trends but to analyze price cycles and mean reversion behavior.
Visualization
The script plots:
* the DPO line in a separate indicator pane
* green coloring when values are above zero
* red coloring when values are below zero
* a zero reference line for cycle symmetry
This presentation makes cyclical expansions and contractions clearly visible.
Use case
This indicator is intended for:
* identifying cyclical market highs and lows
* timing entries and exits in ranging markets
* analyzing mean reversion behavior
* confirming cycle-based divergences
* supporting non-trend-following and oscillation strategies
It works best when used independently from trend indicators or alongside regime filters.
Disclaimer
This indicator is provided for educational and technical analysis purposes only and does not constitute financial advice or trading recommendations. All trading decisions and risk management remain the responsibility of the user.
Pine Script® Indikator
Pine Script® Strategie
Clusters Volume Profile [LuxAlgo]The Clusters Volume Profile indicator utilizes K-Means clustering to categorize historical price action into distinct groups and generates individual volume profiles for each detected cluster. This tool provides a unique perspective on volume distribution by isolating price behaviors based on proximity rather than strictly chronological order.
🔶 USAGE
The indicator identifies "clusters" of price activity within a user-defined lookback period. Each cluster is assigned a unique color and its own horizontal volume profile, allowing traders to see where liquidity is most concentrated within specific price regimes.
🔹 Identifying Institutional Zones
Traders can use the Point of Control (POC) of high-volume clusters to identify significant institutional interest. Because the K-Means algorithm groups price action by density rather than time, a cluster's POC often represents a "fair value" level where significant exchange occurred. These dashed POC lines frequently act as robust support or resistance levels when price returns to them in the future.
🔹 Market Regime Detection
By observing the vertical distribution and overlap of clusters, traders can identify market phases. Overlapping clusters with high volume often indicate accumulation or distribution phases (sideways markets), whereas distinct, vertically separated clusters with lower volume gaps between them suggest a trending environment. A shift from multiple overlapping clusters to a new, isolated cluster can signal a breakout or the start of a new trend.
🔹 Precision Entry & Exits
Cluster boundaries and POC lines provide concrete levels for trade management. An entry can be sought when price retests a high-volume cluster POC, while stops can be placed outside the total price range of that specific cluster (the area covered by its volume profile). Conversely, targets can be set at the POC of the next major cluster above or below current price action.
🔹 Volume Conviction
The tool provides specific volume metrics that allow traders to gauge conviction. By comparing the "Total" volume label of one cluster against another, a trader can determine which price regime had more participation. A breakout into a price zone with a high-volume cluster suggests stronger conviction and a higher probability of the level holding compared to a zone with low total volume.
🔶 DETAILS
The script employs a K-Means clustering algorithm. This process involves:
Initializing "centroids" across the price range of the lookback period.
Iteratively assigning each price bar to the nearest centroid based on the HLC2 (median) price.
Recalculating centroids based on the volume-weighted average price of the assigned bars.
Finalizing assignments after the specified number of iterations to ensure stable clusters.
By separating price action into these clusters, the tool helps identify high-interest zones that might be obscured by a single, traditional Volume Profile.
🔶 SETTINGS
🔹 Clustering Settings
Lookback Period: Determines the number of recent bars used for the clustering analysis.
Number of Clusters: Sets how many distinct price groups the algorithm should attempt to find (2 to 10).
K-Means Iterations: Controls the number of times the algorithm refines the cluster centers. Higher values can lead to more stable results.
🔹 Volume Profile Settings
Rows per Cluster VP: Defines the vertical resolution (number of bins) for each individual cluster's profile.
Max VP Width (Bars): Sets the maximum horizontal length of the volume profile histograms.
VP Offset: Adjusts the horizontal spacing between the current bar and the start of the volume profiles.
Highlight Price Dots: Toggles the visibility of the colored dots on the price action to identify cluster assignments.
Dot Size: Adjusts the size of the cluster assignment dots on the chart, ranging from tiny to huge.
Pine Script® Indikator
Deep AILibrary "Deeptest"
Comprehensive quantitative backtesting library with 112+ metrics: Sharpe/Sortino ratios, drawdown analysis, Monte Carlo simulation, Walk-Forward Analysis, VaR/CVaR, benchmark comparison, and interactive table rendering for TradingView strategies
@version 1.0.1 (01.01.2026)
============================================================================
CHANGELOG
============================================================================
v1.0.1 (01.01.2026)
- Added textSize parameter to runDeeptest() for controlling table text size
- New values: size.auto, size.small, size.tiny, size.normal, size.large
- Applies to all tables: main, stress test, drawdowns, recoveries, trades
v1.0.0 (31.12.2025)
- Initial release
- 112+ backtesting metrics
- Monte Carlo simulation and Walk-Forward Analysis
- Interactive table rendering with tooltips
============================================================================
TABLE OF CONTENTS
============================================================================
SECTION 1: File Header & Metadata
SECTION 2: Constants & Configuration
SECTION 3: Type Definitions
SECTION 4: Core Calculation Functions - Array Utilities
SECTION 5: Core Calculation Functions - Return Extraction
SECTION 6: Core Calculation Functions - Sharpe & Sortino
SECTION 7: Core Calculation Functions - Performance Metrics
SECTION 8: Core Calculation Functions - Drawdown Analysis
SECTION 9: Core Calculation Functions - Recovery Analysis
SECTION 10: Core Calculation Functions - Trade Analysis
SECTION 11: Core Calculation Functions - Statistical Distribution
SECTION 12: Core Calculation Functions - Risk Metrics
SECTION 13: Core Calculation Functions - Benchmark Comparison
SECTION 14: Core Calculation Functions - Time-Based Metrics
SECTION 15: Core Calculation Functions - Rolling Statistics
SECTION 16: Core Calculation Functions - Strategy Integration
SECTION 17: Core Calculation Functions - Walk Forward Analysis
SECTION 18: Core Calculation Functions - Monte Carlo Simulation
SECTION 19: Core Calculation Functions - Out-of-Sample Analysis
SECTION 20: Formatting Utilities - Value Formatting
SECTION 21: Formatting Utilities - Duration Formatting
SECTION 22: Formatting Utilities - Frequency Formatting
SECTION 23: Formatting Utilities - Date Formatting
SECTION 24: Tooltip Builders - Main Table Metrics
SECTION 25: Tooltip Builders - Complementary Metrics
SECTION 26: Tooltip Builders - Stress Test Metrics
SECTION 27: Tooltip Builders - Period Analysis Cards
SECTION 28: Table Rendering - Structure Helpers
SECTION 29: Table Rendering - Main Deeptest Table
SECTION 30: Table Rendering - Cell Renderers - Complementary Row
SECTION 31: Table Rendering - Stress Test Table
SECTION 32: Table Rendering - Period Analysis Cards
SECTION 33: Main Entry Point
============================================================================
API REFERENCE
============================================================================
Main Export:
------------
runDeeptest() - Complete backtest analysis orchestrator
============================================================================
KEY FEATURES
============================================================================
- Comprehensive backtesting metrics (112+ functions)
- Rolling window analysis with statistical distributions
- Advanced risk metrics (Sharpe, Sortino, Calmar, Martin, VaR, CVaR)
- Drawdown and recovery analysis
- Monte Carlo simulation and Walk-Forward Analysis
- Trade analysis (top/worst trades, consecutive streaks)
- Benchmark comparison (Alpha, Beta, R², Buy & Hold)
- Interactive table rendering with tooltips
============================================================================
USAGE EXAMPLE
============================================================================
╔══════════════════════════════════════════════════════════════════════════════╗
║ PROGRESSIVE USAGE EXAMPLES ║
╠══════════════════════════════════════════════════════════════════════════════╣
║ Three examples demonstrating increasing complexity: ║
║ 1. MINIMAL - "Hello World" with basic MA crossover ║
║ 2. BALANCED - Production ready with risk management & filters ║
║ 3. PROFESSIONAL - Full-featured with trailing stops & session filters ║
╚══════════════════════════════════════════════════════════════════════════════╝
╔══════════════════════════════════════════════════════════════════════════════╗
║ EXAMPLE 1: MINIMAL (The "Hello World") ║
╠══════════════════════════════════════════════════════════════════════════════╣
║ The simplest possible integration - just 3 lines to get started: ║
║ 1. Import the library ║
║ 2. Write your strategy logic ║
║ 3. Call runDeeptest() ║
╚══════════════════════════════════════════════════════════════════════════════╝
//@version=6
strategy("MA Crossover ", overlay=true)
// ═══════════════════════════════════════════════════════════════════════════
// ⮟ Import Deeptest (Direct import - no namespace prefix needed)
// ═══════════════════════════════════════════════════════════════════════════
import Fractalyst/Deeptest/1 as *
// ────────────────────────────────────────────────────────────────────────────
// Strategy Logic: Simple Moving Average Crossover
// ────────────────────────────────────────────────────────────────────────────
fastMA = ta.sma(close, 10) // Fast MA: 10 periods
slowMA = ta.sma(close, 30) // Slow MA: 30 periods
// Plot MAs for visualization
plot(fastMA, "Fast MA", color=color.blue)
plot(slowMA, "Slow MA", color=color.orange)
// Entry: Long when fast MA crosses above slow MA
if ta.crossover(fastMA, slowMA)
strategy.entry("Long", strategy.long)
// Exit: Close when fast MA crosses below slow MA
if ta.crossunder(fastMA, slowMA)
strategy.close("Long")
// ═══════════════════════════════════════════════════════════════════════════
// ⮟ Run backtest analysis (all parameters use smart defaults)
// ═══════════════════════════════════════════════════════════════════════════
DT.runDeeptest()
╔══════════════════════════════════════════════════════════════════════════════╗
║ EXAMPLE 2: BALANCED (Production Ready) ║
╠══════════════════════════════════════════════════════════════════════════════╣
║ Adds essential production features: ║
║ • User-configurable inputs ║
║ • ADX trend filter to avoid choppy markets ║
║ • Stop loss / Take profit for risk management ║
║ • Custom backtest parameters ║
╚══════════════════════════════════════════════════════════════════════════════╝
//@version=6
strategy("MA Crossover ", overlay=true)
import Fractalyst/Deeptest/1 as *
// ────────────────────────────────────────────────────────────────────────────
// INPUT PARAMETERS
// ────────────────────────────────────────────────────────────────────────────
fastLen = input.int(10, "Fast MA Period", minval=1)
slowLen = input.int(30, "Slow MA Period", minval=1)
riskPct = input.float(2.0, "Risk %", minval=0.1) / 100
slPct = input.float(5.0, "Stop Loss %", minval=0.1) / 100
tpPct = input.float(10.0, "Take Profit %", minval=0.1) / 100
adxThresh = input.int(20, "ADX Trend Threshold")
// ────────────────────────────────────────────────────────────────────────────
// INDICATORS
// ────────────────────────────────────────────────────────────────────────────
fastMA = ta.sma(close, fastLen)
slowMA = ta.sma(close, slowLen)
adx = ta.adx(14)
= ta.dmi(14, 14)
// ────────────────────────────────────────────────────────────────────────────
// FILTERS
// ────────────────────────────────────────────────────────────────────────────
trendConfirmed = adx > adxThresh and diPlus > diMinus
// ────────────────────────────────────────────────────────────────────────────
// STRATEGY LOGIC
// ────────────────────────────────────────────────────────────────────────────
// Entry: MA crossover + trend confirmation
if ta.crossover(fastMA, slowMA) and trendConfirmed
strategy.entry("Long", strategy.long)
// Exit: MA crossunder
if ta.crossunder(fastMA, slowMA)
strategy.close("Long")
// Risk management: Stop loss and take profit
if strategy.position_size > 0
strategy.exit("RM", "Long",
stop=strategy.position_avg_price * (1 - slPct),
limit=strategy.position_avg_price * (1 + tpPct))
// ═══════════════════════════════════════════════════════════════════════════
// ⮟ Run backtest with custom parameters
// ═══════════════════════════════════════════════════════════════════════════
DT.runDeeptest(
riskPerTrade = 1.0, // ← 1% risk per trade
targetMaxDDPct = 15.0, // ← 15% max drawdown target
showStressTest = true, // ← Enable stress test table
showPeriodCards = true, // ← Enable period cards
wfaWindows = 12, // ← Walk-forward windows
mcSimulations = 1000, // ← Monte Carlo runs
bullColor = color.new(#00b9ff, 0),
bearColor = color.new(#ff0051, 0),
benchmarkSymbol = "SPX", // ← Compare to S&P; 500
periodCardMode = "drawdowns", // ← Show drawdown periods
tradeSortBy = "return" // ← Sort by return %
)
╔══════════════════════════════════════════════════════════════════════════════╗
║ EXAMPLE 3: PROFESSIONAL (Full-Featured) ║
╠══════════════════════════════════════════════════════════════════════════════╣
║ Complete professional implementation: ║
║ • Organized input groups for better UX ║
║ • Multiple filters: ADX trend, ATR volatility, Session timing ║
║ • Trailing stop to lock in profits ║
║ • Position highlighting for visual feedback ║
║ • Full parameter customization with inline documentation ║
╚══════════════════════════════════════════════════════════════════════════════╝
//@version=6
runDeeptest(targetMaxDDPct, bullColor, bearColor, tableBg, headerBg, borderColor, textPrimary, textMuted, textSize, showComplementaryRow, showStressTestTable, showDrawdownRecoveryCards, showTradeCards)
Parameters:
targetMaxDDPct (float)
bullColor (color)
bearColor (color)
tableBg (color)
headerBg (color)
borderColor (color)
textPrimary (color)
textMuted (color)
textSize (string)
showComplementaryRow (bool)
showStressTestTable (bool)
showDrawdownRecoveryCards (bool)
showTradeCards (bool)
ThresholdConfig
ThresholdConfig - Configuration for metric thresholds and corresponding colors
Fields:
sharpeExc (series float)
sharpeGood (series float)
sharpeOk (series float)
sharpeBear (series color)
sharpeNeutral (series color)
sharpeOrange (series color)
sharpeBull (series color)
ddSevere (series float)
ddMod (series float)
ddMild (series float)
ddSevereColor (series color)
ddModColor (series color)
ddOrange (series color)
ddGoodColor (series color)
rorHigh (series float)
rorMod (series float)
rorLow (series float)
rorHighColor (series color)
rorModColor (series color)
rorOrange (series color)
rorLowColor (series color)
r2Poor (series float)
r2Mod (series float)
r2Good (series float)
r2PoorColor (series color)
r2ModColor (series color)
r2Orange (series color)
r2GoodColor (series color)
kurtHigh (series float)
kurtMod (series float)
kurtOk (series float)
kurtHighColor (series color)
kurtModColor (series color)
kurtOrange (series color)
kurtGoodColor (series color)
skewVNeg (series float)
skewModNeg (series float)
skewPos (series float)
skewVPos (series float)
skewVNegColor (series color)
skewModNegColor (series color)
skewNeutral (series color)
skewPosColor (series color)
payoffPoor (series float)
payoffBE (series float)
payoffGood (series float)
payoffPoorColor (series color)
payoffBEColor (series color)
payoffOrange (series color)
payoffGoodColor (series color)
pfPoor (series float)
pfBE (series float)
pfGood (series float)
pfPoorColor (series color)
pfBEColor (series color)
pfOrange (series color)
pfGoodColor (series color)
ulcerHigh (series float)
ulcerLow (series float)
ulcerHighColor (series color)
ulcerModColor (series color)
ulcerOrange (series color)
ulcerLowColor (series color)
wrLow (series float)
wrOk (series float)
wrHigh (series float)
wrLowColor (series color)
wrOkColor (series color)
wrOrange (series color)
wrHighColor (series color)
cagrPoor (series float)
cagrOk (series float)
cagrGood (series float)
cagrPoorColor (series color)
cagrOkColor (series color)
cagrOrange (series color)
cagrGoodColor (series color)
pInsig (series float)
pMod (series float)
pSig (series float)
pInsigColor (series color)
pModColor (series color)
pOrange (series color)
pSigColor (series color)
calmarPoor (series float)
calmarBE (series float)
calmarGood (series float)
calmarPoorColor (series color)
calmarBEColor (series color)
calmarOrange (series color)
calmarGoodColor (series color)
betaHigh (series float)
betaLow (series float)
betaHighColor (series color)
betaLowColor (series color)
betaGoodColor (series color)
Stats
Stats - Comprehensive backtest statistics container
Fields:
totalTrades (series int)
winTrades (series int)
lossTrades (series int)
evenTrades (series int)
winRate (series float)
lossRate (series float)
avgWinPct (series float)
avgLossPct (series float)
avgTradePct (series float)
profitFactor (series float)
payoffRatio (series float)
expectancy (series float)
grossProfit (series float)
grossLoss (series float)
netProfit (series float)
netProfitPct (series float)
compEffect (series float)
sharpe (series float)
sortino (series float)
calmar (series float)
martin (series float)
maxDrawdown (series float)
maxDrawdownPct (series float)
currentDrawdown (series float)
currentDrawdownPct (series float)
avgDrawdownPct (series float)
maxEquity (series float)
minEquity (series float)
cagr (series float)
monthlyReturn (series float)
maxConsecWins (series int)
maxConsecLosses (series int)
avgTradeDuration (series float)
avgWinDuration (series float)
avgLossDuration (series float)
timeInMarketPct (series float)
tradesPerMonth (series float)
tradesPerYear (series float)
skewness (series float)
kurtosis (series float)
var95 (series float)
cvar95 (series float)
ulcerIndex (series float)
riskOfRuin (series float)
pValue (series float)
zScore (series float)
alpha (series float)
beta (series float)
buyHoldReturn (series float)
equityRSquared (series float)
firstTradeTime (series int)
lastTradeTime (series int)
tradingPeriodDays (series float)
RollingWindowSummary
RollingWindowSummary - Summary of metrics for a single rolling analysis window
Fields:
windowIndex (series int)
startTrade (series int)
endTrade (series int)
effectiveCount (series int)
minValue (series float)
maxValue (series float)
metricValue (series float)
RollingStats
RollingStats - Statistical distribution of rolling window metrics
Fields:
windowSize (series int) : Number of trades in rolling window
expectancyMin (series float) : Minimum rolling expectancy
expectancyMax (series float) : Maximum rolling expectancy
sharpeMin (series float) : Minimum rolling Sharpe
sharpeMax (series float) : Maximum rolling Sharpe
sortinoMin (series float) : Minimum rolling Sortino
sortinoMax (series float) : Maximum rolling Sortino
expectancyWindows (array) : Per-window summaries for expectancy
sharpeWindows (array) : Per-window summaries for Sharpe
sortinoWindows (array) : Per-window summaries for Sortino
expectancyMean (series float) : Mean expectancy across rolling windows
expectancyStdDev (series float) : Standard deviation of expectancy
expectancyPct90 (series float) : 90th percentile expectancy
expectancyPct50 (series float) : 50th percentile expectancy (median)
expectancyPct10 (series float) : 10th percentile expectancy
sharpeMean (series float) : Mean Sharpe across rolling windows
sharpeStdDev (series float) : Standard deviation of Sharpe
sharpePct90 (series float) : 90th percentile Sharpe
sharpePct50 (series float) : 50th percentile Sharpe
sharpePct10 (series float) : 10th percentile Sharpe
sortinoMean (series float) : Mean Sortino across rolling windows
sortinoStdDev (series float) : Standard deviation of Sortino
sortinoPct90 (series float) : 90th percentile Sortino
sortinoPct50 (series float) : 50th percentile Sortino
sortinoPct10 (series float) : 10th percentile Sortino
Pine Script® Bibliothek
Liquidity Grab ScannerMarks last week and last 3 days highs and lows.
Can be used for liquidity grabs above or below those levels, I use for it.
Claude AI coded it.
Pine Script® Indikator
Custom MACD Strategy with Trailing Stop on 12SMAtest1:Strategy This is a special, somewhat unexpected indicator. AI optimization was applied after the strategy was developed, giving it a certain win rate and practical reference value.
Pine Script® Strategie
Adaptive Elliott Wave: Forecast + Dashboard (V.2)Title: Adaptive Elliott Wave: Forecast + Dashboard
Description:
Overview
The Adaptive Elliott Wave: Forecast + Dashboard is a technical analysis tool designed to visualize potential Elliott Wave structures using a dynamic, multi-factor approach. Unlike static wave scripts, this indicator adapts its projections based on real-time trend context (Weighted Moving Averages) and momentum shifts (RSI). It is built to help traders identify the most likely path—Impulse or Correction—based on current market conditions.
How It Works
The script uses a combination of pivot-point detection and trend filtering to project future wave paths.
Pivot Logic: The indicator identifies significant Highs and Lows using a sensitivity setting. These pivots form the "anchors" for the Elliott Wave count.
Adaptive Engine: The "Auto-Detect" mode analyzes the relationship between the 50/200 WMA (Trend) and RSI (Momentum).
In a Bull Trend: If RSI is oversold, the script anticipates a bullish "Impulse" wave. If RSI is overbought, it prepares for a "Correction."
In a Bear Trend: The logic reverses to project rallies or downward impulses.
Projections: It calculates Fibonacci-based targets for waves 1-5 (Impulse) or A-B-C/W-X-Y (Correction) and renders them as "ghost lines" that move with the price.
Macro Outlook: For long-term context, the script includes a Macro Projection feature that uses higher-period pivots to show the possible 1-year direction.
Key Features
Target Table: A real-time dashboard showing exact Fibonacci target prices and the percentage distance from the current price.
Corrective Channels: Automatically draws channels for wave corrections to help identify potential breakout or breakdown zones.
Bullish/Bearish Extensions: Shows immediate volatility-based extensions beyond the last confirmed pivot.
RSI Signals: Visual markers on the chart indicate overbought/oversold conditions that feed into the adaptive logic.
How to Use
Identify the Phase: Use the "AI STATUS" in the dashboard to see if the script is currently projecting an Impulse (Trend move) or a Correction (Counter-trend).
Confirm with WMA: Use the 50 (Blue) and 200 (Orange) WMAs to confirm the macro trend before following a projection.
Monitor Fib Targets: Watch for price reactions at the projected labels. If price breaks a target significantly, the wave count may need to be re-evaluated (re-pivot).
Customize Sensitivity: For scalping, lower the "Short-Term Sensitivity." For swing trading, increase it.
Disclaimer
This script is for educational purposes only. Elliott Wave Theory is subjective, and projections are mathematical estimates based on historical volatility. Past performance does not guarantee future results. Always use proper risk management.
Settings Guide
Forecast Mode: Choose between "Auto-Detect" (Dynamic) or manually force an Impulse/Correction count.
Macro Sensitivity: Controls how far back the script looks to generate the purple 1-year projection.
Link Correction to Extension: A unique feature that starts the forecast from a potential extension target rather than the current live price.
Pine Script® Indikator
Pine Script® Indikator
Market ContextMarket Context is a context-based trading indicator designed to evaluate entry conditions , not to blindly follow signals.
The indicator combines:
trend
momentum
strength of movement
volatility
volume
multi-timeframe context
and presents them in a clear and structured decision-making table.
What the indicator does
analyzes the market across multiple dimensions
separates valid trading conditions from noise and chop
shows when an entry is justified and when it is better to stay out
does not repaint
suitable for manual trading and as a foundation for algorithmic logic
Core idea
Context first — entry second.
The indicator does not say “buy” or “sell” without conditions.
It shows how prepared the market is for continuation.
Table modes
Data Mode shows the current market state:
active signal (Strong / Early / Neutral)
ADX and its dynamics
momentum (Oscillator)
DI dominance
AI Bias (aggregated assessment)
volume and volatility
HTF context
multi-timeframe Supertrend grid
Help Mode displays a checklist of entry conditions:
separate rules for LONG and SHORT
what allows an entry
what blocks an entry
visual representation without formulas or overload
This mode is designed primarily for learning and beginners.
Multi-timeframe context
The indicator takes into account:
the local timeframe
higher timeframe (HTF)
direction and alignment between timeframes
This helps avoid entries:
against the higher-timeframe trend
during low-liquidity / night chop
in weakening momentum
Important
This indicator is not a trading recommendation.
It is not intended for one-click automated trading.
Best results are achieved when combined with:
market structure
key levels
understanding of time-of-day and liquidity conditions
Who this indicator is for
traders tired of noisy signal-based indicators
those who trade context rather than individual signals
beginners who need a clear checklist
experienced traders — as a filter and confirmation tool
Settings
All key parameters (thresholds, weights, HTF settings) are configurable and can be adapted to the instrument and trading style.
Pine Script® Indikator
Adaptive Volatility Trend Filter AI PANDAHENTesting scripts by using ma ema volume and will give green and red indicator where is suggestion to buy or sell
Pine Script® Indikator
Leader Stock ScannerLeader Stock Scanner, Testing using AI
✅ How it works:
Relative Strength (RS) vs SPY – RS above 80 marks strong leaders.
Trend Alignment – 50 EMA > 150 EMA > 200 EMA and price above all EMAs.
Liquidity Filter – 20-day average volume > 500k.
Price Filter – avoids low-priced microcap traps (< $10).
Output – signals a “triangle up” on chart and can trigger alerts.
Pine Script® Indikator
NodialTreesLows2: ML Random Forest / Pivot Lows (Part 2 of 2)Title: `Library: ML Random Forest / Pivot Lows (Part 2 of 2)`
Description:
This library contains the second half (Trees 6-11) of the Random Forest Classifier designed to validate Pivot Lows (Long setups).
It is a direct extension of NodialTreesL1 and cannot be used alone. Due to Pine Script's compilation limits on complexity and file size, the 12-tree ensemble model has been split into two separate libraries.
### 🧩 Library Contents
This module exports the following methods representing the specific decision paths of the trained AI model:
- `tree_6(array f)`
- `tree_7(array f)`
- `tree_8(array f)`
- `tree_9(array f)`
- `tree_10(array f)`
- `tree_11(array f)`
### ⚠️ Implementation Guide
To use this library, you must combine it with Part 1.
Please refer to the NodialTreesLows1 library description for:
1. The full Integration Code Example (how to average the votes).
2. The exact Input Feature List (the 27 required metrics).
3. Detailed explanation of the Machine Learning logic.
How to finish the integration:
Import this library alongside Part 1 and add the results of `tree_6` through `tree_11` to your voting sum, as shown in the Part 1 documentation.
Pine Script® Bibliothek
NodialTreesHighs2: ML Random Forest / Pivot Highs (Part 2 of 2)Title: `Library: ML Random Forest / Pivot Highs (Part 2 of 2)`
Description:
This library contains the second half (Trees 6-11) of the Random Forest Classifier designed to validate Pivot Highs (Short setups).
It is a direct extension of NodialTreesH1 and cannot be used alone. Due to Pine Script's compilation limits on complexity and file size, the 12-tree ensemble model has been split into two separate libraries.
### 🧩 Library Contents
This module exports the following methods representing the specific decision paths of the trained AI model:
- `tree_6(array f)`
- `tree_7(array f)`
- `tree_8(array f)`
- `tree_9(array f)`
- `tree_10(array f)`
- `tree_11(array f)`
### ⚠️ Implementation Guide
To use this library, you must combine it with Part 1.
Please refer to the NodialTreesH1 library description for:
1. The full Integration Code Example (how to average the votes).
2. The exact Input Feature List (the 27 required metrics).
3. Detailed explanation of the Machine Learning logic.
How to finish the integration:
Import this library alongside Part 1 and add the results of `tree_6` through `tree_11` to your voting sum, as shown in the Part 1 documentation.
Pine Script® Bibliothek
Ultimate Elite Pro Overview
The Ultimate Elite + Scalp Mode is a premium, all-in-one trading indicator designed for TradingView. It integrates advanced technical tools, confluence-based signals, volume analysis, trend detection, and a customizable dashboard to help traders spot high-probability long (buy) and short (sell) entry points. Emphasizing signal confluence for reliability, it includes "AI" enhanced signals with stricter criteria for superior win rates.
This indicator overlays directly on your chart, featuring labels, arrows, lines, bar colors, and an interactive dashboard. It leverages oscillators (RSI, Stochastic RSI, MACD), EMAs, volume metrics (spikes, CVD), volatility (Bollinger Bands), trend strength (ADX), DXY correlation (for gold), MTF confirmation, BOS logic, candlestick patterns, and divergences.
Pine Script® Indikator
Neely EW Pro V9This code was AI generated by intensive Research and document upload i share it for improvement as it do not display multiple waves on multilevel degree.
Pine Script® Indikator
AlphaGen v2.5.3 (Elite Divergence + Cal)Yo what up; I built this indicator with our AI overlords. Hopefully it works for you; if it's shit let me know and I'll try to make it better. I'll include the description below.
Get that schmoney
G
Here's the description:
AlphaGen v2.5.3 — Adaptive Dual-Engine System
Two brains, one indicator. Automatically switches between trend-following and mean-reversion based on market conditions.
What's different:
Tracks its own win rate — shuts off when it's not working
Every signal has a confidence score — filter out the weak ones
Calculates position size, stops, and targets for you
Color-coded risk ribbon shows your targets and stop zones
Enter your account size and risk %. It does the rest.
Pine Script® Indikator
Mean Reversion [SIMI]This mean reversion indicator identifies extreme price deviations from the mean, providing high-probability reversal signals. Designed for confluence-based trading, it works best when combined with complementary indicators such as VWAP, price action, and volume analysis.
📊 Core Features
Signal Types
Prime Signals (Bright Green/Red Dots): Extreme reversions usually beyond ±1.5 SD - highest probability setups (you can customise this zone!)
Regular Signals (Dark Green/Red Dots): Standard reversions - moderate probability
Leader Line (Pink Dotted): Early warning indicator for potential reversals
Histogram Weakness: Momentum divergence signals
Normalisation Methods:
Institutional Hybrid (Z-ATR) (Recommended): Volatility-adjusted Z-score - adapts to changing market conditions
Percentile Ranking: Statistical ranking - excellent for ranging markets
PPO + ATR Hybrid: Percentage-based with volatility adjustment
Efficiency Ratio: Trend-strength weighted
ATR: Pure volatility-based
None: Raw Z-score
⚙️ Quick Setup Guide
1. Institutional Presets
Pre-configured parameter sets optimised for different timeframes:
5M Day Trading (5/21/5): Intraday scalping
1H Options Trading (6/24/5): Options-focused setups
1D Monthly Cycle (5/20/5): Swing trading
2. Signal Filtering
Prime Thresholds: Adjust ±1.5 SD to control signal quality (tighter = fewer, higher quality, adjust this zone per asset traded)
Dot Filters: Fine-tune entry zones (-0.03/+0.03 default - this ignores noisy signals near Zero line)
Volume Filter: Enable to require volume confirmation (1.4x average recommended, but fine tune yourself)
3. Advanced Filters
Dynamic SD Thresholds: Auto-adjusts for volatility regimes (tighter in low vol, wider in high vol)
Time of Day Filter: Avoids first 30 minutes, last 15 minutes, and lunch hour (11:30-13:00 EST)
💡 Trading Strategy Recommendations
Optimal Usage
This indicator is not intended as a standalone system. Use it for confluence alongside:
VWAP (institutional positioning)
Price action (support/resistance)
Options flow (institutional direction)
Volume analysis (conviction confirmation)
Signal Interpretation
Prime Signals: Wait for these for highest-probability entries - mean reversion may take hours to days
Manual Entries: Don't wait for dots - trade the ±2 SD zones directly using your own confirmation
Options Strategy: Prime sell signals at +2 SD make excellent short call setups; prime buy signals at -2 SD for long calls
Timeframe Guidance
Lower Timeframes (1M-5M): Higher noise - require additional confluence
Higher Timeframes (1H-1D): More reliable signals - suitable for options and swing trades
Best Results: Multi-timeframe analysis (check 1H and 4H alignment on 5M entries)
🔔 Alert System
Master Alert
Enable customisable alerts via the Master Alert System:
Toggle individual signal types (Prime Buy/Sell, SD Crosses, Leader, Histogram)
Receives bespoke messages with ticker, timeframe, and price
One alert condition handles all selected signals
Individual Alerts
Separate alert conditions available for Prime and Regular signals if preferred.
📈 Backtesting Notes
Important: Backtest results are date-sensitive and should not be the primary focus. Instead:
Dial in settings visually on your chosen asset
Aim for signals near actual tops and bottoms
Test different normalisation methods for your specific instrument
Optimise for signal quality, not backtest ROI
Asset Testing: Primarily developed using SPY, QQQ, and IWM as main assets to trade. Other instruments may require parameter adjustment - mess around!
Backtest Engine
Entry/Exit modes (All Signals, Prime Only, Early Signals)
Position sizing (percentage-based)
Slippage and fill method (candle close recommended)
Date range selection
⚠️ Best Practices
Always use confluence - never trade on MR signals alone
Start with Institutional Hybrid normalisation - most adaptive to market conditions
Focus on Prime signals for quality over quantity
Test on your specific asset - optimal settings vary by instrument
Longer timeframes = higher reliability - 1H+ for best results
Enable Time Filter on intraday charts to avoid volatile periods
Use Dynamic SD in highly volatile markets (earnings, FOMC, etc.)
🛠️ Troubleshooting
Too many signals: Increase Prime Thresholds or enable Volume Filter
Too few signals: Decrease Prime Thresholds or reduce Dot Filters
False signals: Enable Time of Day Filter and Dynamic SD
Signals don't align with tops/bottoms: Try different normalisation method
📝 Feedback & Development
Bug Reports: Please report any issues via TradingView comments or direct message.
Strategy Sharing: I'd love to hear how you're using this indicator and what strategies you've developed.
Open Source: Feel free to fork and modify this indicator. If you create an improved version, please share it with the community!
🙏 Acknowledgements
Developed through AI-assisted collaboration.
Special thanks to Lazy Bear for his open source MACD histogram (volume based).
Open source forever - use freely, modify, and share.
Happy Trading!
Remember: Past performance does not guarantee future results. Always manage risk appropriately.
Pandas rock \m/
Pine Script® Indikator
NASDAQ NY Session Break FVG Strategy⚡ NASDAQ NY Session Break FVG Strategy — Trade Like Institutions During Peak Volatility
Stop chasing random breakouts. This strategy automatically detects New York session breaks combined with Fair Value Gap (FVG) confirmation — the exact setup institutional traders use to enter high-probability NASDAQ scalps during peak volume. Built for 1-minute scalpers trading NAS100, this combines ICT Smart Money Concepts with automated risk management for precise entries during the most volatile trading hour.
NOW AVAILABLE IN TWO VERSIONS: Choose between conservative single-entry precision or aggressive multi-entry scalping based on your trading style.
💡 How It Works
The strategy waits for the NY opening session (9:30-9:45 EST), monitors for session high/low breaks, then confirms entries using Fair Value Gap detection:
✅ Long Setup:
Price breaks above NY session high
Fair Value Gap forms (bullish gap between candles)
Minimum gap threshold met (0.1% default, adjustable)
→ BUY signal triggers with automatic TP/SL placement
✅ Short Setup:
Price breaks below NY session low
Fair Value Gap forms (bearish gap between candles)
Minimum gap threshold met
→ SELL signal triggers with automatic TP/SL placement
📦 TWO VERSIONS INCLUDED — CHOOSE YOUR TRADING STYLE
VERSION 1: SINGLE-ENTRY PRECISION (Conservative)
✔️ One Trade Per Session — Takes only the FIRST FVG breakout signal per NY session
✔️ Maximum Discipline — Eliminates overtrading, focuses on highest-probability setup
✔️ Lower Risk Exposure — Single position per session caps risk
✔️ Best For: Conservative traders, account preservation, strict daily limits
✔️ Strategy: Wait for session formation → First FVG breakout only → Done for the day
VERSION 2: MULTI-ENTRY SCALPING (Aggressive)
✔️ Unlimited Trades Per Session — Takes EVERY valid FVG breakout during NY session
✔️ Maximum Opportunities — Capitalizes on volatile session with multiple entries
✔️ Scalper-Optimized — Designed for active traders seeking volume
✔️ Best For: Experienced scalpers, high-frequency trading, compounding gains
✔️ Strategy: Session range breaks → Multiple FVG confirmations → Stack positions or pyramid
BOTH VERSIONS USE IDENTICAL ENTRY LOGIC — Only difference is trade frequency control. Switch between versions instantly based on market conditions or your daily plan.
🔥 Why Traders Choose This Strategy
✅ Session-Based Precision — Only trades the NY opening range breakout (9:30-9:45 EST), avoiding choppy mid-day markets
✅ Smart Money Confirmation — Uses FVG gaps (institutional footprints) to filter false breakouts
✅ 6 Risk Management Options — Choose from Fixed %, Trailing Stop, Break-Even, Candle-Based, Pips, or ATR methods
✅ Visual Session Boxes — Automatically plots NY session range with high/low lines
✅ Non-Repainting Logic — All signals lock on candle close, what you see is what you get
✅ Automation-Ready — Pre-built alerts for 3Commas, PineConnector, Tickerly integration
✅ Fully Customizable — Adjust FVG threshold, TP/SL ratios, session times, version selection, and visual elements
⚙️ Key Features
✔️ NY Session Auto-Detection — 9:30-9:45 EST session box with dotted range outline
✔️ Fair Value Gap Scanner — Detects bullish/bearish FVG zones with adjustable minimum gap % (0.1% default)
✔️ Session Break Logic — Only triggers when price breaks session high/low + FVG confirmation
✔️ Trade Frequency Control — Toggle between Single-Entry (conservative) or Multi-Entry (aggressive) modes
✔️ 6 TP/SL Methods:
Fixed Percentage (default: 2% TP, 1% SL)
Trailing Stop Loss (locks in profits as price moves)
Break-Even Stop Loss (moves SL to entry after 50% profit)
Candle-Based Stop Loss (swing high/low protection)
Pips-Based Stop Loss (custom pip offset)
ATR-Based Stop Loss (dynamic volatility adjustment)
✔️ Visual Trade Management — Entry line, TP zones (green fill), SL zones (red fill)
✔️ Risk-Reward Ratio Control — Default 2:1 RR, fully adjustable
✔️ Timezone Flexibility — UTC offset or exchange timezone options
✔️ Color-Coded Zones — FVG boxes in translucent colors, clear BUY/SELL markers
🎯 Perfect For
✅ 1-Minute NASDAQ Scalpers — Trade NAS100 during peak NY volatility
✅ ICT/Smart Money Traders — Use institutional FVG concepts for precision entries
✅ Session Traders — Focus on high-probability opening range breakouts
✅ Conservative Accounts — Version 1 limits exposure with single daily entry
✅ Aggressive Scalpers — Version 2 maximizes opportunities with unlimited entries
✅ Risk-Conscious Traders — Multiple TP/SL options for different risk tolerances
✅ Automation Users — Compatible with 3Commas, PineConnector, Tickerly via alerts
🧩 What Makes This Different
This isn't another basic breakout indicator. It combines three institutional concepts:
1. Session Liquidity Zones — NY session creates predictable high/low ranges where institutions accumulate orders
2. Fair Value Gap Confirmation — Filters breakouts by requiring FVG formation (imbalance zones institutions exploit)
3. Automated Risk Management — 6 different TP/SL methods let you match strategy to your trading style
PLUS: Dual Version System — Conservative traders get disciplined single-entry control. Aggressive scalpers get unlimited opportunity capture. Same proven logic, different execution styles.
No AI hype, no profit promises — just clean Smart Money logic translated into automated Pine Script signals with professional-grade risk management.
🛠️ Compatibility
✅ TradingView (Free & Pro accounts)
✅ Best Markets: NASDAQ (NAS100), US30, SPX500
✅ Optimal Timeframe: 1-minute (scalping)
✅ Works on: 5M, 15M (adjust session settings accordingly)
✅ Alert Integrations: 3Commas, PineConnector, Tickerly, TradingView native alerts
✅ Timezone Support: UTC offset or exchange-based
✅ Version Control: Easy toggle between Single-Entry and Multi-Entry modes
⚠️ Disclaimer
This tool is for educational and research purposes only. Trading involves risk of loss. Always backtest thoroughly and use proper risk management. Past performance does not guarantee future results.
Version 2 (Multi-Entry) can generate significantly more trades per session — ensure you understand position sizing and maximum daily loss limits before use. Start with Version 1 if new to the strategy.
Get instant access to both versions and choose your trading style.
Pine Script® Strategie
ATR Levels - Current Candle Close1 of 3 scripts
I use all 3 together to "tell the story"
specifically designed for NQ to watch 4H timeframe.
code is generated by Claude AI so thats why it is free.
Pine Script® Indikator






















