X Tail that Wagsintraday session-framework and ETH-anchored VWAP tool for TradingView. It draws today’s OVN (ETH) high/mid/low, today’s RTH-day open, previous day open/high/low, and a carried ETH VWAP handle (yesterday’s 4:00 PM NY VWAP, projected forward) to give you a clean, non-repainting scaffold for bias, structure, and execution. All timestamps are New York–local with DST handled explicitly, so historical sessions align correctly across time changes.
Key Capabilities
ETH OVN Range (18:00 → 09:30 NY)
Captures the rolling overnight high/low and computes the mid; at 09:30 NY it locks those levels and extends them to 16:00 NY (same day).
Optional labels (size/color configurable) placed slightly to the right of the 4 PM timestamp for readability.
Daily Handles (Today & Previous Day)
Today’s open line starts at the ETH open (anchor preserved) and extends toward 4 PM NY (or up to the “current bar + 5 bars” cap), with label control.
Previous day open/high/low plotted as discrete reference lines for carry-over structure.
ETH-Anchored VWAP (Live) + Bands
ETH-anchored VWAP runs only during the active ETH session (DST-aware).
Optional VWAP bands (0.5×, 1.0×, 2.0× multipliers) plotted as line-break series.
Carried ETH VWAP Handle (PD 4 PM Snapshot)
At 16:00 NY, the script snapshots the final ETH VWAP value.
On the next ETH open, it projects that value as a static dashed line through the session (non-mutating, non-repainting), with optional label.
Labeling & Styling
Single-toggle label system with color and five sizes.
Per-line color/width controls for quick visual hierarchy.
Internal “tail” logic keeps right endpoints near price (open-anchored lines extend to min(4 PM, now + 5 bars)), avoiding chart-wide overdraw.
Robust Session Logic
All session boundaries computed in NY local time; DST rules applied for historical bars.
Cross-midnight windows handled safely (no gaps or misalignment around day rolls).
Primary Use Cases
Session Bias & Context
Use OVN H/M/L and today’s open to define structural bias zones before RTH begins. A break-and-hold above OVN mid, for example, can filter long ideas; conversely, rejection at OVN high can warn of mean reversion.
Carry-Forward Mean/Value Reference
The carried ETH VWAP (PD 4 PM) acts as a “value memory” line for the next day. Traders can:
Fade tests away from it in balanced conditions,
Use it as a pullback/acceptance gauge during trends,
Track liquidity grabs when price spikes through and reclaims.
Execution Planning & Risk
Anchor stops/targets around PD H/L and OVN H/M/L for well-defined invalidation.
Combine with your entry model (order-flow, momentum, or pattern) to time fades at range extremes or momentum breaks from OVN mid.
Confluence Mapping
Layer the tool with opening range tools, HTF zones, or profile/VWAPs (weekly/daily) to spot high-quality confluence where multiple references cluster.
Regime & Day-Type Read
Quickly see whether RTH accepts/rejects the OVN range or gravitates to PD VWAP handle, helping classify the day (trend, balanced, double-distribution, etc.).
Quick Start
Apply to your intraday chart (any instrument supported by TradingView; best on ≤15m for live intraday context).
In Current Day group, keep Open and OVN HL on; optionally display the mid.
In Previous Day group, enable PD Open/HL for carry-over levels.
Enable AVWAP if you want live ETH-anchored VWAP and its Bands for distance context.
Keep PD VWAP on to project yesterday’s 4 PM ETH VWAP as a static dashed line into today.
Use the Label group to size/color the on-chart tags.
Settings Overview (Plain-English)
Label: Toggle labels on/off; choose label text color and size.
Current Day:
Open (color/width) — daily open line anchored at ETH open.
OVN HL (and Mid) — overnight high/low and midpoint, locked at 09:30 and extended to 16:00.
AVWAP + Bands — ETH-anchored VWAP with optional 0.5×/1×/2× bands.
Previous Day:
PD Open/HL — yesterday’s daily handles.
PD VWAP — the carried snapshot of yesterday’s 4 PM ETH VWAP projected forward (dashed).
Notes & Best Practices
Time Zone: All session logic is hard-coded to America/New_York and DST-robust. No manual DST tweaks required.
Non-Repainting: The carried PD VWAP line is a snapshot; once drawn, it does not back-fill or mutate.
Intraday Use: Designed for intraday execution. It will display on higher TFs, but the session granularity is most informative at ≤15m.
Performance: Script caps lines/labels (500) and uses short “tails” to keep charts responsive.
Compatibility: Uses request.security(..., "D", series, lookahead_on) intentionally to lock daily handles early for planning; this is by design.
Typical Playbook Examples
Fade Extremes in Balance: As RTH opens inside OVN, look for rejection wicks at OVN High with confluence from PD VWAP handle overhead; risk above OVN High.
Trend Continuation: In directional sessions, acceptances above OVN Mid with price pulling back to the live ETH VWAP can offer continuation entries.
Reversion to Value: Sharp extensions away from the carried PD VWAP that quickly stall often revert to that handle; use it as a target or as an acceptance test.
Cari skrip untuk "weekly"
Liquidity Pool TimesThis script automatically plots key liquidity pool times on your chart. I will release an updated script that plots the names on the far right when i can figure it out. Until then you will see Monthly Open/Close Weekly Open/Close and Midnight/10AM open
BlackScrum Swing Boxes 1/2/3 After seeing influencers selling their indicator suite's online, I decided to start making replicas of them, maybe mine are better, maybe they are worse. I use them in my day to day trading and they help me make money, hopefully they help you make money.
Not financial advice, Do Your Own Research.
Everything provided without warranty or liability. If you stuff up, learn from it, get better, we all make mistakes.
// BlackScrum — 1/2/3-Bar Swing Boxes (auto timeframe)
//
// DESCRIPTION
// This indicator displays three swing-direction boxes (1B, 2B, 3B) in the top-right corner of the chart.
// The boxes automatically adapt to the chart's timeframe (15m, 1H, 4H, 1D, etc.).
// Each box represents the direction of the most recently confirmed swing pivot:
// • 1B → 1-bar swing (fastest, most sensitive)
// • 2B → 2-bar swing (medium confirmation)
// • 3B → 3-bar swing (slowest, strongest confirmation)
//
// COLORS
// • GREEN = last confirmed swing pivot was a higher low (up swing)
// • RED = last confirmed swing pivot was a lower high (down swing)
// • GREY = no clear swing yet (fresh/transition area)
//
// CONFLUENCE
// • ALL GREEN = bullish alignment across 1B, 2B, 3B → strong trend continuation signal
// • ALL RED = bearish alignment across all three → strong downtrend continuation signal
//
// HOW TO USE (TRADEPLAY)
//
// 1) ENTRIES
// • Aggressive entry → enter when ALL GREEN prints on your timeframe.
// • Safer pullback entry → wait for 1B to briefly turn red during a green 2B/3B,
// then flip back to green. Enter on the re-flip.
// • Multi-timeframe filter:
// Take longs only when higher TF (e.g., 1H/4H) boxes are at least neutral-to-green.
//
// 2) EXITS
// • Weakness exit → when 1B flips against your position while 2B is neutral/red.
// • Full exit → when ALL RED prints.
// • Time stop → if price hasn’t moved after several bars of your execution timeframe.
//
// 3) STOP-LOSS / RISK
// • Place stops beyond the latest opposite swing used by 2B or 3B.
// • Add 0.5–1× ATR buffer if your market has stop-hunt volatility.
// • Always size position based on the distance to the swing stop.
//
// 4) WHEN TO IGNORE SIGNALS
// • Chop zones → 1B flipping repeatedly while 2B/3B disagree.
// • News candles → wait for pivots to confirm on the *closed* bar.
//
// 5) USING WITH OTHER TOOLS
// • With a trend ribbon (e.g., Larsson-style):
// Only take ALL GREEN longs when the ribbon is UP, and ALL RED shorts when ribbon is DOWN.
// • With a Fear & Greed index:
// Prefer longs when F&G > 60,
// Avoid longs when F&G < 40 unless countertrend scalping.
//
// 6) TIMEFRAME GUIDANCE
// • Scalping: 5m / 15m, confirmed by 1H or 4H boxes.
// • Swinging: 1H / 4H with daily filter.
// • Positioning: 1D with weekly confirmation.
//
// 7) INTERPRETATION CHEATSHEET
// • 1B green, 2B grey, 3B red → short-term bounce inside higher timeframe downtrend.
// • 1B/2B green, 3B grey → early trend reversal forming.
// • All grey → fresh swing area; wait for direction.
//
// 8) CUSTOMIZATION
// • len1 / len2 / len3 control sensitivity (higher = slower & cleaner).
// • Can add a timeframe header box (e.g., “15m / 4H / 1D”).
// • Can add a multi-timeframe grid (e.g., 15m | 1H | 4H | 1D each with 1B/2B/3B).
//
// ====================================================================================================
dO / wO / mO + MA 50/200 + PrevDay H/L Description
This indicator plots key reference levels used by professional traders:
Daily Open (dO)
Weekly Open (wO)
Monthly Open (mO)
Previous Day High (pdH) and Previous Day Low (pdL)
Moving Averages: 50 & 200 SMA
Each level is drawn as a clean dotted white line with a fixed label directly on the price chart.
All levels can be individually toggled on or off via checkboxes in the settings panel.
The pdH/pdL lines start exactly from the candles that created them, providing clear structure for breakout, retracement, and liquidity analysis.
The 50/200 SMA are included for long-term trend context.
This tool is designed for traders who rely on multi-timeframe structure and precision levels for both intraday and swing strategies.
Features
Toggle visibility for dO, wO, mO, pdH, and pdL
Accurate placement of previous day levels
Lightweight and responsive
Clean minimal visual design
Supports any symbol and timeframe
Usage Notes
Perfect for confluence-based trading:
Combine pdH/pdL with session opens to identify key liquidity zones
Use SMA 50/200 for directional bias
Works on crypto, forex, indices, and equities
Golden Flow MapGolden Flow Mapis a multi–timeframe moving–average system
designed to reveal the underlying direction of long–term market flow,
beyond daily volatility or short–term signals.
This script overlays four major trend lines — each representing a different layer of market rhythm:
Timeframe Length Meaning
🟣 1D – 365 MA Annual average — the true life line of the trend
🔴 1D – 200 MA Institutional benchmark — the long-term threshold
🟢 1W – 20 MA Mid-cycle momentum guide
🟠 3D – 100 MA Wave transition detector — captures trend shifts early
By combining these four perspectives on a single chart,
you can instantly distinguish between a short-term bounce and a major trend reversal.
🧭 How to Use
When all four lines align in one direction → that’s the main current of the market.
If price loses the 200D or 365D, ignore small rebounds — the structure has shifted.
The cross between Weekly 20 and 3D 100 often marks a wave transition.
Focus on alignment order rather than crossovers —
markets ultimately return to the direction of the higher timeframe.
⚙️ Features
SMA / EMA toggle
Individual MA on/off controls
Built-in alerts for 200D and 1W20 cross events
🧠 Concept
“Indicators are not signals — they are maps.”
This tool is not meant to predict, but to reveal the pulse of the market
and guide you through its long-term structure.
✍️ Creator’s Note
Developed from DDU’s personal long-term trend framework,
this indicator serves as a visual compass to expand a trader’s vision
from short-term reactions to macro-level flow.
Golden Flow MapGolden Flow Map is a multi–timeframe moving–average system
designed to reveal the underlying direction of long–term market flow,
beyond daily volatility or short–term signals.
This script overlays four major trend lines — each representing a different layer of market rhythm:
Timeframe Length Meaning
🟣 1D – 365 MA Annual average — the true life line of the trend
🔴 1D – 200 MA Institutional benchmark — the long-term threshold
🟢 1W – 20 MA Mid-cycle momentum guide
🟠 3D – 100 MA Wave transition detector — captures trend shifts early
By combining these four perspectives on a single chart,
you can instantly distinguish between a short-term bounce and a major trend reversal.
🧭 How to Use
When all four lines align in one direction → that’s the main current of the market.
If price loses the 200D or 365D, ignore small rebounds — the structure has shifted.
The cross between Weekly 20 and 3D 100 often marks a wave transition.
Focus on alignment order rather than crossovers —
markets ultimately return to the direction of the higher timeframe.
⚙️ Features
SMA / EMA toggle
Individual MA on/off controls
Built-in alerts for 200D and 1W20 cross events
🧠 Concept
“Indicators are not signals — they are maps.”
This tool is not meant to predict, but to reveal the pulse of the market
and guide you through its long-term structure.
✍️ Creator’s Note
Developed from DDU’s personal long-term trend framework,
this indicator serves as a visual compass to expand a trader’s vision
from short-term reactions to macro-level flow.
Overnight Time Box Overnight Time Box (22:59 → 09:59, minutes & TZ)
Automatically draws a time-based box for a customizable window that can cross midnight. Perfect for marking the overnight range up to London open (e.g., 22:59–09:59 in Europe/Bucharest), but works with any minute-level window.
What it does
Builds a daily box covering all price action between two user-defined times (e.g., 22:59 → 09:59).
Tracks session High/Low in real time and can plot extended HL lines for reference.
Keeps historical boxes on the chart for backtesting and review (no flicker, no errors).
How to use
Add the script to an intraday chart.
Configure:
Time zone (default: Europe/Bucharest).
Interval (HHMM-HHMM) — e.g., 2259-0959 (minutes supported).
Optional: High/Low lines, fill color, border color, line width.
Use on intraday timeframes (M1–H4).
Note: On Daily/Weekly/Monthly, a heads-up label reminds you it’s designed for intraday use.
Inputs
Time zone: correct DST handling.
Interval (HHMM-HHMM): supports windows that span midnight.
Draw High/Low lines: extended HL guides for the session.
Colors & widths: full visual customization.
Use cases
Mark the overnight range into London open (10:00 RO).
Delimit Killzones / ICT Silver Bullet windows.
Study range, liquidity raids, FVGs before major sessions.
Tech notes
Built on Pine Script v5 using input.session → stable, DST-safe.
Increased max_boxes_count / max_lines_count to preserve history.
Boxes are “frozen” at session end and remain on chart.
Limitations
Intended for intraday only.
One interval per script instance; attach multiple instances for multiple windows.
Multi-Sigma Bands [fmb]Multi-Sigma Bands
What It Is
Multi-Sigma Bands is a volatility-based statistical channel that visualizes how far price deviates from its long-term mean in standard deviation (σ) units. It offers a high-signal, low-noise view of trend strength, volatility regimes, and statistical extremes directly on price, keeping the chart clean and focused without any secondary pane.
What It Does
The indicator calculates a central basis line—using SMA, EMA, RMA, or Linear Regression—and surrounds it with multi-sigma envelopes, typically at ±1σ, ±2σ, and ±3σ. These bands represent the statistically expected ranges of price movement. The blue zone (±1σ) reflects normal volatility where roughly two-thirds of price activity occurs. The yellow zone (±2σ) captures moderate extensions that account for most of the remaining moves, while the red zone (±3σ) marks rare extremes that fall outside the 99% probability boundary. Each region is color-coded for immediate visual interpretation, allowing you to see at a glance when price is trading in calm, stretched, or extreme conditions.
Why It Was Built
Conventional Bollinger Bands tend to compress and expand too aggressively over short windows, making it difficult to read structural volatility changes. Multi-Sigma Bands addresses this by providing a longer statistical view. It helps distinguish mean reversion from sustained breakouts, quantifies trend acceleration or exhaustion, and highlights when markets move into statistically unusual zones that often precede reversals or volatility resets. It is particularly effective on monthly or weekly charts for assessing where a market sits within its long-term distribution. For instance, when the S&P 500 trades above +2σ for several months, risk-reward conditions often tighten.
How It Works
You can choose your preferred basis type—SMA, EMA, RMA, or Linear Regression—and decide whether to force monthly data even on lower timeframes for consistent macro analysis. Adjustable parameters include length, sigma multipliers, and standard deviation smoothing for fine-tuning sensitivity. The script automatically fills the space between the bands, creating a layered color map that clearly shows each volatility zone.
How To Use
When price remains above +1σ, it often confirms strong upside momentum. Consistent rejections at ±2σ or ±3σ zones can suggest exhaustion and potential mean reversion. Narrowing bands often precede volatility expansion, signaling that a breakout or trend change may be near. Multi-Sigma Bands can be used on its own for macro context or as an overlay with directional systems to refine entries and exits.
Credits
Created by Fullym0bile
Enhanced with leading trend detection logic.
www.fullymobile.ca
Volume Cluster Support and Resistance Levels [QuantAlgo]🟢 Overview
This indicator identifies statistically significant support and resistance levels through volume cluster analysis, isolating price zones characterized by elevated trading activity and institutional participation. By quantifying areas where volume concentration exceeded historical norms, it reveals price levels with demonstrated supply-demand imbalances that exhibit persistent influence on subsequent price action. The methodology is asset-agnostic and timeframe-independent, applicable across equities, cryptocurrencies, forex, and commodities from intraday to weekly intervals.
🟢 Key Features
1. Support and Resistance Levels
The indicator scans historical price data to identify bars where volume exceeds a user-defined threshold multiplier relative to the rolling average. For each qualifying bar, a representative price is calculated using the average of high, low, and close. Proximate price levels within a specified percentage range are then aggregated into discrete clusters using volume-weighted averaging, eliminating redundant signals. Clusters are ranked by cumulative volume to determine statistical significance. Finally, the indicator plots horizontal levels at each cluster price: support levels (green) below current price indicate zones where historical buying pressure exceeded selling pressure, while resistance levels (red) above current price mark zones where sellers historically dominated. These levels represent areas of established liquidity and price discovery, where institutional order flow previously concentrated.
The Touch Count (T) metric quantifies historical price interaction frequency, while Total Volume (TV) measures aggregate trading activity at each level, providing objective criteria for assessing level strength and trade execution decisions.
2. Volume Histogram
A histogram appears below the price chart, displaying relative volume for each bar within the lookback period, with bar height scaled to the maximum volume observed. Green bars represent up-periods (close > open) indicating buying pressure, while red bars show down-periods (close < open) indicating selling pressure. This visualization helps you confirm the validity of support/resistance levels by seeing where volume actually spiked, identify accumulation/distribution patterns, and validate breakouts by checking if they occur on above-average volume.
3. Built-in Alerts
Automated alerts trigger when price crosses below support levels or breaks above resistance levels, allowing you to monitor multiple assets without constant chart-watching.
4. Customizable Color Schemes
The indicator provides four preset color configurations (Classic, Aqua, Cosmic, Custom) optimized for visual clarity across different charting environments. Each scheme maintains consistent color mapping for support and resistance zones across both level lines and volume histogram components. The Custom configuration permits full color specification to accommodate individual charting setups, ensuring optimal visual contrast for extended analysis sessions.
Classic:
Aqua:
Cosmic:
Custom:
🟢 Pro Tips
→ Trade entry optimization: Execute long positions at support levels with high touch counts or upon confirmed resistance breakouts accompanied by above-average volume
→ Risk parameter definition: Position stop-loss orders near identified support/resistance zones with statistical significance to minimize premature exits
→ Breakout validation: Require volume confirmation exceeding historical average when price penetrates resistance to filter false breakouts
→ Level strength assessment: Prioritize levels with higher touch counts and total volume metrics for enhanced probability trade setups
→ Multi-timeframe confluence: Synthesize support/resistance levels across multiple timeframes to identify high-conviction zones where daily support aligns with 4-hour resistance structures
Ethereum Sleepy Wallets – 6-Month DormancyWhat This Indicator Does
It measures how many Ethereum addresses have been completely inactive for at least 6 months (≥ 180 days) — using official Glassnode and CryptoQuant on-chain metrics.
This reveals deep conviction among long-term ETH holders
Core Concept: Direct 6-Month Dormancy
The indicator uses two precise on-chain signals:
Total Unique ETH Addresses
From GLASSNODE:ETH_ADDRESSES or CRYPTOQUANT:ETH_TOTAL_ADDRESSES
Counts every address ever used on Ethereum
Addresses Inactive ≥ 180 Days
From GLASSNODE:ETH_ADDRESSES_GREATER_THAN_180_DAYS
Counts every address that has not sent or received ETH in 6+ months
Sleepy ETH = Dormant ≥ 180 Days
Sleepy Ratio % = (Sleepy / Total) × 100
This is not an estimate — it’s direct, real dormancy.
Why 6-Month Dormancy Matters
Short-term activity (7-day) = noise from DeFi, NFTs, trading
180-day inactivity = true HODLing — coins untouched through entire market cycles
Historically:
Rising dormancy → supply drying up → bullish pressure
Falling dormancy → long-term holders selling → bearish warning
How It Works (Step-by-Step)
Fetches daily data from Glassnode (Pro+) or CryptoQuant (free)
Selects real data if available; otherwise uses robust fallback
Calculates raw sleepy wallets = addresses inactive ≥ 180 days
Smooths the signal with a 21-day simple moving average (SMA) to filter noise
Computes Sleepy Ratio % for instant conviction reading
Displays live info table with exact values on every bar
How to Use It
Signal
Interpretation
Suggested Action
Sleepy Ratio > 75% and rising
Extreme long-term HODLing
Strong accumulation — buy/hold
Smooth Sleepy trending up
Dormancy growing over 21 days
Bullish supply shock forming
Sleepy Ratio < 68% and falling
Long-term coins re-entering circulation
Caution — possible distribution
Smooth Sleepy dropping fast
HODLers breaking after 6+ months
Bearish warning — consider exits
Use on Daily (D) or Weekly (W) charts for clean, reliable signals.
Pro+ vs Free Mode
Mode
Data Source
Accuracy
Pro+ (Glassnode ON)
Real 180-day dormancy metric
100% precise
Free (Glassnode OFF)
CryptoQuant + price-scaled estimate
~80% historical correlation
Toggle in settings: Use Glassnode Data
What Makes This Indicator Original
First open-source script to directly plot Ethereum’s 6-month dormancy using official ADDRESSES_GREATER_THAN_180_DAYS
No fake math — uses true inactivity, not active address subtraction
Dual-source logic ensures usability on any TradingView plan
Dual output: raw sleepy count + 21-day SMA for precision and trend
Live info table shows real-time values and data source
BUY LOW, BUY MORE, SELL HIGH -BUFFET STRATEGY LITE__________________________________________________________________________
Buy Low, Buy More, Sell High With Buffett Meter (LITE – JTMarketAI)
__________________________________________________________________________
Category: Quantitative Momentum & Liquidity Flow
Author: JTMarketAI
Architecture: Non-Repainting
This strategy accumulates into validated pullbacks during fear cycles, scales intelligently as price declines into liquidity support, and exits when momentum weakens after meaningful run-ups. It uses synthetic higher-timeframe OHLC data (non-repainting), liquidity imbalance confirmation, adaptive KAMA trend logic, RSI validation, and a live Buffett macro valuation gauge.
This is a patient, conviction-based accumulation engine designed for equities.
It is not a scalp bot.
__________________________________________________________________________
Core Features
__________________________________________________________________________
Non-repainting (confirmed bars only)
Synthetic HTF OHLC (no lookahead)
Dynamic trailing exit preserves ~80–87% of peak profit
Bull vs Bear liquidity dominance and flow imbalance
Rolling lowest-low tracking (LLL)
NY-session alignment (default)
Buffett Macro Meter integration
Technical Highlights
Flow-confidence derived from volume-order pressure
Adaptive KAMA smoothing for lower-lag confirmation
Daily > Weekly > Monthly synthetic aggregation
LLL progression display for trend exhaustion
Fully profiler-optimized
Supports averaging down when pyramiding enabled
__________________________________________________________________________
Why It Does Not Repaint
__________________________________________________________________________
All state updates occur only on confirmed bars
Synthetic HTFs built without lookahead
Persistent arrays freeze historical values
Trailing highs updated only after confirmation
No forward-reference to future bars
__________________________________________________________________________
Lite Edition Notes
__________________________________________________________________________
Manual trading focused
Buffett Meter enabled
Up to 20 trades per session
Visual dashboard included
No alerts, automation, or webhooks (PRO unlocks IBKR + TradersPost)
__________________________________________________________________________
Limitations
__________________________________________________________________________
Best on intraday equities (1m–4h)
Designed for US stocks only
High-resource if full visuals enabled
Avoid penny stocks and extremely low-volume tickers
Does not guard against after-hours gaps or major news moves
__________________________________________________________________________
Warnings
__________________________________________________________________________
Contrarian scaling requires discipline and patience
Expect longer-duration trades, not rapid scalps
Use on quality tickers unlikely to permanently collapse
Confirm price behavior outside cash session
Test manually before automating anything
Not suitable for every market environment or asset
Notes on Philosophy
This strategy attempts to accumulate when markets overshoot lower, and distribute after recovery momentum fades. It reflects a patient, value-driven approach built on the principle of buying fear and reducing exposure into strength.
__________________________________________________________________________
Disclaimer
__________________________________________________________________________
For research and educational use only. Not financial advice. Past performance does not guarantee future results. Test thoroughly and use appropriate risk management.
__________________________________________________________________________
Hashtags
__________________________________________________________________________
#buffett #quantstrategy #valuemomentum #accumulation #contrarian #nonrepaint #equitystrategy #swingtrading #liquidityanalysis #synthetichtf #tradingviewstrategy
BUY LOW, BUY MORE, SELL HIGH - MARKET FLOW STRATEGY LITE
TV Description - Buffett Meter Lite
body{font-family:Arial,Helvetica,sans-serif;max-width:900px;margin:32px auto;line-height:1.4} h1,h2{margin:16px 0 8px}
Buy Low, Buy More, Sell High With Buffett Meter (Lite v1283 – JTM)
Category: Quantitative Momentum & Liquidity Flow
Author: JTM
Architecture: Non-Repainting
This strategy accumulates into validated pullbacks during fear cycles, scales intelligently as price declines into liquidity support, and exits when momentum weakens after meaningful run-ups. It uses synthetic higher-timeframe OHLC data (non-repainting), liquidity imbalance confirmation, adaptive KAMA trend logic, RSI validation, and a live Buffett macro valuation gauge.
This is a patient, conviction-based accumulation engine designed for equities.
It is not a scalp bot.
Core Features
Non-repainting (confirmed bars only)
Synthetic HTF OHLC (no lookahead)
Dynamic trailing exit preserves ~80–87% of peak profit
Bull vs Bear liquidity dominance and flow imbalance
Rolling lowest-low tracking (LLL)
NY-session alignment (default)
Buffett Macro Meter integration
Technical Highlights
Flow-confidence derived from volume-order pressure
Adaptive KAMA smoothing for lower-lag confirmation
Daily > Weekly > Monthly synthetic aggregation
LLL progression display for trend exhaustion
Fully profiler-optimized
Supports averaging down when pyramiding enabled
Why It Does Not Repaint
All state updates occur only on confirmed bars
Synthetic HTFs built without lookahead
Persistent arrays freeze historical values
Trailing highs updated only after confirmation
No forward-reference to future bars
Lite Edition Notes
Manual trading focused
Buffett Meter enabled
Limit of 20 trades per session
Buffet Meter dashboard included
No alerts, automation, or webhooks (PRO unlocks IBKR + TradersPost)
Limitations
Best on intraday equities (1m–4h)
Designed for US stocks only
High-resource if full visuals enabled
Avoid penny stocks and extremely low-volume tickers
Does not guard against after-hours gaps or major news moves
Warnings
Contrarian scaling requires discipline and patience
Expect longer-duration trades, not rapid scalps
Use on quality tickers unlikely to permanently collapse
Confirm price behavior outside cash session
Test manually before automating anything
Not suitable for every market environment or asset
Notes on Philosophy
This strategy attempts to accumulate when markets overshoot lower, and distribute after recovery momentum fades. It reflects a patient, value-driven approach built on the principle of buying fear and reducing exposure into strength.
This is edge-based, not “trade every wiggle” logic
“Be fearful when others are greedy, and greedy when others are fearful.” — Buffett
“The stock market transfers money from the impatient to the patient.” — Buffett
Disclaimer
For research and educational use only. Not financial advice. Past performance does not guarantee future results. Test thoroughly and use appropriate risk management.
Hashtags
#buffett #quantstrategy #valuemomentum #accumulation #contrarian #nonrepaint #equitystrategy #swingtrading #liquidityanalysis #synthetichtf #tradingviewstrategy
Time & Session Dividers### indicator Summary
This indicator is a powerful utility designed to help you visualize time-based market structure by drawing customizable vertical lines on your chart. It allows you to clearly mark the beginning of new timeframes (like hours, days, or weeks) and highlight specific trading sessions or time slots (like the London open or a news event).
It comes with **6 independent dividers** that you can configure to your exact needs:
* **3 Timeframe Dividers**
* **3 Custom Time Slot Dividers**
### Key Features
* **Timeframe Separators:** Set up to 3 different higher timeframes (e.g., 1H, 4H, 1D). The indicator will automatically draw a vertical line at the start of each new bar for that timeframe, helping you easily see hourly, daily, or weekly boundaries.
* **Custom Time Slots (Sessions):** Define up to 3 specific time windows (e.g., "09:30-16:00" for the New York session). The indicator will draw a line at the **start** of this session and another line at the **end**, allowing you to isolate specific periods of market activity.
* **Full Customization:** Each of the 6 dividers is fully independent and can be customized with:
* A simple toggle to turn it on or off.
* A unique color.
* A line style (Solid, Dotted, or Dashed).
* A toggle to show or hide its text label.
* **Smart Labels:** Labels for timeframe dividers display the timeframe (e.g., "4H"), while labels for time slots automatically format to show the precise start or end time (e.g., "09:30" and "16:00").
### How to Use
1. Add the "Timeframe Vertical Lines" indicator to your chart.
2. Open the indicator's **Settings** panel.
3. **To add a timeframe line (e.g., Daily):**
* Go to the "Timeframe Divider 1" group.
* Check the "Show Divider 1" box.
* Set the "Timeframe 1" to "1D".
* Adjust the color, style, and text visibility to your liking.
4. **To add a session line (e.g., London Session):**
* Go to the "Time Slot Divider 1" group.
* Check the "Show Time Slot Divider 1" box.
* Set the "Time Slot 1" to your desired session, e.g., "0800-1700".
* Adjust the color and style. The script will now draw lines at 08:00 and 17:00 (based on the chart's timezone).
5. Repeat the process using the other available divider slots to build a complete temporal map of your chart.
Multi-Anchor VWAP | Trade Symmetry🧩 Multi-Anchor VWAP
Description:
Dynamic VWAP anchored to Session, Week, Month, Quarter, and Year — all in one view.
Full Description:
This indicator plots multiple VWAPs (Volume-Weighted Average Prices) simultaneously — each anchored to a different time period:
Session, Week, Month, Quarter, and Year.
💡 Ideal for traders who track institutional mean reversion and liquidity zones across multiple timeframes.
Features
✅ Session, Weekly, Monthly, Quarterly, and Yearly Anchored VWAPs
✅ Independent color and visibility controls for each anchor
✅ Adjustable label position and size
✅ Option to hide VWAPs on Daily or higher charts
✅ Clean and efficient performance
This tool helps you visualize volume-weighted mean levels where price often reacts — offering a clear map of bias and equilibrium across all major time horizons.
Pinbar MTF - No Repaint# Pinbar MTF - No Repaint Indicator
## Complete Technical Documentation
---
## 📊 Overview
**Pinbar MTF (Multi-Timeframe) - No Repaint** is a professional-grade TradingView Pine Script indicator designed to detect high-probability pinbar reversal patterns with advanced filtering systems. The indicator is specifically engineered to be **100% non-repainting**, making it reliable for both live trading and backtesting.
### Key Features
✅ **Non-Repainting** - Signals only appear AFTER bar closes, never disappear
✅ **Three-Layer Filter System** - ATR, SWING, and RSI filters
✅ **Automatic SL/TP Calculation** - Based on risk:reward ratios
✅ **Real-time Alerts** - TradingView notifications for all signals
✅ **Visual Trade Management** - Lines, labels, and areas for entries, stops, and targets
✅ **Backtesting Ready** - Reliable historical data for strategy testing
---
## 🎯 What is a Pinbar?
A **Pinbar (Pin Bar/Pinocchio Bar)** is a single candlestick pattern that indicates a potential price reversal:
### Bullish Pinbar (BUY Signal)
- **Long lower wick** (rejection of lower prices)
- **Small body at the top** of the candle
- Shows buyers rejected sellers' attempt to push price down
- Forms at support levels or swing lows
- Entry signal for LONG positions
### Bearish Pinbar (SELL Signal)
- **Long upper wick** (rejection of higher prices)
- **Small body at the bottom** of the candle
- Shows sellers rejected buyers' attempt to push price up
- Forms at resistance levels or swing highs
- Entry signal for SHORT positions
---
## 🔧 How the Indicator Works
### 1. **Pinbar Detection Logic**
The indicator analyzes the **previous closed bar ** to identify pinbar patterns:
```
Bullish Pinbar Requirements:
- Lower wick > 72% of total candle range (adjustable)
- Upper wick < 28% of total candle range
- Close > Open (bullish candle body)
Bearish Pinbar Requirements:
- Upper wick > 72% of total candle range (adjustable)
- Lower wick < 28% of total candle range
- Close < Open (bearish candle body)
```
**Why check ?** By analyzing the previous completed bar, we ensure the pattern is fully formed and won't change, preventing repainting.
---
### 2. **Three-Layer Filter System**
#### 🔍 **Filter #1: ATR (Average True Range) Filter**
- **Purpose**: Ensures the pinbar has significant size
- **Function**: Only signals if pinbar range ≥ ATR value
- **Benefit**: Filters out small, insignificant pinbars
- **Settings**:
- Enable/Disable toggle
- ATR Period (default: 7)
**Example**: If ATR = 50 pips, only pinbars with 50+ pip range will signal.
---
#### 🔍 **Filter #2: SWING Filter** (Always Active)
- **Purpose**: Confirms pinbar forms at swing highs/lows
- **Function**: Validates the pinbar is an absolute high/low
- **Benefit**: Identifies true reversal points
- **Settings**:
- Swing Candles (default: 3)
**How it works**:
- For bullish pinbar: Checks if low is lowest of past 3 bars
- For bearish pinbar: Checks if high is highest of past 3 bars
**Example**: With 3 swing candles, a bullish pinbar must have the lowest low among the last 3 bars.
---
#### 🔍 **Filter #3: RSI (Relative Strength Index) Filter**
- **Purpose**: Confirms momentum conditions
- **Function**: Prevents signals in extreme momentum zones
- **Benefit**: Avoids counter-trend trades
- **Settings**:
- Enable/Disable toggle
- RSI Period (default: 7)
- RSI Source (Close, Open, High, Low, HL2, HLC3, OHLC4)
- Overbought Level (default: 70)
- Oversold Level (default: 30)
**Logic**:
- Bullish Pinbar: Only signals if RSI < 70 (not overbought)
- Bearish Pinbar: Only signals if RSI > 30 (not oversold)
---
### 3. **Stop Loss Calculation**
Two methods available:
#### Method A: ATR-Based Stop Loss (Recommended)
```
Bullish Pinbar:
SL = Pinbar Low - (1 × ATR)
Bearish Pinbar:
SL = Pinbar High + (1 × ATR)
```
**Benefit**: Dynamic stops that adapt to market volatility
#### Method B: Fixed Pips Stop Loss
```
Bullish Pinbar:
SL = Pinbar Low - (Fixed Pips)
Bearish Pinbar:
SL = Pinbar High + (Fixed Pips)
```
**Settings**:
- Calculate Stop with ATR (toggle)
- Stop Pips without ATR (default: 5)
---
### 4. **Take Profit Calculation**
Take Profit is calculated based on Risk:Reward ratio:
```
Bullish Trade:
TP = Entry + (Entry - SL) × Risk:Reward Ratio
Bearish Trade:
TP = Entry - (SL - Entry) × Risk:Reward Ratio
```
**Example**:
- Entry: 1.2000
- SL: 1.1950 (50 pip risk)
- RR: 2:1
- TP: 1.2100 (100 pip reward = 50 × 2)
**Settings**:
- Risk:Reward Ratio (default: 1.0, range: 0.1 to 10.0)
---
## 📈 Visual Elements
### On-Chart Displays
1. **Signal Markers**
- 🟢 **Green Triangle Up** = Bullish Pinbar (BUY)
- 🔴 **Red Triangle Down** = Bearish Pinbar (SELL)
- Placed directly on the pinbar candle
2. **Entry Labels**
- Green "BUY" label with entry price
- Red "SELL" label with entry price
- Shows exact entry level
3. **Stop Loss Lines**
- 🔴 Red horizontal line
- "SL" label
- Extends 20 bars forward
4. **Take Profit Lines**
- 🟢 Green horizontal line
- "TP" label
- Extends 20 bars forward
5. **Risk/Reward Areas** (Optional)
- Red shaded box = Risk zone (Entry to SL)
- Green shaded box = Reward zone (Entry to TP)
- Visual risk:reward visualization
6. **Info Table** (Top Right)
- Displays current settings
- Shows filter status (ON/OFF)
- Real-time RSI value
- Quick reference panel
---
## 🔔 Alert System
Three alert types available:
### 1. Combined Alert: "Pinbar Signal (Any Direction)"
- Fires for BOTH bullish and bearish pinbars
- **Best for**: General monitoring
- **Message**: "Pinbar Signal Detected on {TICKER} at {PRICE}"
### 2. Bullish Alert: "Bullish Pinbar Alert"
- Fires ONLY for BUY signals
- **Best for**: Long-only strategies
- **Message**: "BUY Signal on {TICKER} at {PRICE}"
### 3. Bearish Alert: "Bearish Pinbar Alert"
- Fires ONLY for SELL signals
- **Best for**: Short-only strategies
- **Message**: "SELL Signal on {TICKER} at {PRICE}"
---
## ⚙️ Input Parameters Reference
### **Filters Group**
| Parameter | Default | Range | Description |
|-----------|---------|-------|-------------|
| ATR Filter on Pinbar Range? | ✅ ON | Boolean | Enable/disable ATR filter |
| ATR Period | 7 | 1+ | Lookback period for ATR calculation |
| Swing Candles | 3 | 1+ | Bars to check for swing high/low |
| RSI Filter on Pinbar? | ❌ OFF | Boolean | Enable/disable RSI filter |
| RSI Period | 7 | 2+ | Lookback period for RSI calculation |
| RSI Source | Close | Multiple | Price data for RSI (Close/Open/High/Low/etc) |
| RSI Overbought Level | 70 | 50-100 | Upper threshold for RSI filter |
| RSI Oversold Level | 30 | 0-50 | Lower threshold for RSI filter |
### **Pinbar Detection Group**
| Parameter | Default | Range | Description |
|-----------|---------|-------|-------------|
| Shadow % vs Body | 72 | 50-95 | Minimum wick size as % of total range |
### **Visualization Group**
| Parameter | Default | Range | Description |
|-----------|---------|-------|-------------|
| Show SL and TP Lines? | ✅ ON | Boolean | Display stop loss and take profit lines |
| Show SL and TP Area? | ❌ OFF | Boolean | Show shaded risk/reward boxes |
### **Risk Management Group**
| Parameter | Default | Range | Description |
|-----------|---------|-------|-------------|
| Risk:Reward Ratio | 1.0 | 0.1-10.0 | Target profit vs risk (1.0 = 1:1, 2.0 = 1:2) |
| Calculate Stop with ATR? | ✅ ON | Boolean | Use ATR for stop calculation |
| Stop Pips without ATR | 5 | 1+ | Fixed pip stop when ATR disabled |
---
## 🚫 Non-Repainting Architecture
### What is Repainting?
**Repainting** occurs when an indicator's historical signals differ from what appeared in real-time. This makes backtesting unreliable and can lead to false confidence in a strategy.
### How This Indicator Prevents Repainting
1. **Closed Bar Analysis**
- All calculations use ` ` offset (previous bar)
- Only analyzes COMPLETED candles
- Signals appear on the bar AFTER the pinbar closes
2. **Confirmed Swing Points**
- Waits for sufficient bar history before signaling
- Only checks historical bars that cannot change
- Prevents premature swing detection
3. **Static Alert Timing**
- Alerts fire only after bar completion
- No conditional logic that changes historically
- Same results in replay mode and live trading
### Verification Method
To verify non-repainting behavior:
1. Apply indicator to chart
2. Note signal locations and prices
3. Refresh browser / reload chart
4. **Signals remain in exact same locations**
---
## 💼 Trading Strategy Guidelines
### Entry Rules
**For Bullish Pinbar (LONG):**
1. Wait for green triangle to appear
2. Enter at close of pinbar (shown in label)
3. Alternative: Enter on break of pinbar high
4. Place stop loss at red SL line
5. Set target at green TP line
**For Bearish Pinbar (SHORT):**
1. Wait for red triangle to appear
2. Enter at close of pinbar (shown in label)
3. Alternative: Enter on break of pinbar low
4. Place stop loss at red SL line
5. Set target at green TP line
### Risk Management
- **Position Sizing**: Risk only 1-2% of account per trade
- **Stop Loss**: Always use the calculated SL (never move it wider)
- **Take Profit**: Use calculated TP or trail stop after 1:1 RR
- **Multiple Timeframes**: Confirm signals on higher timeframe
### Best Practices
✅ **DO:**
- Wait for bar to close before entering
- Trade in direction of higher timeframe trend
- Use on liquid markets with clear support/resistance
- Combine with price action analysis
- Keep a trading journal
❌ **DON'T:**
- Enter before bar closes (prevents seeing full pattern)
- Trade against strong trends
- Ignore the filters (they improve win rate)
- Risk more than 2% per trade
- Trade every signal (be selective)
---
## 📊 Backtesting & Data Export
### Available Data Points
The indicator exports these values for strategy development:
| Output | Description |
|--------|-------------|
| Bullish Signal | 1 = BUY signal, 0 = No signal |
| Bearish Signal | 1 = SELL signal, 0 = No signal |
| Bull SL | Stop loss level for long trades |
| Bull TP | Take profit level for long trades |
| Bull Entry | Entry price for long trades |
| Bear SL | Stop loss level for short trades |
| Bear TP | Take profit level for short trades |
| Bear Entry | Entry price for short trades |
### How to Use in Strategy
These values can be accessed by Pine Script strategies using:
```pine
indicator_values = request.security(syminfo.tickerid, timeframe.period,
)
```
---
## 🎓 Understanding the Filters
### Why Use Multiple Filters?
Single-indicator systems often generate too many false signals. This indicator uses a **confluence approach**:
1. **Pinbar Pattern** = Price rejection detected
2. **+ SWING Filter** = Rejection at key level
3. **+ ATR Filter** = Significant move
4. **+ RSI Filter** = Favorable momentum
**Result**: Higher probability setups with better risk:reward
### Filter Optimization
**Conservative Settings** (Fewer, Higher Quality Signals):
- ATR Filter: ON
- Swing Candles: 5
- RSI Filter: ON
- Shadow %: 75%
**Aggressive Settings** (More Signals, More Noise):
- ATR Filter: OFF
- Swing Candles: 2
- RSI Filter: OFF
- Shadow %: 65%
**Balanced Settings** (Recommended):
- ATR Filter: ON
- Swing Candles: 3
- RSI Filter: OFF (or ON for trending markets)
- Shadow %: 72%
---
## 🔍 Troubleshooting
### "No Signals Appearing"
**Possible Causes:**
1. Filters are too strict
2. No pinbars forming on chart
3. Insufficient bar history
**Solutions:**
- Reduce Shadow % to 65%
- Reduce Swing Candles to 2
- Disable ATR or RSI filters temporarily
- Check that chart has enough data loaded
### "Too Many Signals"
**Solutions:**
- Enable ATR filter
- Increase Swing Candles to 4-5
- Enable RSI filter
- Increase Shadow % to 75-80%
### "Signals Appearing Late"
**This is normal behavior!** The indicator:
- Analyzes previous closed bar
- Signals appear on the bar AFTER the pinbar
- This is what prevents repainting
- Signal latency is 1 bar (by design)
---
## 📝 Technical Specifications
**Indicator Type:** Overlay (displays on price chart)
**Pine Script Version:** 5
**Max Labels:** 500
**Max Lines:** 500
**Repainting:** None (100% non-repainting)
**Data Window Values:** 8 exported values
**Alert Types:** 3 (Combined, Bullish, Bearish)
**Performance:**
- Lightweight script (fast execution)
- Works on all timeframes
- Compatible with all markets (Forex, Crypto, Stocks, Futures)
- No data snooping bias
---
## 🎯 Use Cases
### 1. **Swing Trading**
- Timeframe: Daily, 4H
- Filter Settings: All enabled
- Best for: Catching major reversals
### 2. **Day Trading**
- Timeframe: 15m, 1H
- Filter Settings: ATR + SWING only
- Best for: Intraday reversals
### 3. **Scalping**
- Timeframe: 5m, 15m
- Filter Settings: SWING only (aggressive)
- Best for: Quick reversals (requires experience)
### 4. **Position Trading**
- Timeframe: Weekly, Daily
- Filter Settings: All enabled + high RR (2:1 or 3:1)
- Best for: Long-term trend reversal catches
---
## 🏆 Advantages Over Other Pinbar Indicators
✅ **Guaranteed Non-Repainting** - Many pinbar indicators repaint; this one never does
✅ **Automatic SL/TP** - No manual calculation needed
✅ **Multi-Layer Filtering** - Reduces false signals significantly
✅ **Visual Trade Management** - Clear entry, stop, and target levels
✅ **Flexible Configuration** - Adaptable to any trading style
✅ **Alert System** - Never miss a setup
✅ **Backtesting Ready** - Reliable historical data
✅ **Professional Grade** - Suitable for live trading
---
## 📚 Educational Resources
### Recommended Reading on Pinbars
- "The Pin Bar Trading Strategy" by Nial Fuller
- "Price Action Trading" by Al Brooks
- TradingView Education: Price Action Patterns
### Practice Recommendations
1. Paper trade signals for 20+ trades before live trading
2. Backtest on different timeframes and markets
3. Keep detailed records of all trades
4. Analyze winning vs losing setups
5. Refine filter settings based on results
---
## ⚖️ Disclaimer
This indicator is a tool for technical analysis and does not guarantee profits. Trading involves substantial risk of loss. Past performance is not indicative of future results.
- Always use proper risk management
- Never risk more than you can afford to lose
- Consider your trading experience and objectives
- Seek independent financial advice if needed
---
## 📧 Version Information
**Current Version:** 1.0
**Last Updated:** 2024
**Compatibility:** TradingView Pine Script v5
**Status:** Production Ready
---
## 🔄 Future Enhancements (Potential)
Possible future additions:
- Multi-timeframe confirmation option
- Volume filter integration
- Customizable color schemes
- Win rate statistics display
- Partial profit taking levels
- Trailing stop functionality
---
## 📖 Quick Start Guide
### 5-Minute Setup
1. **Add to Chart**
- Open TradingView
- Go to Pine Editor
- Paste the code
- Click "Add to Chart"
2. **Configure Settings**
- Open indicator settings (gear icon)
- Start with default settings
- Enable "Show SL and TP Lines"
3. **Set Alert**
- Right-click indicator name
- Click "Add Alert"
- Select "Pinbar Signal (Any Direction)"
- Configure notification method
4. **Test**
- Scroll back on chart
- Verify signals make sense
- Check that signals don't repaint
5. **Trade** (After Practice!)
- Wait for alert
- Verify signal quality
- Enter, place SL/TP
- Manage trade
---
## 🎯 Final Thoughts
The **Pinbar MTF - No Repaint** indicator is designed for serious traders who value:
- **Reliability** over flashy signals
- **Quality** over quantity
- **Honesty** over false promises
This indicator will NOT:
- Make you rich overnight
- Win every trade
- Replace proper trading education
This indicator WILL:
- Identify high-probability reversal setups
- Save you analysis time
- Provide consistent, non-repainting signals
- Help you develop a systematic trading approach
**Success in trading comes from:**
1. Proper education (60%)
2. Risk management (30%)
3. Technical tools like this indicator (10%)
Use this tool as part of a complete trading plan, not as a standalone solution.
Fibonacci Auto Retracement & HTF candles ReferenceAdvanced Higher Timeframe (HTF) Candle & Fibonacci Viewer
Overview:
The Advanced HTF Candle & Fibonacci Viewer is a professional Trading View indicator designed to help traders overlay higher timeframe price structures onto lower timeframe charts. By combining daily candle analysis with precise Fibonacci retracement levels, this tool allows traders to identify critical support and resistance zones, potential breakouts, and retracement opportunities without switching charts.
Special Thanks:
This script includes a small part of coding inspired by Zeiierman, whose work on HTF analysis provided the foundation for visualizing higher timeframe structures. Full credit to Zeiierman for their invaluable contribution to the Trading View community.
Key Features:
1. Multi-Day HTF Range Display
Automatically displays high and low of 1–7 previous days.
Highlights candle bodies and wicks for clear structure visualization.
Ideal for spotting daily ranges and breakout levels.
2. Dynamic Fibonacci Levels
Standard levels: 0%, 11.8%, 23.6%, 38.2%, 50%, 61.8%, 76.4%, 88.2%, 100%.
Optional mid-level lines for intraday support/resistance identification.
Levels adjust automatically to reflect price action direction.
3. Customizable Labels & Colors
Adjustable text size, color, transparency, and offset.
Fully customizable candle and Fibonacci colors.
Mid-level lines can be shown or hidden for a cleaner look.
4. Persistent Levels
Levels remain until the next trading session or breakout, helping track trends and retracements consistently.
5. Multi-Timeframe Optimization
Works on any chart timeframe, from 1-minute to weekly charts.
Provides higher timeframe insight while trading on lower timeframes.
Why Traders Love This Indicator:
View higher timeframe action without switching charts.
Identify high-probability entry and exit zones.
Combine with other indicators for complete market analysis.
Useful for swing traders, day traders, and scalpers alike.
Customization Options:
Number of previous days (1–7)
Show/hide mid-level lines
Show/hide labels
Customize label size, color, and offset
Customize Fibonacci and candle colors
Ideal Use Cases:
Swing Trading: Identify daily key levels for entry, exit, and stop-loss.
Day Trading: Use HTF ranges on intraday charts to spot breakouts and reversals.
Fibonacci Analysis: Locate retracement zones efficiently.
Trend Confirmation: Validate trades with higher timeframe structure.
Summary:
The Advanced HTF Candle & Fibonacci Viewer is a powerful tool for traders seeking clarity, structure, and precision. With higher timeframe insight overlaid on active charts and proper credit to Zeiierman for their HTF coding contribution, this indicator helps traders make informed, confident decisions in any market.
Multi-timeframe Pivot PointThis indicator is a lightweight indicator designed to display higher timeframe pivot levels on your chart.
It helps traders quickly identify key support and resistance zones derived from higher timeframes (such as daily or weekly pivots) while analyzing lower timeframes (e.g., 15m or 1h charts).
Calculation Logic
This indicator uses the classic pivot point formula, calculated from high, low, and close values:
PP = (High + Low + Close) / 3
R1 = 2 * PP - Low
S1 = 2 * PP - High
R2 = PP + (High - Low)
S2 = PP - (High - Low)
R3 = R1 + (High - Low)
S3 = S1 - (High - Low)
Additionally, it includes breakout levels:
HBOP = PP + PP + (High - Low) - Low
LBOP = PP + PP - (High - Low) - High
Cumulative Volume Profile DeltaThis indicator calculates the Cumulative Volume Profile Delta (CVPD). It constructs a high-resolution volume profile for each bar using intra-bar data, then derives and accumulates the delta from that profile to show net buying/selling pressure.
Key Features:
Statistical Volume Profile Engine: For each bar, the indicator builds a high-resolution 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 before accumulation.
Periodic Accumulation: The CVPD accumulation is anchored to a user-defined 'Anchor Timeframe' (e.g., daily, weekly). This cyclical reset allows to analyze the build-up of pressure within specific trading periods.
"Delta Candle" Visualization: The periodic CVPD is shown as a candle, where:
Open: The CVPD value at the start of the period (or zero).
High/Low: Represent the peak buying (CVD High) and selling (CVD Low) pressure within that period's profile.
Close: The final net delta value (CVD) for the period.
Dual CVD & Divergence Engine: The indicator calculates two CVPDs: a Periodic one (for plotting) and a Continuous one (non-resetting). The continuous line is used as a stable source for the built-in divergence engine (detecting Regular, Hidden, and Exaggerated).
Dynamic Divergence Plotting: Divergence markers are plotted relative to the periodic (candle) CVPD. They automatically adjust their vertical position after a reset to remain visually aligned with the plotted candles.
Note on Confirmation (Lag): Divergence signals rely on a pivot confirmation method to ensure they do not repaint.
The Start of a- divergence is only detected after the confirming pivot is fully formed (a delay based on Pivot Right Bars).
The End of a divergence is detected either instantly (if the signal is invalidated by price action) or with a delay (when a new, non-divergent pivot is confirmed).
Multi-Timeframe (MTF) Capability:
MTF Output: The entire analysis (Delta Candles, Divergences) can be calculated on a higher timeframe (using the Timeframe input), with standard options to handle gaps (Fill Gaps) and prevent repainting (Wait for...).
Limitation: The Divergence detection engine (pivDiv) is disabled if a Higher Timeframe (HTF) is selected.
Integrated Alerts: Includes 18 comprehensive alerts for:
The start and end of all 6 divergence types.
The periodic CVPD crossing the zero line.
Conditions of agreement or disagreement between the delta and the main bar's direction.
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
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.
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.
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.
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.
Signals Are Not Recommendations: The alerts and visual signals (e.Example: crossovers) generated by this tool are not direct recommendations to buy or sell. They are technical observations for your own analysis and consideration.
Cumulative Volume DeltaThis Cumulative Volume Delta (CVD) indicator analyzes intra-bar volume dynamics. It introduces a periodic reset mechanism, anchoring the accumulation to a user-defined timeframe (e.g., daily, weekly) for cyclical analysis.
Key Features:
Dual CVD Calculation: The indicator computes two CVD values simultaneously:
Periodic CVD: Resets on the user-defined 'Anchor Timeframe'. This is plotted as "Delta Candles".
Continuous CVD: Accumulates volume continuously (non-resetting) and is used as the source for divergence detection.
Intra-Bar Delta Analysis: Uses a lower timeframe ('Intra-Bar Timeframe') to calculate buy/sell pressure based on the direction of the intra-bar candles.
"Delta Candle" Visualization: The periodic CVD is shown as a candle, where:
Open: The CVD value at the start of the period (or zero).
High/Low: Represent the peak buying (CVD High) and selling (CVD Low) pressure within that period.
Close: The final net delta value for that period.
Full Divergence Suite (Class A, B, C): A built-in engine automatically detects and plots Regular (A), Hidden (B), and Exaggerated (C) divergences between price and the continuous CVD line.
Dynamic Divergence Plotting: Divergence markers are plotted relative to the periodic (candle) CVD. They automatically adjust their vertical position after a reset to remain visually aligned with the plotted candles.
Note on Confirmation (Lag): Divergence signals rely on a pivot confirmation method to ensure they do not repaint.
The Start of a- divergence is only detected after the confirming pivot is fully formed (a delay based on Pivot Right Bars).
The End of a divergence is detected either instantly (if the signal is invalidated by price action) or with a delay (when a new, non-divergent pivot is confirmed).
Multi-Timeframe (MTF) Capability:
MTF Output: The entire dual-CVD analysis can be run on a higher timeframe (using the Timeframe input), with standard options to handle gaps (Fill Gaps) and prevent repainting (Wait for...).
Limitation: The Divergence detection engine (pivDiv) is disabled if a Higher Timeframe (HTF) is selected.
Integrated Alerts: Includes 18 comprehensive alerts for:
The start and end of all 6 divergence types.
The periodic CVD crossing the zero line.
Conditions of agreement or disagreement between the delta and the main bar's direction.
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
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.
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.
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.
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.
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.
Scientific Correlation Testing FrameworkScientific Correlation Testing Framework - Comprehensive Guide
Introduction to Correlation Analysis
What is Correlation?
Correlation is a statistical measure that describes the degree to which two assets move in relation to each other. Think of it like measuring how closely two dancers move together on a dance floor.
Perfect Positive Correlation (+1.0): Both dancers move in perfect sync, same direction, same speed
Perfect Negative Correlation (-1.0): Both dancers move in perfect sync but in opposite directions
Zero Correlation (0): The dancers move completely independently of each other
In financial markets, correlation helps us understand relationships between different assets, which is crucial for:
Portfolio diversification
Risk management
Pairs trading strategies
Hedging positions
Market analysis
Why This Script is Special
This script goes beyond simple correlation calculations by providing:
Two different correlation methods (Pearson and Spearman)
Statistical significance testing to ensure results are meaningful
Rolling correlation analysis to track how relationships change over time
Visual representation for easy interpretation
Comprehensive statistics table with detailed metrics
Deep Dive into the Script's Components
1. Input Parameters Explained-
Symbol Selection:
This allows you to select the second asset to compare with the chart's primary asset
Default is Apple (NASDAQ:AAPL), but you can change this to any symbol
Example: If you're viewing a Bitcoin chart, you might set this to "NASDAQ:TSLA" to see if Bitcoin and Tesla are correlated
Correlation Window (60): This is the number of periods used to calculate the main correlation
Larger values (e.g., 100-500) provide more stable, long-term correlation measures
Smaller values (e.g., 10-50) are more responsive to recent price movements
60 is a good balance for most daily charts (about 3 months of trading days)
Rolling Correlation Window (20): A shorter window to detect recent changes in correlation
This helps identify when the relationship between assets is strengthening or weakening
Default of 20 is roughly one month of trading days
Return Type: This determines how price changes are calculated
Simple Returns: (Today's Price - Yesterday's Price) / Yesterday's Price
Easy to understand: "The asset went up 2% today"
Log Returns: Natural logarithm of (Today's Price / Yesterday's Price)
More mathematically elegant for statistical analysis
Better for time-additive properties (returns over multiple periods)
Less sensitive to extreme values.
Confidence Level (95%): This determines how certain we want to be about our results
95% confidence means we accept a 5% chance of being wrong (false positive)
Higher confidence (e.g., 99%) makes the test more strict
Lower confidence (e.g., 90%) makes the test more lenient
95% is the standard in most scientific research
Show Statistical Significance: When enabled, the script will test if the correlation is statistically significant or just due to random chance.
Display options control what you see on the chart:
Show Pearson/Spearman/Rolling Correlation: Toggle each correlation type on/off
Show Scatter Plot: Displays a scatter plot of returns (limited to recent points to avoid performance issues)
Show Statistical Tests: Enables the detailed statistics table
Table Text Size: Adjusts the size of text in the statistics table
2.Functions explained-
calcReturns():
This function calculates price returns based on your selected method:
Log Returns:
Formula: ln(Price_t / Price_t-1)
Example: If a stock goes from $100 to $101, the log return is ln(101/100) = ln(1.01) ≈ 0.00995 or 0.995%
Benefits: More symmetric, time-additive, and better for statistical modeling
Simple Returns:
Formula: (Price_t - Price_t-1) / Price_t-1
Example: If a stock goes from $100 to $101, the simple return is (101-100)/100 = 0.01 or 1%
Benefits: More intuitive and easier to understand
rankArray():
This function calculates the rank of each value in an array, which is used for Spearman correlation:
How ranking works:
The smallest value gets rank 1
The second smallest gets rank 2, and so on
For ties (equal values), they get the average of their ranks
Example: For values
Sorted:
Ranks: (the two 2s tie for ranks 1 and 2, so they both get 1.5)
Why this matters: Spearman correlation uses ranks instead of actual values, making it less sensitive to outliers and non-linear relationships.
pearsonCorr():
This function calculates the Pearson correlation coefficient:
Mathematical Formula:
r = (nΣxy - ΣxΣy) / √
Where x and y are the two variables, and n is the sample size
What it measures:
The strength and direction of the linear relationship between two variables
Values range from -1 (perfect negative linear relationship) to +1 (perfect positive linear relationship)
0 indicates no linear relationship
Example:
If two stocks have a Pearson correlation of 0.8, they have a strong positive linear relationship
When one stock goes up, the other tends to go up in a fairly consistent proportion
spearmanCorr():
This function calculates the Spearman rank correlation:
How it works:
Convert each value in both datasets to its rank
Calculate the Pearson correlation on the ranks instead of the original values
What it measures:
The strength and direction of the monotonic relationship between two variables
A monotonic relationship is one where as one variable increases, the other either consistently increases or decreases
It doesn't require the relationship to be linear
When to use it instead of Pearson:
When the relationship is monotonic but not linear
When there are significant outliers in the data
When the data is ordinal (ranked) rather than interval/ratio
Example:
If two stocks have a Spearman correlation of 0.7, they have a strong positive monotonic relationship
When one stock goes up, the other tends to go up, but not necessarily in a straight-line relationship
tStatistic():
This function calculates the t-statistic for correlation:
Mathematical Formula: t = r × √((n-2)/(1-r²))
Where r is the correlation coefficient and n is the sample size
What it measures:
How many standard errors the correlation is away from zero
Used to test the null hypothesis that the true correlation is zero
Interpretation:
Larger absolute t-values indicate stronger evidence against the null hypothesis
Generally, a t-value greater than 2 (in absolute terms) is considered statistically significant at the 95% confidence level
criticalT() and pValue():
These functions provide approximations for statistical significance testing:
criticalT():
Returns the critical t-value for a given degrees of freedom (df) and significance level
The critical value is the threshold that the t-statistic must exceed to be considered statistically significant
Uses approximations since Pine Script doesn't have built-in statistical distribution functions
pValue():
Estimates the p-value for a given t-statistic and degrees of freedom
The p-value is the probability of observing a correlation as strong as the one calculated, assuming the true correlation is zero
Smaller p-values indicate stronger evidence against the null hypothesis
Standard interpretation:
p < 0.01: Very strong evidence (marked with **)
p < 0.05: Strong evidence (marked with *)
p ≥ 0.05: Weak evidence, not statistically significant
stdev():
This function calculates the standard deviation of a dataset:
Mathematical Formula: σ = √(Σ(x-μ)²/(n-1))
Where x is each value, μ is the mean, and n is the sample size
What it measures:
The amount of variation or dispersion in a set of values
A low standard deviation indicates that the values tend to be close to the mean
A high standard deviation indicates that the values are spread out over a wider range
Why it matters for correlation:
Standard deviation is used in calculating the correlation coefficient
It also provides information about the volatility of each asset's returns
Comparing standard deviations helps understand the relative riskiness of the two assets.
3.Getting Price Data-
price1: The closing price of the primary asset (the chart you're viewing)
price2: The closing price of the secondary asset (the one you selected in the input parameters)
Returns are used instead of raw prices because:
Returns are typically stationary (mean and variance stay constant over time)
Returns normalize for price levels, allowing comparison between assets of different values
Returns represent what investors actually care about: percentage changes in value
4.Information Table-
Creates a table to display statistics
Only shows on the last bar to avoid performance issues
Positioned in the top right of the chart
Has 2 columns and 15 rows
Populating the Table
The script then populates the table with various statistics:
Header Row: "Metric" and "Value"
Sample Information: Sample size and return type
Pearson Correlation: Value, t-statistic, p-value, and significance
Spearman Correlation: Value, t-statistic, p-value, and significance
Rolling Correlation: Current value
Standard Deviations: For both assets
Interpretation: Text description of the correlation strength
The table uses color coding to highlight important information:
Green for significant positive results
Red for significant negative results
Yellow for borderline significance
Color-coded headers for each section
=> Practical Applications and Interpretation
How to Interpret the Results
Correlation Strength
0.0 to 0.3 (or 0.0 to -0.3): Weak or no correlation
The assets move mostly independently of each other
Good for diversification purposes
0.3 to 0.7 (or -0.3 to -0.7): Moderate correlation
The assets show some tendency to move together (or in opposite directions)
May be useful for certain trading strategies but not extremely reliable
0.7 to 1.0 (or -0.7 to -1.0): Strong correlation
The assets show a strong tendency to move together (or in opposite directions)
Can be useful for pairs trading, hedging, or as a market indicator
Statistical Significance
p < 0.01: Very strong evidence that the correlation is real
Marked with ** in the table
Very unlikely to be due to random chance
p < 0.05: Strong evidence that the correlation is real
Marked with * in the table
Unlikely to be due to random chance
p ≥ 0.05: Weak evidence that the correlation is real
Not marked in the table
Could easily be due to random chance
Rolling Correlation
The rolling correlation shows how the relationship between assets changes over time
If the rolling correlation is much different from the long-term correlation, it suggests the relationship is changing
This can indicate:
A shift in market regime
Changing fundamentals of one or both assets
Temporary market dislocations that might present trading opportunities
Trading Applications
1. Portfolio Diversification
Goal: Reduce overall portfolio risk by combining assets that don't move together
Strategy: Look for assets with low or negative correlations
Example: If you hold tech stocks, you might add some utilities or bonds that have low correlation with tech
2. Pairs Trading
Goal: Profit from the relative price movements of two correlated assets
Strategy:
Find two assets with strong historical correlation
When their prices diverge (one goes up while the other goes down)
Buy the underperforming asset and short the outperforming asset
Close the positions when they converge back to their normal relationship
Example: If Coca-Cola and Pepsi are highly correlated but Coca-Cola drops while Pepsi rises, you might buy Coca-Cola and short Pepsi
3. Hedging
Goal: Reduce risk by taking an offsetting position in a negatively correlated asset
Strategy: Find assets that tend to move in opposite directions
Example: If you hold a portfolio of stocks, you might buy some gold or government bonds that tend to rise when stocks fall
4. Market Analysis
Goal: Understand market dynamics and interrelationships
Strategy: Analyze correlations between different sectors or asset classes
Example:
If tech stocks and semiconductor stocks are highly correlated, movements in one might predict movements in the other
If the correlation between stocks and bonds changes, it might signal a shift in market expectations
5. Risk Management
Goal: Understand and manage portfolio risk
Strategy: Monitor correlations to identify when diversification benefits might be breaking down
Example: During market crises, many assets that normally have low correlations can become highly correlated (correlation convergence), reducing diversification benefits
Advanced Interpretation and Caveats
Correlation vs. Causation
Important Note: Correlation does not imply causation
Example: Ice cream sales and drowning incidents are correlated (both increase in summer), but one doesn't cause the other
Implication: Just because two assets move together doesn't mean one causes the other to move
Solution: Look for fundamental economic reasons why assets might be correlated
Non-Stationary Correlations
Problem: Correlations between assets can change over time
Causes:
Changing market conditions
Shifts in monetary policy
Structural changes in the economy
Changes in the underlying businesses
Solution: Use rolling correlations to monitor how relationships change over time
Outliers and Extreme Events
Problem: Extreme market events can distort correlation measurements
Example: During a market crash, many assets may move in the same direction regardless of their normal relationship
Solution:
Use Spearman correlation, which is less sensitive to outliers
Be cautious when interpreting correlations during extreme market conditions
Sample Size Considerations
Problem: Small sample sizes can produce unreliable correlation estimates
Rule of Thumb: Use at least 30 data points for a rough estimate, 60+ for more reliable results
Solution:
Use the default correlation length of 60 or higher
Be skeptical of correlations calculated with small samples
Timeframe Considerations
Problem: Correlations can vary across different timeframes
Example: Two assets might be positively correlated on a daily basis but negatively correlated on a weekly basis
Solution:
Test correlations on multiple timeframes
Use the timeframe that matches your trading horizon
Look-Ahead Bias
Problem: Using information that wouldn't have been available at the time of trading
Example: Calculating correlation using future data
Solution: This script avoids look-ahead bias by using only historical data
Best Practices for Using This Script
1. Appropriate Parameter Selection
Correlation Window:
For short-term trading: 20-50 periods
For medium-term analysis: 50-100 periods
For long-term analysis: 100-500 periods
Rolling Window:
Should be shorter than the main correlation window
Typically 1/3 to 1/2 of the main window
Return Type:
For most applications: Log Returns (better statistical properties)
For simplicity: Simple Returns (easier to interpret)
2. Validation and Testing
Out-of-Sample Testing:
Calculate correlations on one time period
Test if they hold in a different time period
Multiple Timeframes:
Check if correlations are consistent across different timeframes
Economic Rationale:
Ensure there's a logical reason why assets should be correlated
3. Monitoring and Maintenance
Regular Review:
Correlations can change, so review them regularly
Alerts:
Set up alerts for significant correlation changes
Documentation:
Keep notes on why certain assets are correlated and what might change that relationship
4. Integration with Other Analysis
Fundamental Analysis:
Combine correlation analysis with fundamental factors
Technical Analysis:
Use correlation analysis alongside technical indicators
Market Context:
Consider how market conditions might affect correlations
Conclusion
This Scientific Correlation Testing Framework provides a comprehensive tool for analyzing relationships between financial assets. By offering both Pearson and Spearman correlation methods, statistical significance testing, and rolling correlation analysis, it goes beyond simple correlation measures to provide deeper insights.
For beginners, this script might seem complex, but it's built on fundamental statistical concepts that become clearer with use. Start with the default settings and focus on interpreting the main correlation lines and the statistics table. As you become more comfortable, you can adjust the parameters and explore more advanced applications.
Remember that correlation analysis is just one tool in a trader's toolkit. It should be used in conjunction with other forms of analysis and with a clear understanding of its limitations. When used properly, it can provide valuable insights for portfolio construction, risk management, and pair trading strategy development.
LibTmFrLibrary "LibTmFr"
This is a utility library for handling timeframes and
multi-timeframe (MTF) analysis in Pine Script. It provides a
collection of functions designed to handle common tasks related
to period detection, session alignment, timeframe construction,
and time calculations, forming a foundation for
MTF indicators.
Key Capabilities:
1. **MTF Period Engine:** The library includes functions for
managing higher-timeframe (HTF) periods.
- **Period Detection (`isNewPeriod`):** Detects the first bar
of a given timeframe. It includes custom logic to handle
multi-month and multi-year intervals where
`timeframe.change()` may not be sufficient.
- **Bar Counting (`sinceNewPeriod`):** Counts the number of
bars that have passed in the current HTF period or
returns the final count for a completed historical period.
2. **Automatic Timeframe Selection:** Offers functions for building
a top-down analysis framework:
- **Automatic HTF (`autoHTF`):** Suggests a higher timeframe
(HTF) for broader context based on the current timeframe.
- **Automatic LTF (`autoLTF`):** Suggests an appropriate lower
timeframe (LTF) for granular intra-bar analysis.
3. **Timeframe Manipulation and Comparison:** Includes tools for
working with timeframe strings:
- **Build & Split (`buildTF`, `splitTF`):** Functions to
programmatically construct valid Pine Script timeframe
strings (e.g., "4H") and parse them back into their
numeric and unit components.
- **Comparison (`isHigherTF`, `isActiveTF`, `isLowerTF`):**
A set of functions to check if a given timeframe is
higher, lower, or the same as the script's active timeframe.
- **Multiple Validation (`isMultipleTF`):** Checks if a
higher timeframe is a practical multiple of the current
timeframe. This is based on the assumption that checking
if recent, completed HTF periods contained more than one
bar is a valid proxy for preventing data gaps.
4. **Timestamp Interpolation:** Contains an `interpTimestamp()`
function that calculates an absolute timestamp by
interpolating at a given percentage across a specified
range of bars (e.g., 50% of the way through the last
20 bars), enabling time calculations at a resolution
finer than the chart's native bars.
---
**DISCLAIMER**
This library is provided "AS IS" and for informational and
educational purposes only. It does not constitute financial,
investment, or trading advice.
The author assumes no liability for any errors, inaccuracies,
or omissions in the code. Using this library to build
trading indicators or strategies is entirely at your own risk.
As a developer using this library, you are solely responsible
for the rigorous testing, validation, and performance of any
scripts you create based on these functions. The author shall
not be held liable for any financial losses incurred directly
or indirectly from the use of this library or any scripts
derived from it.
buildTF(quantity, unit)
Builds a Pine Script timeframe string from a numeric quantity and a unit enum.
The resulting string can be used with `request.security()` or `input.timeframe`.
Parameters:
quantity (int) : series int Number to specifie how many `unit` the timeframe spans.
unit (series TFUnit) : series TFUnit The size category for the bars.
Returns: series string A Pine-style timeframe identifier, e.g.
"5S" → 5-seconds bars
"30" → 30-minute bars
"120" → 2-hour bars
"1D" → daily bars
"3M" → 3-month bars
"24M" → 2-year bars
splitTF(tf)
Splits a Pine‑timeframe identifier into numeric quantity and unit (TFUnit).
Parameters:
tf (string) : series string Timeframe string, e.g.
"5S", "30", "120", "1D", "3M", "24M".
Returns:
quantity series int The numeric value of the timeframe (e.g., 15 for "15", 3 for "3M").
unit series TFUnit The unit of the timeframe (e.g., TFUnit.minutes, TFUnit.months).
Notes on strings without a suffix:
• Pure digits are minutes; if divisible by 60, they are treated as hours.
• An "M" suffix is months; if divisible by 12, it is converted to years.
autoHTF(tf)
Picks an appropriate **higher timeframe (HTF)** relative to the selected timeframe.
It steps up along a coarse ladder to produce sensible jumps for top‑down analysis.
Mapping → chosen HTF:
≤ 1 min → 60 (1h) ≈ ×60
≤ 3 min → 180 (3h) ≈ ×60
≤ 5 min → 240 (4h) ≈ ×48
≤ 15 min → D (1 day) ≈ ×26–×32 (regular session 6.5–8 h)
> 15 min → W (1 week) ≈ ×64–×80 for 30m; varies with input
≤ 1 h → W (1 week) ≈ ×32–×40
≤ 4 h → M (1 month) ≈ ×36–×44 (~22 trading days / month)
> 4 h → 3M (3 months) ≈ ×36–×66 (e.g., 12h→×36–×44; 8h→×53–×66)
≤ 1 day → 3M (3 months) ≈ ×60–×66 (~20–22 trading days / month)
> 1 day → 12M (1 year) ≈ ×(252–264)/quantity
≤ 1 week → 12M (1 year) ≈ ×52
> 1 week → 48M (4 years) ≈ ×(208)/quantity
= 1 M → 48M (4 years) ≈ ×48
> 1 M → error ("HTF too big")
any → error ("HTF too big")
Notes:
• Inputs in months or years are restricted: only 1M is allowed; larger months/any years throw.
• Returns a Pine timeframe string usable in `request.security()` and `input.timeframe`.
Parameters:
tf (string) : series string Selected timeframe (e.g., "D", "240", or `timeframe.period`).
Returns: series string Suggested higher timeframe.
autoLTF(tf)
Selects an appropriate **lower timeframe LTF)** for intra‑bar evaluation
based on the selected timeframe. The goal is to keep intra‑bar
loops performant while providing enough granularity.
Mapping → chosen LTF:
≤ 1 min → 1S ≈ ×60
≤ 5 min → 5S ≈ ×60
≤ 15 min → 15S ≈ ×60
≤ 30 min → 30S ≈ ×60
> 30 min → 60S (1m) ≈ ×31–×59 (for 31–59 minute charts)
≤ 1 h → 1 (1m) ≈ ×60
≤ 2 h → 2 (2m) ≈ ×60
≤ 4 h → 5 (5m) ≈ ×48
> 4 h → 15 (15m) ≈ ×24–×48 (e.g., 6h→×24, 8h→×32, 12h→×48)
≤ 1 day → 15 (15m) ≈ ×26–×32 (regular sessions ~6.5–8h)
> 1 day → 60 (60m) ≈ ×(26–32) per day × quantity
≤ 1 week → 60 (60m) ≈ ×32–×40 (≈5 sessions of ~6.5–8h)
> 1 week → 240 (4h) ≈ ×(8–10) per week × quantity
≤ 1 M → 240 (4h) ≈ ×33–×44 (~20–22 sessions × 6.5–8h / 4h)
≤ 3 M → D (1d) ≈ ×(20–22) per month × quantity
> 3 M → W (1w) ≈ ×(4–5) per month × quantity
≤ 1 Y → W (1w) ≈ ×52
> 1 Y → M (1M) ≈ ×12 per year × quantity
Notes:
• Ratios for D/W/M are given as ranges because they depend on
**regular session length** (typically ~6.5–8h, not 24h).
• Returned strings can be used with `request.security()` and `input.timeframe`.
Parameters:
tf (string) : series string Selected timeframe (e.g., "D", "240", or timeframe.period).
Returns: series string Suggested lower TF to use for intra‑bar work.
isNewPeriod(tf, offset)
Returns `true` when a new session-aligned period begins, or on the Nth bar of that period.
Parameters:
tf (string) : series string Target higher timeframe (e.g., "D", "W", "M").
offset (simple int) : simple int 0 → checks for the first bar of the new period.
1+ → checks for the N-th bar of the period.
Returns: series bool `true` if the condition is met.
sinceNewPeriod(tf, offset)
Counts how many bars have passed within a higher timeframe (HTF) period.
For daily, weekly, and monthly resolutions, the period is aligned with the trading session.
Parameters:
tf (string) : series string Target parent timeframe (e.g., "60", "D").
offset (simple int) : simple int 0 → Running count for the current period.
1+ → Finalized count for the Nth most recent *completed* period.
Returns: series int Number of bars.
isHigherTF(tf, main)
Returns `true` when the selected timeframe represents a
higher resolution than the active timeframe.
Parameters:
tf (string) : series string Selected timeframe.
main (bool) : series bool When `true`, the comparison is made against the chart's main timeframe
instead of the script's active timeframe. Optional. Defaults to `false`.
Returns: series bool `true` if `tf` > active TF; otherwise `false`.
isActiveTF(tf, main)
Returns `true` when the selected timeframe represents the
exact resolution of the active timeframe.
Parameters:
tf (string) : series string Selected timeframe.
main (bool) : series bool When `true`, the comparison is made against the chart's main timeframe
instead of the script's active timeframe. Optional. Defaults to `false`.
Returns: series bool `true` if `tf` == active TF; otherwise `false`.
isLowerTF(tf, main)
Returns `true` when the selected timeframe represents a
lower resolution than the active timeframe.
Parameters:
tf (string) : series string Selected timeframe.
main (bool) : series bool When `true`, the comparison is made against the chart's main timeframe
instead of the script's active timeframe. Optional. Defaults to `false`.
Returns: series bool `true` if `tf` < active TF; otherwise `false`.
isMultipleTF(tf)
Returns `true` if the selected timeframe (`tf`) is a practical multiple
of the active skript's timeframe. It verifies this by checking if `tf` is a higher timeframe
that has consistently contained more than one bar of the skript's timeframe in recent periods.
The period detection is session-aware.
Parameters:
tf (string) : series string The higher timeframe to check.
Returns: series bool `true` if `tf` is a practical multiple; otherwise `false`.
interpTimestamp(offStart, offEnd, pct)
Calculates a precise absolute timestamp by interpolating within a bar range based on a percentage.
This version works with RELATIVE bar offsets from the current bar.
Parameters:
offStart (int) : series int The relative offset of the starting bar (e.g., 10 for 10 bars ago).
offEnd (int) : series int The relative offset of the ending bar (e.g., 1 for 1 bar ago). Must be <= offStart.
pct (float) : series float The percentage of the bar range to measure (e.g., 50.5 for 50.5%).
Values are clamped to the range.
Returns: series int The calculated, interpolated absolute Unix timestamp in milliseconds.
Camarilla Pivot Plays (Lite) [BruzX]█ OVERVIEW
This indicator implements the Camarilla Pivot Points levels and a system for suggesting particular plays. It only 3rd, 4th, and 6th levels, as these are the only ones used by the system. It also optionally shows the Central Pivot Range, which is in fact between S2 and R2. In total, there are 12 possible plays, grouped into two groups of six. The algorithm evaluates in real-time which plays fulfil their precondition and shows the candidate plays. The user must then decide if and when to take the play.
█ CREDITS
The Camarilla pivot plays are defined in a strategy developed by Thor Young, and the whole system is explained in his book "A Complete Day Trading System". This description is self-sufficient for effective use.
█ FEATURES
Display the 3rd, 4th and 6th Camarilla pivot levels
Works for stocks, futures, indices, forex and crypto
Automatically switches between RTH and ETH data based on criteria defined by the system.
Option to force RTH/ETH data and force a close price to be used in the calculation.
Preconditions for the plays can be toggled on/off
Works correctly on both RTH and ETH charts
Well-documented options tooltips
Well-documented and high-quality open-source code for those who are interested
█ HOW TO USE
The defaults work well; at a minimum, just add the indicator and watch the plays being called. For US futures, you will probably want to chat the "Timezone for sessions" to New York and the regular session times to 09:30 - 16:00. The following diagram shows its key features.
By default, the indicator draws plays 1 days back; this can be changed up to 20 days. The labels can be shifted left/right using the "label offset" option to avoid overlapping with other labels in this indicator or those of another indicator.
An information box at the top-right of the chart shows:
The data currently in use for the main pivots. This can switch in the pre-market if the H/L range exceeds the previous day's H/L, and if it does, you will see that switch at the time that it happens
Whether the current day's pivots are in a higher or lower range compared to the previous day's.
The width of the pivots compared to the previous day
The current candidate plays fulfilling preconditions. You then need to watch the price action to decide whether to take the play.
The resistance pivots are all drawn in the same colour (red by default), as are the support pivots (green by default). You can change the resistance and support colours, but it is not possible to have different colours for different levels of the same kind.
█ CONCEPTS
The indicator is focused around daily Camarilla pivots and evaluates the preconditions for 12 possible plays: 6 when in a higher range, 6 when in a lower range. The plays are labelled by two letters—the first indicates the range, the second indicates the play—as shown in this diagram:
The pivots can be calculated using only RTH (Regular Trading Hours) data, or ETH (Extended Trading Hours) data, which includes the pre-market and post-market. The indicator implements logic to automatically choose the correct data, based on the rules defined by the strategy. This is user-overridable. With the default options, ETH will be used when the H/L range in the previous day's post-market or current day's pre-market exceeds that of the previous day's regular market. In auto mode, the chosen pivots are considered the main pivots for that day and are the ones used for play evaluation. The "other" pivots can also be shown—"other" here meaning using ETH data when the main pivots use RTH data, and vice versa.
The plays must fulfil a set of preconditions. There are preconditions for valid region and range, price sweeps into levels, correct pivot width, opening position, price action, and whether neutral range plays and premarket plays are enabled. When all the preconditions are fulfilled, the play will be shown as a candidate.
█ NOTE FOR FUTURES
Futures don't officially have a pre-market or post-market like equities. Let's take ES on CME as an example. It trades from 18:00 ET Sunday to 17:00 Friday (ET), with a daily pause between 17:00 and 18:00 ET. However, most of the trading activity is done between 09:30 and 16:00, which you can tell from the volume spikes at those times, and this coincides with NYSE/NASDAQ regular hours. So we define a pseudo-pre-market from 18:00 the previous day to 09:30 on the current day, then a pseudo-regular market from 08:30 to 16:00, then a pseudo-post-market from 16:00 to 17:00. The indicator then works exactly the same as with equities—all the options behave the same, just with different session times defined for the pre-, regular, and post-market, with "RTH" meaning just the regular market and "ETH" meaning all three.
█ LIMITATIONS
The pivots are very close to those shown in DAS Trader Pro. They are not to-the-cent exact, but within a few cents. The reasons are:
TradingView provides free real-time data from CBOE One, not full exchange data (you can pay for this though, and it's not expensive), and
the close/high/low are taken from the intraday timeframe you are currently viewing, not daily data—which are very close, but often not exactly the same. For example, the high on the daily timeframe may differ slightly from the daily high you'll see on an intraday timeframe.
Despite these caveats, occasionally large spikes will be seem in one platform and not the other (even with paid data), or the spikes will reach significantly difference prices. Where these spikes create the daily high or low, this can cause significantly different pivots levels. The more traded the stock is, the less the difference tends to be. Highly traded stocks are usually within a few cents (but even they occasionally have large differences in spikes). There is nothing that can be done about this.
The 6th Camarilla level does not have a standard definition and may not match the level shown on other platforms. It does match the definition used by DAS Trader Pro.
Replay mode for stocks does not work correctly. This is due to some important Pine Script variables provided by the TradingView platform and used by the script not being assigned correct values in replay mode. Futures do not use these variables, so they should work in replay mode.
The indicator is an intraday indicator (despite also being able to show weekly and monthly pivots on an intraday chart). It deactivates on a daily timeframe and higher. Sub-minute timeframes are also not supported.
The indicator was developed and tested for US/European stocks, US futures and EURUSD forex and BTCUSD. It should work as intended for stocks and futures in different countries, and for all forex and crypto, but this is tested as much as the security it was developed for.
█ DISCLAIMER
This indicator is provided for information only and should not be used in isolation without a good understand of the system and without considering other factors. You should not take trades using real money based solely on what this indicator says. Any trades you take are entirely at your own risk.






















