Market ProfileHello All,
This is Market Profile script. "Market Profile is an intra-day charting technique (price vertical, time/activity horizontal) devised by J. Peter Steidlmayer. Steidlmayer was seeking a way to determine and to evaluate market value as it developed in the day time frame. The concept was to display price on a vertical axis against time on the horizontal, and the ensuing graphic generally is a bell shape--fatter at the middle prices, with activity trailing off and volume diminished at the extreme higher and lower prices." You better search it on the net for more information, you can find a lot of articles and books about the Market Profile.
You have option to see Value Area, All Channels or only POC line, you can set the colors as you wish.
Also you can choose the Higher Time Frame from the list or the script can choose the HTF for you automatically.
Enjoy!
Recherche dans les scripts pour "daily"
Pivot Fibonacci TradingWe use fibonacci in many things, why not the Pivot? Hey, it does works, price does reacts to the fibonacci off the pivot.
Pivots are road map for the price, fibonacci are just some stops or gas stations appear on the road, with these additional lines, there's more time for price to think about which way it'd move, therefore, more time for us traders to track and follow.
I know they usually use Daily pivot in H1, Weekly in H4 and Monthly in Daily timeframe, but since there are more lines now, price now needs space to travel between line. I recommend using Weekly Pivot for intraday(H1,...), Monthly for H4 and Yearly for Daily.
I also add some text that shows current day's range in pips (High - Low = range) and compare it to Average Daily Range. I thinks this is helpful if you use it for day trading.
I'll let this as a open sources as you may find something to customize in your own way.
Hope this helps you in someway, community :)
Happy trading!
#Thanks to @Davit on forexfactory for the idea
Realized VolatilityRealized / Historical Volatility
Calculates historical, i.e. realized volatility of any underlying. If frequency is not the daily, but for example 6h, 30min, weeks or months, it scales the initial setting to be suitable for the different time frame.
Examples with default settings (30 day volatility, 365 days per year):
A) Frequency = Daily:
Returns 30 day historical volatility, under the assumption that there are 365 trading days in a year.
B) Frequency = 6h:
Still returns 30 day historical volatility, under the assumption that there are 365 trading days in a year. However, since 6h granularity fits 4 times in 24 hours, it rescales the look back period to rather 30*4 = 120 units to still reflect 30 day historical volatility.
10/20 MA Cross-Over with Heikin-Ashi Signals by SchobbejakThe 10/20 MA Heikin-Ashi Strategy is the best I know. It's easy, it's elegant, it's effective.
It's particularly effective in markets that trend on the daily. You may lose some money when markets are choppy, but your loss will be more than compensated when you're aboard during the big moves at the beginning of a trend or after retraces. There's that, and you nearly eliminate the risk of losing your profit in the long run.
The results are good throughout most assets, and at their best when an asset is making new all-time highs.
It uses two simple moving averages: the 10 MA (blue), and the 20 MA (red), together with heikin-ashi candles. Now here's the great thing. This script does not change your regular candles into heikin-ashi ones, which would have been annoying; instead, it subtly prints either a blue dot or a red square around your normal candles, indicating a heikin-ashi change from red to green, or from green to red, respectively. This way, you get both regular and heikin ashi "candles" on your chart.
Here's how to use it.
Go LONG in case of ALL of the below:
1) A blue dot appeared under the last daily candle (meaning the heikin-ashi is now "green").
2) The blue MA-line is above the red MA-line.
3) Price has recently breached the blue MA-line upwards, and is now above.
COVER when one or more of the above is no longer the case. This is very important. You want to keep your profit.
Go SHORT in case of ALL of the below:
1) A red square appeared above the last daily candle (meaning the heikin-ashi is now "red").
2) The red MA-line is above the blue MA-line.
3) Price has recently breached the blue MA-line downwards, and is now below.
Again, COVER when one or more of the above is no longer the case. This is what gives you your edge.
It's that easy.
Now, why did I make the signal blue, and not green? Because blue looks much better with red than green does. It's my firm believe one does not become rich using ugly charts.
Good luck trading.
--You may tip me using bitcoin: bc1q9pc95v4kxh6rdxl737jg0j02dcxu23n5z78hq9 . Much appreciated!--
15-Minute ORB Breakout Strategy with VWAP and Volume Filters# 15-Minute ORB Breakout Strategy with VWAP and Volume Filters
## Overview
This strategy implements the 15-minute Opening Range Breakout (ORB) methodology for NASDAQ futures, enhanced with session-anchored VWAP, volume confirmation, and candle strength analysis. The ORB approach waits for the first 15 minutes of the trading session to establish a range, then trades breakouts with defined risk management.
This implementation is based on rules described in a YouTube tutorial by Bull Barbie: www.youtube.com
The strategy was systematically coded and backtested to evaluate performance over an extended period.
**Backtest Disclosure:** Over 1,354 trades from 2010-2026, this systematic implementation produced negative returns. Discretionary traders may achieve different results through real-time adjustments not captured in systematic rules.
---
## How It Works
### Opening Range Calculation
The strategy identifies the high and low of the first 15 minutes after the New York open (first 3 candles on a 5-minute chart). These levels become the breakout triggers for the session.
### Entry Logic
- **Long Entry:** Price closes above the ORB High while meeting all filter conditions
- **Short Entry:** Price closes below the ORB Low while meeting all filter conditions
### Exit Logic
- **Take Profit:** 1x the ORB range beyond the breakout level (approximately 1:1 risk-reward)
- **Stop Loss:** Opposite side of the ORB range
- **Breakeven:** Stop moves to entry when price reaches 50% of the take profit distance
- **Session Close:** All positions closed at end of trading session
### Filters
All filters are toggleable:
1. **Session VWAP Filter:** Price must be above VWAP with upward slope for longs (below with downward slope for shorts). VWAP is anchored to session open and resets daily.
2. **Volume Filter:** Breakout bar must exceed minimum volume threshold (default: 2,500 contracts) to confirm participation.
3. **Candle Strength Filter:** Close must be in the top 30% of the bar range for longs (bottom 30% for shorts), indicating conviction rather than absorption.
---
## Backtest Results
**Instrument:** MNQ (Micro NASDAQ)
**Timeframe:** 5-minute
**Period:** 2010-2026
**Session:** 09:30 - 12:00 ET (Morning)
| Metric | Value |
|--------|-------|
| Total Trades | 1,354 |
| Win Rate | 50.07% |
| Profit Factor | 0.833 |
| Net P&L | -$11,916 (-23.83%) |
| Max Drawdown | $13,119 (26.21%) |
| Avg Win | +0.30% |
| Avg Loss | -0.37% |
| Expected Payoff | -$8.80/trade |
| Long Win Rate | 52.25% (360/689) |
| Short Win Rate | 47.82% (318/665) |
---
## Strategy Properties
These settings match the published backtest:
| Property | Value |
|----------|-------|
| Initial Capital | $50,000 USD |
| Position Size | 1 contract (fixed) |
| Commission | $4.00 per contract (round-trip) |
| Slippage | 2 ticks |
| Margin | 1% (NinjaTrader intraday reference) |
| Pyramiding | Disabled |
**Instrument Note:** MNQ (Micro NASDAQ) was selected because realistic account sizes ($25,000-$50,000) face margin constraints with full NQ contracts during drawdown periods.
---
## Settings Guide
### Main Settings
- **ORB Bars:** Number of bars defining the opening range (3 = 15 minutes on 5-min chart)
- **Trading Session:** Time window for trading (tested: 0930-1200 ET)
- **Take Profit:** Multiple of ORB range for target (1.0 = full range)
- **Breakeven Trigger:** Distance to move stop to entry (0.5 = halfway to TP)
- **Max Trades Per Day:** Daily trade limit (default: 2)
### VWAP Filter
- **Use VWAP Filter:** Enable/disable session VWAP confirmation
- **VWAP Slope Lookback:** Bars to measure VWAP direction (default: 5)
- **Min VWAP Slope:** Minimum slope in points (default: 0.5)
### Volume Filter
- **Use Volume Filter:** Enable/disable volume confirmation
- **Min Breakout Volume:** Minimum contracts required (default: 2,500)
### Candle Strength
- **Use Candle Strength Filter:** Enable/disable close position analysis
- **Min Candle Strength:** Required close position within bar (0.7 = top/bottom 30%)
---
## Visual Elements
- **Orange Background:** ORB forming period (first 15 minutes)
- **Green Background:** Active trading session
- **Green/Red Lines:** ORB High and Low levels
- **VWAP Line:** Color indicates slope direction (green=up, red=down, gray=flat)
- **White Line:** Trade entry price
- **Lime/Red Lines:** Take profit and stop loss levels
- **Orange Line:** Breakeven trigger level
- **Blue Background:** Breakeven activated
- **Triangle Markers:** Candle strength indicators
---
## How to Use
1. Apply to MNQ or NQ on a 5-minute chart
2. Wait for the ORB forming period (orange background) to complete
3. Monitor breakouts above/below ORB levels
4. Check VWAP color for trend alignment
5. Strategy enters automatically when conditions align
---
## Limitations
1. **Systematic vs. Discretionary:** This backtest captures only the mechanical rules. Experienced traders may apply real-time judgment (reading price action, avoiding certain setups, scaling in/out) that improves results but cannot be systematically coded.
2. **Average Loss Exceeds Average Win:** The 0.37% average loss versus 0.30% average win creates negative expectancy even with ~50% win rate.
3. **Commission Impact:** $10,832 in commissions over the test period affects net returns.
4. **Market Regime Variation:** The equity curve shows profitable periods (2023-2025) alongside extended drawdowns, suggesting regime-dependent performance.
5. **Sample Considerations:** While 1,354 trades provides statistical significance, results may vary across different time periods or market conditions.
---
## Research Notes
This strategy was built following rules from Bull Barbie's ORB tutorial video. The systematic backtest could not reproduce the performance figures mentioned in that content. This does not mean the approach is without merit—discretionary execution, trade selection, and real-time adjustments likely play significant roles that systematic backtesting cannot capture.
Traders interested in ORB strategies should consider this as a starting framework for their own research and optimization.
---
## Reference
Original strategy concept: Bull Barbie - "Battle-Tested 15-Minute ORB Trading Strategy for Nasdaq—Rules That Actually Work"
www.youtube.com
Eclipse Multi-Oscillator [JOAT]Eclipse Multi-Oscillator - Unified Momentum Confluence System
Introduction and Purpose
Eclipse Multi-Oscillator is an open-source indicator that combines four classic oscillators (RSI, Stochastic, CCI, and Williams %R) into a single unified view with confluence detection. The core problem this indicator solves is oscillator disagreement: traders often see RSI oversold while Stochastic is neutral, or CCI overbought while Williams %R is mid-range. This creates confusion about the true momentum state.
This indicator addresses that by displaying all four oscillators together and counting how many agree on overbought or oversold conditions, providing a clear confluence score that cuts through the noise.
Why These Four Oscillators Work Together
Each oscillator measures momentum differently, and their combination provides a more complete picture:
1. RSI (Relative Strength Index) - Measures the magnitude of recent price changes. Best at identifying momentum exhaustion.
2. Stochastic - Compares closing price to the high-low range. Best at identifying where price is within its recent range.
3. CCI (Commodity Channel Index) - Measures price deviation from statistical mean. Best at identifying unusual price movements.
4. Williams %R - Similar to Stochastic but inverted. Provides confirmation of Stochastic readings.
When 3 or more of these oscillators agree on overbought or oversold, the signal is significantly more reliable than any single oscillator alone.
How Confluence Scoring Works
The indicator counts how many oscillators are in extreme territory:
int obCount = 0
if rsi > rsiOB
obCount += 1
if stochK > stochOB
obCount += 1
if cci > cciOB
obCount += 1
if willRScaled > stochOB
obCount += 1
bool strongOverbought = obCount >= 3
bool strongOversold = osCount >= 3
The confluence score ranges from -4 (all oversold) to +4 (all overbought), with 0 being neutral.
Signal Types
Strong Oversold - 3+ oscillators below oversold threshold (potential bounce)
Strong Overbought - 3+ oscillators above overbought threshold (potential pullback)
OB/OS Exit - RSI leaving extreme zone with Stochastic confirmation (potential reversal)
Divergence - Price makes new high/low while RSI does not (potential reversal warning)
Dashboard Information
RSI/Stoch K/CCI/Will %R - Current values with zone status (OB/OS/MID)
Confluence - Overall bias (STRONG OS, STRONG OB, Lean Bull/Bear, Neutral)
OB Count - How many oscillators are overbought (0-4)
OS Count - How many oscillators are oversold (0-4)
How to Use This Indicator
For Reversal Trading:
1. Wait for Strong Oversold (3+ oscillators agree)
2. Look for bullish candlestick pattern or support level
3. Enter long with stop below recent low
4. Take profit when confluence returns to neutral or overbought
For Trend Confirmation:
1. Check confluence direction matches your trade bias
2. Avoid longs when confluence is strongly overbought
3. Avoid shorts when confluence is strongly oversold
For Divergence Trading:
1. Watch for "D" labels indicating RSI divergence
2. Bullish divergence at support = potential long
3. Bearish divergence at resistance = potential short
Input Parameters
RSI Length (14) - Period for RSI calculation
Stochastic K/D Length (14/3) - Periods for Stochastic
CCI Length (20) - Period for CCI
Williams %R Length (14) - Period for Williams %R
OB/OS Thresholds - Customizable levels for each oscillator
Timeframe Recommendations
15m-1H: Good for intraday momentum analysis
4H-Daily: Best for swing trading confluence
Very short timeframes may produce noisy signals
Limitations
All oscillators can remain in extreme territory during strong trends
Confluence does not predict direction, only identifies extremes
Divergence detection is simplified and may miss some patterns
Works best in ranging or moderately trending markets
Open-Source and Disclaimer
This script is published as open-source under the Mozilla Public License 2.0 for educational purposes. The source code is fully visible and can be studied.
This indicator does not constitute financial advice. Oscillator confluence does not guarantee reversals. Past performance does not guarantee future results. Always use proper risk management.
- Made with passion by officialjackofalltrades
Aurora Volatility Bands [JOAT]Aurora Volatility Bands - Dynamic ATR-Based Envelope System
Introduction and Purpose
Aurora Volatility Bands is an open-source overlay indicator that creates multi-layered volatility envelopes around price using ATR (Average True Range) calculations. The core problem this indicator solves is that static bands (like fixed percentage envelopes) fail to adapt to changing market conditions. During high volatility, static bands are too tight; during low volatility, they're too wide.
This indicator addresses that by using ATR-based dynamic bands that automatically expand during volatile periods and contract during quiet periods, providing contextually appropriate support/resistance levels at all times.
Why These Components Work Together
The indicator combines three analytical approaches:
1. Triple-Layer Band System - Inner (1x ATR), Outer (2x ATR), and Extreme (3x ATR) bands provide graduated levels of significance
2. Volatility State Detection - Compares current ATR to historical average to classify market regime
3. Multiple MA Types - Allows customization of the center line calculation method
These components complement each other:
The triple-layer system gives traders multiple reference points - inner bands for normal moves, outer for significant moves, extreme for rare events
Volatility state detection tells you WHEN bands are expanding or contracting, helping anticipate breakouts or mean-reversion
MA type selection lets you match the indicator to your trading style (faster EMA vs smoother SMA)
How the Calculation Works
The bands are calculated using ATR multiplied by configurable factors:
float atr = ta.atr(atrPeriod)
float innerUpper = centerMA + (atr * innerMult)
float outerUpper = centerMA + (atr * outerMult)
float extremeUpper = centerMA + (atr * extremeMult)
Volatility state is determined by comparing current ATR percentage to its historical average:
float atrPercent = (atr / close) * 100
float avgAtrPercent = ta.sma(atrPercent, volatilityLookback)
float volatilityRatio = atrPercent / avgAtrPercent
bool isExpanding = volatilityRatio > 1.2 // 20%+ above average
bool isContracting = volatilityRatio < 0.8 // 20%+ below average
Signal Types
Band Touch - Price reaches inner, outer, or extreme bands
Mean Reversion - Price returns to center after touching outer/extreme bands
Breakout - Sustained move beyond outer bands during volatility expansion
Dashboard Information
Volatility - Current state (EXPANDING/CONTRACTING/NORMAL)
Vol Ratio - Current volatility vs average (e.g., 1.5x = 50% above average)
ATR - Current ATR value
ATR % - ATR as percentage of price
Zone - Current price position (EXTREME HIGH/UPPER ZONE/CENTER ZONE/etc.)
Position - Price position as percentage within band structure
Width - Total band width as percentage of price
Using SMA in settings:
How to Use This Indicator
For Mean-Reversion Trading:
1. Wait for price to touch outer or extreme bands
2. Check that volatility state is NORMAL or CONTRACTING (not expanding)
3. Look for reversal candlestick patterns at the band
4. Enter toward center MA with stop beyond the band
For Breakout Trading:
1. Wait for volatility state to show EXPANDING
2. Look for price closing beyond outer bands
3. Enter in direction of breakout
4. Use the band as trailing stop reference
For Volatility Analysis:
1. Monitor volatility ratio for regime changes
2. CONTRACTING often precedes large moves (squeeze)
3. EXPANDING confirms trend strength
Using VWMA and Mean Reversion Signal/MR:
Input Parameters
ATR Period (14) - Period for ATR calculation
Inner/Outer/Extreme Multipliers (1.0/2.0/3.0) - Band distance from center
MA Type (EMA) - Center line calculation method
MA Period (20) - Period for center line
Volatility Comparison Period (20) - Lookback for volatility state
Timeframe Recommendations
15m-1H: Good for intraday mean-reversion
4H-Daily: Best for swing trading and breakout identification
Weekly: Useful for position trading and major level identification
Limitations
ATR-based bands lag during sudden volatility spikes
Mean-reversion signals can fail in strong trends
Breakout signals may whipsaw in ranging markets
Works best on liquid instruments with consistent volatility patterns
Open-Source and Disclaimer
This script is published as open-source under the Mozilla Public License 2.0 for educational purposes. The source code is fully visible and can be studied to understand how each component works.
This indicator does not constitute financial advice. Band touches do not guarantee reversals. Past performance does not guarantee future results. Always use proper risk management, position sizing, and stop-losses.
- Made with passion by officialjackofalltrades
Final Project Midpoint Package (4H / D / W) Layer 1This script runs based off of the higher timeframe candlesticks. (4HR and Daily)
This strategy is simple and is based on your logic as well. I personally use all 5 strategies on one chart however those are being tested. As soon as you get it you will see allot on the screen , just open the setting and turn off the extra bands from the 4HR and the Daily. Fix your settings however you seem fit . Once the others are finished testing i will release those also. Will be adding updates as it progresses.
Quantum Reversal Detector [JOAT]
Quantum Reversal Detector - Multi-Factor Reversal Probability Analysis
Introduction and Purpose
Quantum Reversal Detector is an open-source overlay indicator that combines multiple reversal detection methods into a unified probability-based framework. The core problem this indicator addresses is the unreliability of single-factor reversal signals. A price touching support means nothing without momentum confirmation; an RSI oversold reading means nothing without price structure context.
This indicator solves that by requiring multiple independent factors to align before generating reversal signals, then expressing the result as a probability score rather than a binary signal.
Why These Components Work Together
The indicator combines five analytical approaches, each addressing a different aspect of reversal detection:
1. RSI Extremes - Identifies momentum exhaustion (overbought/oversold)
2. MACD Crossovers - Confirms momentum direction change
3. Support/Resistance Proximity - Ensures price is at a significant level
4. Multi-Depth Momentum - Analyzes momentum across multiple timeframes
5. Statistical Probability - Quantifies reversal likelihood using Bayesian updating
These components are not randomly combined. Each filter catches reversals that others miss:
RSI catches momentum exhaustion but misses structural reversals
MACD catches momentum shifts but lags price action
S/R proximity catches structural levels but ignores momentum
Multi-depth momentum catches divergences across timeframes
Probability scoring combines all factors into actionable confidence levels
How the Detection System Works
Step 1: Pattern Detection
The indicator first identifies potential reversal conditions:
// Check if price is at support/resistance
float lowestLow = ta.lowest(low, period)
float highestHigh = ta.highest(high, period)
bool atSupport = low <= lowestLow * 1.002
bool atResistance = high >= highestHigh * 0.998
// Check RSI conditions
float rsi = ta.rsi(close, 14)
bool oversold = rsi < 30
bool overbought = rsi > 70
// Check MACD crossover
float macd = ta.ema(close, 12) - ta.ema(close, 26)
float signal = ta.ema(macd, 9)
bool macdBullish = ta.crossover(macd, signal)
bool macdBearish = ta.crossunder(macd, signal)
// Combine for reversal detection
if atSupport and oversold and macdBullish
bullishReversal := true
Step 2: Multi-Depth Momentum Analysis
The indicator calculates momentum across multiple periods to detect divergences:
calculateQuantumMomentum(series float price, simple int period, simple int depth) =>
float totalMomentum = 0.0
for i = 0 to depth - 1
int currentPeriod = period * (i + 1)
float momentum = ta.roc(price, currentPeriod)
totalMomentum += momentum
totalMomentum / depth
This creates a composite momentum reading that smooths out noise while preserving genuine momentum shifts.
Step 3: Bayesian Probability Calculation
The indicator uses Bayesian updating to calculate reversal probability:
bayesianProbability(series float priorProb, series float likelihood, series float evidence) =>
float posterior = evidence > 0 ? (likelihood * priorProb) / evidence : priorProb
math.min(math.max(posterior, 0.0), 1.0)
The prior probability starts at 50% and updates based on:
RSI extreme readings increase likelihood
MACD crossovers increase likelihood
S/R proximity increases likelihood
Momentum divergence increases likelihood
Step 4: Confidence Intervals
Using Monte Carlo simulation concepts, the indicator estimates price distribution:
monteCarloSimulation(series float price, series float volatility, simple int iterations) =>
float sumPrice = 0.0
float sumSqDiff = 0.0
for i = 0 to iterations - 1
float randomFactor = (i % 10 - 5) / 10.0
float simulatedPrice = price + volatility * randomFactor
sumPrice += simulatedPrice
float avgPrice = sumPrice / iterations
// Calculate standard deviation for confidence intervals
This provides 95% and 99% confidence bands around the current price.
Signal Classification
Signals are classified by confirmation level:
Confirmed Reversal : Pattern detected for N consecutive bars (default 3)
High Probability : Confirmed + Bayesian probability > 70%
Ultra High Probability : High probability + PDF above average
Dashboard Information
The dashboard displays:
Bayesian Probability - Updated reversal probability (0-100%)
Quantum Momentum - Multi-depth momentum average
RSI - Current RSI value with overbought/oversold status
Volatility - Current ATR as percentage of price
Reversal Signal - BULLISH, BEARISH, or NONE
Divergence - Momentum divergence detection
MACD - Current MACD histogram value
S/R Zone - AT SUPPORT, AT RESISTANCE, or NEUTRAL
95% Confidence - Price range with 95% probability
Bull/Bear Targets - ATR-based reversal targets
Visual Elements
Quantum Bands - ATR-based upper and lower channels
Probability Field - Circle layers showing probability distribution
Confidence Bands - 95% and 99% confidence interval circles
Reversal Labels - REV markers at confirmed reversals
High Probability Markers - Star diamonds at high probability setups
Reversal Zones - Boxes around confirmed reversal areas
Divergence Markers - Triangles at momentum divergences
How to Use This Indicator
For Reversal Trading:
1. Wait for Bayesian Probability to exceed 70%
2. Confirm price is at S/R zone (dashboard shows AT SUPPORT or AT RESISTANCE)
3. Check that RSI is in extreme territory (oversold for longs, overbought for shorts)
4. Enter when REV label appears with high probability marker
For Risk Management:
1. Use the 95% confidence band as a stop-loss reference
2. Use Bull/Bear Targets for take-profit levels
3. Higher probability readings warrant larger position sizes
For Filtering False Signals:
1. Increase Confirmation Bars to require more consecutive signals
2. Only trade when probability exceeds 70%
3. Require divergence confirmation for highest conviction
Input Parameters
Reversal Period (21) - Lookback for S/R and momentum calculations
Quantum Depth (5) - Number of momentum layers for multi-depth analysis
Confirmation Bars (3) - Consecutive bars required for confirmation
Detection Sensitivity (1.2) - Band width and target multiplier
Bayesian Probability (true) - Enable probability calculation
Monte Carlo Simulation (true) - Enable confidence interval calculation
Normal Distribution (true) - Enable PDF calculation
Confidence Intervals (true) - Enable confidence bands
Timeframe Recommendations
1H-4H: Best for swing trading reversals
Daily: Fewer but more significant reversal signals
15m-30m: More signals, requires higher probability threshold
Limitations
Statistical concepts are simplified implementations for Pine Script
Monte Carlo uses deterministic pseudo-random factors, not true randomness
Bayesian probability uses simplified prior/likelihood model
Reversal detection does not guarantee actual reversals will occur
Confirmation bars add lag to signal generation
Open-Source and Disclaimer
This script is published as open-source under the Mozilla Public License 2.0 for educational purposes. The source code is fully visible and can be studied to understand how each component works.
This indicator does not constitute financial advice. Reversal detection is probabilistic, not predictive. The probability scores represent statistical likelihood based on historical patterns, not guaranteed outcomes. Past performance does not guarantee future results. Always use proper risk management, position sizing, and stop-losses.
- Made with passion by officialjackofalltrades
Photon Price Action Scanner [JOAT]Photon Price Action Scanner - Multi-Pattern Recognition with Adaptive Filtering
Introduction and Purpose
Photon Price Action Scanner is an open-source overlay indicator that automates the detection of 15+ candlestick patterns while filtering them through multiple confirmation layers. The core problem this indicator solves is pattern noise: raw candlestick pattern detection produces too many signals, most of which fail because they lack context. This indicator addresses that by combining pattern recognition with trend alignment, volume-weighted strength scoring, velocity confirmation, and an adaptive neural bias filter.
The combination of these components is not arbitrary. Each filter addresses a specific weakness in standalone pattern detection:
Trend alignment ensures patterns appear in favorable market structure
Volume-weighted strength filters out weak patterns with low conviction
Velocity confirmation identifies momentum behind the pattern
Neural bias filter adapts to recent price behavior to avoid counter-trend signals
What Makes This Indicator Original
While candlestick pattern scanners exist, this indicator's originality comes from:
1. Multi-Layer Filtering System - Patterns must pass through trend, strength, velocity, and neural bias filters before generating signals. This dramatically reduces false positives compared to simple pattern detection.
2. Adaptive Neural Bias Filter - A custom momentum-adjusted EMA that learns from recent price action using a configurable learning rate. This is not a standard moving average but an adaptive filter that accelerates during trends and smooths during consolidation.
3. Pattern Strength Scoring - Each pattern receives a strength score based on volume ratio and body size, allowing traders to focus on high-conviction setups rather than every pattern occurrence.
4. Smart Cooldown System - Prevents signal overlap by enforcing minimum bar spacing between pattern labels, keeping charts clean even when "Show All Patterns" is enabled.
How the Components Work Together
Step 1: Pattern Detection
The indicator scans for 15 candlestick patterns using precise mathematical definitions:
// Example: Bullish Engulfing requires the current bullish candle to completely
// engulf the previous bearish candle with a larger body
isBullishEngulfing() =>
bool pattern = close < open and close > open and
open <= close and close >= open and
close - open > open - close
pattern
// Example: Three White Soldiers requires three consecutive bullish candles
// with each opening within the previous body and closing higher
isThreeWhiteSoldiers() =>
bool pattern = close > open and close > open and close > open and
close < close and close < close and
open > open and open < close and
open > open and open < close
pattern
Step 2: Strength Calculation
Each detected pattern receives a strength score combining volume and body size:
float volRatio = avgVolume > 0 ? volume / avgVolume : 1.0
float bodySize = math.abs(close - open) / close
float baseStrength = (volRatio + bodySize * 100) / 2
This ensures patterns with above-average volume and large bodies score higher than weak patterns on low volume.
Step 3: Trend Alignment
Patterns are checked against the trend direction using an EMA:
float trendEMA = ta.ema(close, i_trendPeriod)
int trendDir = close > trendEMA ? 1 : close < trendEMA ? -1 : 0
Bullish patterns in uptrends and bearish patterns in downtrends receive priority.
Step 4: Neural Bias Filter
The adaptive filter uses a momentum-adjusted EMA that responds to price changes:
neuralEMA(series float src, simple int period, simple float lr) =>
var float neuralValue = na
var float momentum = 0.0
if na(neuralValue)
neuralValue := src
float error = src - neuralValue
float adjustment = error * lr
momentum := momentum * 0.9 + adjustment * 0.1
neuralValue := neuralValue + adjustment + momentum
neuralValue
The learning rate (lr) controls how quickly the filter adapts. Higher values make it more responsive; lower values make it smoother.
Step 5: Velocity Confirmation
Price velocity (rate of change) must exceed the average velocity for strong signals:
float velocity = ta.roc(close, i_trendPeriod)
float avgVelocity = ta.sma(velocity, i_trendPeriod)
bool velocityBull = velocity > avgVelocity * 1.5
Step 6: Signal Classification
Signals are classified based on how many filters they pass:
Strong Pattern : Pattern + strength threshold + trend alignment + neural bias + velocity
Ultra Pattern : Strong pattern + gap in same direction + velocity confirmation
Watch Pattern : Pattern detected but not all filters passed
Detected Patterns
Classic Reversal Patterns:
Bullish/Bearish Engulfing - Complete body engulfment with larger body
Hammer - Long lower wick (2x body), small upper wick, bullish context
Shooting Star - Long upper wick (2x body), small lower wick, bearish context
Morning Star - Three-bar bullish reversal with small middle body
Evening Star - Three-bar bearish reversal with small middle body
Piercing Line - Bullish candle closing above midpoint of previous bearish candle
Dark Cloud Cover - Bearish candle closing below midpoint of previous bullish candle
Bullish/Bearish Harami - Small body contained within previous larger body
Doji - Body less than 10% of total range (indecision)
Advanced Patterns (Optional):
Three White Soldiers - Three consecutive bullish candles with rising closes
Three Black Crows - Three consecutive bearish candles with falling closes
Tweezer Top - Equal highs with reversal candle structure
Tweezer Bottom - Equal lows with reversal candle structure
Island Reversal - Gap isolation creating reversal structure
Dashboard Information
The dashboard displays real-time analysis:
Pattern - Current detected pattern name or "SCANNING..."
Bull/Bear Strength - Volume-weighted strength scores
Trend - UPTREND, DOWNTREND, or SIDEWAYS based on EMA
RSI - 14-period RSI for momentum context
Momentum - 10-period momentum reading
Volatility - ATR as percentage of price
Neural Bias - BULLISH, BEARISH, or NEUTRAL from adaptive filter
Action - ULTRA BUY/SELL, BUY/SELL, WATCH BUY/SELL, or WAIT
Visual Elements
Pattern Labels - Abbreviated codes (BE=Engulfing, H=Hammer, MS=Morning Star, etc.)
Neural Bias Line - Adaptive trend line showing filter direction
Gap Boxes - Cyan boxes highlighting price gaps
Action Zones - Dashed boxes around strong pattern areas
Velocity Markers - Small circles when velocity confirms direction
Ultra Signals - Large labels for highest conviction setups
How to Use This Indicator
For Reversal Trading:
1. Wait for a pattern to appear at a key support/resistance level
2. Check that the Action shows "BUY" or "SELL" (not just "WATCH")
3. Confirm the Neural Bias aligns with your trade direction
4. Use the strength score to gauge conviction (higher is better)
For Trend Continuation:
1. Identify the trend using the Trend row in the dashboard
2. Look for patterns that align with the trend (bullish patterns in uptrends)
3. Ultra signals indicate the strongest continuation setups
For Filtering Noise:
1. Keep "Show All Patterns" disabled to see only filtered signals
2. Increase "Pattern Strength Filter" to see fewer, higher-quality patterns
3. Enable "Velocity Confirmation" to require momentum behind patterns
Input Parameters
Scan Sensitivity (1.0) - Overall detection sensitivity multiplier
Pattern Strength Filter (3) - Minimum strength score for strong signals
Trend Period (20) - EMA period for trend determination
Show All Patterns (false) - Display all patterns regardless of filters
Advanced Patterns (true) - Enable soldiers/crows/tweezer detection
Gap Analysis (true) - Enable gap detection and boxes
Velocity Confirmation (true) - Require velocity for strong signals
Neural Bias Filter (true) - Enable adaptive trend filter
Neural Period (50) - Lookback for neural bias calculation
Neural Learning Rate (0.12) - Adaptation speed (0.01-0.5)
Timeframe Recommendations
1H-4H: Best balance of signal frequency and reliability
Daily: Fewer but more significant patterns
15m-30m: More signals, requires tighter filtering (increase strength threshold)
Limitations
Pattern detection is mechanical and does not consider fundamental context
Neural bias filter may lag during rapid trend reversals
Gap detection requires clean price data without after-hours gaps
Strength scoring favors high-volume patterns, which may miss valid low-volume setups
- Made with passion by officialjackofalltrades
Dual Account Position Size CalculatorA quick and easy to use position sizing calculator for use on the daily TF only. inputs for two different account sizes and risk %. Calculates risk to low of day (plus a small buffer which can be changed based on ATR). Shows # of shares to buy, stop loss, portfolio %.
Will show on smaller timeframes , but be aware that the stop level will no longer be low of day, so it will not calculate properly. Always use on the daily.
Bifurcation Early WarningBifurcation Early Warning (BEW) — Chaos Theory Regime Detection
OVERVIEW
The Bifurcation Early Warning indicator applies principles from chaos theory and complex systems research to detect when markets are approaching critical transition points — moments where the current regime is likely to break down and shift to a new state.
Unlike momentum or trend indicators that tell you what is happening, BEW tells you when something is about to change. It provides early warning of regime shifts before they occur, giving traders time to prepare for increased volatility or trend reversals.
THE SCIENCE BEHIND IT
In complex systems (weather, ecosystems, financial markets), major transitions don't happen randomly. Research has identified three universal warning signals that precede critical transitions:
1. Critical Slowing Down
As a system approaches a tipping point, it becomes "sluggish" — small perturbations take longer to decay. In markets, this manifests as rising autocorrelation in returns.
2. Variance Amplification
Short-term volatility begins expanding relative to longer-term baselines as the system destabilizes.
3. Flickering
The system oscillates between two potential states before committing to one — visible as increased crossing of mean levels.
BEW combines all three signals into a single composite score.
COMPONENTS
AR(1) Coefficient — Critical Slowing Down (Blue)
Measures lag-1 autocorrelation of returns over a rolling window.
• Rising toward 1.0: Market becoming "sticky," slow to mean-revert — transition approaching
• Low values (<0.3): Normal mean-reverting behavior, stable regime
Variance Ratio (Purple)
Compares short-term variance to long-term variance.
• Above 1.5: Short-term volatility expanding — energy building before a move
• Near 1.0: Volatility stable, no unusual pressure
Flicker Count (Yellow/Teal)
Counts state changes (crossings of the dynamic mean) within the lookback period.
• High count: Market oscillating between states — indecision before commitment
• Low count: Price firmly in one regime
INTERPRETING THE BEW SCORE
0–50 (STABLE): Normal market conditions. Existing strategies should perform as expected.
50–70 (WARNING): Elevated instability detected. Consider reducing exposure or tightening risk parameters.
70–85 (DANGER): High probability of regime change. Avoid initiating new positions; widen stops on existing ones.
85+ (CRITICAL): Bifurcation likely imminent or in progress. Expect large, potentially unpredictable moves.
HOW TO USE
As a Regime Filter
• BEW < 50: Normal trading conditions — apply your standard strategies
• BEW > 60: Elevated caution — reduce position sizes, avoid mean-reversion plays
• BEW > 80: High alert — consider staying flat or hedging existing positions
As a Preparation Signal
BEW tells you when to pay attention, not which direction. When readings elevate:
• Watch for confirmation from volume, order flow, or other directional indicators
• Prepare for breakout scenarios in either direction
• Adjust take-profit and stop-loss distances for larger moves
For Volatility Adjustment
High BEW periods correlate with larger candles. Use this to:
• Widen stops during elevated readings
• Adjust position sizing inversely to BEW score
• Set more ambitious profit targets when entering during high-BEW breakouts
Divergence Analysis
• Price making new highs/lows while BEW stays low: Trend likely to continue smoothly
• Price consolidating while BEW rises: Breakout incoming — direction uncertain but move will be significant
SETTINGS GUIDE
Core Settings
• Lookback Period: General reference period (default: 50)
• Source: Price source for calculations (default: close)
Critical Slowing Down (AR1)
• AR(1) Calculation Period: Bars used for autocorrelation (default: 100). Higher = smoother, slower.
• AR(1) Warning Threshold: Level at which AR(1) is considered elevated (default: 0.85)
Variance Growth
• Variance Short Period: Fast variance window (default: 20)
• Variance Long Period: Slow variance window (default: 100)
• Variance Ratio Threshold: Level for maximum score contribution (default: 1.5)
Regime Flickering
• Flicker Detection Period: Window for counting state changes (default: 20)
• Flicker Bandwidth: ATR multiplier for state detection — lower = more sensitive (default: 0.5)
• Flicker Count Threshold: Number of crossings for maximum score (default: 4)
TIMEFRAME RECOMMENDATIONS
• 5m–15m: Use shorter periods (AR: 30–50, Var: 10/50). Expect more noise.
• 1H: Balanced performance with default or slightly extended settings (AR: 100, Var: 20/100).
• 4H–Daily: Extend periods further (AR: 100–150, Var: 30/150). Cleaner signals, less frequent.
ALERTS
Three alert conditions are included:
• BEW Warning: Score crosses above 50
• BEW Danger: Score crosses above 70
• BEW Critical: Score crosses above 85
LIMITATIONS
• No directional bias: BEW detects instability, not direction. Combine with trend or momentum indicators.
• Not a timing tool: Elevated readings may persist for several bars before the actual move.
• Parameter sensitive: Optimal settings vary by asset and timeframe. Backtest before live use.
• Leading indicator trade-off: Early warning means some false positives are inevitable.
CREDITS
Inspired by research on early warning signals in complex systems:
• Dakos et al. (2012) — "Methods for detecting early warnings of critical transitions"
DISCLAIMER
This indicator is for educational and informational purposes only. It does not constitute financial advice. Past performance is not indicative of future results. Always conduct your own analysis and risk management. Use at your own risk.
Volume Based Ranges (VBR) [SS]Here is the Volume Based Ranges or VBR indicator.
How it works
The indicator works by:
Sorting volume into buying and selling volume, then
Calculating 2 independent Z-Scores for buying and selling data, then
Identifying the high buying and selling nodes through the use of the Z-score threshold.
Tracks the average target/move based on buying and selling nodes over a designated lookforward horizon (i.e. if you want to see the average move a high selling node happens over 20 candles, you can modify the lookforward horizon to 20).
Calculates the composition from each volume node, displaying the composition information on each line (the % of buying and selling each node contains).
How to Use it
To use this indicator:
Select the Z-Score length of assessment: By default, z-score is 75 and this is usually fine to leave.
Identify the threshold trigger: This will need to be adjusted based on your timeframe. If you are using 1 minute, the data is noiser and you want more profound signals. Thresholds generally in this range should be between 5 - 7. For larger timeframes, you want to relax this threshold, to about 2 to 3. You can toggle in increments of 0.5 to find what works the best. Generally you want to see very rigorous volume node signals instead of tons of them.
Determine what you want to see: You can turn of the support and resistance lines and just have the node identification signals and the return boxes. Or, you can just have the support and resistance lines and turn off the return boxes. You can customize the information the indicator displays in the settings menu to suit what you are most interested in.
Let's look at some examples '
DIS on the hourly. We can see that the average up move from the high buying nodes has a target of 115.42, and in between there we can see the high selling and buying nodes and their compositions.
High buying (100% of the high buying volume) is around the 112.61. This means, you would expect this to be an area of retracement.
We can also see that high selling is just below that at 111.66, which can be a resistance area.
Here is a closer look at the levels specifically:
EPAM on the daily:
You can see a successful retrace back to a high volume node.
Concluding remarks
That's the indicator!
Its one that is best to get a feel for, play around and decide on the settings you like for your individual ticker.
I have included tooltip descriptions for the settings within the indicator as well.
I hope you enjoy it and find it helpful!
Thanks for reading/checking it out and as always, safe trades!
Ben's BTC Macro Fair Value OscillatorBen's BTC Macro Fair Value Oscillator
Overview
The **BTC Macro Fair Value Oscillator** is a non-crypto fair value framework that uses macro asset relationships (equities, dollar, gold) to estimate Bitcoin's "macro-driven fair value" and identify mean-reversion opportunities.
"Is BTC cheap or expensive right now?" on the 4 Hour Timeframe ONLY
### Key Features
✅ **Macro-driven**: Uses QQQ, DXY, XAUUSD instead of on-chain or crypto metrics
✅ **Dynamic weighting**: Assets weighted by rolling correlation strength
✅ **Mean-reversion signals**: Identifies when BTC is cheap/expensive vs macro
✅ **Validated parameters**: Optimized through 5-year backtest (Sharpe 6.7-9.9)
✅ **Visual transparency**: Live correlation panel, fair value bands, statistics
✅ **Non-repainting**: All calculations use confirmed historical data only
### What This Indicator Does
- Builds a **synthetic macro composite** from traditional assets
- Runs a **rolling regression** to predict BTC price from macro
- Calculates **deviation z-score** (how far BTC is from macro fair value)
- Generates **entry signals** when BTC is extremely cheap vs macro (dev < -2)
- Generates **exit signals** when BTC returns to fair value (dev > 0)
### What This Indicator Is NOT
❌ Not a high-frequency trading system (sparse signals by design)
❌ Not optimized for absolute returns (optimized for Sharpe ratio)
❌ Not suitable as standalone trading system (best as overlay/confirmation)
❌ Not predictive of short-term price movements (mean-reversion timeframe: days to weeks)
---
## Core Concept
### The Premise
Bitcoin doesn't trade in a vacuum. It's influenced by:
- **Risk appetite** (equities: QQQ, SPX)
- **Dollar strength** (DXY - inverse to risk assets)
- **Safe haven flows** (Gold: XAUUSD)
When macro conditions are "good for BTC" (risk-on, weak dollar, strong equities), BTC should trade higher. When macro conditions turn against it, BTC should trade lower.
### The Innovation
Instead of looking at BTC in isolation, this indicator:
1. **Measures how strongly** BTC currently correlates with each macro asset
2. **Builds a weighted composite** of those macro returns (the "D" driver)
3. **Regresses BTC price on D** to estimate "macro fair value"
4. **Tracks the deviation** between actual price and fair value
5. **Signals mean reversion** when deviation becomes extreme
### The Edge
The validated edge comes from:
- **Extreme deviations predict future returns** (dev < -2 → +1.67% over 12 bars)
- **Monotonic relationship** (more negative dev → higher forward returns)
- **Works out-of-sample** (test Sharpe +83-87% better than training)
- **Low correlation with buy & hold** (provides diversification value)
---
## Methodology
### Step 1: Macro Composite Driver D(t)
The indicator builds a weighted composite of macro asset returns:
**Process:**
1. Calculate **log returns** for BTC and each macro reference (QQQ, DXY, XAUUSD)
2. Compute **rolling correlation** between BTC and each reference over `corrLen` bars
3. **Weight each asset** by `|correlation|` if above `minCorrAbs` threshold, else 0
4. **Sign-adjust** weights (+1 for positive corr, -1 for negative) to handle inverse relationships
5. **Z-score normalize** each reference's returns over `fvWindow`
6. **Composite D(t)** = weighted sum of sign-adjusted z-scores
**Formula:**
```
For each reference i:
corr_i = correlation(BTC_returns, ref_i_returns, corrLen)
weight_i = |corr_i| if |corr_i| >= minCorrAbs else 0
sign_i = +1 if corr_i >= 0 else -1
z_i = (ref_i_returns - mean) / std
contrib_i = sign_i * z_i * weight_i
D(t) = sum(contrib_i) / sum(weight_i)
```
**Key Insight:** D(t) represents "how good macro conditions are for BTC right now" in a normalized, correlation-weighted way.
---
### Step 2: Fair Value Regression
Uses rolling linear regression to predict BTC price from D(t):
**Model:**
```
BTC_price(t) = α + β * D(t)
```
**Calculation (Pine Script approach):**
```
corr_CD = correlation(BTC_price, D, fvWindow)
sd_price = stdev(BTC_price, fvWindow)
sd_D = stdev(D, fvWindow)
cov = corr_CD * sd_price * sd_D
var_D = variance(D, fvWindow)
β = cov / var_D
α = mean(BTC_price) - β * mean(D)
fair_value(t) = α + β * D(t)
```
**Result:** A time-varying "macro fair value" line that adapts as correlations change.
---
### Step 3: Deviation Oscillator
Measures how far BTC price has deviated from fair value:
**Calculation:**
```
residual(t) = BTC_price(t) - fair_value(t)
residual_std = stdev(residual, normWindow)
deviation(t) = residual(t) / residual_std
```
**Interpretation:**
- `dev = 0` → BTC at fair value
- `dev = -2` → BTC is 2 standard deviations **cheap** vs macro
- `dev = +2` → BTC is 2 standard deviations **rich** vs macro
---
### Step 4: Signal Generation
**Long Entry:** `dev` crosses below `-2.0` (BTC extremely cheap vs macro)
**Long Exit:** `dev` crosses above `0.0` (BTC returns to fair value)
**No shorting** in default config (risk management choice - crypto volatility)
---
## How It Works
### Visual Components
#### 1. Price Chart (Main Panel)
**Fair Value Line (Orange):**
- The estimated "macro-driven fair value" for BTC
- Calculated from rolling regression on macro composite
**Fair Value Bands:**
- **±1σ** (light): 68% confidence zone
- **±2σ** (medium): 95% confidence zone
- **±3σ** (dark, dots): 99.7% confidence zone
**Entry/Exit Markers:**
- **Green "LONG" label** below bar: Entry signal (dev < -2)
- **Red "EXIT" label** above bar: Exit signal (dev > 0)
#### 2. Deviation Oscillator (Separate Pane)
**Line plot:**
- Shows current deviation z-score
- **Green** when dev < -2 (cheap)
- **Red** when dev > +2 (rich)
- **Gray** when neutral
**Histogram:**
- Visual representation of deviation magnitude
- Green bars = negative deviation (cheap)
- Red bars = positive deviation (rich)
**Threshold lines:**
- **Green dashed at -2.0**: Entry threshold
- **Red dashed at 0.0**: Exit threshold
- **Gray solid at 0**: Fair value line
#### 3. Correlation Panel (Top-Right)
Shows live correlation and weighting for each macro asset:
| Asset | Corr | Weight |
|-------|------|--------|
| QQQ | +0.45 | 0.45 |
| DXY | -0.32 | 0.32 |
| XAUUSD | +0.15 | 0.00 |
| Avg \|Corr\| | 0.31 | 0.77 |
**Reading:**
- **Corr**: Current rolling correlation with BTC (-1 to +1)
- **Weight**: How much this asset contributes to fair value (0 = excluded)
- **Avg |Corr|**: Average correlation strength (should be > 0.2 for reliable signals)
**Colors:**
- Green/Red corr = positive/negative correlation
- White weight = asset included, Gray = excluded (below minCorrAbs)
#### 4. Statistics Label (Bottom-Right)
```
━━━ BTC Macro FV ━━━
Dev: -2.34
Price: $103,192
FV: $110,500
Status: CHEAP ⬇
β: 103.52
```
**Fields:**
- **Dev**: Current deviation z-score
- **Price**: Current BTC close price
- **FV**: Current macro fair value estimate
- **Status**: CHEAP (< -2), RICH (> +2), or FAIR
- **β**: Current regression beta (sensitivity to macro)
---
## Installation & Setup
### TradingView Setup
1. Open TradingView and navigate to any **BTC chart** (BTCUSD, BTCUSDT, etc.)
2. Open **Pine Editor** (bottom panel)
3. Click **"+ New"** → **"Blank indicator"**
4. **Delete** all default code
5. **Copy** the entire Pine Script from `GHPT_optimized.pine`
6. **Paste** into the editor
7. Click **"Save"** and name it "BTC Macro Fair Value Oscillator"
8. Click **"Add to Chart"**
### Recommended Chart Settings
**Timeframe:** 4h (validated timeframe)
**Chart Type:** Candlestick or Heikin Ashi
**Overlay:** Yes (indicator plots on price chart + separate pane)
**Alternative Timeframes:**
- Daily: Works but slower signals
- 1h-2h: May work but not validated
- < 1h: Not recommended (too noisy)
### Symbol Requirements
**Primary:** BTC/USD or BTC/USDT on any exchange
**Macro References:** Automatically fetched
- QQQ (Nasdaq 100 ETF)
- DXY (US Dollar Index)
- XAUUSD (Gold spot)
**Data Requirements:**
- At least **90 bars** of history (warmup period)
- Premium TradingView recommended for full historical data
---
## Reading the Indicator
### Identifying Signals
#### Strong Long Signal (High Conviction)
- ✅ Deviation < -2.0 (extreme undervaluation)
- ✅ Avg |Corr| > 0.3 (strong macro relationships)
- ✅ Price touching or below -2σ band
- ✅ "LONG" label appears below bar
**Interpretation:** BTC is extremely cheap relative to macro conditions. Historical data shows +1.67% average return over next 12 bars (48 hours at 4h timeframe).
#### Moderate Long Signal (Lower Conviction)
- ⚠️ Deviation between -1.5 and -2.0
- ⚠️ Avg |Corr| between 0.2-0.3
- ⚠️ Price approaching -2σ band
**Interpretation:** BTC is cheap but not extreme. Consider as confirmation for other signals.
#### Exit Signal
- 🔴 Deviation crosses above 0 (returns to fair value)
- 🔴 "EXIT" label appears above bar
**Interpretation:** Mean reversion complete. Close long positions.
#### Strong Short/Avoid Signal
- 🔴 Deviation > +2.0 (extreme overvaluation)
- 🔴 Avg |Corr| > 0.3
- 🔴 Price touching or above +2σ band
**Interpretation:** BTC is expensive vs macro. Historical data shows -1.79% average return over next 12 bars. Consider exiting longs or reducing exposure.
### Regime Detection
**Strong Regime (Reliable Signals):**
- Avg |Corr| > 0.3
- Multiple assets weighted > 0
- Fair value line tracking price reasonably well
**Weak Regime (Unreliable Signals):**
- Avg |Corr| < 0.2
- Most weights = 0 (grayed out)
- Fair value line diverging wildly from price
- **Action:** Ignore signals until correlations strengthen
SMT + CVD (NQ vs ES) w/ AlertsSMT + CVD (NQ vs ES) w/ Alerts
This tool combines Smart Money Technique (SMT) and Cumulative Volume Delta (CVD) to highlight high-probability inflection points on NQ (primary) versus ES (secondary).
How it works
SMT condition: the primary breaks its most recent swing (High for bearish / Low for bullish) while the secondary does not break the corresponding swing within a small retest window.
CVD confirmation: at the same time, the primary’s CVD shows divergence (higher price but lower/equal CVD for shorts, lower price but higher/equal CVD for longs).
When both align, the script plots a marker/label and draws a line from the primary swing to the signal bar. Alerts are fired.
Signals & Alerts
Labels: “SMT+CVD DOWN/UP” on the signal bar.
Lines: connects the primary swing → signal bar so you can see the structure that produced the signal.
Alert names: “SMT+CVD Bearish” and “SMT+CVD Bullish.”
Inputs
Primary / Secondary symbols: defaults NQ & ES (you can change them).
Resolution: use chart timeframe or specify one.
Swing Left/Right Bars: pivot detection depth (higher = larger swings).
Break Window Bars: how many bars the secondary has to not break for SMT to be valid.
CVD Up/Down By: Close vs Previous Close (default) or Close vs Open.
Anchor CVD Daily: resets CVD at session/day start.
CVD Smoothing (EMA): smooths the CVD line (optional show).
FAST Pivots (no future bars): left-only swing detection so signals appear sooner and behave well in Replay/live.
Require Secondary Pivot: if ON, SMT checks wait for a confirmed secondary swing; if OFF, signals can appear while the secondary swing is still forming (useful for Replay/testing).
Show CVD line: optional, may compress price scale.
Non-repaint notes
With FAST Pivots ON, swings are detected with no future bars (minimal latency = leftBars).
With FAST Pivots OFF, standard pivots require rightBars future bars to confirm the swing (classic, but naturally delayed).
Tips
For intraday futures, keep leftBars/rightBars small (e.g., 3/3) and Break Window 1–3.
In Replay, enable FAST Pivots and consider disabling Require Secondary Pivot if you want signals to appear as soon as the primary breaks.
Combine with session filters, execution rules, or liquidity zones for context.
RightFlow Universal Volume Profile - Any Market Any TimeframeSummary in one paragraph
RightFlow is a right anchored microstructure volume profile for stocks, futures, FX, and liquid crypto on intraday and daily timeframes. It acts only when several conditions align inside a session window and presents the result as a compact right side profile with value area, POC, a bull bear mix by price bin, and a HUD of profile VWAP and pressure shares. It is original because it distributes each bar’s weight into multiple mid price slices, blends bull bear pressure per bin with a CLV based split, and grows the profile to the right so price action stays readable. Add to a clean chart, read the table, and use the visuals. For conservative workflows read on bar close.
Scope and intent
• Markets. Major FX pairs, index futures, large cap equities and ETFs, liquid crypto.
• Timeframes. One minute to daily.
• Default demo used in the publication. SPY on 15 minute.
• Purpose. See where participation concentrates, which side dominated by price level, and how far price sits from VA and POC.
Originality and usefulness
• Unique fusion. Right anchored growth plus per bar slicing and CLV split, with weight modes Raw, Notional, and DeltaProxy.
• Failure mode addressed. False reads from single bar direction and coarse binning.
• Testability. All parts sit in Inputs and the HUD.
• Portable yardstick. Value Area percent and POC are universal across symbols.
• Protected scripts. Not applicable. Method and use are fully disclosed.
Method overview in plain language
Pick a scope Rolling or Today or This Week. Define a window and number of price bins. For each bar, split its range into small slices, assign each slice a weight from the selected mode, and split that weight by CLV or by bar direction. Accumulate totals per bin. Find the bin with the highest total as POC. Expand left and right until the chosen share of total volume is covered to form the value area. Compute profile VWAP for all, buyers, and sellers and show them with pressure shares.
Base measures
Range basis. High minus low and mid price samples across the bar window.
Return basis. Not used. VWAP trio is price weighted by weights.
Components
• RightFlow Bins. Price histogram that grows to the right.
• Bull Bear Split. CLV based 0 to 1 share or pure bar direction.
• Weight Mode. Raw volume, notional volume times close, or DeltaProxy focus.
• Value Area Engine. POC then outward expansion to target share.
• HUD. Profile VWAP, Buy and Sell percent, winner delta, split and weight mode.
• Session windows optional. Scope resets on day or week.
Fusion rule
Color of each bin is the convex blend of bull and bear shares. Value area shading is lighter inside and darker outside.
Signal rule
This is context, not a trade signal. A strong separation between buy and sell percent with price holding inside VA often confirms balance. Price outside VA with skewed pressure often marks initiative moves.
What you will see on the chart
• Right side bins with blended colors.
• A POC line across the profile width.
• Labels for POC, VAH, and VAL.
• A compact HUD table in the top right.
Table fields and quick reading guide
• VWAP. Profile VWAP.
• Buy and Sell. Pressure shares in percent.
• Delta Winner. Winner side and margin in percent.
• Split and Weight. The active modes.
Reading tip. When Session scope is Today or This Week and Buy minus Sell is clearly positive or negative, that side often controls the day’s narrative.
Inputs with guidance
Setup
• Profile scope. Rolling or session reset. Rolling uses window bars.
• Rolling window bars. Typical 100 to 300. Larger is smoother.
Binning
• Price bins. Typical 32 to 128. More bins increase detail.
• Slices per bar. Typical 3 to 7. Raising it smooths distribution.
Weighting
• Weight mode. Raw, Notional, DeltaProxy. Notional emphasizes expensive prints.
• Bull Bear split. CLV or BarDir. CLV is more nuanced.
• Value Area percent. Typical 68 to 75.
View
• Profile width in bars, color split toggle, value area shading, opacities, POC line, VA labels.
Usage recipes
Intraday trend focus
• Scope Today, bins 64, slices 5, Value Area 70.
• Split CLV, Weight Notional.
Intraday mean reversion
• Scope Today, bins 96, Value Area 75.
• Watch fades back to POC after initiative pushes.
Swing continuation
• Scope Rolling 200 bars, bins 48.
• Use Buy Sell skew with price relative to VA.
Realism and responsible publication
No performance claims. Shapes can move while a bar forms and settle on close. Education only.
Honest limitations and failure modes
Thin liquidity and data gaps can distort bin weights. Very quiet regimes reduce contrast. Session time is the chart venue time.
Open source reuse and credits
None.
Legal
Education and research only. Not investment advice. Test on history and simulation before live use.
FluxVector Liquidity Universal Trendline FluxVector Liquidity Trendline FFTL
Summary in one paragraph
FFTL is a single adaptive trendline for stocks ETFs FX crypto and indices on one minute to daily. It fires only when price action pressure and volatility curvature align. It is original because it fuses a directional liquidity pulse from candle geometry and normalized volume with realized volatility curvature and an impact efficiency term to modulate a Kalman like state without ATR VWAP or moving averages. Add it to a clean chart and use the colored line plus alerts. Shapes can move while a bar is open and settle on close. For conservative alerts select on bar close.
Scope and intent
• Markets. Major FX pairs index futures large cap equities liquid crypto top ETFs
• Timeframes. One minute to daily
• Default demo used in the publication. SPY on 30min
• Purpose. Reduce false flips and chop by gating the line reaction to noise and by using a one bar projection
• Limits. This is a strategy. Orders are simulated on standard candles only
Originality and usefulness
• Unique fusion. Directional Liquidity Pulse plus Volatility Curvature plus Impact Efficiency drives an adaptive gain for a one dimensional state
• Failure mode addressed. One or two shock candles that break ordinary trendlines and saw chop in flat regimes
• Testability. All windows and gains are inputs
• Portable yardstick. Returns use natural log units and range is bar high minus low
• Protected scripts. Not used. Method disclosed plainly here
Method overview in plain language
Base measures
• Return basis. Natural log of close over prior close. Average absolute return over a window is a unit of motion
Components
• Directional Liquidity Pulse DLP. Measures signed participation from body and wick imbalance scaled by normalized volume and variance stabilized
• Volatility Curvature. Second difference of realized volatility from returns highlights expansion or compression
• Impact Efficiency. Price change per unit range and volume boosts gain during efficient moves
• Energy score. Z scores of the above form a single energy that controls the state gain
• One bar projection. Current slope extended by one bar for anticipatory checks
Fusion rule
Weighted sum inside the energy score then logistic mapping to a gain between k min and k max. The state updates toward price plus a small flow push.
Signal rule
• Long suggestion and order when close is below trend and the one bar projection is above the trend
• Short suggestion and flip when close is above trend and the one bar projection is below the trend
• WAIT is implicit when neither condition holds
• In position states end on the opposite condition
What you will see on the chart
• Colored trendline teal for rising red for falling gray for flat
• Optional projection line one bar ahead
• Optional background can be enabled in code
• Alerts on price cross and on slope flips
Inputs with guidance
Setup
• Price source. Close by default
Logic
• Flow window. Typical range 20 to 80. Higher smooths the pulse and reduces flips
• Vol window. Typical range 30 to 120. Higher calms curvature
• Energy window. Typical range 20 to 80. Higher slows regime changes
• Min gain and Max gain. Raise max to react faster. Raise min to keep momentum in chop
UI
• Show 1 bar projection. Colors for up down flat
Properties visible in this publication
• Initial capital 25000
• Base currency USD
• Commission percent 0.03
• Slippage 5
• Default order size method percent of equity value 3%
• Pyramiding 0
• Process orders on close off
• Calc on every tick off
• Recalculate after order is filled off
Realism and responsible publication
• No performance claims
• Intrabar reminder. Shapes can move while a bar forms and settle on close
• Strategy uses standard candles only
Honest limitations and failure modes
• Sudden gaps and thin liquidity can still produce fast flips
• Very quiet regimes reduce contrast. Use larger windows and lower max gain
• Session time uses the exchange time of the chart if you enable any windows later
• Past results never guarantee future outcomes
Open source reuse and credits
• None
Previous Period High/Low LevelsThis indicator plots the previous day, week, and month high and low levels to highlight key liquidity levels.
Perfect for traders using market structure, liquidity, or SMC concepts.
Features:
Auto-plots PDH/PDL, PWH/PWL, and PMH/PML
Adjustable line styles, widths, and label sizes
Toggle price display on or off
Accurate UTC offset handling
First X Days Of A YearFirst X-Day Indicator
Overview
The "First X-Day Indicator" is a powerful tool to visualize and analyze market sentiment during the crucial first trading days of each new year. It provides immediate visual feedback on whether the year is starting with positive or negative momentum compared to the previous year's close, a concept often related to market theories like the "January Effect" or the "First Five Days Rule."
The indicator is designed to be clean, intuitive, and fully customizable to fit your charting style.
Key Features
Yearly Baseline: Automatically draws a horizontal line at the previous year's closing price. This line serves as a clear 0% reference for the current year's performance.
Dynamic Background Coloring: For a user-defined number of days at the start of the year, the chart background is colored daily. Green indicates the close is above the previous year's close, while red indicates it's below.
Final Performance Symbol: At the end of the analysis period (e.g., on the 5th day), a single summary symbol (like 👍 or 👎) appears. This symbol represents the final performance outcome of the initial trading period.
Settings & Customization
You have full control over all visual elements:
Analysis Period: Define exactly how many days at the start of the year you want to analyze (e.g., 3, 5, or 10 days).
Line Customization: Fully control the yearly baseline's appearance. You can change its color, width, and style (Solid, Dashed, or Dotted) or hide it completely.
Symbol Customization: Choose any character or emoji for the positive and negative performance symbols. You can also adjust their size (Small, Normal, Large) or hide them.
Background Control: Enable or disable the daily background coloring and select your preferred custom colors for positive and negative days.
Timeframe LiquidityTimeframe Liquidity – Multi-Timeframe Highs & Lows by
Timeframe Liquidity automatically plots previous day, week, month, and year highs and lows, key liquidity zones used by smart money and price-action traders. These levels extend into the future and can automatically stop once price wicks through, showing clear liquidity sweeps and tested zones.
Perfect for traders using ICT / SMC concepts, liquidity theory, or market structure analysis. Instantly see where liquidity rests, where it’s been taken, and how price reacts at major support and resistance.
Features:
Auto-plots PDH/PDL, PWH/PWL, PMH/PML, PYH/PYL
Custom line styles, colors, and label sizes
Option to stop line on wick (liquidity sweep)
Smart timeframe visibility (hides same-TF levels)
Accurate UTC offset handling
Identify liquidity pools fast, trade cleaner charts, and track where smart money hunts liquidity.
Built for precision, clarity, and confluence.
RD-DynamicTSMADescription of the RD-DynamicTSMA Pine Script Indicator:
This single indicator dynamically adjusts the three SMAs to key periods used by professional traders across timeframes:
Daily: 10, 21, 50 periods (standard for swing trading trends).
Weekly+: 10, 21, 30 periods (optimized for positional & longer-term views).
Lengths auto-update on timeframe switches.
Triple-EMA Cloud (3× configurable EMAs + timeframe + fill)About This Script
Name: Triple-EMA Cloud (3× configurable EMAs + timeframe + fill)
What it does:
The script plots three Exponential Moving Averages (EMAs) on your chart.
You can set each EMA’s length (how many bars or days it averages over), source (for example, closing price, opening price, or the midpoint of high + low), and timeframe (you can have one EMA use daily data, another hourly data, etc.).
The indicator draws a “cloud” or channel by shading the area between the outermost two EMAs of the three. This lets you see a band or zone that the price is moving in, defined by those EMAs.
You also get full control over how each of the three EMA‐lines looks: color, thickness, transparency, and plot style (solid line, steps, circles, etc.).
How to Use It (for Beginners)
Here’s how a trader who’s new to charts can use this tool, especially when looking for pullbacks or undercut price action.
Key Concepts
Trend: Imagine the market price is generally going up or down. EMAs are a way to smooth out price movements so you can see the trend more clearly.
Pullback: When a price has been going up (an uptrend), sometimes it dips down a little before going up again. That dip is the pullback. It’s a chance to enter or add to a position at a “better price.”
Undercut: This is when price drops below an important level (for example an EMA) and then comes back up. It looks like it broke below, but then it recovers. That may show reverse pressure or strength building.
How the Script Helps With Pullbacks & Undercuts
Marking Trend Zones with the Cloud
The cloud between the outer EMA lines gives you a zone of expected support/resistance. If the price is above the cloud, that zone can act like a “floor” in uptrends; if it is below, the cloud might act like a “ceiling” in downtrends.
Watching Price vs the EMAs
If the price pulls back toward the cloud (or toward one of the EMAs) and then bounces back up, that’s a signal that the uptrend might continue.
If the price undercuts (goes a bit below) one of the EMAs or the cloud and then returns above it, that can also be a signal. It suggests that even though there was a temporary drop, buyers stepped in.
Using the Three EMAs for Confirmation
Because the script uses three EMAs, you can see how tightly or loosely they are spaced.
If all three EMAs are broadly aligned (for example, in an uptrend: shorter length above longer length, each pulling from reliable price source), that gives more confidence in trend strength.
If the middle EMA (or different source/timeframe) is holding up as support while others are above, it strengthens signal.
Entry & Exit Points
Entry: For example, after a pullback toward the cloud or “mid‐EMA”, wait for price to show a bounce up. That could be a better entry than buying at the top.
Stop Loss / Risk: You might place a stop loss just below the cloud or the lowest of your selected EMAs so that if price breaks through, the idea is invalidated.
Profit Target: Could be a recent high, resistance level, or a fixed reward-risk multiple (for example aiming to make twice what you risked).
Practical Steps for New Traders
Set up the EMAs
Choose simple lengths like 10, 21, 50.
For example, EMA #1 = length 10, source Close, timeframe “current chart”; EMA #2 = length 21, source (H+L)/2; EMA #3 = length 50, maybe timeframe daily.
Observe the Price Action
When price moves up, then dips, see if it comes back near the shaded cloud or one of the EMAs.
See if the dip touches the EMAs lightly (not a big drop) and then price starts climbing again.
Look for undercuts
If price briefly goes below a line (or below cloud) and then closes back above, that’s undercut + recovery. That bounce back is often meaningful.
Manage risk
Only put in money you can afford to lose.
Use small position size until you get comfortable.
Use stop-loss (as mentioned) in case the price doesn’t bounce as expected.
Practice
Put this indicator on charts (stocks you follow) in past time periods. See how price behaved with pullbacks / undercuts relative to the EMAs & cloud. This helps you learn to see signals.
What It Doesn’t Do (and What to Be Careful Of)
It doesn’t predict the future — it simply shows zones and trends. Price can still break down through the cloud.
In a “choppy” market (i.e. when price is going up and down without a clear trend), signals from EMAs / clouds are less reliable. You’ll get more “false bounces.”
Under / overshoots & big news events can break through clean levels, so always watch for confirmation (volume, price behavior) before putting big money in.
Aftershock Playbook: Stock Earnings Drift EngineStrategy type
Event-driven post-earnings momentum engine (long/short) built for single-stock charts or ADRs that publish quarterly results.
What it does
Detects the exact earnings bar (request.earnings, lookahead_off).
Scores the surprise and launches a position on that candle’s close.
Tracks PnL: if the first leg closes green, the engine automatically re-enters on the very next bar, milking residual drift.
Blocks mid-cycle trades after a loss until the next earnings release—keeping the risk contained to one cycle.
Think of it as a sniper that fires on the earnings pop, reloads once if the shot lands, then goes silent until the next report.
Core signal inputs
Component Default Purpose
EPS Surprise % +0 % / –5 % Minimum positive / negative shock to trigger longs/shorts.
Reverse signals? Off Quick flip for mean-reversion experiments.
Time Risk Mgt. Off Optional hard exit after 45 calendar days (auto-scaled to any TF).
Risk engine
ATR-based stop (ATR × 2 by default, editable).
Bar time stop (15-min → Daily: Have to select the bar value ).
No pyramiding beyond the built-in “double-tap”.
All positions sized as % of equity via Strategy Properties.
Visual aids
Yellow triangle marks the earnings bar.
Diagnostics table (top-right) shows last Actual, Estimate, and Surprise %.
Status-line tool-tips on every input.
Default inputs
Setting Value
Positive surprise ≥ 0 %
Negative surprise ≤ –5 %
ATR stop × 2
ATR length 50
Hold horizon 350 ( 1h timeframe chart bars)
Back-test properties
Initial capital 10 000
Order size 5 % of equity
Pyramiding 1 (internal re-entry only)
Commission 0.03 %
Slippage 5 ticks
Fills Bar magnifier ✔ · On bar close ✔ · Standard OHLC ✔
How to use
Add the script to any earnings-driven stock (AAPL, MSFT, TSLA…).
Turn on Time Risk Management if you want stricter risk management
Back-test different ATR multipliers to fit the stock’s volatility.
Sync commission & slippage with your broker before forward-testing.
Important notes
Works on every timeframe from 15 min to 1 D. Sweet spot around 30min/1h
All request.earnings() & request.security() calls use lookahead_off—zero repaint.
The “double-tap” re-entry occurs once per winning cycle to avoid drift-chasing loops.
Historical stats ≠ future performance. Size positions responsibly.






















