Dynamic MAs Zscore | Lyro RSThe Dynamic MAs Zscore is an adaptive momentum and valuation oscillator built around advanced moving averages and statistical Z-Score normalization. By combining a wide selection of moving average types with dynamic deviation bands, this indicator delivers clear insights into trend strength , directional bias , and relative valuation — all in a clean, visually intuitive format.
━━━━━━━━━━━━━━━
Key Features
━━━━━━━━━━━━━━━
Dynamic Moving Average Engine
Applies one of 12 selectable moving average types (SMA, EMA, WMA, VWMA, HMA, ALMA, TEMA, etc.) to the chosen source. This allows fine-tuning between responsiveness and smoothness depending on market conditions.
Z-Score Normalization
Transforms the selected moving average into a standardized Z-Score:
(MA − mean) / standard deviation
This normalization makes momentum strength comparable across assets and timeframes.
Adaptive Deviation Bands
Upper and lower bands are derived from the rolling standard deviation of the Z-Score:
Custom band length
Independent positive and negative multipliers
These bands dynamically expand and contract with volatility.
Dual Signal Modes
Trend Mode – Focuses on directional continuation. Color changes and signals occur when Z-Score breaks above or below deviation bands.
Valuation Mode – Highlights relative overvaluation and undervaluation using a gradient color scale and predefined value zones.
Advanced Visual System
Includes bold layered plots, gradient fills, background shading, and candle/bar coloring to clearly reflect current market state.
Custom Color Palettes
Choose from multiple preset themes (Classic, Mystic, Accented, Royal) or define your own bullish and bearish colors.
━━━━━━━━━━━━━━━
How It Works
━━━━━━━━━━━━━━━
MA Calculation – The selected moving average type is applied to the chosen price source.
Z-Score Computation – The MA is normalized over a user-defined lookback period to quantify deviation from its mean.
Band Construction – Standard deviation of the Z-Score is calculated over the band length and scaled by positive/negative multipliers.
Mode-Dependent Logic
Trend Mode – Breaks above the upper band signal bullish momentum; breaks below the lower band signal bearish momentum.
Valuation Mode – A gradient reflects relative valuation from undervalued to overvalued, with background highlights at extreme Z-Score levels.
━━━━━━━━━━━━━━━
Signal Interpretation
━━━━━━━━━━━━━━━
Trend Confirmation
In Trend Mode, sustained moves beyond deviation bands indicate strong directional bias.
Momentum Strength
The distance of the Z-Score from zero reflects the intensity of trend momentum.
Relative Valuation
In Valuation Mode, deep negative Z-Scores suggest undervaluation, while high positive Z-Scores suggest overvaluation.
Visual Clarity
Bar and candle coloring aligned with oscillator state allows for rapid assessment of market conditions.
━━━━━━━━━━━━━━━
Customization
━━━━━━━━━━━━━━━
Adjust MA type and length to balance speed vs. smoothness.
Modify Z-Score length to control sensitivity.
Tune band length and multipliers for volatility adaptation.
Switch between Trend and Valuation modes depending on strategy.
Personalize visuals using preset or custom color palettes.
━━━━━━━━━━━━━━━
Alerts
━━━━━━━━━━━━━━━
Bullish condition when Z-Score > 0
Bearish condition when Z-Score < 0
Overvalued and undervalued valuation alerts
⚠️ Disclaimer
This indicator is intended for technical analysis and educational purposes only. It does not guarantee profitable outcomes and should be used alongside other tools, confirmation methods, and sound risk management. The author is not responsible for any financial decisions made using this indicator.
Statistics
Sideways Zone Breakout 📘 Sideways Zone Breakout – Indicator Description
Sideways Zone Breakout is a visual market-structure indicator designed to identify low-volatility consolidation zones and highlight potential breakout opportunities when price exits these zones.
This indicator focuses on detecting periods where price trades within a tight range, often referred to as sideways or consolidation phases, and visually marks these zones directly on the chart for clarity.
🔍 Core Concept
Markets often spend time moving sideways before making a directional move.
This indicator aims to:
Detect price compression
Visually highlight the sideways zone
Signal when price breaks above or below the zone boundaries
Instead of predicting direction, it simply reacts to range expansion after consolidation.
⚙️ How the Indicator Works
1️⃣ Sideways Zone Detection
The indicator looks back over a user-defined number of candles
It calculates the highest high and lowest low within that window
If the total price range remains within a defined percentage of the current price, the market is considered sideways
This helps filter out trending and highly volatile conditions.
2️⃣ Visual Zone Representation
When a sideways condition is detected:
A clear price zone is drawn between the recent high and low
The zone is displayed using a soft gradient fill for better visibility
Outer borders are added to enhance zone clarity without cluttering the chart
This makes consolidation areas easy to spot at a glance.
3️⃣ Breakout Identification
Once a sideways zone is active:
A bullish breakout is marked when price closes above the upper boundary
A bearish breakout is marked when price closes below the lower boundary
Directional arrows and labels are plotted directly on the chart to indicate these events.
📊 Visual Elements Included
Sideways consolidation zones with gradient fill
Upper and lower zone boundaries
Buy and Sell arrows on breakout
Optional text labels for clear interpretation
All visuals are designed to remain lightweight and readable on any chart theme.
🔧 User Inputs
Sideways Lookback (candles): Controls how many past candles are used to define the range
Max Range % (tightness): Determines how tight the range must be to qualify as sideways
Adjusting these inputs allows users to adapt the indicator to different instruments and timeframes.
📈 Usage Guidelines
Can be applied to any market or timeframe
Works well as a context or confirmation tool
Best used alongside volume, trend, or risk management tools
Signals should be validated with proper trade planning
⚠️ Disclaimer
This indicator is provided as open-source for educational and analytical purposes only.
It does not generate trade recommendations or guarantee outcomes.
Market conditions vary, and users are responsible for their own trading decisions.
USDT Market Cap Change [Alpha Extract]A sophisticated stablecoin market analysis tool that tracks USDT market capitalization changes across daily and 60-day periods with statistical normalization and gradient intensity visualization. Utilizing z-score methodology for overbought/oversold detection and dynamic color gradients reflecting change magnitude, this indicator delivers institutional-grade market liquidity assessment through stablecoin flow analysis. The system's dual-timeframe approach combined with statistical normalization provides comprehensive market sentiment measurement based on capital inflows and outflows from the dominant stablecoin.
🔶 Advanced Market Cap Tracking Framework
Implements daily USDT market capitalization monitoring with dual-period change calculations measuring both 1-day and 60-day net capital flows. The system retrieves real-time CRYPTOCAP:USDT data on daily timeframe resolution, calculating absolute dollar changes to quantify stablecoin supply expansion or contraction as primary market liquidity indicator.
// Core Market Cap Analysis
USDT = request.security("CRYPTOCAP:USDT", "D", close)
USDT_60D_Change = USDT - USDT
USDT_1D_Change = USDT - USDT
🔶 Dynamic Gradient Intensity System
Features sophisticated color gradient engine that intensifies visual representation based on change magnitude relative to recent extremes. The system normalizes current 60-day change against configurable lookback period maximum, applying gradient strength calculation to transition colors from neutral tones through progressively intense blues (negative) or reds (positive) based on flow direction and magnitude.
🔶 Statistical Z-Score Normalization Engine
Implements comprehensive z-score calculation framework that normalizes 60-day market cap changes using rolling mean and standard deviation for objective overbought/oversold determination. The system applies statistical normalization over configurable periods, enabling cross-temporal comparison and threshold-based regime identification independent of absolute market cap levels.
// Z-Score Normalization
Change_Mean = ta.sma(USDT_60D_Change, Normalization_Length)
Change_StdDev = ta.stdev(USDT_60D_Change, Normalization_Length)
Z_Score = Change_StdDev > 0 ? (USDT_60D_Change - Change_Mean) / Change_StdDev : 0.0
🔶 Multi-Tier Threshold Detection System
Provides four-level regime classification including standard overbought (+1.5σ), standard oversold (-1.5σ), extreme overbought (+2.5σ), and extreme oversold (-2.5σ) thresholds with configurable adjustment. The system identifies market liquidity extremes when stablecoin inflows or outflows reach statistically significant levels, indicating potential market turning points or trend exhaustion.
🔶 Dual-Timeframe Flow Visualization
Features layered area plots displaying both 60-day strategic flows and 1-day tactical movements with distinct color coding for instant flow direction assessment. The system overlays short-term daily changes on longer-term 60-day trends, enabling traders to identify divergences between tactical and strategic capital flows into or out of stablecoin reserves.
🔶 Gradient Color Psychology Framework
Implements intuitive color scheme where red gradients indicate capital inflow (bullish for crypto as USDT supply expands for buying) and blue gradients show capital outflow (bearish as USDT is redeemed). The intensity progression from pale to vivid colors communicates flow magnitude, with extreme colors signaling statistically significant liquidity events requiring attention.
🔶 Background Zone Highlighting System
Provides subtle background coloring when z-score breaches overbought or oversold thresholds, creating visual alerts without obscuring primary data. The system applies translucent red backgrounds during overbought conditions and blue during oversold states, enabling instant regime recognition across chart timeframes.
🔶 Configurable Normalization Architecture
Features adjustable gradient lookback and statistical normalization periods enabling optimization across different market cycles and trading timeframes. The system allows traders to calibrate sensitivity by modifying the window used for maximum change detection (gradient) and mean/standard deviation calculation (z-score), adapting to volatile or stable market regimes.
🔶 Market Liquidity Interpretation Framework
Tracks USDT supply changes as proxy for overall cryptocurrency market liquidity conditions, where expanding market cap indicates fresh capital entering crypto markets and contracting cap suggests capital flight. The system provides leading indicator properties as large stablecoin inflows often precede major market rallies while outflows may signal distribution phases.
🔶 Why Choose USDT Market Cap Change ?
This indicator delivers sophisticated stablecoin flow analysis through statistical normalization and gradient visualization of USDT market capitalization changes. Unlike traditional market sentiment indicators that rely on price action alone, this tool measures actual capital flows through the dominant stablecoin, providing objective assessment of market liquidity conditions. The combination of dual-timeframe tracking, z-score normalization for overbought/oversold detection, and intensity-based gradient coloring makes it essential for traders seeking macro-level market assessment and regime change detection across cryptocurrency markets. The indicator excels at identifying liquidity extremes that often precede major market reversals or trend accelerations.
Trinity Real Move Detector DashboardRelease Notes (critical)
1. This code "will" require tweaks for different timeframes to the multiplier, do not assume the data in the table is accurate, cross check it with the Trinity Real Move Detector or another ATR tool, to validate the values in the table and ensure you have set the correct values.
2. I mention this below. But please understand that pine code has a limitation in the number of security calls (40 request.security() calls per script). This code is on the limit of that threshold and I would encourage developers to see if they can find a way around this to improve the script and release further updates.
What do we have...
The Trinity Real Move Detector Dashboard is a powerful TradingView indicator designed to scan multiple assets at once and show when each one has genuine short-term volatility "energy" — the kind that makes directional options trades (especially 0DTE or short-dated) have a high probability of follow-through, and can be used for swing trading as well. It combines a simple ATR-based volatility filter with a SuperTrend-style bias to tell you not only if the market is "awake" but also in which direction the momentum is leaning.
At its core, the indicator calculates the current ATR on your chosen timeframe and compares it to a user-defined percentage of the asset's daily ATR. When the short-term ATR spikes above that threshold, it signals "enough energy" — meaning the underlying is moving with real force rather than choppy noise. The SuperTrend logic then determines bullish or bearish bias, so the status shows "BULLISH ENERGY" (green) or "BEARISH ENERGY" (red) when energy is on, or "WAIT" when it's not. It also counts how many bars the energy has been active and shows the current ATR vs threshold for quick visual confirmation.
The dashboard displays all this in a clean table with columns for Symbol, Multiplier, Current ATR, Threshold, Status, Bars Active, and Bias (UP/DOWN). It's perfect for 3-minute charts but works on any timeframe — just adjust the multiplier based on the hints in the settings.
Editing symbols and multipliers is straightforward and user-friendly. In the indicator settings, you'll see numbered inputs like "1. Symbol - NVDA" and "1. Multiplier". To change an asset, simply type the new ticker in the symbol field (e.g., replace "NVDA" with "TSLA", "AVGO", or "ADAUSD"). You can also adjust the multiplier for each asset individually in the corresponding "Multiplier" field to make it more or less sensitive — lower numbers give more signals, higher numbers give stricter, higher-quality ones. This lets you customize the dashboard to your watchlist without any coding. For example, if you switch to a 4-hour chart or a slower-moving stock like AVGO, you may need to raise the multiplier (e.g., to 0.3–0.4) to avoid false "bullish" signals during minor bounces in a larger downtrend.
One important note about the multiplier and timeframes: the default values are optimized for fast intraday charts (like 3-minute or 5-minute). On higher timeframes (15-minute, 1-hour, 4-hour, or daily), the SuperTrend bias can be too sensitive with low multipliers (1.0 default in the code), leading to situations like the AVGO 4-hour example — where price is clearly downtrending, but the dashboard shows "BULLISH ENERGY" because the tight bands flip on small bounces. To fix this, you need to manually increase the multiplier for that asset (or all assets) in the settings. For 4-hour or daily charts, 0.25–0.35 is often better to match smoother SuperTrend indicators like Trinity. Always test on your timeframe and asset — crypto usually needs slightly lower multipliers than stocks due to higher volatility.
TradingView has a hard limit of 40 request.security() calls per script. Each asset in the dashboard requires several calls (current ATR, daily ATR, SuperTrend components, etc.), so with the full ATR-based bias, you can safely monitor about 6–8 assets before hitting the limit. Adding more symbols increases the number of calls and will trigger the "too many securities" error. This is a platform restriction to prevent excessive server load, and there's no official way around it in a single script. Some advanced coders use tricks like caching or lower-timeframe requests to squeeze in a few more, but for reliability, sticking to 6–8 assets is recommended. If you need more, the common workaround is to create two separate indicators (e.g., one for stocks, one for crypto) and add both to the same chart.
Overall, this dashboard gives you a professional-grade multi-asset scanner that filters out low-energy noise and highlights real momentum opportunities across stocks and crypto — all in one glance. It's especially valuable for options traders who want to avoid theta decay on weak moves and only strike when the market has true fuel. By tweaking the per-symbol multipliers in the settings, you can perfectly adapt it to any timeframe or asset behavior, avoiding issues like the AVGO false bullish signal on higher timeframes.
EMA Slope Angle# EMA Slope Angle Indicator
A professional, non-repainting overlay indicator that visualizes EMA slope strength as an angle in degrees, providing instant visual feedback through dynamic EMA coloring and comprehensive trend analysis.
## ORIGINALITY
This indicator is original in its approach to slope measurement:
- **Angle-based calculation**: Uses arctangent to calculate slope as an angle in degrees (not percentage), providing a more intuitive measure of trend strength
- **Dynamic visual feedback**: Combines real-time EMA line coloring with regime detection, creating a continuous visual representation of market conditions
- **Comprehensive analysis**: Integrates angle-based trend shift signals with optional statistical analysis in a single, cohesive tool
- **Non-repainting design**: All calculations use confirmed bars only, ensuring reliable, deterministic output
## HOW IT WORKS
The indicator calculates the EMA slope angle using trigonometric functions:
```
Angle = arctan((EMA_current - EMA_past) / lookback_bars) × 180/π
```
This provides an intuitive measure where:
- **Steep angles** = strong trends (visualized with saturated colors)
- **Shallow angles** = weak trends (visualized with lighter colors)
- **Near-zero angles** = flat/consolidation (visualized in gray)
The EMA line color dynamically reflects:
- **Direction**: Green shades for uptrends, red shades for downtrends
- **Strength**: Color intensity based on normalized angle (stronger slopes = more saturated colors)
- **Regime**: Gray for flat conditions when angle is below threshold
## KEY FEATURES
### Dynamic EMA Coloring
- EMA line color changes continuously based on slope strength
- Color intensity reflects trend strength (50-100% opacity range)
- Instant visual feedback without cluttering the chart
### Regime Detection
- Automatically classifies market conditions: **RISING**, **FALLING**, or **FLAT**
- Configurable angle thresholds for regime classification
- Real-time regime updates on confirmed bars only
### Trend-Shift Signals
- Detects transitions from FLAT to RISING/FALLING regimes
- Visual arrows on chart when significant trend shifts occur
- Prevents signal spam by only triggering from FLAT state
- Configurable trigger thresholds for signal sensitivity
### KPI Dashboard
- Real-time angle display (rounded to 1 decimal place)
- Current regime status with color coding
- Last signal tracking (UP/DOWN/NONE)
- Positioned in top-right corner for easy reference
### Advanced Angle Statistics (Optional)
- Detailed breakdown of angle distribution across 9 granular buckets:
- 0-0.2°, 0.2-0.5°, 0.5-1°, 1-1.5°, 1.5-2°, 2-3°, 3-5°, 5-10°, >10°
- Shows count and percentage for each bucket
- Automatically resets on symbol/timeframe changes
- Useful for analyzing historical slope patterns
## SETTINGS
### Main Settings
- **EMA Length**: Period for exponential moving average (default: 50)
- **Slope Lookback Bars**: Number of bars to compare for slope calculation (default: 5)
### Angle Settings
- **Flat Angle Threshold**: Maximum angle for FLAT regime classification (default: 2.0°)
- **Rising Angle Trigger**: Minimum angle to trigger RISING regime and UP signals (default: 1.0°)
- **Falling Angle Trigger**: Maximum angle to trigger FALLING regime and DOWN signals (default: -1.0°)
- **Max Angle for Color Saturation**: Maximum angle for full color intensity (default: 30.0°)
### Display Options
- **Uptrend Color**: Color for rising trends (default: dark green)
- **Downtrend Color**: Color for falling trends (default: dark red)
- **Flat Color**: Color for flat conditions (default: gray)
- **Show Trend-Shift Signals**: Toggle signal arrows on/off (default: true)
- **Show Angle Statistics**: Toggle statistics dashboard on/off (default: false)
## NON-REPAINTING GUARANTEE
- All calculations use confirmed bars only (`barstate.isconfirmed`)
- No future bar references
- No higher timeframe calls using `request.security()`
- Deterministic output - what you see is what you get
- Reliable for backtesting and live trading
## USE CASES
- **Trend Identification**: Instantly identify trend strength and direction at a glance
- **Reversal Detection**: Spot trend reversals early through regime changes
- **Trade Filtering**: Filter trades based on slope strength and regime
- **Consolidation Monitoring**: Identify flat market conditions for range trading
- **Pattern Analysis**: Study historical angle distributions to understand market behavior
- **Momentum Assessment**: Gauge trend momentum through visual color intensity
## LIMITATIONS
- Angle calculation depends on EMA length and lookback period settings
- Regime classification is based on configurable thresholds - adjust to match your trading style
- Signals only trigger when transitioning from FLAT state to prevent spam
- Statistics reset on symbol/timeframe changes (by design)
- Color intensity is normalized to max angle setting - adjust for your market's typical ranges
## TECHNICAL NOTES
- Uses Pine Script v6
- Overlay indicator (plots on price chart)
- No external dependencies
- Compatible with all TradingView chart types
- Works on all timeframes and symbols
## DISCLAIMER
This indicator is designed for visual trend analysis and educational purposes. Always combine with other technical analysis tools, fundamental analysis, and proper risk management strategies. Past performance does not guarantee future results. Trading involves risk of loss.
---
**Perfect for**: Swing traders, day traders, trend followers, and market analysts seeking intuitive trend strength visualization.
Pair Creation🙏🏻 The one and only pair construction tech you need, unlike others:
Applies one consistent operation to all the data features (not only prices). Then, the script outputs these, so you can apply other calculations on these outputs.
calculates a very fast and native volatility based hedge ratio, that also takes into account point value (think SPY vs ES) so you can easily use it in position sizing
Has built-in forward pricing aka cost of carry model , so you can de-drift pairs from cost of carry, discover spot price of oil based on futures, and ofc find arbitrage opportunities
Also allows to make a pair as a product of 2 series, useful for triangular arbitrage
This script can make a pair in 2 ways:
Ratio, by dividing leg 1 by leg 2
Product, by multiplying leg 1 by leg 2
The real mathematically right way to construct a pair is a ratio/product (Spreads are in fact = 2 legged portfolio, but I ain't told ya that ok). Why? Because a pair of 2 entities has a mathematically unique beauty, it allows direct comparisons and relationship analysis, smth you can't do directly with 3 and more components.
Multiplication (think inversions like (EURUSD -> USDEUR), and use cases for triangular arbitrage) is useful sometimes too.
...
Quickguide:
First, "Legs" are pair components: make a pair of related assets. Don’t be guided exclusively by clustering, cointegrations, mutual information etc. Common sense and exogenous info can easily made them all Forward pricing model: is useful when u work with spot vs futures pairs. Otherwise: put financing, storage and yield all on zeros, this way u will turn it off and have a pure ratio/product of 2 legs.
Look at the 2 numbers on the script’s status line: the first one would always be 1), and the second one is a variable.
First number (always 1) is multiplier for your position size on leg 1
The second number is the multiplier for your position size on leg 2 in the opposite direction.
If both legs are related, trading your sizes with these multipliers makes you do statistical arbitrage -> trading ~ volatility in risk free mode, while the relationship between the assets is still in place.
Also guys srsly, nobody ‘ever’ made a universal law that somewhy somehow for whatever secret conspiracy reason one shall only trade pairs in mean reverting style xd. You can do whatever you want:
Tilt hedge ratio significantly based on relative strength of legs
Trade the pair in momentum style
Ignore hedge ratio all together
And more and more, the limit is your imagination, e.g.:
Anticipate hedge ratio changes based on exogenous info and act accordingly
Scalp a pair just like any other asset
Make a pair out of 2 pairs
Like I mean it, whatever you desire
About forward pricing model:
It’s applied only to leg 2;
Direct: takes spot price and finds out implied futures price
Inverse: takes futures price and finds out implied spot price (try on oil)
Pls read online how to choose parameters, it’s open access reliable info
About the hedge ratio I use:
You prolly noticed the way I prefer to use inferred volumes vs the “real” ones. In pairs it’s especially meaningful, because real volumes lose sense in pair creation. And while volumes are closely tied to volatility, the inferred volumes ‘Are’ volatility irl (and later can be converted to currency space by using point value, allowing direct comparisons symbol vs symbol).
This hedge ratio is a good example of how discovering the real nature of entities beats making 100s of inventions, why domain knowledge and proper feature engineering beats difficult bulky models, neural networks etc. How simple data understanding & operations on it is all you need.
This script simply does this:
Takes inferred volume delta of both assets, makes a ratio, normalizes it by tick sizes and points values of both legs, calculates a typical value of this series.
That’s it, no step 2, we’re done. No Kalman filters, no TLS regression, no vine copulas, or whatever new fancy keywords you can come up with etc.
...
^^ comparing real ES prices vs theoretical ones by forward-pricing model. Financing: 0.04, yield 0.0175
^^ EURUSD, 6E futures with theoretical futures price calculated with interest rate differential 0.02 (4% USD - 2% EUR interest rates)
^^4 different pairs (RTY/ES, YM/ES, NQ/ES, ES/ZN) each with different plot style (pick one you like in script's Style settings)
^^ YM/RTY pair, each plot represents ratio of different features: ratio of prices, ratio of inferred volume deltas, ratio of inferred volumes, ratio of inferred tick counts (also can be turned on/off in Style settings)
...
How can u upgrade it and make a step forward yourself:
On tradingview missing values are automatically fixed by backfilling, and this never becomes a thing until you hit high frequency data. You can do better and use Kalman filter for filling missing values.
Script contains the functions I use everywhere to calculate inferred volume delta, inferred volume, and inferred tick count.
...
∞
Golden Volume Lines📌 Golden Volume — Lines (Golden Team)
Golden Volume — Lines is an advanced volume-based indicator that detects Ultra High Volume candles using a statistical percentile model, then automatically draws and tracks key price levels derived from those candles.
The indicator highlights where real market interest and liquidity appear and shows how price reacts when those levels are broken.
🔍 How It Works
Volume Measurement
Choose between:
Units (raw volume)
Money (Volume × Average Price)
Average price can be calculated using HL2 or OHLC4.
Percentile-Based Classification
Volume is classified into:
Medium
High
Ultra High Volume
Thresholds are calculated using a rolling percentile window.
Ultra Volume candles are colored orange.
Dynamic High & Low Levels
For every Ultra Volume candle:
A High and Low dotted line is drawn.
Lines extend to the right until price breaks them.
Smart Line Break Detection (Wick-Based)
A line is considered broken when price wicks through it.
When a break occurs:
🟧 Orange line → broken by an Ultra Volume candle
⚪ White line → broken by a normal candle
The line stops exactly at the breaking candle.
🔔 Alerts
Alert on Ultra High Volume candles
Alert when a High or Low line is broken
Separate alerts for:
Break by Ultra Volume candle
Break by Normal candle
🎯 Use Cases
Breakout & continuation confirmation
Liquidity sweep detection
Volume-validated support & resistance
Market reaction after extreme participation
⚙️ Key Inputs
Volume display mode (Units / Money)
Percentile thresholds
Lookback window size
Maximum number of active Ultra levels
Optional dynamic alerts
⚠️ Disclaimer
This indicator is a volume and market structure tool, not a standalone trading system.
Always use proper risk management and additional confirmation.
Gamma & Volatility Levels [Pro]General Purpose
This indicator analyzes volatility levels and expected price movements, combining gamma concepts (financial options) with volatility analysis to identify support and resistance zones.
Main Components
High Volatility Level (HVL): Calculates a volatility level based on the simple moving average (SMA) of the price plus one standard deviation. This level is represented by an orange line showing where volatility is concentrated.
Expected Movement (Movimiento Esperante): Uses the Average True Range (ATR) multiplied by an adjustable factor to project potential upward and downward movement ranges from the current price. It is drawn in green (upward) and red (downward).
Gamma Levels (Nivelas Gamma): Identifies two key levels: the call resistance (highest high of the last 50 periods) in blue, and the put support (lowest low) in purple. These are based on recent extreme prices.
Additional Information: The indicator calculates the percentage distance between the current price and the HVL, displaying it in a label.
Visual Elements
Colored lines on the chart for each level.
Labels with exact values next to each line.
A table in the upper right corner summarizing all calculated values.
Options to show or hide each element according to preference.
This is a useful tool for traders who work with options or seek to identify levels of extreme volatility and dynamic support/resistance zones.
MenthorQ Levels ConversionLevels Conversion helps traders accurately overlay price levels from spot/index ETFs and indices (like SPX, SPY, QQQ, NDX) onto futures charts (like ES, NQ, etc.).
Because futures and spot/index prices don’t trade at the same price, your levels will be misaligned if you plot them directly. Futures typically trade at a spread or ratio versus their related index/ETF. This indicator solves that by calculating the conversion ratio automatically, so your levels stay aligned on the futures chart.
How it works
This script calculates the ratio between Asset A and Asset B and applies it to convert levels from one instrument to the other (for example, SPX → ES, QQQ → NQ).
Ratio options (3 modes)
You can choose one of three ratio sources:
✅ T1 Ratio (Morning Snapshot)
Select a specific time to “lock” the ratio.
Default: 10:00 AM ET (morning session snapshot)
✅ T2 Ratio (Afternoon Snapshot)
Select a second time to “lock” the ratio.
Default: 3:30 PM ET (afternoon snapshot)
✅ Last Price Ratio (Live)
Uses the last traded price of both assets to compute the ratio.
Note: To refresh the “Last Price” baseline, simply remove and re-add the indicator.
Learn more about Levels Conversions: menthorq.com
Common levels conversions
Some popular use-cases include:
- SPX Gamma Levels → ES
- SPY Gamma Levels → ES
- QQQ Gamma Levels → NQ
- NDX Gamma Levels → NQ
- SPX Intraday Gamma Levels → ES
- QQQ Intraday Gamma Levels → NQ
- SPX Swing Trading Levels → ES
- QQQ Swing Trading Levels → NQ
- GLD Levels → GC
- DIA Levels → YM
- USO Levels → CL
- NVDA / MAG7 Levels → QQQ
Al Brooks - Bar CountIndicator Purpose:
This indicator displays bar counts on the chart to help traders identify important time nodes and cycle transitions
Features smart session filtering with automatic futures/stock detection and appropriate trading session counting
Core Features:
Smart asset detection: Auto-detect futures and stocks
Session filter toggle: Choose all-day or session-specific counting
Auto timezone handling: Chicago time for futures, NY time for stocks
Flexible display control: Customizable display frequency and label size
Session Settings:
8:30-15:15 (CT) / Futures mode: Chicago time 8:30-15:15 (CT)
9:30-16:00 (ET) / Stock mode: New York time 9:30-16:00 (ET)
All-day mode: Count from first bar of the day
Timeframe Correspondence:
Multiples of 3: Correspond to 15-minute chart update cycles
Multiples of 12: Correspond to 1-hour chart update cycles
18: Key nodes, important time turning points
Magical Thirteen Turns - The Greedy SnakeThe number 9 appears:
Meaning: Warning signal. The rise may encounter resistance and a cautious pullback is about to begin.
Operation: Consider reducing your holdings (selling a portion) to lock in profits and avoid experiencing wild fluctuations.
The number 13 appears:
Meaning: Strong sell signal. The upward momentum is likely to be exhausted, which is also known as "bull exhaustion".
Operation: It is recommended to liquidate your positions or significantly reduce them. Short sell (if you are trading contracts).
RO H1 Signal CandleMarks specific H1 signal candles based on Bucharest (RO) time.
Designed for clean backtesting and time-based analysis.
Displays a small marker on selected hourly candles only.
PatternTransitionTablesPatternTransitionTables Library
🌸 Part of GoemonYae Trading System (GYTS) 🌸
🌸 --------- 1. INTRODUCTION --------- 🌸
💮 Overview
This library provides precomputed state transition tables to enable ultra-efficient, O(1) computation of Ordinal Patterns. It is designed specifically to support high-performance indicators calculating Permutation Entropy and related complexity measures.
💮 The Problem & Solution
Calculating Permutation Entropy, as introduced by Bandt and Pompe (2002), typically requires computing ordinal patterns within a sliding window at every time step. The standard successive-pattern method (Equations 2+3 in the paper) requires ≤ 4d-1 operations per update.
Unakafova and Keller (2013) demonstrated that successive ordinal patterns "overlap" significantly. By knowing the current pattern index and the relative rank (position l) of just the single new data point, the next pattern index can be determined via a precomputed look-up table. Computing l still requires d comparisons, but the table lookup itself is O(1), eliminating the need for d multiplications and d additions. This reduces total operations from ≤ 4d-1 to ≤ 2d per update (Table 4). This library contains these precomputed tables for orders d = 2 through d = 5.
🌸 --------- 2. THEORETICAL BACKGROUND --------- 🌸
💮 Permutation Entropy
Bandt, C., & Pompe, B. (2002). Permutation entropy: A natural complexity measure for time series.
doi.org
This concept quantifies the complexity of a system by comparing the order of neighbouring values rather than their magnitudes. It is robust against noise and non-linear distortions, making it ideal for financial time series analysis.
💮 Efficient Computation
Unakafova, V. A., & Keller, K. (2013). Efficiently Measuring Complexity on the Basis of Real-World Data.
doi.org
This library implements the transition function φ_d(n, l) described in Equation 5 of the paper. It maps a current pattern index (n) and the position of the new value (l) to the successor pattern, reducing the complexity of updates to constant time O(1).
🌸 --------- 3. LIBRARY FUNCTIONALITY --------- 🌸
💮 Data Structure
The library stores transition matrices as flattened 1D integer arrays. These tables are mathematically rigorous representations of the factorial number system used to enumerate permutations.
💮 Core Function: get_successor()
This is the primary interface for the library for direct pattern updates.
• Input: The current pattern index and the rank position of the incoming price data.
• Process: Routes the request to the specific transition table for the chosen order (d=2 to d=5).
• Output: The integer index of the next ordinal pattern.
💮 Table Access: get_table()
This function returns the entire flattened transition table for a specified dimension. This enables local caching of the table (e.g. in an indicator's init() method), avoiding the overhead of repeated library calls during the calculation loop.
💮 Supported Orders & Terminology
The parameter d is the order of ordinal patterns (following Bandt & Pompe 2002). Each pattern of order d contains (d+1) data points, yielding (d+1)! unique patterns:
• d=2: 3 points → 6 unique patterns, 3 successor positions
• d=3: 4 points → 24 unique patterns, 4 successor positions
• d=4: 5 points → 120 unique patterns, 5 successor positions
• d=5: 6 points → 720 unique patterns, 6 successor positions
Note: d=6 is not implemented. The resulting code size (approx. 191k tokens) exceeds the Pine Script limit of 100k tokens (as of 2025-12).
Shiori TFGI Lite Technical Fear and Greed Index (Open Source)Shiori’s TFGI Lite
Technical Fear & Greed Index (Open Source)
---
English — Official Description
Shiori’s TFGI Lite is an open-source Technical Fear & Greed Index designed to help traders and investors understand market emotion, not predict price.
Instead of generating buy or sell signals, this indicator focuses on answering a calmer, more important question:
> Is the market emotionally stretched away from its own historical balance?
TFGI Lite combines three well-known technical dimensions — volatility, price deviation, and momentum — and normalizes them into a single, intuitive 0–100 sentiment scale.
What This Indicator Is
* A market context tool, not a trading signal
* A way to observe emotional extremes and misalignment
* Designed for any asset, any timeframe
* Fully open source, transparent and adjustable
Core Components
* Fear Factor: Short-term vs long-term ATR ratio with logarithmic compression
* Greed Factor: Price Z-score with tanh-based normalization
* Momentum Factor: Classic RSI as emotional momentum
These factors are blended and gently smoothed to form the current sentiment level.
Historical Baseline & Deviation
TFGI Lite introduces a historical baseline concept:
* The baseline represents the market’s own emotional equilibrium
* Deviation measures how far current sentiment has drifted from that equilibrium
This allows the indicator to highlight conditions such as:
* 🔥 Overheated: High sentiment + strong positive deviation
* 💎 Undervalued: Low sentiment + strong negative deviation
* ⚠️ Misaligned: Emotionally extreme, but inconsistent with historical behavior
How to Use (Lite Philosophy)
* Use TFGI Lite as a background compass, not a trigger
* Combine it with price structure, risk management, and your own strategy
* Extreme readings suggest emotional tension, not immediate reversal
> Think of TFGI Lite as market weather — it tells you the climate, not when to open or close the door.
About Parameters & Customization
All parameters in TFGI Lite are fully adjustable. Markets have different personalities — volatility, sentiment range, and emotional extremes vary by asset and timeframe.
You are encouraged to:
* Adjust fear/greed thresholds based on the asset you trade
* Tune smoothing and baseline lengths to match your timeframe
* Treat sentiment levels as relative, not universal absolutes
There is no single “correct” setting — TFGI Lite is designed to adapt to your market, not force the market into a fixed model.
Important Notes
* This is a technical sentiment indicator, not financial advice
* No future performance is implied
* Designed to reduce emotional decision-making, not replace it
---
🇹🇼 繁體中文 — 指標說明
Shiori’s TFGI Lite(技術型恐懼與貪婪指數) 是一款開源的市場情緒指標,目的不是預測價格,而是幫助你理解市場當下的「情緒狀態」。
與其問「現在該不該買或賣」,TFGI Lite 更關心的是:
> 市場情緒是否已經偏離了它自己的歷史平衡?
本指標整合三個常見但關鍵的技術面向,並統一轉換為 0–100 的情緒刻度,讓市場狀態一眼可讀。
這個指標是什麼
* 市場情緒與狀態觀察工具(非買賣訊號)
* 用來辨識情緒極端與錯位狀態
* 適用於任何商品與任何週期
* 完全開源,可學習、可調整
核心構成
* 恐懼因子:短期 / 長期 ATR 比例(對數壓縮)
* 貪婪因子:價格 Z-Score(tanh 正規化)
* 動能因子:RSI 作為情緒動量
歷史基準與偏離
TFGI Lite 引入「歷史情緒基準」的概念:
* 基準代表市場長期的情緒平衡
* 偏離值顯示當前情緒與自身歷史的距離
因此可以辨識:
* 🔥 過熱(高情緒 + 正向偏離)
* 💎 低估(低情緒 + 負向偏離)
* ⚠️ 錯位(情緒極端,但不符合歷史行為)
使用建議(Lite 精神)
* 將 TFGI Lite 作為「背景雷達」,而非進出場依據
* 搭配價格結構、風險控管與個人策略
* 情緒極端不等於立刻反轉
> 你可以把它想像成市場的天氣預報,而不是交易指令。
參數調整與個人化說明
本指標中的所有參數皆可調整。不同市場、不同商品,其波動特性與情緒區間並不相同。
建議你:
* 依標的特性自行調整恐懼 / 貪婪門檻
* 依交易週期調整平滑與基準長度
* 將情緒數值視為「相對狀態」,而非固定答案
TFGI Lite 的設計初衷,是讓你定義市場,而不是被單一參數綁住。
溫馨提示
如果你在調整指標參數時遇到不熟悉的項目,請點擊參數旁邊的 「!」圖示,每個設定都有清楚的說明。
本指標設計為可慢慢探索,請依自己的節奏理解市場狀態。
---
🇯🇵 日本語 — インジケーター説明
Shiori’s TFGI Lite は、価格を予測するための指標ではなく、
市場の「感情状態」を可視化するためのオープンソース指標です。
この指標が問いかけるのは、
> 現在の市場感情は、過去のバランスからどれだけ乖離しているのか?
という一点です。
特徴
* 売買シグナルではありません
* 市場心理の極端さやズレを観察するためのツールです
* すべての銘柄・時間軸に対応
* 学習・調整可能なオープンソース
構成要素
* 恐怖要素:ATR 比率(対数圧縮)
* 強欲要素:価格 Z スコア(tanh 正規化)
* モメンタム:RSI
ベースラインと乖離
市場自身の感情的な基準点と、
現在の感情との距離を測定します。
過熱・割安・感情のズレを視覚的に把握できます。
パラメータ調整について
TFGI Lite のすべてのパラメータは調整可能です。市場ごとにボラティリティや感情の振れ幅は異なります。
* 恐怖・強欲の閾値は銘柄に応じて調整してください
* 時間軸に合わせて平滑化やベースライン期間を変更できます
* 数値は絶対値ではなく、相対的な感情状態として捉えてください
この指標は、市場に合わせて柔軟に使うことを前提に設計されています。
フレンドリーヒント
入力項目で分からない設定がある場合は、横に表示されている 「!」アイコン をクリックしてください。各パラメータには分かりやすい説明が用意されています。
このインジケーターは、落ち着いて市場の状態を理解するためのものです。
---
🇰🇷 한국어 — 지표 설명
Shiori’s TFGI Lite는 매수·매도 신호를 제공하는 지표가 아니라,
시장 감정의 상태를 이해하기 위한 기술적 심리 지표입니다.
이 지표의 핵심 질문은 다음과 같습니다.
> 현재 시장 감정은 과거의 균형 상태에서 얼마나 벗어나 있는가?
특징
* 거래 신호 아님
* 시장 심리의 과열·저평가·불일치를 관찰
* 모든 자산, 모든 타임프레임 지원
* 오픈소스 기반
구성 요소
* 공포 요인: ATR 비율 (로그 압축)
* 탐욕 요인: Z-Score (tanh 정규화)
* 모멘텀: RSI
활용 방법
TFGI Lite는 배경 지표로 사용하세요.
가격 구조와 리스크 관리와 함께 사용할 때 가장 효과적입니다.
파라미터 조정 안내
TFGI Lite의 모든 설정 값은 사용자가 직접 조정할 수 있습니다. 자산마다 변동성과 감정 범위는 서로 다릅니다.
* 공포 / 탐욕 기준값은 종목 특성에 맞게 조정하세요
* 타임프레임에 따라 스무딩 및 기준 기간을 변경할 수 있습니다
* 감정 수치는 절대적인 값이 아닌 상대적 상태로 해석하세요
이 지표는 하나의 정답을 강요하지 않고, 시장에 맞춰 적응하도록 설계되었습니다.
친절한 안내
설정 값이 익숙하지 않다면, 항목 옆에 있는 "!" 아이콘을 클릭해 보세요. 각 입력값마다 설명이 제공됩니다.
이 지표는 천천히 시장의 맥락을 이해하도록 설계되었습니다.
---
Educational purpose only. Not financial advice.
---
#FearAndGreed #MarketSentiment #TradingPsychology #TechnicalAnalysis #OpenSourceIndicator #Volatility #RSI #ATR #ZScore #MultiAsset #TradingView #Shiori
BTC Regime Oscillator (MC + Spread) [1D]ONLY SUPPOSED TO BE USED FOR BTC PERPS, AND SPOT LEVERAGING:
This is a risk oscillator that measures whether Bitcoin’s price is supported by real capital or is running ahead of it, and converts that into a simple risk-regime oscillator.
It's built with market cap, and FDV, and Z-scores compressed to -100 <-> 100
I created this indicator because I got tired of FOMO Twitter and Wall Street games.
DO NOT USE THIS AS A BEGIN-ALL-AND-END-ALL. YOU NEED TO USE THIS AS A CONFIRMATION INDICATOR, AND ON HTF ONLY (1D>) IF YOU USE THIS ON LOWER TIMEFRAMES, YOU ARE FEEDING YOUR MONEY TO A LOW-LIFE DING BAT ON WALL STREET. HERE IS HOW IT WORKS:
This indicator is Split up by
A) Market Cap
--> Represents real money in BTC
--> Ownership capital
--> If MC is rising, money is entering BTC
B) FDV (Fully Diluted Valuation)
--> For BTC: price(21M) (21,000,000)
--> Represents the theoretical valuation
--> Since BTC really has a fixed cap, FDV mostly tracks the price
C) Oscillators
Both MC and FDV are:
--> Logged (to handle scale)
--> Normalized (Z-score)
--> Compressed to -100 <-> 100
HERE ARE THREE THINGS YOU ARE GOING TO SEE ON THE CHART
A) The market cap oscillator (MC OSC)
--> Normalized trend of real capital
RISING: Indicates capital inflow
FALLING: Indicates capital outflow
B) FDV Oscillator
--> Normalized trend of valuation pressure
ABOVE MC: Price is ahead of capital
BELOW MC: Capital is keeping up
!!!! FDV IS CONTEXT NOT SIGNALS !!!!
C) Spread = (FDV - MC)
--> The difference between valuation and capital
(THIS IS THE CORE SIGNAL)
NEGATIVE: Capital is gonna lead price
NEAR 0: Balanced
POSITIVE: Price leads capital
(THIS MEANS STRESS FOR BTC, NOT DILLUTION!)
WHAT DOES -60, 0, 60 MEAN?:
--> These are meant to serve as risk zones, not buy/sell dynamics; this is not the same as an RSI oscillator.
A) 0 level
--> Price and capital are balanced
--> No structural stress
(TRADE WITH NORMAL POSITION SIZE, AND NORMAL EXPECTATIONS)
B) Below -60 (Supportive/Compressed)
--> BTC is relatively cheap to recent history
--> Capital supports price well
(ALWAYS REMEMBER TO CONFIRM THIS WITH WHAT THE CHART IS TELLING YOU)
--> Press trends
--> Use higher ATRs
--> Pullbacks are better here
C) Above 60 (Overextension, or fragile)
--> BTC is expensive relative to recent history
--> Price is ahead of capital
(ALWAYS REMEMBER TO CONFIRM THIS WITH WHAT THE CHART IS TELLING YOU)
--> Reduce leverage, use smaller ATR
--> Use lower ATRs, TP faster
--> Do not chase breakouts
--> Expect volatility and whipsaws
"Can I press trades right now? Or do I need to hog my capital?"
CONDITIONS:
Spread Less than 0 and below -60 = Press trades
Spread near 0 = Normal trading conditions
Spread is Greater than 0 or above 60+ = Capital protection
FF calculation Saptarshi ChatterjeeForward factor (in options contexts) measures implied volatility (IV) for a future period between two expirations, like from 30 DTE (days to expiry) front-month to 60 DTE back-month options.
This indicator calculates the FORWARD FACTOR(FF) using 2 IVs of 2 DTEs.
+ve value means front DTE is rich in premium and back expiry is cheap.
-ve value means front DTE IV is cheap and 2nd DTE is expensive
we can use this term structure disbalance to trade calendar spreads with edge.
Mutanabby_AI | ONEUSDT_MR1
ONEUSDT Mean-Reversion Strategy | 74.68% Win Rate | 417% Net Profit
This is a long-only mean-reversion strategy designed specifically for ONEUSDT on the 1-hour timeframe. The core logic identifies oversold conditions following sharp declines and enters positions when selling pressure exhausts, capturing the subsequent recovery bounce.
Backtested Period: June 2019 – December 2025 (~6 years)
Performance Summary
| Metric | Value |
|--------|-------|
| Net Profit | +417.68% |
| Win Rate | 74.68% |
| Profit Factor | 4.019 |
| Total Trades | 237 |
| Sharpe Ratio | 0.364 |
| Sortino Ratio | 1.917 |
| Max Drawdown | 51.08% |
| Avg Win | +3.14% |
| Avg Loss | -2.30% |
| Buy & Hold Return | -80.44% |
Strategy Logic :
Entry Conditions (Long Only):
The strategy seeks confluence of three conditions that identify exhausted selling:
1. Prior Move Filter:*The price change from 5 bars ago to 3 bars ago must be ≥ -7% (ensures we're not entering during freefall)
2. Current Move Filter: The price change over the last 2 bars must be ≤ 0% (confirms momentum is stalling or reversing)
3. Three-Bar Decline: The price change from 5 bars ago to 3 bars ago must be ≤ -5% (confirms a significant recent drop occurred)
When all three conditions align, the strategy identifies a potential reversal point where sellers are exhausted.
Exit Conditions:
- Primary Exit: Close above the previous bar's high while the open of the previous bar is at or below the close from 9 bars ago (profit-taking on strength)
- Trailing Stop: 11x ATR trailing stop that locks in profits as price rises
Risk Management
- Position Sizing:Fixed position based on account equity divided by entry price
- Trailing Stop:11× ATR (14-period) provides wide enough room for crypto volatility while protecting gains
- Pyramiding:Up to 4 orders allowed (can scale into winning positions)
- **Commission:** 0.1% per trade (realistic exchange fees included)
Important Disclaimers
⚠️ This is NOT financial advice.
- Past performance does not guarantee future results
- Backtest results may contain look-ahead bias or curve-fitting
- Real trading involves slippage, liquidity issues, and execution delays
- This strategy is optimized for ONEUSDT specifically — results may differ on other pairs
- Always test before risking real capital
Recommended Usage
- Timeframe:*1H (as designed)
- Pair: ONEUSDT (Binance)
- Account Size: Ensure sufficient capital to survive max drawdown
Source Code
Feedback Welcome
I'm sharing this strategy freely for educational purposes. Please:
- Drop a comment with your backtesting results any you analysis
- Share any modifications that improve performance
- Let me know if you spot any issues in the logic
Happy trading
As a quant trader, do you think this strategy will survive in live trading?
Yes or No? And why?
I want to hear from you guys
LuxyEnergyIndexThe Luxy Energy Index (LEI) library provides functions to measure price movement exhaustion by analyzing three dimensions: Extension (distance from fair value), Velocity (speed of movement), and Volume (confirmation level).
LEI answers a different question than traditional momentum indicators: instead of "how far has price gone?" (like RSI), LEI asks "how tired is this move?"
This library allows Pine Script developers to integrate LEI calculations into their own indicators and strategies.
How to Import
//@version=6
indicator("My Indicator")
import OrenLuxy/LuxyEnergyIndex/1 as LEI
Main Functions
`lei(src)` → float
Returns the LEI value on a 0-100 scale.
src (optional): Price source, default is `close`
Returns : LEI value (0-100) or `na` if insufficient data (first 50 bars)
leiValue = LEI.lei()
leiValue = LEI.lei(hlc3) // custom source
`leiDetailed(src)` → tuple
Returns LEI with all component values for detailed analysis.
= LEI.leiDetailed()
Returns:
`lei` - Final LEI value (0-100)
`extension` - Distance from VWAP in ATR units
`velocity` - 5-bar price change in ATR units
`volumeZ` - Volume Z-Score
`volumeModifier` - Applied modifier (1.0 = neutral)
`vwap` - VWAP value used
Component Functions
| Function | Description | Returns |
|-----------------------------------|---------------------------------|---------------|
| `calcExtension(src, vwap)` | Distance from VWAP / ATR | float |
| `calcVelocity(src)` | 5-bar price change / ATR | float |
| `calcVolumeZ()` | Volume Z-Score | float |
| `calcVolumeModifier(volZ)` | Volume modifier | float (≥1.0) |
| `getVWAP()` | Auto-detects asset type | float |
Signal Functions
| Function | Description | Returns |
|---------------------------------------------|----------------------------------|-----------|
| `isExhausted(lei, threshold)` | LEI ≥ threshold (default 70) | bool |
| `isSafe(lei, threshold)` | LEI ≤ threshold (default 30) | bool |
| `crossedExhaustion(lei, threshold)` | Crossed into exhaustion | bool |
| `crossedSafe(lei, threshold)` | Crossed into safe zone | bool |
Utility Functions
| Function | Description | Returns |
|----------------------------|-------------------------|-----------|
| `getZone(lei)` | Zone name | string |
| `getColor(lei)` | Recommended color | color |
| `hasEnoughHistory()` | Data check | bool |
| `minBarsRequired()` | Required bars | int (50) |
| `version()` | Library version | string |
Interpretation Guide
| LEI Range | Zone | Meaning |
|-------------|--------------|--------------------------------------------------|
| 0-30 | Safe | Low exhaustion, move may continue |
| 30-50 | Caution | Moderate exhaustion |
| 50-70 | Warning | Elevated exhaustion |
| 70-100 | Exhaustion | High exhaustion, increased reversal risk |
Example: Basic Usage
//@version=6
indicator("LEI Example", overlay=false)
import OrenLuxy/LuxyEnergyIndex/1 as LEI
// Get LEI value
leiValue = LEI.lei()
// Plot with dynamic color
plot(leiValue, "LEI", LEI.getColor(leiValue), 2)
// Reference lines
hline(70, "High", color.red)
hline(30, "Low", color.green)
// Alert on exhaustion
if LEI.crossedExhaustion(leiValue) and barstate.isconfirmed
alert("LEI crossed into exhaustion zone")
Technical Details
Fixed Parameters (by design):
Velocity Period: 5 bars
Volume Period: 20 bars
Z-Score Period: 50 bars
ATR Period: 14
Extension/Velocity Weights: 50/50
Asset Support:
Stocks/Forex: Uses Session VWAP (daily reset)
Crypto: Uses Rolling VWAP (50-bar window) - auto-detected
Edge Cases:
Returns `na` until 50 bars of history
Zero volume: Volume modifier defaults to 1.0 (neutral)
Credits and Acknowledgments
This library builds upon established technical analysis concepts:
VWAP - Industry standard volume-weighted price measure
ATR by J. Welles Wilder Jr. (1978) - Volatility normalization
Z-Score - Statistical normalization method
Volume analysis principles from Volume Spread Analysis (VSA) methodology
Disclaimer
This library is provided for **educational and informational purposes only**. It does not constitute financial advice. Past performance does not guarantee future results. The exhaustion readings are probabilistic indicators, not guarantees of price reversal. Always conduct your own research and use proper risk management when trading.
Pardos Info DashboardThis indicator presents basic data in a concentrated form
Additions to the indicator are welcome by email to gshayp@gmail.com
Trinity ATR Real Move DetectorTrinity ATR Real Move Detector
This ATR Energy Table indicator is one of the simplest yet most powerful filters you can have on a chart when trading short-dated or 0DTE options or swing trades on any timeframe from 1-minute up to 4-hour. Its entire job is to answer the single most important question in intraday and swing trading: “Does the underlying actually have enough short-term explosive energy right now to make a directional position worth the theta and the spread, or is this just pretty candles that will die in ten minutes?”
Most losing 0DTE and short-dated option trades happen because people buy or sell direction on a “nice-looking” breakout or pullback while the underlying is actually in low-energy grind mode. The premium decays faster than the move develops, and you lose even when you’re “right” on direction. This little table stops that from ever happening again.
Here’s what it does in plain English:
Every bar it measures two things:
- The current ATR on whatever timeframe you are using (1 min, 3 min, 5 min, 10 min, etc.). This tells you how big the average true range of the last 14 bars has been — in other words, how violently the stock or index is actually moving right now.
- The daily ATR (14-period on the daily chart). This is your benchmark for “normal” daily movement over the last two–three weeks.
It then multiplies the daily ATR by a small number (the multiplier you set) and compares the two. If the short-term ATR is bigger than that percentage of the daily ATR, the table turns bright green and says “ENOUGH ENERGY”. If not, it stays red and says “NOT ENOUGH”.
Why this works so well:
- Real explosive moves that carry for 0DTE and 1–3 DTE options almost always show a short-term ATR spike well above the recent daily average. Quiet grind moves never do.
- The comparison is completely adaptive — on a high-vol day the threshold automatically rises, on a low-vol day it automatically drops. You never have to guess if “2 points on SPY is big today”.
- It removes emotion completely. You simply wait for green before you even think about clicking buy or sell on an option.
Key settings and what to do with them:
- Energy Multiplier — this is the only number you ever touch. It is expressed as a decimal (0.15 = 15 % of the daily ATR). Lower = more signals, higher = stricter and higher win rate. The tooltip gives you the exact sweet-spot numbers for every popular timeframe (0.09 for 1-minute scalping, 0.13 for 3-minute, 0.14–0.16 for 5-minute, 0.15–0.19 for 10-minute, etc.). Just pick your timeframe once and type the number — done forever.
- ATR Length — leave it at 14. That’s the standard and works perfectly.
- Table Position — move the table to wherever you want on the chart (top-right, bottom-right, bottom-left, top-left).
- Table Size — make the text Tiny, Small, Normal or Large depending on how much screen space you have.
How this helps you make money and stop losing it:
- On most days you will see red 80–90 % of the time — that’s good! It is forcing you to sit on your hands instead of overtrading low-energy chop that eats premium.
- When it finally flips green you know institutions are actually pushing size right now — follow-through probability jumps from ~40 % to 65–75 % depending on the stock and timeframe.
- You stop buying calls on every green candle and puts on every red candle. You only strike when the market is genuinely “awake”.
- Over a week you take dramatically fewer trades, but your win rate and average winner size go way up — which is exactly how consistent intraday option profits are made.
In short, this tiny table is the closest thing to an “edge on/off switch” that exists for short-dated options. Red = preserve capital and go do something else. Green = pull the trigger with confidence. Use it religiously and you’ll immediately feel the difference in your P&L.
KernelFunctionsLibrary "KernelFunctions"
This library provides non-repainting kernel functions for Nadaraya-Watson estimator implementations. This allows for easy substition/comparison of different kernel functions for one another in indicators. Furthermore, kernels can easily be combined with other kernels to create newer, more customized kernels.
rationalQuadratic(_src, _lookback, _relativeWeight, startAtBar)
Rational Quadratic Kernel - An infinite sum of Gaussian Kernels of different length scales.
Parameters:
_src (float) : The source series.
_lookback (simple int) : The number of bars used for the estimation. This is a sliding value that represents the most recent historical bars.
_relativeWeight (simple float) : Relative weighting of time frames. Smaller values resut in a more stretched out curve and larger values will result in a more wiggly curve. As this value approaches zero, the longer time frames will exert more influence on the estimation. As this value approaches infinity, the behavior of the Rational Quadratic Kernel will become identical to the Gaussian kernel.
startAtBar (simple int)
Returns: yhat The estimated values according to the Rational Quadratic Kernel.
gaussian(_src, _lookback, startAtBar)
Gaussian Kernel - A weighted average of the source series. The weights are determined by the Radial Basis Function (RBF).
Parameters:
_src (float) : The source series.
_lookback (simple int) : The number of bars used for the estimation. This is a sliding value that represents the most recent historical bars.
startAtBar (simple int)
Returns: yhat The estimated values according to the Gaussian Kernel.
periodic(_src, _lookback, _period, startAtBar)
Periodic Kernel - The periodic kernel (derived by David Mackay) allows one to model functions which repeat themselves exactly.
Parameters:
_src (float) : The source series.
_lookback (simple int) : The number of bars used for the estimation. This is a sliding value that represents the most recent historical bars.
_period (simple int) : The distance between repititions of the function.
startAtBar (simple int)
Returns: yhat The estimated values according to the Periodic Kernel.
locallyPeriodic(_src, _lookback, _period, startAtBar)
Locally Periodic Kernel - The locally periodic kernel is a periodic function that slowly varies with time. It is the product of the Periodic Kernel and the Gaussian Kernel.
Parameters:
_src (float) : The source series.
_lookback (simple int) : The number of bars used for the estimation. This is a sliding value that represents the most recent historical bars.
_period (simple int) : The distance between repititions of the function.
startAtBar (simple int)
Returns: yhat The estimated values according to the Locally Periodic Kernel.
Open Interest Z-Score [BackQuant]Open Interest Z-Score
A standardized pressure gauge for futures positioning that turns multi venue open interest into a Z score, so you can see how extreme current positioning is relative to its own history and where leverage is stretched, decompressing, or quietly re loading.
What this is
This indicator builds a single synthetic open interest series by aggregating futures OI across major derivatives venues, then standardises that aggregated OI into a rolling Z score. Instead of looking at raw OI or a simple change, you get a normalized signal that says "how many standard deviations away from normal is positioning right now", with optional smoothing, reference bands, and divergence detection against price.
You can render the Z score in several plotting modes:
Line for a clean, classic oscillator.
Colored line that encodes both sign and momentum of OI Z.
Oscillator histogram that makes impulses and compressions obvious.
The script also includes:
Aggregated open interest across Binance, Bybit, OKX, Bitget, Kraken, HTX, and Deribit, using multiple contract suffixes where applicable.
Choice of OI units, either coin based or converted to USD notional.
Standard deviation reference lines and adaptive extreme bands.
A flexible smoothing layer with multiple moving average types.
Automatic detection of regular and hidden divergences between price and OI Z.
Alerts for zero line and ±2 sigma crosses.
Aggregated open interest source
At the core is the same multi venue OI aggregation engine as in the OI RSI tool, adapted from NoveltyTrade's work and extended for this use case. The indicator:
Anchors on the current chart symbol and its base currency.
Loops over a set of exchanges, gated by user toggles:
Binance.
Bybit.
OKX.
Bitget.
Kraken.
HTX.
Deribit.
For each exchange, loops over several contract suffixes such as USDT.P, USD.P, USDC.P, USD.PM to cover the common perp and margin styles.
Requests OI candles for each exchange plus suffix pair into a small custom OI type that carries open, high, low and close of open interest.
Converts each OI stream into a common unit via the sw method:
In COIN mode, OI is normalized relative to the coin.
In USD mode, OI is scaled by price to approximate notional.
Exchange specific scaling factors are applied where needed to match contract multipliers.
Accumulates all valid OI candles into a single combined OI "candle" by summing open, high, low and close across venues.
The result is oiClose , a synthetic close for aggregated OI that represents cross venue positioning. If there is no valid OI data for the symbol after this process, the script throws a clear runtime error so you know the market is unsupported rather than quietly plotting nonsense.
How the Z score is computed
Once the aggregated OI close is available, the indicator computes a rolling Z score over a configurable lookback:
Define subject as the aggregated OI close.
Compute a rolling mean of this subject with EMA over Z Score Lookback Period .
Compute a rolling standard deviation over the same length.
Subtract the mean from the current OI and divide by the standard deviation.
This gives a raw Z score:
oi_z_raw = (subject − mean) ÷ stdDev .
Instead of plotting this raw value directly, the script passes it through a smoothing layer:
You pick a Smoothing Type and Smoothing Period .
Choices include SMA, HMA, EMA, WMA, DEMA, RMA, linear regression, ALMA, TEMA, and T3.
The helper ma function applies the chosen smoother to the raw Z score.
The result is oi_z , a smoothed Z score of aggregated open interest. A separate EMA with EMA Period is then applied on oi_z to create a signal line ma that can be used for crossovers and trend reads.
Plotting modes
The Plotting Type input controls how this Z score is rendered:
1) Line
In line mode:
The smoothed OI Z score is plotted as a single line using Base Line Color .
The EMA overlay is optionally plotted if Show EMA is enabled.
This is the cleanest view when you want to treat OI Z like a standard oscillator, watching for zero line crosses, swings, and divergences.
2) Colored Line
Colored line mode adds conditional color logic to the Z score:
If the Z score is above zero and rising, it is bright green, representing positive and strengthening positioning pressure.
If the Z score is above zero and falling, it shifts to a cooler cyan, representing positive but weakening pressure.
If the Z score is below zero and falling, it is bright red, representing negative and strengthening pressure (growing net de risking or shorting).
If the Z score is below zero and rising, it is dark red, representing negative but recovering pressure.
This mapping makes it easy to see not only whether OI is above or below its historical mean, but also whether that deviation is intensifying or fading.
3) Oscillator
Oscillator mode turns the Z score into a histogram:
The smoothed Z score is plotted as vertical columns around zero.
Column colors use the same conditional palette as colored line mode, based on sign and change direction.
The histogram base is zero, so bars extend up into positive Z and down into negative Z.
Oscillator mode is useful when you care about impulses in positioning, for example sharp jumps into positive Z that coincide with fast builds in leverage, or deep spikes into negative Z that show aggressive flushes.
4) None
If you only want reference lines, extreme bands, divergences, or alerts without the base oscillator, you can set plotting to None and keep the rest of the tooling active.
The EMA overlay respects plotting mode and only appears when a visible Z score line or histogram is present.
Reference lines and standard deviation levels
The Select Reference Lines input offers two styles:
Standard Deviation Levels
Plots small markers at zero.
Draws thin horizontal lines at +1, +2, −1 and −2 Z.
Acts like a classic Z score ladder, zero as mean, ±1 as normal band, ±2 as outer band.
This mode is ideal if you want a textbook statistical framing, using ±1 and ±2 sigma as standard levels for "normal" versus "extended" positioning.
Extreme Bands
Extreme bands build on the same ±1 and ±2 lines, then add:
Upper outer band between +3 and +4 Z.
Lower outer band between −3 and −4 Z.
Dynamic fill colors inside these bands:
If the Z score is positive, the upper band fill turns red with an alpha that scales with the magnitude of |Z|, capped at a chosen max strength. Stronger deviations towards +4 produce more opaque red fills.
If the Z score is negative, the lower band fill turns green with the same adaptive alpha logic, highlighting deep negative deviations.
Opposite side bands remain a faint neutral white when not in use, so they still provide structural context without shouting.
This creates a visual "danger zone" for position crowding. When the Z score enters these outer bands, open interest is many standard deviations away from its mean and you are dealing with rare but highly loaded positioning states.
Z score as a positioning pressure gauge
Because this is a Z score of aggregated open interest, it measures how unusual current positioning is relative to its own recent history, not just whether OI is rising or falling:
Z near zero means total OI is roughly in line with normal conditions for your lookback window.
Positive Z means OI is above its recent mean. The further above zero, the more "crowded" or extended positioning is.
Negative Z means OI is below its recent mean. Deep negatives often mark post flush environments where leverage has been cleared and the market is under positioned.
The smoothing options help control how much noise you want in the signal:
Short Z score lookback and short smoothing will react quickly, suited for short term traders watching intraday positioning shocks.
Longer Z score lookback with smoother MA types (EMA, RMA, T3) give a slower, more structural view of where the crowd sits over days to weeks.
Divergences between price and OI Z
The indicator includes automatic divergence detection on the Z score versus price, using pivot highs and lows:
You configure Pivot Lookback Left and Pivot Lookback Right to control swing sensitivity.
Pivots are detected on the OI Z series.
For each eligible pivot, the script compares OI Z and price at the last two pivots.
It looks for four patterns:
Regular Bullish – price makes a lower low, OI Z makes a higher low. This can indicate selling exhaustion in positioning even as price washes out. These are marked with a line and a label "ℝ" below the oscillator, in the bullish color.
Hidden Bullish – price makes a higher low, OI Z makes a lower low. This suggests continuation potential where price holds up while positioning resets. Marked with "ℍ" in the bullish color.
Regular Bearish – price makes a higher high, OI Z makes a lower high. This is a classic warning sign of trend exhaustion, where price pushes higher while OI Z fails to confirm. Marked with "ℝ" in the bearish color.
Hidden Bearish – price makes a lower high, OI Z makes a higher high. This is often seen in pullbacks within downtrends, where price retraces but positioning stretches again in the direction of the prevailing move. Marked with "ℍ" in the bearish color.
Each divergence type can be toggled globally via Show Detected Divergences . Internally, the script restricts how far back it will connect pivots, so you do not get stray signals linking very old structures to current bars.
Trading applications
Crowding and squeeze risk
Z scores are a natural way to talk about crowding:
High positive Z in aggregated OI means the market is running high leverage compared to its own norm. If price is also extended, the risk of a squeeze or sharp unwind rises.
Deep negative Z means leverage has been cleaned out. While it can be painful to sit through, this environment often sets up cleaner new trends, since there is less one sided positioning to unwind.
The extreme bands at ±3 to ±4 highlight the rare states where crowding is most intense. You can treat these events as regime markers rather than day to day noise.
Trend confirmation and fade selection
Combine Z score with price and trend:
Bull trends with positive and rising Z are supported by fresh leverage, usually more persistent.
Bull trends with flat or falling Z while price keeps grinding up can be more fragile. Divergences and extreme bands can help identify which edges you do not want to fade and which you might.
In downtrends, deep negative Z that stays pinned can mean persistent de risking. Once the Z score starts to mean revert back toward zero, it can mark the early stages of stabilization.
Event and liquidation context
Around major events, you often see:
Rapid spikes in Z as traders rush to position.
Reversal and overshoot as liquidations and forced de risking clear the book.
A move from positive extremes through zero into negative extremes as the market transitions from crowded to under exposed.
The Z score makes that path obvious, especially in oscillator mode, where you see a block of high positive bars before the crash, then a slab of deep negative bars after the flush.
Settings overview
Z Score group
Plotting Type – None, Line, Colored Line, Oscillator.
Z Score Lookback Period – window used for mean and standard deviation on aggregated OI.
Smoothing Type – SMA, HMA, EMA, WMA, DEMA, RMA, linear regression, ALMA, TEMA or T3.
Smoothing Period – length for the selected moving average on the raw Z score.
Moving Average group
Show EMA – toggle EMA overlay on Z score.
EMA Period – EMA length for the signal line.
EMA Color – color of the EMA line.
Thresholds and Reference Lines group
Select Reference Lines – None, Standard Deviation Levels, Extreme Bands.
Standard deviation lines at 0, ±1, ±2 appear in both modes.
Extreme bands add filled zones at ±3 to ±4 with adaptive opacity tied to |Z|.
Extra Plotting and UI
Base Line Color – default color for the simple line mode.
Line Width – thickness of the oscillator line.
Positive Color – positive or bullish condition color.
Negative Color – negative or bearish condition color.
Divergences group
Show Detected Divergences – master toggle for divergence plotting.
Pivot Lookback Left and Pivot Lookback Right – how many bars left and right to define a pivot, controlling divergence sensitivity.
Open Interest Source group
OI Units – COIN or USD.
Exchange toggles for Binance, Bybit, OKX, Bitget, Kraken, HTX, Deribit.
Internally, all enabled exchanges and contract suffixes are aggregated into one synthetic OI series.
Alerts included
The indicator defines alert conditions for several key events:
OI Z Score Positive – Z crosses above zero, aggregated OI moves from below mean to above mean.
OI Z Score Negative – Z crosses below zero, aggregated OI moves from above mean to below mean.
OI Z Score Enters +2σ – Z enters the +2 band and above, marking extended positive positioning.
OI Z Score Enters −2σ – Z enters the −2 band and below, marking extended negative positioning.
Tie these into your strategy to be notified when leverage moves from normal to extended states.
Notes
This indicator does not rely on price based oscillators. It is a statistical lens on cross venue open interest, which makes it a complementary tool rather than a replacement for your existing price or volume signals. Use it to:
Quantify how unusual current futures positioning is compared to recent history.
Identify crowded leverage phases that can fuel squeezes.
Spot structural divergences between price and positioning.
Frame risk and opportunity around events and regime shifts.
It is not a complete trading system. Combine it with your own entries, exits and risk rules to get the most out of what the Z score is telling you about positioning pressure under the hood of the market.
machine_learningLibrary "machine_learning"
euclidean(a, b)
Parameters:
a (array)
b (array)
manhattan(a, b)
Parameters:
a (array)
b (array)
cosine_similarity(a, b)
Parameters:
a (array)
b (array)
cosine_distance(a, b)
Parameters:
a (array)
b (array)
chebyshev(a, b)
Parameters:
a (array)
b (array)
minkowski(a, b, p)
Parameters:
a (array)
b (array)
p (float)
dot_product(a, b)
Parameters:
a (array)
b (array)
vector_norm(arr, p)
Parameters:
arr (array)
p (float)
sigmoid(x)
Parameters:
x (float)
sigmoid_derivative(x)
Parameters:
x (float)
tanh_derivative(x)
Parameters:
x (float)
relu(x)
Parameters:
x (float)
relu_derivative(x)
Parameters:
x (float)
leaky_relu(x, alpha)
Parameters:
x (float)
alpha (float)
leaky_relu_derivative(x, alpha)
Parameters:
x (float)
alpha (float)
elu(x, alpha)
Parameters:
x (float)
alpha (float)
gelu(x)
Parameters:
x (float)
swish(x, beta)
Parameters:
x (float)
beta (float)
softmax(arr)
Parameters:
arr (array)
apply_activation(arr, activation_type, alpha)
Parameters:
arr (array)
activation_type (string)
alpha (float)
normalize_minmax(arr, min_val, max_val)
Parameters:
arr (array)
min_val (float)
max_val (float)
normalize_zscore(arr, mean_val, std_val)
Parameters:
arr (array)
mean_val (float)
std_val (float)
normalize_matrix_cols(m)
Parameters:
m (matrix)
scaler_fit(arr, method)
Parameters:
arr (array)
method (string)
scaler_fit_matrix(m, method)
Parameters:
m (matrix)
method (string)
scaler_transform(scaler, arr)
Parameters:
scaler (ml_scaler)
arr (array)
scaler_transform_matrix(scaler, m)
Parameters:
scaler (ml_scaler)
m (matrix)
clip(x, lo, hi)
Parameters:
x (float)
lo (float)
hi (float)
clip_array(arr, lo, hi)
Parameters:
arr (array)
lo (float)
hi (float)
loss_mse(predicted, actual)
Parameters:
predicted (array)
actual (array)
loss_rmse(predicted, actual)
Parameters:
predicted (array)
actual (array)
loss_mae(predicted, actual)
Parameters:
predicted (array)
actual (array)
loss_binary_crossentropy(predicted, actual)
Parameters:
predicted (array)
actual (array)
loss_huber(predicted, actual, delta)
Parameters:
predicted (array)
actual (array)
delta (float)
gradient_step(weights, gradients, lr)
Parameters:
weights (array)
gradients (array)
lr (float)
adam_step(weights, gradients, m, v, lr, beta1, beta2, t, epsilon)
Parameters:
weights (array)
gradients (array)
m (array)
v (array)
lr (float)
beta1 (float)
beta2 (float)
t (int)
epsilon (float)
clip_gradients(gradients, max_norm)
Parameters:
gradients (array)
max_norm (float)
lr_decay(initial_lr, decay_rate, step)
Parameters:
initial_lr (float)
decay_rate (float)
step (int)
lr_cosine_annealing(initial_lr, min_lr, step, total_steps)
Parameters:
initial_lr (float)
min_lr (float)
step (int)
total_steps (int)
knn_create(k, distance_type)
Parameters:
k (int)
distance_type (string)
knn_fit(model, X, y)
Parameters:
model (ml_knn)
X (matrix)
y (array)
knn_predict(model, x)
Parameters:
model (ml_knn)
x (array)
knn_predict_proba(model, x)
Parameters:
model (ml_knn)
x (array)
knn_batch_predict(model, X)
Parameters:
model (ml_knn)
X (matrix)
linreg_fit(X, y)
Parameters:
X (matrix)
y (array)
ridge_fit(X, y, lambda)
Parameters:
X (matrix)
y (array)
lambda (float)
linreg_predict(model, x)
Parameters:
model (ml_linreg)
x (array)
linreg_predict_batch(model, X)
Parameters:
model (ml_linreg)
X (matrix)
linreg_score(model, X, y)
Parameters:
model (ml_linreg)
X (matrix)
y (array)
logreg_create(n_features, learning_rate, iterations)
Parameters:
n_features (int)
learning_rate (float)
iterations (int)
logreg_fit(model, X, y)
Parameters:
model (ml_logreg)
X (matrix)
y (array)
logreg_predict_proba(model, x)
Parameters:
model (ml_logreg)
x (array)
logreg_predict(model, x, threshold)
Parameters:
model (ml_logreg)
x (array)
threshold (float)
logreg_batch_predict(model, X, threshold)
Parameters:
model (ml_logreg)
X (matrix)
threshold (float)
nb_create(n_classes)
Parameters:
n_classes (int)
nb_fit(model, X, y)
Parameters:
model (ml_nb)
X (matrix)
y (array)
nb_predict_proba(model, x)
Parameters:
model (ml_nb)
x (array)
nb_predict(model, x)
Parameters:
model (ml_nb)
x (array)
nn_create(layers, activation)
Parameters:
layers (array)
activation (string)
nn_forward(model, x)
Parameters:
model (ml_nn)
x (array)
nn_predict_class(model, x)
Parameters:
model (ml_nn)
x (array)
accuracy(y_true, y_pred)
Parameters:
y_true (array)
y_pred (array)
precision(y_true, y_pred, positive_class)
Parameters:
y_true (array)
y_pred (array)
positive_class (int)
recall(y_true, y_pred, positive_class)
Parameters:
y_true (array)
y_pred (array)
positive_class (int)
f1_score(y_true, y_pred, positive_class)
Parameters:
y_true (array)
y_pred (array)
positive_class (int)
r_squared(y_true, y_pred)
Parameters:
y_true (array)
y_pred (array)
mse(y_true, y_pred)
Parameters:
y_true (array)
y_pred (array)
rmse(y_true, y_pred)
Parameters:
y_true (array)
y_pred (array)
mae(y_true, y_pred)
Parameters:
y_true (array)
y_pred (array)
confusion_matrix(y_true, y_pred, n_classes)
Parameters:
y_true (array)
y_pred (array)
n_classes (int)
sliding_window(data, window_size)
Parameters:
data (array)
window_size (int)
train_test_split(X, y, test_ratio)
Parameters:
X (matrix)
y (array)
test_ratio (float)
create_binary_labels(data, threshold)
Parameters:
data (array)
threshold (float)
lag_matrix(data, n_lags)
Parameters:
data (array)
n_lags (int)
signal_to_position(prediction, threshold_long, threshold_short)
Parameters:
prediction (float)
threshold_long (float)
threshold_short (float)
confidence_sizing(probability, max_size, min_confidence)
Parameters:
probability (float)
max_size (float)
min_confidence (float)
kelly_sizing(win_rate, avg_win, avg_loss, max_fraction)
Parameters:
win_rate (float)
avg_win (float)
avg_loss (float)
max_fraction (float)
sharpe_ratio(returns, risk_free_rate)
Parameters:
returns (array)
risk_free_rate (float)
sortino_ratio(returns, risk_free_rate)
Parameters:
returns (array)
risk_free_rate (float)
max_drawdown(equity)
Parameters:
equity (array)
atr_stop_loss(entry_price, atr, multiplier, is_long)
Parameters:
entry_price (float)
atr (float)
multiplier (float)
is_long (bool)
risk_reward_take_profit(entry_price, stop_loss, ratio)
Parameters:
entry_price (float)
stop_loss (float)
ratio (float)
ensemble_vote(predictions)
Parameters:
predictions (array)
ensemble_weighted_average(predictions, weights)
Parameters:
predictions (array)
weights (array)
smooth_prediction(current, previous, alpha)
Parameters:
current (float)
previous (float)
alpha (float)
regime_classifier(volatility, trend_strength, vol_threshold, trend_threshold)
Parameters:
volatility (float)
trend_strength (float)
vol_threshold (float)
trend_threshold (float)
ml_knn
Fields:
k (series int)
distance_type (series string)
X_train (matrix)
y_train (array)
ml_linreg
Fields:
coefficients (array)
intercept (series float)
lambda (series float)
ml_logreg
Fields:
weights (array)
bias (series float)
learning_rate (series float)
iterations (series int)
ml_nn
Fields:
layers (array)
weights (matrix)
biases (array)
weight_offsets (array)
bias_offsets (array)
activation (series string)
ml_nb
Fields:
class_priors (array)
means (matrix)
variances (matrix)
n_classes (series int)
ml_scaler
Fields:
min_vals (array)
max_vals (array)
means (array)
stds (array)
method (series string)
ml_train_result
Fields:
loss_history (array)
final_loss (series float)
converged (series bool)
iterations_run (series int)
ml_prediction
Fields:
class_label (series int)
probability (series float)
probabilities (array)
value (series float)






















