Range Oscillator Strategy + Stoch Confirm🔹 Short summary
This is a free, educational long-only strategy built on top of the public “Range Oscillator” by Zeiierman (used under CC BY-NC-SA 4.0), combined with a Stochastic timing filter, an EMA-based exit filter and an optional risk-management layer (SL/TP and R-multiple exits). It is NOT financial advice and it is NOT a magic money machine. It’s a structured framework to study how range-expansion + momentum + trend slope can be combined into one rule-based system, often with intentionally RARE trades.
────────────────────────
0. Legal / risk disclaimer
────────────────────────
• This script is FREE and public. I do not charge any fee for it.
• It is for EDUCATIONAL PURPOSES ONLY.
• It is NOT financial advice and does NOT guarantee profits.
• Backtest results can be very different from live results.
• Markets change over time; past performance is NOT indicative of future performance.
• You are fully responsible for your own trades and risk.
Please DO NOT use this script with money you cannot afford to lose. Always start in a demo / paper trading environment and make sure you understand what the logic does before you risk any capital.
────────────────────────
1. About default settings and risk (very important)
────────────────────────
The script is configured with the following defaults in the `strategy()` declaration:
• `initial_capital = 10000`
→ This is only an EXAMPLE account size.
• `default_qty_type = strategy.percent_of_equity`
• `default_qty_value = 100`
→ This means 100% of equity per trade in the default properties.
→ This is AGGRESSIVE and should be treated as a STRESS TEST of the logic, not as a realistic way to trade.
TradingView’s House Rules recommend risking only a small part of equity per trade (often 1–2%, max 5–10% in most cases). To align with these recommendations and to get more realistic backtest results, I STRONGLY RECOMMEND you to:
1. Open **Strategy Settings → Properties**.
2. Set:
• Order size: **Percent of equity**
• Order size (percent): e.g. **1–2%** per trade
3. Make sure **commission** and **slippage** match your own broker conditions.
• By default this script uses `commission_value = 0.1` (0.1%) and `slippage = 3`, which are reasonable example values for many crypto markets.
If you choose to run the strategy with 100% of equity per trade, please treat it ONLY as a stress-test of the logic. It is NOT a sustainable risk model for live trading.
────────────────────────
2. What this strategy tries to do (conceptual overview)
────────────────────────
This is a LONG-ONLY strategy designed to explore the combination of:
1. **Range Oscillator (Zeiierman-based)**
- Measures how far price has moved away from an adaptive mean.
- Uses an ATR-based range to normalize deviation.
- High positive oscillator values indicate strong price expansion away from the mean in a bullish direction.
2. **Stochastic as a timing filter**
- A classic Stochastic (%K and %D) is used.
- The logic requires %K to be below a user-defined level and then crossing above %D.
- This is intended to catch moments when momentum turns up again, rather than chasing every extreme.
3. **EMA Exit Filter (trend slope)**
- An EMA with configurable length (default 70) is calculated.
- The slope of the EMA is monitored: when the slope turns negative while in a long position, and the filter is enabled, it triggers an exit condition.
- This acts as a trend-protection exit: if the medium-term trend starts to weaken, the strategy exits even if the oscillator has not yet fully reverted.
4. **Optional risk-management layer**
- Percentage-based Stop Loss and Take Profit (SL/TP).
- Risk/Reward (R-multiple) exit based on the distance from entry to SL.
- Implemented as OCO orders that work *on top* of the logical exits.
The goal is not to create a “holy grail” system but to serve as a transparent, configurable framework for studying how these concepts behave together on different markets and timeframes.
────────────────────────
3. Components and how they work together
────────────────────────
(1) Range Oscillator (based on “Range Oscillator (Zeiierman)”)
• The script computes a weighted mean price and then measures how far price deviates from that mean.
• Deviation is normalized by an ATR-based range and expressed as an oscillator.
• When the oscillator is above the **entry threshold** (default 100), it signals a strong move away from the mean in the bullish direction.
• When it later drops below the **exit threshold** (default 30), it can trigger an exit (if enabled).
(2) Stochastic confirmation
• Classic Stochastic (%K and %D) is calculated.
• An entry requires:
- %K to be below a user-defined “Cross Level”, and
- then %K to cross above %D.
• This is a momentum confirmation: the strategy tries to enter when momentum turns up from a pullback rather than at any random point.
(3) EMA Exit Filter
• The EMA length is configurable via `emaLength` (default 70).
• The script monitors the EMA slope: it computes the relative change between the current EMA and the previous EMA.
• If the slope turns negative while the strategy holds a long position and the filter is enabled, it triggers an exit condition.
• This is meant to help protect profits or cut losses when the medium-term trend starts to roll over, even if the oscillator conditions are not (yet) signalling exit.
(4) Risk management (optional)
• Stop Loss (SL) and Take Profit (TP):
- Defined as percentages relative to average entry price.
- Both are disabled by default, but you can enable them in the Inputs.
• Risk/Reward Exit:
- Uses the distance from entry to SL to project a profit target at a configurable R-multiple.
- Also optional and disabled by default.
These exits are implemented as `strategy.exit()` OCO orders and can close trades independently of oscillator/EMA conditions if hit first.
────────────────────────
4. Entry & Exit logic (high level)
────────────────────────
A) Time filter
• You can choose a **Start Year** in the Inputs.
• Only candles between the selected start date and 31 Dec 2069 are used for backtesting (`timeCondition`).
• This prevents accidental use of tiny cherry-picked windows and makes tests more honest.
B) Entry condition (long-only)
A long entry is allowed when ALL the following are true:
1. `timeCondition` is true (inside the backtest window).
2. If `useOscEntry` is true:
- Range Oscillator value must be above `entryLevel`.
3. If `useStochEntry` is true:
- Stochastic condition (`stochCondition`) must be true:
- %K < `crossLevel`, then %K crosses above %D.
If these filters agree, the strategy calls `strategy.entry("Long", strategy.long)`.
C) Exit condition (logical exits)
A position can be closed when:
1. `timeCondition` is true AND a long position is open, AND
2. At least one of the following is true:
- If `useOscExit` is true: Oscillator is below `exitLevel`.
- If `useMagicExit` (EMA Exit Filter) is true: EMA slope is negative (`isDown = true`).
In that case, `strategy.close("Long")` is called.
D) Risk-management exits
While a position is open:
• If SL or TP is enabled:
- `strategy.exit("Long Risk", ...)` places an OCO stop/limit order based on the SL/TP percentages.
• If Risk/Reward exit is enabled:
- `strategy.exit("RR Exit", ...)` places an OCO order using a projected R-multiple (`rrMult`) of the SL distance.
These risk-based exits can trigger before the logical oscillator/EMA exits if price hits those levels.
────────────────────────
5. Recommended backtest configuration (to avoid misleading results)
────────────────────────
To align with TradingView House Rules and avoid misleading backtests:
1. **Initial capital**
- 10 000 (or any value you personally want to work with).
2. **Order size**
- Type: **Percent of equity**
- Size: **1–2%** per trade is a reasonable starting point.
- Avoid risking more than 5–10% per trade if you want results that could be sustainable in practice.
3. **Commission & slippage**
- Commission: around 0.1% if that matches your broker.
- Slippage: a few ticks (e.g. 3) to account for real fills.
4. **Timeframe & markets**
- Volatile symbols (e.g. crypto like BTCUSDT, or major indices).
- Timeframes: 1H / 4H / **1D (Daily)** are typical starting points.
- I strongly recommend trying the strategy on **different timeframes**, for example 1D, to see how the behaviour changes between intraday and higher timeframes.
5. **No “caution warning”**
- Make sure your chosen symbol + timeframe + settings do not trigger TradingView’s caution messages.
- If you see warnings (e.g. “too few trades”), adjust timeframe/symbol or the backtest period.
────────────────────────
5a. About low trade count and rare signals
────────────────────────
This strategy is intentionally designed to trade RARELY:
• It is **long-only**.
• It uses strict filters (Range Oscillator threshold + Stochastic confirmation + optional EMA Exit Filter).
• On higher timeframes (especially **1D / Daily**) this can result in a **low total number of trades**, sometimes WELL BELOW 100 trades over the whole backtest.
TradingView’s House Rules mention 100+ trades as a guideline for more robust statistics. In this specific case:
• The **low trade count is a conscious design choice**, not an attempt to cherry-pick a tiny, ultra-profitable window.
• The goal is to study a **small number of high-conviction long entries** on higher timeframes, not to generate frequent intraday signals.
• Because of the low trade count, results should NOT be interpreted as statistically strong or “proven” – they are only one sample of how this logic would have behaved on past data.
Please keep this in mind when you look at the equity curve and performance metrics. A beautiful curve with only a handful of trades is still just a small sample.
────────────────────────
6. How to use this strategy (step-by-step)
────────────────────────
1. Add the script to your chart.
2. Open the **Inputs** tab:
- Set the backtest start year.
- Decide whether to use Oscillator-based entry/exit, Stochastic confirmation, and EMA Exit Filter.
- Optionally enable SL, TP, and Risk/Reward exits.
3. Open the **Properties** tab:
- Set a realistic account size if you want.
- Set order size to a realistic % of equity (e.g. 1–2%).
- Confirm that commission and slippage are realistic for your broker.
4. Run the backtest:
- Look at Net Profit, Max Drawdown, number of trades, and equity curve.
- Remember that a low trade count means the statistics are not very strong.
5. Experiment:
- Tweak thresholds (`entryLevel`, `exitLevel`), Stochastic settings, EMA length, and risk params.
- See how the metrics and trade frequency change.
6. Forward-test:
- Before using any idea in live trading, forward-test on a demo account and observe behaviour in real time.
────────────────────────
7. Originality and usefulness (why this is more than a mashup)
────────────────────────
This script is not intended to be a random visual mashup of indicators. It is designed as a coherent, testable strategy with clear roles for each component:
• Range Oscillator:
- Handles mean vs. range-expansion states via an adaptive, ATR-normalized metric.
• Stochastic:
- Acts as a timing filter to avoid entering purely on extremes and instead waits for momentum to turn.
• EMA Exit Filter:
- Trend-slope-based safety net to exit when the medium-term direction changes against the position.
• Risk module:
- Provides practical, rule-based exits: SL, TP, and R-multiple exit, which are useful for structuring risk even if you modify the core logic.
It aims to give traders a ready-made **framework to study and modify**, not a black box or “signals” product.
────────────────────────
8. Limitations and good practices
────────────────────────
• No single strategy works on all markets or in all regimes.
• This script is long-only; it does not short the market.
• Performance can degrade when market structure changes.
• Overfitting (curve fitting) is a real risk if you endlessly tweak parameters to maximise historical profit.
Good practices:
- Test on multiple symbols and timeframes.
- Focus on stability and drawdown, not only on how high the profit line goes.
- View this as a learning tool and a basis for your own research.
────────────────────────
9. Licensing and credits
────────────────────────
• Core oscillator idea & base code:
- “Range Oscillator (Zeiierman)”
- © Zeiierman, licensed under CC BY-NC-SA 4.0.
• Strategy logic, Stochastic confirmation, EMA Exit Filter, and risk-management layer:
- Modifications by jokiniemi.
Please respect both the original license and TradingView House Rules if you fork or republish any part of this script.
────────────────────────
10. No payments / no vendor pitch
────────────────────────
• This script is completely FREE to use on TradingView.
• There is no paid subscription, no external payment link, and no private signals group attached to it.
• If you have questions, please use TradingView’s comment system or private messages instead of expecting financial advice.
Use this script as a tool to learn, experiment, and build your own understanding of markets.
────────────────────────
11. Example backtest settings used in screenshots
────────────────────────
To avoid any confusion about how the results shown in screenshots were produced, here is one concrete example configuration:
• Symbol: BTCUSDT (or similar major BTC pair)
• Timeframe: 1D (Daily)
• Backtest period: from 2018 to the most recent data
• Initial capital: 10 000
• Order size type: Percent of equity
• Order size: 2% per trade
• Commission: 0.1%
• Slippage: 3 ticks
• Risk settings: Stop Loss and Take Profit disabled by default, Risk/Reward exit disabled by default
• Filters: Range Oscillator entry/exit enabled, Stochastic confirmation enabled, EMA Exit Filter enabled
If you change any of these settings (symbol, timeframe, risk per trade, commission, slippage, filters, etc.), your results will look different. Please always adapt the configuration to your own risk tolerance, market, and trading style.
Göstergeler ve stratejiler
Quantile Support & ResistanceThis indicator plots dynamic support and resistance zones based on quantile logic — a statistically grounded method for identifying structural price boundaries.
Support Level: The price below which only a small percentage of lows fall (default: 10%). This approximates a strong demand zone.
Resistance Level: The price above which only a small percentage of highs rise (default: 10%). This approximates a strong supply zone.
Volatility-Adaptive: Levels adjust automatically to changing market conditions using a configurable lookback window.
Quantile Interpolation: Uses sorted price data and fractional indexing to estimate percentile thresholds with precision.
This tool is ideal for traders who want to visualize statistically significant price zones without relying on subjective drawing or fixed levels. It pairs well with breakout strategies, retest logic, and compression overlays.
Swing Trade BUY/SELL + SCORING +COLOUR FIXBUY/SELL labels now appear with a score (1–3) next to them.
Color coding visually distinguishes signal strength:
BUY → 1 yellow, 2 light green, 3 dark green
SELL → 1 orange, 2 red, 3 burgundy
This allows you to instantly see the signal strength both numerically and visually.
TraderDemircan Auto Fibonacci RetracementDescription:
What This Indicator Does:This indicator automatically identifies significant swing high and swing low points within a customizable lookback period and draws comprehensive Fibonacci retracement and extension levels between them. Unlike the manual Fibonacci tool that requires you to constantly redraw levels as price action evolves, this automated version continuously updates the Fibonacci grid based on the most recent major swing points, ensuring you always have current and relevant support/resistance zones displayed on your chart.Key Features:
Automatic Swing Detection: Continuously scans the specified lookback period to find the most significant high and low points, eliminating manual drawing errors
Comprehensive Level Coverage: Plots 16 Fibonacci levels including 7 retracement levels (0.0 to 1.0) and 9 extension levels (1.115 to 3.618)
Top-Down Methodology: Draws from swing high to swing low (right-to-left), following the traditional Fibonacci retracement convention where 100% is at the top
Dual Labeling System: Shows both exact price values and Fibonacci percentages for easy reference
Complete Customization: Individual toggle controls and color selection for each of the 16 levels
Flexible Display Options: Adjust line thickness (1-5), style (solid/dashed/dotted), and extension direction (left/right/both)
Visual Swing Markers: Red diamond at the swing high (starting point) and green diamond at the swing low (ending point)
Optional Trend Line: Connects the two swing points to visualize the overall price movement direction
How It Works:The indicator employs a sophisticated swing point detection algorithm that operates in two stages:Stage 1 - Find the Swing Low (Support Base):
Scans the entire lookback period to identify the lowest low, which becomes the anchor point (0.0 level in traditional retracement terms, though displayed at the bottom of the grid).Stage 2 - Find the Swing High (Resistance Peak):
After identifying the swing low, searches for the highest high that occurred after that low point, establishing the swing range. This creates a valid price movement range for Fibonacci analysis.Fibonacci Calculation Method:
The indicator uses the top-down approach where:
1.0 Level = Swing High (100% retracement, the top)
0.0 Level = Swing Low (0% retracement, the bottom)
Retracement Levels (0.236 to 0.786) = Potential support zones during pullbacks from the high
Extension Levels (1.115 to 3.618) = Potential target zones below the swing low
Formula: Price = SwingHigh - (SwingHigh - SwingLow) × FibonacciLevelThis ensures that 0.0 is at the bottom and extensions (>1.0) plot below the swing low, following standard Fibonacci retracement convention.Fibonacci Levels Explained:Retracement Levels (0.0 - 1.0):
0.0 (Gray): Swing low - the base support level
0.236 (Red): Shallow retracement, first minor support
0.382 (Orange): Moderate retracement, commonly watched support
0.5 (Purple): Psychological midpoint, significant support/resistance
0.618 (Blue - Golden Ratio): The most important retracement level, high-probability reversal zone
0.786 (Cyan): Deep retracement, last defense before full reversal
1.0 (Gray): Swing high - the initial resistance level
Extension Levels (1.115 - 3.618):
1.115 (Green): First extension, minimal downside target
1.272 (Light Green): Minor extension, common profit target
1.414 (Yellow-Green): Square root of 2, mathematical significance
1.618 (Gold - Golden Extension): Primary downside target, most watched extension level
2.0 (Orange-Red): 200% extension, psychological round number
2.382 (Pink): Secondary extension target
2.618 (Purple): Deep extension, major target zone
3.272 (Deep Purple): Extreme extension level
3.618 (Blue): Maximum extension, rare but powerful target
How to Use:For Retracement Trading (Buying Pullbacks in Uptrends):
Wait for price to make a significant move up from swing low to swing high
When price starts pulling back, watch for reactions at key Fibonacci levels
Most common entry zones: 0.382, 0.5, and especially 0.618 (golden ratio)
Enter long positions when price shows reversal signals (candlestick patterns, volume increase) at these levels
Place stop loss below the next Fibonacci level
Target: Return to swing high or higher extension levels
For Extension Trading (Profit Targets):
After price breaks below the swing low (0.0 level), use extensions as profit targets
First target: 1.272 (conservative)
Primary target: 1.618 (golden extension - most commonly reached)
Extended target: 2.618 (for strong trends)
Extreme target: 3.618 (only in powerful trending moves)
For Counter-Trend Trading (Fading Extremes):
When price reaches deep retracements (0.786 or below), look for exhaustion signals
Watch for divergences between price and momentum indicators at these levels
Enter reversal trades with tight stops below the swing low
Target: 0.5 or 0.382 levels on the bounce
For Trend Continuation:
In strong uptrends, shallow retracements (0.236 to 0.382) often hold
Use these as low-risk entry points to join the existing trend
Failure to hold 0.5 suggests weakening momentum
Breaking below 0.618 often indicates trend reversal, not just retracement
Multi-Timeframe Strategy:
Use daily timeframe Fibonacci for major support/resistance zones
Use 4H or 1H Fibonacci for precise entry timing within those zones
Confluence between multiple timeframe Fibonacci levels creates high-probability zones
Example: Daily 0.618 level aligning with 4H 0.5 level = strong support
Settings Guide:Lookback Period (10-500):
Short (20-50): Captures recent swings, more frequent updates, suited for day trading
Medium (50-150): Balanced approach, good for swing trading (default: 100)
Long (150-500): Identifies major market structure, suited for position trading
Higher values = more stable levels but slower to adapt to new trends
Pivot Sensitivity (1-20):
Controls how many candles are required to confirm a swing point
Low (1-5): More sensitive, identifies minor swings (default: 5)
High (10-20): Less sensitive, only major swings qualify
Use higher sensitivity on lower timeframes to filter noise
Individual Level Toggles:
Enable only the levels you actively trade to reduce chart clutter
Common minimalist setup: Show only 0.382, 0.5, 0.618, 1.0, 1.618, 2.618
Comprehensive setup: Enable all levels for maximum information
Visual Customization:
Line Thickness: Thicker lines (3-5) for presentation, thinner (1-2) for trading
Line Style: Solid for primary levels (0.5, 0.618, 1.618), dashed/dotted for secondary
Price Labels: Essential for knowing exact entry/exit prices
Percent Labels: Helpful for quickly identifying which Fibonacci level you're looking at
Extension Direction: Extend right for forward-looking analysis, left for historical context
What Makes This Original:While Fibonacci indicators are common on TradingView, this script's originality comes from:
Intelligent Two-Stage Detection: Unlike simple high/low finders, this uses a sequential approach (find low first, then find the high that occurred after it), ensuring logical price flow representation
Comprehensive Level Set: Includes 16 levels spanning from retracement to extreme extensions, more than most Fibonacci tools
Top-Down Methodology: Properly implements the traditional Fibonacci retracement convention (high to low) rather than the reverse
Automatic Range Validation: Only draws Fibonacci when both swing points are valid and in the correct temporal order
Dual Extension Options: Separate controls for extending lines left (historical context) and right (forward projection)
Smart Label Positioning: Places percentage labels on the left and price labels on the right for clarity
Visual Swing Confirmation: Diamond markers at swing points help users understand why levels are positioned where they are
Important Considerations:
Historical Nature: Fibonacci retracements are based on past price swings; they don't predict future moves, only suggest potential support/resistance
Self-Fulfilling Prophecy: Fibonacci levels work partly because many traders watch them, creating actual support/resistance at those levels
Not All Levels Hold: In strong trends, price may slice through multiple Fibonacci levels without pausing
Context Matters: Fibonacci works best when aligned with other support/resistance (previous highs/lows, moving averages, trendlines)
Volume Confirmation: The most reliable Fibonacci reversals occur with volume spikes at key levels
Dynamic Updates: The levels will redraw as new swing highs/lows form, so don't rely solely on static screenshots
Best Practices:
Don't Trade Blindly: Fibonacci levels are zones, not exact prices. Look for confirmation (candlestick patterns, indicators, volume)
Combine with Price Action: Watch for pin bars, engulfing candles, or doji at key Fibonacci levels
Use Stop Losses: Place stops beyond the next Fibonacci level to give trades room but limit risk
Scale In/Out: Consider entering partial positions at 0.5 and adding more at 0.618 rather than all-in at one level
Check Multiple Timeframes: Daily Fibonacci + 4H Fibonacci convergence = high-probability zone
Respect the 0.618: This golden ratio level is historically the most reliable for reversals
Extensions Need Strong Trends: Don't expect extensions to be hit unless there's clear momentum beyond the swing low
Optimal Timeframes:
Scalping (1-5 minutes): Lookback 20-30, watch 0.382, 0.5, 0.618 only
Day Trading (15m-1H): Lookback 50-100, all retracement levels important
Swing Trading (4H-Daily): Lookback 100-200, focus on 0.5, 0.618, 0.786, and extensions
Position Trading (Daily-Weekly): Lookback 200-500, all levels relevant for long-term planning
Common Fibonacci Trading Mistakes to Avoid:
Wrong Swing Selection: Choosing insignificant swings produces meaningless levels
Premature Entry: Entering as soon as price touches a Fibonacci level without confirmation
Ignoring Trend: Fighting the main trend by buying deep retracements in downtrends
Over-Reliance: Using Fibonacci in isolation without confirming with other technical factors
Static Analysis: Not updating your Fibonacci as market structure evolves
Arbitrary Lookback: Using the same lookback period for all assets and timeframes
Integration with Other Tools:Fibonacci + Moving Averages:
When 0.618 level aligns with 50 or 200 EMA, confluence creates stronger support
Price bouncing from both Fibonacci and MA simultaneously = high-probability trade
Fibonacci + RSI/Stochastic:
Oversold indicators at 0.618 or deeper retracements = strong buy signal
Overbought indicators at swing high (1.0) = potential reversal warning
Fibonacci + Volume Profile:
High-volume nodes aligning with Fibonacci levels create robust support/resistance
Low-volume areas near Fibonacci levels may see rapid price movement through them
Fibonacci + Trendlines:
Fibonacci retracement level + ascending trendline = double support
Breaking both simultaneously confirms trend change
Technical Notes:
Uses ta.lowest() and ta.highest() for efficient swing detection across the lookback period
Implements dynamic line and label arrays for clean redraws without memory leaks
All calculations update in real-time as new bars form
Extension options allow customization without modifying core code
Format.mintick ensures price labels match the symbol's minimum price increment
Tooltip on swing markers shows exact price values for precision
ICT SMT A+ LONG & SELL ChecklistTrade Checklist. Once all items checked color changes from yellow to green.
MTF Trend - Gold/XAU with DXY Filter + ADRThis MTF Dashboard has had an addition to it I have added the ADR to the MTF Dashboard this works with all assets but the DXY filter must be turned off If not Trading Gold The Dashboard gives Clarity to the Direction and the Strength of the Trend
Swing Trade AL/SAT + Güç Derecesi_huğurlu
Weak signal → MACD crossover only.
Moderate signal → MACD crossover + RSI confirmation.
Strong signal → MACD crossover + RSI + Stoch RSI confirmation.
BUY/SELL labels appear on the chart in different colors and sizes.
This way, you can instantly see which signal is more reliable.
Zayıf sinyal → sadece MACD kesişim var
Orta sinyal → MACD kesişim + RSI teyidi.
Güçlü sinyal → MACD kesişim + RSI + Stoch RSI teyidi.
EMA Dynamic Crossover Detector with Real-Time Signal TableDescriptionWhat This Indicator Does:This indicator monitors all possible crossovers between four key exponential moving averages (20, 50, 100, and 200 periods) and displays them both visually on the chart and in an organized data table. Unlike standard EMA indicators that only plot the lines, this tool actively detects every crossover event, marks the exact crossover point with a circle, records the precise price level, and maintains a running log of all crossovers during the trading session. It's designed for traders who want comprehensive EMA crossover analysis without manually watching multiple moving average pairs.Key Features:
Four Essential EMAs: Plots 20, 50, 100, and 200-period exponential moving averages with color-coded thin lines for clean chart presentation
Complete Crossover Detection: Monitors all 6 possible EMA pair combinations (20×50, 20×100, 20×200, 50×100, 50×200, 100×200) in both directions
Precise Price Marking: Places colored circles at the exact average price where crossovers occur (not just at candle close)
Real-Time Signal Table: Displays up to 10 most recent crossovers with timestamp, direction, exact price, and signal type
Session Filtering: Only records crossovers during active trading hours (10:00-18:00 Istanbul time) to avoid noise from low-liquidity periods
Automatic Daily Reset: Clears the signal table at the start of each new trading day for fresh analysis
Built-In Alerts: Two alert conditions (bullish and bearish crossovers) that can be configured to send notifications
How It Works:The indicator calculates four exponential moving averages using the standard EMA formula, then continuously monitors for crossover events using Pine Script's ta.crossover() and ta.crossunder() functions:Bullish Crossovers (Green ▲):
When a faster EMA crosses above a slower EMA, indicating potential upward momentum:
20 crosses above 50, 100, or 200
50 crosses above 100 or 200
100 crosses above 200 (Golden Cross when it's the 50×200)
Bearish Crossovers (Red ▼):
When a faster EMA crosses below a slower EMA, indicating potential downward momentum:
20 crosses below 50, 100, or 200
50 crosses below 100 or 200
100 crosses below 200 (Death Cross when it's the 50×200)
Price Calculation:
Instead of marking crossovers at the candle's close price (which might not be where the actual cross occurred), the indicator calculates the average price between the two crossing EMAs, providing a more accurate representation of the crossover point.Signal Table Structure:The table in the top-right corner displays four columns:
Saat (Time): Exact time of crossover in HH:MM format
Yön (Direction): Arrow indicator (▲ green for bullish, ▼ red for bearish)
Fiyat (Price): Calculated average price at the crossover point
Durum (Status): Signal classification ("ALIŞ" for buy signals, "SATIŞ" for sell signals) with color-coded background
The table shows up to 10 most recent crossovers, automatically updating as new signals appear. If no crossovers have occurred during the session within the time filter, it displays "Henüz kesişim yok" (No crossovers yet).EMA Color Coding:
EMA 20 (Aqua/Turquoise): Fastest-reacting, most sensitive to recent price changes
EMA 50 (Green): Short-term trend indicator
EMA 100 (Yellow): Medium-term trend indicator
EMA 200 (Red): Long-term trend baseline, key support/resistance level
How to Use:For Day Traders:
Monitor 20×50 crossovers for quick entry/exit signals within the day
Use the time filter (10:00-18:00) to focus on high-volume trading hours
Check the signal table throughout the session to track momentum shifts
Look for confirmation: if 20 crosses above 50 and price is above EMA 200, bullish bias is stronger
For Swing Traders:
Focus on 50×200 crossovers (Golden Cross/Death Cross) for major trend changes
Use higher timeframes (4H, Daily) for more reliable signals
Wait for price to close above/below the crossover point before entering
Combine with support/resistance levels for better entry timing
For Position Traders:
Monitor 100×200 crossovers on daily/weekly charts for long-term trend changes
Use as confirmation of major market shifts
Don't react to every crossover—wait for sustained movement after the cross
Consider multiple timeframe analysis (if crossovers align on weekly and daily, signal is stronger)
Understanding EMA Hierarchies:The indicator becomes most powerful when you understand EMA relationships:Bullish Hierarchy (Strongest to Weakest):
All EMAs ascending (20 > 50 > 100 > 200): Strong uptrend
20 crosses above 50 while both are above 200: Pullback ending in uptrend
50 crosses above 200 while 20/50 below: Early trend reversal signal
Bearish Hierarchy (Strongest to Weakest):
All EMAs descending (20 < 50 < 100 < 200): Strong downtrend
20 crosses below 50 while both are below 200: Rally ending in downtrend
50 crosses below 200 while 20/50 above: Early trend reversal signal
Trading Strategy Examples:Pullback Entry Strategy:
Identify major trend using EMA 200 (price above = uptrend, below = downtrend)
Wait for pullback (20 crosses below 50 in uptrend, or above 50 in downtrend)
Enter when 20 re-crosses 50 in the trend direction
Place stop below/above the recent swing point
Exit when 20 crosses 50 against the trend again
Golden Cross/Death Cross Strategy:
Wait for 50×200 crossover (appears in the signal table)
Verify: Check if crossover occurs with increasing volume
Entry: Enter in the direction of the cross after a pullback
Stop: Place stop below/above the 200 EMA
Target: Swing high/low or when opposite crossover occurs
Multi-Crossover Confirmation:
Watch for multiple crossovers in the same direction within a short period
Example: 20×50 crossover followed by 20×100 = strengthening momentum
Enter after the second confirmation crossover
More crossovers = stronger signal but also means you're entering later
Time Filter Benefits:The 10:00-18:00 Istanbul time filter prevents recording crossovers during:
Pre-market volatility and gaps
Low-volume overnight sessions (for 24-hour markets)
After-hours erratic movements
Boring MACD Trading Strategy - Dedicated to 'The Secret Mindset'This indicator displays the MACD status across three selectable timeframes, regardless of the chart timeframe you are currently viewing.
For each timeframe, it shows whether the MACD line is above or below the zero line, indicating bullish or bearish momentum.
It also shows whether the MACD line is above or below the signal line, revealing the current trend condition as bullish, bearish, or neutral.
Boring MACD Trading Strategy - Dedicated to 'The Secret Mindset'This indicator displays the MACD status across three selectable timeframes, regardless of the chart timeframe you are currently viewing.
For each timeframe, it shows whether the MACD line is above or below the zero line, indicating bullish or bearish momentum.
It also shows whether the MACD line is above or below the signal line, revealing the current trend condition as bullish, bearish, or neutral.
Live Bar = White (Body+Wick), Others = #2e2e2eThis script turns all candles gray, except for the last bar, which is the candle that hasn't closed and whose price is changing live. It makes that candle white so you can always spot the last candle on the chart more clearly. Enjoy!
Intraday Technical Strength Dashboard — 5m (Universal) — FIXED2An Intraday Technical Strength Dashboard for RSI, OBV, MACD, ADX, and EMA Cloud
60-Minute Range Highlighter - Color Coded (All Dates)//@version=5
indicator("60-Minute Range Highlighter - Color Coded (All Dates)", overlay=true)
// === INPUTS ===
show_all_ranges = input.bool(true, "Highlight All 60-Minute Ranges")
show_specific_range = input.bool(true, "Show Specific 60-Minute Range")
target_hour = input.int(9, "Target Hour (24h format)", minval=0, maxval=23)
// === COLOR PICKERS ===
color1 = input.color(color.new(color.teal, 85), "Box Color 1")
color2 = input.color(color.new(color.orange, 85), "Box Color 2")
color3 = input.color(color.new(color.purple, 85), "Box Color 3")
color4 = input.color(color.new(color.green, 85), "Box Color 4")
label_color = input.color(color.yellow, "Label Color")
// === TIME CONDITIONS ===
range_period = 60
range_index = math.floor(time / (range_period * 60 * 1000)) // continuous 60-min index
is_new_range = ta.change(range_index)
range_color = switch range_index % 4
0 => color1
1 => color2
2 => color3
=> color4
// === VARS FOR STORING RANGE ===
var float h_start = na
var float l_start = na
var label range_label = na
var box b = na
if is_new_range
h_start := high
l_start := low
if show_all_ranges
b := box.new(left=bar_index, right=bar_index,
top=h_start, bottom=l_start,
border_color=color.new(range_color, 40),
bgcolor=range_color)
else
h_start := math.max(high, h_start)
l_start := math.min(low, l_start)
if show_all_ranges and not na(b)
box.set_right(b, bar_index)
box.set_top(b, h_start)
box.set_bottom(b, l_start)
// === SHOW SPECIFIC RANGE ===
hour_now = hour(time)
next_hour = (target_hour + 1) % 24
in_target_range = (hour_now == target_hour) or (hour_now == next_hour and minute(time) < 30)
if show_specific_range and is_new_range and in_target_range
range_val = h_start - l_start
label.delete(range_label)
mid_price = (h_start + l_start) / 2
range_label := label.new(bar_index, mid_price, text="Range: " + str.tostring(range_val, "#.##"), style=label.style_label_left, color=label_color, textcolor=color.black, size=size.small)
POC Volume Bar (Highest Volume in Range)What the highlighted POC bar means
🔶 1. Institutional interest
A POC often identifies where big money stepped in.
🔶 2. Support or resistance pivot
Large volume often signals:
• A reversal
• A breakout
• Or the beginning of a trend
🔶 3. Liquidity magnet
Price tends to revisit high-volume bars.
They act like magnets.
🔶 4. Trend confirmation or exhaustion
High volume on:
• Green candle → bullish participation
• Red candle → distribution / aggressive selling
Market Structure Volume Time Velocity ProfileThis is the Market Structure Volume Time Velocity Profile (MSVTVP). It combines event-based profiling with advanced metrics like Time and Velocity (Flow Rate). Instead of fixed time periods, profiles are anchored to critical market events (Swings, Structure Breaks, Delta Breaks), giving you a precise view of value development during specific market phases.
## The 3 Dimensions of the Market
Unlike standard tools that only show Volume, MSVTVP allows you
to switch between three critical metrics:
1. **VOLUME Profile (The "Where"):**
* Shows standard acceptance. High volume nodes (HVN)
are magnets for price.
2. **TIME Profile (The "How Long"):**
* Similar to TPO, it measures how long price spent at each
level.
* **High Time:** True acceptance and fair value.
* **Low Time:** Rejection or rapid movement.
3. **VELOCITY Profile (The "How Fast"):**
* Measures the **speed of trading** (Contracts per Second).
This reveals the hidden intent of market participants.
* **High Velocity (Fast Flow):** Aggression. Initiative
buyers/sellers are hitting market orders rapidly. Often
seen at breakouts or in liquidity vacu.
* **Low Velocity (Slow Flow):** Absorption. Massive passive
limit orders are slowing price down despite high volume.
Often seen at major reversals ("hitting a brick wall").
Key Features:
1. **Event-Based Profile Anchoring:** The indicator starts a new
profile based on one of three user-selected events
('Profile Anchor'):
- **Swing:** A new profile begins when the 'impulse baseline'
(derived from intra-bar delta) changes. This baseline
adjusts when a new **price pivot** is confirmed: When a
price **high** forms, the baseline moves to the **lower**
of its previous level or the peak delta (max of
delta O/C) at the pivot. When a price **low** forms, it
moves to the **higher** of its previous level or the
trough delta (min of delta O/C) at the pivot.
- **Structure:** A new profile begins immediately on the bar
that *confirms* a market structure break (e.g., a new HH
or LL, based on a sequence of price pivots).
- **Delta:** A new profile begins immediately on the bar
that *confirms* a break in the *cumulative delta's*
market structure (e.g., a new HH or LL in the delta).
Both 'Swing' and 'Delta' anchors are derived from the same
**continuous (non-resetting) Cumulative Volume Profile Delta (CVPD)**,
which is built from the intra-bar statistical analysis.
2. **Statistical Profile Engine:** For each bar in the anchored
period, the indicator builds a volume profile on a lower
'Intra-Bar Timeframe'. Instead of simple tick counting, it
uses advanced statistical models:
- **Allocation ('Allot model'):** 'PDF' (Probability Density
Function) distributes volume proportionally across the
bar's range based on an assumed statistical model
(e.g., T4-Skew). 'Classic' assigns all volume to
the close.
- **Buy/Sell Split ('Volume Estimator'):** 'Dynamic'
applies a model that analyzes candle wicks and
recent trend to estimate buy/sell pressure. 'Classic'
classifies all volume based on the candle color.
3. **Visualization & Lag:** The indicator plots the final
profile (as a polygon) and the developing statistical
lines (POC, VA, VWAP, StdDev).
- **Note on Lag:** All anchor events require `Pivot Right Bars`
for confirmation.
- In 'Structure' and 'Delta' mode, the developing lines
(POC, VA, etc.) are plotted using a **non-repainting**
method (showing the value from `pivRi` bars ago).
- In 'Swing' mode, the profile is plotted **retroactively**,
starting *from the bar where the pivot occurred*. The
developing lines are also plotted with this full
`pivRi` lag to align with the past data.
4. **Flexible Display Modes:** The finalized profile can be displayed
in three ways: 'Up/Down' (buy vs. sell), 'Total' (combined
volume), and 'Delta' (net difference).
5. **Dynamic Row Sizing:** Includes an option ('Rows per Percent')
to automatically adjust the number of profile rows (buckets)
based on the profile's price range.
6. **Integrated Alerts:** Includes 13 alerts that trigger for:
- A new profile reset ('Profile was resetted').
- Price crossing any of the 6 developing levels (POC,
VA High/Low, VWAP, StdDev High/Low).
- **Alert Lag Assumption:** In 'Swing' mode, alerts are
delayed to match the retroactively plotted lines.
In 'Structure' and 'Delta' modes, alerts fire in
**real-time** based on the *current price* crossing
the *current (repainting)* value of the metric, which
may **differ from the non-repainting plotted line.**
**Caution: Real-Time Data Behavior (Intra-Bar Repainting)**
This indicator uses high-resolution intra-bar data. As a result, the
values on the **current, unclosed bar** (the real-time bar) will
update dynamically as new intra-bar data arrives. This includes
the values used for real-time alerts in 'Structure' and
'Delta' modes.
---
**DISCLAIMER**
1. **For Informational/Educational Use Only:** This indicator is
provided for informational and educational purposes only. It does
not constitute financial, investment, or trading advice, nor is
it a recommendation to buy or sell any asset.
2. **Use at Your Own Risk:** All trading decisions you make based on
the information or signals generated by this indicator are made
solely at your own risk.
3. **No Guarantee of Performance:** Past performance is not an
indicator of future results. The author makes no guarantee
regarding the accuracy of the signals or future profitability.
4. **No Liability:** The author shall not be held liable for any
financial losses or damages incurred directly or indirectly from
the use of this indicator.
5. **Signals Are Not Recommendations:** The alerts and visual signals
(e.g., crossovers) generated by this tool are not direct
recommendations to buy or sell. They are technical observations
for your own analysis and consideration.
Multi-Symbol EMA Crossover Scanner with Multi-Timeframe AnalysisDescription
What This Indicator Does:
This indicator is a comprehensive market scanner that monitors up to 10 symbols simultaneously across 4 different timeframes (15-minute, 1-hour, 4-hour, and daily) to detect exponential moving average (EMA) crossovers in real-time. Instead of manually checking multiple charts and timeframes for EMA crossover signals, this scanner automatically does the work for you and presents all detected signals in a clean, organized table that updates continuously throughout the trading session.
Key Features:
Multi-Symbol Monitoring: Scan up to 10 different symbols at once (stocks, forex, crypto, or any TradingView symbol)
Multi-Timeframe Analysis: Simultaneously tracks 4 timeframes (15m, 1H, 4H, 1D) with toggle options to enable/disable each
Comprehensive EMA Pairs: Detects crossovers between all major EMA combinations: 20×50, 20×100, 20×200, 50×100, 50×200, and 100×200
Real-Time Signal Feed: Displays the most recent signals in a sorted table (newest first) with timestamp, direction, price, and EMA pair information
Session Filter: Built-in time filter (default 10:00-18:00) to focus on specific trading hours and avoid pre-market/after-hours noise
Pagination System: Navigate through signals using a page selector when you have more signals than fit in one view
Signal Statistics: Footer displays total signals, bullish/bearish breakdown, and page navigation hints
Customizable Display: Choose table position (4 corners), signals per page (5-20), and maximum signal history (10-100)
How It Works:
The scanner uses the request.security() function to fetch EMA data from multiple symbols and timeframes simultaneously. For each symbol-timeframe combination, it calculates four exponential moving averages (20, 50, 100, and 200 periods) and monitors for crossovers:
Bullish Crossovers (▲ Green):
Faster EMA crosses above slower EMA
Indicates potential upward momentum
Common entry signals for long positions
Bearish Crossovers (▼ Red):
Faster EMA crosses below slower EMA
Indicates potential downward momentum
Common entry signals for short positions or exits
The scanner prioritizes crossovers involving faster EMAs (20×50) over slower ones (100×200), as faster crossovers typically generate more frequent signals. Each detected crossover is stored with its timestamp, allowing the scanner to sort signals chronologically and remove duplicates within the same timeframe.
Signal Table Columns:
Sym: Symbol name (abbreviated, e.g., "ASELS" instead of "BIST:ASELS")
TF: Timeframe where the crossover occurred (15m, 1h, 4h, 1D)
⏰: Exact time of the crossover (HH:MM format in Istanbul timezone)
↕: Direction indicator (▲ bullish green / ▼ bearish red)
₺: Price level where the crossover occurred (average of the two EMAs)
MA: Which EMA pair crossed (e.g., "20×50", "50×200")
How to Use:
For Day Traders:
Enable 15m and 1h timeframes
Monitor symbols from your watchlist
Use crossovers as entry timing signals in the direction of the larger trend
Adjust the time filter to match your trading session (e.g., market open to 2 hours before close)
For Swing Traders:
Enable 4h and 1D timeframes
Focus on 50×200 and 100×200 crossovers (golden/death crosses)
Look for multiple timeframe confluence (same symbol showing bullish crossovers on both 4h and 1D)
Use as a pre-market scanner to identify potential setups for the day
For Multi-Market Traders:
Mix symbols from different markets (stocks, forex, crypto)
Use the scanner to identify which markets are showing the most momentum
Track relative strength by comparing crossover frequency across symbols
Identify rotation opportunities when one asset shows bullish signals while another shows bearish
Setup Recommendations:
Default BIST (Turkish Stock Market) Setup:
The code comes pre-configured with 10 popular BIST stocks:
ASELS, EKGYO, THYAO, AKBNK, PGSUS, ASTOR, OTKAR, ALARK, ISCTR, BIMAS
For US Stocks:
Replace with symbols like: NASDAQ:AAPL, NASDAQ:TSLA, NASDAQ:NVDA, NYSE:JPM, etc.
For Forex:
Use pairs like: FX:EURUSD, FX:GBPUSD, FX:USDJPY, OANDA:XAUUSD, etc.
For Crypto:
Use exchanges like: BINANCE:BTCUSDT, COINBASE:ETHUSD, BINANCE:SOLUSDT, etc.
Settings Guide:
Symbol List (10 inputs):
Enter any valid TradingView symbol in "EXCHANGE:TICKER" format
Use symbols you actively trade or monitor
Mix different asset classes if desired
Timeframe Toggles:
15 Minutes: High-frequency signals, best for day trading
1 Hour: Balanced frequency, good for intraday swing trades
4 Hours: Lower frequency, quality swing trade signals
1 Day: Low frequency, major trend changes only
Time Filter:
Start Hour (10): Beginning of your trading session
End Hour (18): End of your trading session
Prevents signals during low-liquidity periods
Adjust to match your market's active hours
Display Settings:
Table Position: Choose corner placement (doesn't interfere with other indicators)
Max Signals (40): Total historical signals to keep in memory
Signals Per Page (10): How many rows to show at once
Page Number: Navigate through signal history (auto-adjusts to available pages)
What Makes This Original:
Multi-symbol scanners exist on TradingView, but this indicator's originality comes from:
Comprehensive EMA Pair Coverage: Most scanners focus on 1-2 EMA pairs, this monitors 6 different combinations simultaneously
Unified Multi-Timeframe View: Presents signals from 4 timeframes in a single, chronologically sorted feed rather than separate panels
Session-Aware Filtering: Built-in time filter prevents signal overload from 24-hour markets
Smart Pagination: Handles large signal volumes gracefully with page navigation instead of scrolling
Signal Deduplication: Prevents the same crossover from appearing multiple times if it persists across several bars
Price-at-Cross Recording: Captures the exact price where the crossover occurred, not just that it happened
Real-Time Statistics: Live tracking of bullish vs bearish signal distribution
Trading Strategy Examples:
Trend Confirmation Strategy:
Find a symbol showing bullish crossover on 1D (major trend change)
Wait for pullback
Enter when 1h shows bullish crossover (confirmation)
Exit when 1h shows bearish crossover
Multi-Timeframe Confluence:
Look for symbols appearing multiple times with same direction
Example: ASELS shows ▲ on both 4h and 1D = strong bullish signal
Avoid symbols showing conflicting signals (▲ on 1h but ▼ on 4h)
Rotation Scanner:
Monitor 10+ symbols from the same sector
Identify which are turning bullish (▲) first
Enter leaders, avoid laggards
Rotate out when crossovers turn bearish (▼)
Important Considerations:
Not a Complete System: EMA crossovers should be confirmed with price action, volume, and support/resistance analysis
Whipsaw Risk: During consolidation, EMAs can cross back and forth frequently (especially on 15m timeframe)
Lag: EMAs are lagging indicators; crossovers occur after the move has already begun
False Signals: More common during sideways markets; work best in trending environments
Symbol Limits: TradingView has limits on request.security() calls; this scanner uses 40 calls (10 symbols × 4 timeframes)
Performance: On lower-end devices, scanning 10 symbols across 4 timeframes may cause slight delays in chart updates
Best Practices:
Start with 5 symbols and 2 timeframes, then expand as you get comfortable
Use in conjunction with a main chart for price context
Don't trade every signal—filter for high-quality setups
Backtest your favorite EMA pairs on your symbols to understand their reliability
Adjust the time filter to exclude lunch hours if your market has low midday volume
Check the footer statistics—if you're getting 50+ signals per day, tighten your time filter or reduce symbols
Technical Notes:
Uses lookahead=barmerge.lookahead_off to prevent future data leakage
Signals are stored in arrays and sorted by timestamp (newest first)
Automatic daily reset clears old signals to prevent memory buildup
Table dynamically resizes based on signal count
All times displayed in Europe/Istanbul timezone (configurable in code)
YCGH ATH DrawdownHow the Indicator Measures Drawdown from ATH
The indicator continuously tracks and calculates the percentage decline from the all-time high (ATH) using a systematic approach.
ATH Tracking Mechanism
Dynamic ATH Calculation: The script maintains a persistent variable that stores the highest price ever reached. On each bar, it compares the current high with the stored ATH using ath := math.max(ath, high), updating the ATH whenever a new peak is reached.
VIX Calm vs Choppy (Bar Version, VIX High Threshold)This indicator tracks market stability by measuring how long the VIX stays below or above a chosen intraday threshold. Instead of looking at VIX closes, it uses VIX high, so even a brief intraday spike will flip the regime into “choppy.”
The tool builds a running clock of consecutive bars spent in each regime:
Calm regime: VIX high stays below the threshold
Choppy regime: VIX high hits or exceeds the threshold
Calm streaks plot as positive bars (light blue background).
Choppy streaks plot as negative bars (dark pink background).
This gives a clean picture of how long the market has been stable vs volatile — useful for trend traders, breakout traders, and anyone who watches risk-on/risk-off conditions. A table shows the current regime and streak length for quick reference.
YCGH Drawdown PercentilesWhat This Indicator Does?
The Drawdown Percentiles indicator tracks how far below the all-time high (ATH) a stock or asset is currently trading, then displays statistical percentiles of historical drawdowns in a customizable table.
Percentile Analysis: It collects up to 5,000 historical bars of drawdown data, sorts them, and calculates user-selected percentiles (default: 10th, 30th, 50th) to show where current drawdowns rank historically.
Visual Display: A table shows each percentile threshold with color-coded drawdown values, helping you quickly assess whether the current drawdown is typical or extreme compared to historical patterns.
Practical Use Cases
Risk Assessment: Identify if current drawdowns fall within normal ranges or represent extreme conditions requiring position adjustments.
Entry/Exit Timing: Use percentile rankings to time entries during historically shallow drawdowns (better conditions) and reduce exposure during deep drawdowns.
Strategy Comparison: Compare drawdown patterns across different assets or trading strategies to evaluate risk-adjusted performance.
LapseBacktestingTableLibrary "LapseBacktestingMetrics"
This library provides a robust set of quantitative backtesting and performance evaluation functions for Pine Script strategies. It’s designed to help traders, quants, and developers assess risk, return, and robustness through detailed statistical metrics — including Sharpe, Sortino, Omega, drawdowns, and trade efficiency.
Built to enhance any trading strategy’s evaluation framework, this library allows you to visualize performance with the quantlapseTable() function, producing an interactive on-chart performance table.
Credit to EliCobra and BikeLife76 for original concept inspiration.
curve(disp_ind)
Retrieves a selected performance curve of your strategy.
Parameters:
disp_ind (simple string): Type of curve to plot. Options include "Equity", "Open Profit", "Net Profit", "Gross Profit".
Returns: (float) Corresponding performance curve value.
cleaner(disp_ind, plot)
Filters and displays selected strategy plots for clean visualization.
Parameters:
disp_ind (simple string): Type of display.
plot (simple float): Strategy plot variable.
Returns: (float) Filtered plot value.
maxEquityDrawDown()
Calculates the maximum equity drawdown during the strategy’s lifecycle.
Returns: (float) Maximum equity drawdown percentage.
maxTradeDrawDown()
Computes the worst intra-trade drawdown among all closed trades.
Returns: (float) Maximum intra-trade drawdown percentage.
consecutive_wins()
Finds the highest number of consecutive winning trades.
Returns: (int) Maximum consecutive wins.
consecutive_losses()
Finds the highest number of consecutive losing trades.
Returns: (int) Maximum consecutive losses.
no_position()
Counts the maximum consecutive bars where no position was held.
Returns: (int) Maximum flat days count.
long_profit()
Calculates total profit generated by long positions as a percentage of initial capital.
Returns: (float) Total long profit %.
short_profit()
Calculates total profit generated by short positions as a percentage of initial capital.
Returns: (float) Total short profit %.
prev_month()
Measures the previous month’s profit or loss based on equity change.
Returns: (float) Monthly equity delta.
w_months()
Counts the number of profitable months in the backtest.
Returns: (int) Total winning months.
l_months()
Counts the number of losing months in the backtest.
Returns: (int) Total losing months.
checktf()
Returns the time-adjusted scaling factor used in Sharpe and Sortino ratio calculations based on chart timeframe.
Returns: (float) Annualization multiplier.
stat_calc()
Performs complete statistical computation including drawdowns, Sharpe, Sortino, Omega, trade stats, and profit ratios.
Returns: (array)
.
f_colors(x, nv)
Generates a color gradient for performance values, supporting dynamic table visualization.
Parameters:
x (simple string): Metric label name.
nv (simple float): Metric numerical value.
Returns: (color) Gradient color value for table background.
quantlapseTable(option, position)
Displays an interactive Performance Table summarizing all major backtesting metrics.
Includes Sharpe, Sortino, Omega, Profit Factor, drawdowns, profitability %, and trade statistics.
Parameters:
option (simple string): Table type — "Full", "Simple", or "None".
position (simple string): Table position — "Top Left", "Middle Right", "Bottom Left", etc.
Returns: (table) On-chart performance visualization table.
This library empowers advanced quantitative evaluation directly within Pine Script®, ideal for strategy developers seeking deeper performance diagnostics and intuitive on-chart metrics.
Periodic Volume Time Velocity ProfileThis is the Periodic Volume Time Velocity Profile (PVTVP). It is an advanced professional profiling tool that goes beyond standard volume analysis by introducing Time and Velocity (Flow Rate) as profile dimensions.
By analyzing high-resolution intra-bar data, it builds
precise profiles for any custom period (Session, Day, Week, etc.),
helping you understand not just *where* the market traded,
but *how* it traded there.
## The 3 Dimensions of the Market
Unlike standard tools that only show Volume, PVTVP allows you
to switch between three critical metrics:
1. **VOLUME Profile (The "Where"):**
* Shows standard acceptance. High volume nodes (HVN)
are magnets for price.
2. **TIME Profile (The "How Long"):**
* Similar to TPO, it measures how long price spent at each
level.
* **High Time:** True acceptance and fair value.
* **Low Time:** Rejection or rapid movement.
3. **VELOCITY Profile (The "How Fast"):**
* Measures the **speed of trading** (Contracts per Second).
This reveals the hidden intent of market participants.
* **High Velocity (Fast Flow):** Aggression. Initiative
buyers/sellers are hitting market orders rapidly. Often
seen at breakouts or in liquidity vacuums.
* **Low Velocity (Slow Flow):** Absorption. Massive passive
limit orders are slowing price down despite high volume.
Often seen at major reversals ("hitting a brick wall").
## Key Features
1. **Statistical Volume Profile Engine:** For each bar in the selected
period, the indicator builds a complete volume profile on a lower
'Intra-Bar Timeframe'. Instead of simple tick counting, it uses
**statistical models ('PDF' allocation)** to distribute volume
across price levels and **advanced classifiers ('Dynamic' split)**
to determine the buy/sell pressure within that profile.
2. **Flexible Profile Display:** The **finalized profile** (plotted at
the end of each period) can be visualized in three distinct
ways: 'Up/Down' (buy vs. sell), 'Total' (combined volume),
and 'Delta' (net difference).
3. **Developing Key Levels:** The indicator also plots the developing
Point of Control (POC), Value Area (VA), VWAP, and Standard
Deviation bands in real-time as the period unfolds, providing
live insights into the emerging market structure.
4. **Dynamic Row Sizing:** Includes an option ('Rows per Percent')
to automatically adjust the number of profile rows (buckets)
based on the profile's price range, maintaining a consistent
visual density.
5. **Integrated Alerts:** Includes 12 alerts that trigger when the
main price crosses over or under the key developing levels:
POC, VWAP, Value Area High/Low, and the +/- Standard
Deviation bands.
**Caution: Real-Time Data Behavior (Intra-Bar Repainting)**
This indicator uses high-resolution intra-bar data. As a result, the
values on the **current, unclosed bar** (the real-time bar) will
update dynamically as new intra-bar data arrives. This behavior is
normal and necessary for this type of analysis. Signals should only
be considered final **after the main chart bar has closed.**
---
**DISCLAIMER**
1. **For Informational/Educational Use Only:** This indicator is
provided for informational and educational purposes only. It does
not constitute financial, investment, or trading advice, nor is
it a recommendation to buy or sell any asset.
2. **Use at Your Own Risk:** All trading decisions you make based on
the information or signals generated by this indicator are made
solely at your own risk.
3. **No Guarantee of Performance:** Past performance is not an
indicator of future results. The author makes no guarantee
regarding the accuracy of the signals or future profitability.
4. **No Liability:** The author shall not be held liable for any
financial losses or damages incurred directly or indirectly from
the use of this indicator.
5. **Signals Are Not Recommendations:** The alerts and visual signals
(e.g., crossovers) generated by this tool are not direct
recommendations to buy or sell. They are technical observations
for your own analysis and consideration.




















