Pine Script® indicator
Indicators and strategies
L-TPI Correlation Assets# L-TPI Correlation Assets
A composite trend-probability indicator that scores the current asset's directional bias and **scales that score by its rolling correlation to Bitcoin (INDEX:BTCUSD)**. The result is a single weighted signal that strengthens when the asset is moving with BTC and fades toward neutral when the relationship breaks down.
---
## Concept
Most trend indicators tell you *what* an asset is doing. This one asks a second question: *how much does that signal matter right now, given the asset's relationship to the broader crypto market?*
The script does this in three stages:
1. **Trend Probability Index (TPI)** — a 4-filter composite that produces a normalized trend score in the range ` `.
2. **Multi-Period Correlation Weight** — a weighted average of the asset's price correlation to BTC across five lookback windows.
3. **Final Weighted Score** — the TPI multiplied by the correlation weight, with a configurable neutral zone around zero.
---
## 1. Trend Probability Index (TPI)
Four independent filters each cast a vote of `+1` (bullish) or `-1` (bearish):
| Filter | Logic | Bullish When |
|---|---|---|
| **f1 — ROC** | Rate of Change over *N* bars | ROC > 1 |
| **f2 — RSI** | Relative Strength Index | RSI > 50 |
| **f3 — EMA Cross** | Fast EMA vs. Slow EMA | Fast > Slow |
| **f4 — SMA** | Price vs. long SMA | Close > SMA |
- **Raw Trend Score** = `f1 + f2 + f3 + f4` → integer in ` `
- **Avg Trend Score** = `Raw / 4` → normalized to ` `
The Avg Trend Score is the TPI value passed forward.
---
## 2. Correlation Weight (vs. INDEX:BTCUSD)
The script computes the **Pearson correlation coefficient** between the chart asset's close and BTC's close across **five user-defined lookback windows** (default 30, 60, 90, 180, 365 bars). Each window has its own user weight (default 1, 2, 3, 4, 5 — favoring longer horizons).
For each window:
- Validity is checked: a window must have at least *Min valid obs ratio* (default 80%) of aligned, non-`na` bars.
- Invalid windows are excluded from the weighted average.
The final weight is a clamped weighted mean:
```
weight = clamp( Σ(corr_i × user_weight_i) / Σ(user_weight_i), -1, +1 )
```
BTC is fetched via `ticker.modify` so dividend/session adjustments on the chart propagate to the comparison series.
---
## 3. Final Weighted Score
```
final_weighted_score = avg_trend_score × weight
```
- **Range:** ` `
- **Strong bullish:** TPI is bullish *and* asset moves with BTC → score pushes toward +1
- **Strong bearish:** TPI is bearish *and* asset moves with BTC → score pushes toward −1
- **Neutral / decoupled:** TPI is mixed *or* correlation is weak → score collapses toward 0
A configurable **neutral zone** (default `±0.02`) flags conditions where the signal is too weak to act on.
---
## Visual Output
- **Final Weighted Score** — bold line; green above 0, red below, yellow in the neutral zone.
- **Correlation Weight** — stepline showing the current BTC-correlation multiplier.
- **Raw / Avg Trend Score** — the underlying TPI before correlation weighting.
- **Per-window correlations** — optional plots for the 30/60/90/180/365-bar `r` values.
- **Neutral zone** — optional background tint, threshold lines, and diamond marker.
- **Underlying filters** — ROC, RSI, EMAs, SMA can each be plotted individually.
### Tables
- **Signal Table** — every filter's state, raw/avg trend, correlation weight, final score, and overall bull/bear/neutral state.
- **Correlation Diagnostic Table** — per-window `r`, user weight, validity status, and resolved comparison symbol.
- **Final Score Table** — large display of the final weighted score for clean screenshots / streaming.
All tables have configurable positions.
---
## Inputs Overview
| Group | Key Inputs |
|---|---|
| Global | Timeframe |
| Neutral Zone | Low / High thresholds |
| ROC, RSI, EMA, SMA | Lengths for each filter |
| Correlation Weight | 5 × (period, weight), min valid obs ratio |
| Plot Toggles | Per-component visibility |
| Tables | Show/hide and positioning |
---
## How to Read It
- **Score > 0, rising, green:** trend filters and BTC correlation both supportive.
- **Score < 0, falling, red:** trend filters and BTC correlation both negative.
- **Score in yellow zone:** either filters are split, or the asset has decoupled from BTC — treat as no-trade.
- **Correlation weight near 0:** asset is currently uncorrelated with BTC; the trend signal is being intentionally muted.
---
## Notes & Limitations
- Comparison is hardcoded to `INDEX:BTCUSD`. Most useful on crypto and crypto-adjacent assets.
- Correlation is computed on **raw closes**, not returns. This produces smoother, more persistent `r` values that emphasize co-movement of price levels rather than short-term return co-movement.
- The TPI uses a fixed equal-weight blend of ROC, RSI, EMA cross, and SMA. It's a deliberately simple base; the correlation weighting is where the differentiation comes from.
- Designed for higher timeframes (default 1D). Works on lower TFs but the long correlation windows (e.g. 365 bars) become short in calendar time.
---
*Not financial advice. Always backtest and validate on your own instruments and timeframe before using any indicator for live decisions.*
Pine Script® indicator
Opor Liquidity Heatmap - Near Price OnlyHow to Use – Opor Liquidity Heatmap
🔎 Overview
This tool is designed to visualize liquidity zones (stop-loss clusters) in the market.
🔴 Red Zones = Buy-side liquidity (areas where buyers may get stopped out)
🟢 Green Zones = Sell-side liquidity (areas where sellers may get stopped out)
These zones represent potential targets where price is likely to move before reversing.
🧠 Core Concept
The market does not move randomly.
It moves to collect liquidity first, then makes the real move.
This tool helps you identify where liquidity is located, not where to enter immediately.
⚠️ Important
❌ This is NOT a buy/sell signal indicator
❌ Do NOT trade just because price touches a zone
✔ This is a context tool to guide your decision-making
🎯 Step-by-Step Usage
1. Identify the Nearest Liquidity
Use the dashboard:
Upper Dist → distance to upper liquidity
Lower Dist → distance to lower liquidity
👉 Price often moves toward the closer liquidity first
2. Wait for Price to Reach the Zone
Do nothing until price enters:
🔴 Upper (red) zone
🟢 Lower (green) zone
3. Wait for Confirmation
Only consider a trade when BOTH occur:
✔ Sweep (liquidity grab / stop hunt)
✔ Rejection candle (strong wick or reversal candle)
4. Execute with Precision
🔴 Sell Setup
Price enters red zone
Sweep high occurs
Bearish rejection appears
👉 Look for short entries
🟢 Buy Setup
Price enters green zone
Sweep low occurs
Bullish rejection appears
👉 Look for long entries
💡 Pro Insight
Liquidity zones are targets, not entries.
The edge comes from:
Waiting for liquidity to be taken
Entering only after confirmation
🚫 When NOT to Trade
Price is between zones (middle of the range)
No sweep has occurred
No clear rejection candle
Structure is unclear
👉 In these cases: No trade
🧩 Best Practice
Combine this tool with:
Market structure (W / M / H&S / flags)
Multi-timeframe analysis
Risk-to-reward validation (RR ≥ 3:1)
🔥 Summary
Find liquidity → Wait → Confirm → Execute
Pine Script® indicator
MTF Andean OscillatorMTF Andean Oscillator is a Multi Timeframe version of the popular Andean Oscillator that allows traders to view oscillator data from another selected timeframe while staying on the current chart.
This helps traders align entries with higher timeframe trend strength or monitor lower timeframe momentum without switching charts.
How It Works:
The script uses the standard Andean Oscillator formula and imports values from a user selected timeframe using multi timeframe logic.
Example:
Stay on 5 Minute chart and view 1 Hour Andean trend
Stay on 15 Minute chart and view 4 Hour Andean trend
Stay on Daily chart and view 4 Hour momentum shifts
Features:
• Standard Andean Oscillator calculation
• External timeframe selector
• Bull line shown in green
• Bear line shown in red
• Signal line shown in orange
• Separate oscillator pane for clean viewing
• Optional show or hide lines
• Real time multi timeframe updates
• Current selected timeframe display panel
Best Use Cases:
• Scalping with higher timeframe confirmation
• Intraday trading with trend alignment
• Spotting pullbacks inside larger trends
• Avoiding trades against dominant momentum
• Multi timeframe confluence setups
Reading the Oscillator:
Bull line above Bear line may indicate stronger bullish momentum.
Bear line above Bull line may indicate stronger bearish momentum.
Signal line can help identify momentum shifts and transitions.
Examples:
5 Minute chart + 1 Hour external timeframe for scalping
15 Minute chart + 4 Hour external timeframe for intraday trend trades
1 Hour chart + Daily external timeframe for swing bias
Important Note:
This tool is designed for analysis support and should be used together with price action, structure, volume, and risk management.
No indicator guarantees future movement.
Pine Script® indicator
vwap_inicio_ny_NettoIndicador inicia vwap e seus desvios padões no horario da abertura das açoes de NY
Pine Script® indicator
TBR MacrosThis Indicator is completely inspired by ICT_concepts on X(formerly known as twitter). This is a tool to help those who are interested in trading price and liquidity while focusing on time as the ruler. Below serves as a grading of the macros not of their importance but of their purpose and their role.
Tier S: The "Primary Injectors" (Critical Priority)
These are the most important because they coincide with the "Unbinding" of the ADR/ODR ranges into the NY session.
TBR NY 07:30 – 09:00 (Macro 20): * Grade: S+
Role: The Initial Injection. This macro audits the ODR (Overnight Range) and the OVD (Overnight Vertical Displacement). Its role is to determine if the "Ghost" from the overnight session has enough mass to sustain a trend.
Fractal Signature: If this macro sweeps the ODR High/Low and rejects, the daily bias is likely a "Fade."
NY AM 09:50 – 10:10 (Macro 18):
Grade: S
Role: The London Protocol Resolution. This is the classic ICT "Silver Bullet" window. Its role is to deliver price to the first major liquidity pool after the NY Open (144-node shoe start).
TBR NY 08:00 – 08:30 (Macro 21):
Grade: S
Role: The Pre-Open Singularity. It often creates the "Judas Swing" that traps retail traders before the 09:30 open.
Tier A: The "Trend Conductors" (High Priority)
These macros ensure the "Inflation" of the price continues toward the Regular Session targets.
TBR NY 20-40 Series (Macros 22–24: 08:20, 09:20, 10:20):
Grade: A+
Role: Lattice Reinforcement. These are "Harmonic Checkpoints." If price is at the 0.2152 Hinge of the OVD box during the 10:20 macro, the probability of a 27-tick expansion is >80%.
London 01:50 – 02:10 & TBR Lon 02:33 (Macros 9, 14):
Grade: A
Role: ODR Creation. These macros are responsible for "Stirring the Pot" and defining the Overnight Range. They inject the first true volatility into the ADR.
Tier B: The "Distribution & Reversal" Nodes (Medium Priority)
These macros handle the "Residual Pressure" and "Thermal Decay" of the move.
NY PM 13:50 – 14:10 (Macro 31):
Grade: B+
Role: The Hinge Node. As identified in your Node 31 research, this is the "Clock Speed" reversal point. It audits the AM range and decides if the PM session will "Mirror" or "Distribute."
TBR NY PM 15:15 – 15:45 (Macro 35):
Grade: B
Role: The Settlement Sieve. This macro forces price toward the 0.5 Equilibrium of the RDR (Regular Day Range) before the 16:00 close.
Tier C: The "Lattice Vibrations" (Lower Priority)
These macros occur during "Low-Entropy" periods where price is often range-bound.
Asia Hourly Series (Macros 0–8):
Grade: C
Role: Accumulation/Vibration. These macros build the "Mass" of the ADR. While individually less explosive, they collectively set the "Stator Reservoir" (the inhale) for the London expansion.
Strategy: Best used for "Fading the Extremes" of the ADR.
Pine Script® indicator
Invalidation Quality Planner [AGPro Series]Invalidation Quality Planner
🧠 Core Idea
Is the active invalidation shelf meaningful enough to build a plan around, or is it fragile, distant, weak, or already violated?
📌 Overview / What it does
Invalidation Quality Planner is a chart-first risk planning tool designed to evaluate the quality of the level that would invalidate a setup idea.
Instead of drawing generic support/resistance zones or printing buy/sell signals, the script studies one active invalidation shelf and converts its structure into a 0-100 quality score. It measures swing clarity, defended reactions, prior violations, wick pressure, volatility buffer, forward room, and violation risk.
The output is a focused planning workflow: an invalidation shelf zone, shelf and violation guides, forward-room reference, compact event labels, alerts, and a clean AGPro decision panel. It does not predict future price movement, automate decisions, or guarantee that any shelf will hold.
🎯 Purpose & Design Philosophy
This script was built for traders who want to judge whether their risk reference is structurally meaningful before relying on it.
Many tools show entries, targets, support/resistance zones, or stop distances. This tool focuses on the deeper planning question: is the invalidation level itself strong enough to deserve trust?
The design supports a disciplined setup-review mindset. It helps users separate a clean invalidation shelf from a weak, noisy, overextended, or already violated one.
⚡ Why This Script Is Different
Most tools focus on signals, stop-loss placement, support/resistance mapping, or risk/reward drawings.
This script does NOT become a generic S/R zone map, a stop-loss optimizer, a position-size calculator, a target ladder, or an entry signal tool.
Instead, it evaluates the quality of the invalidation reference. The core output is not a trade command. It is a planning state that helps users decide whether the current shelf is VALID, on WATCH, FRAGILE, DISTANT, DEFENDED, WEAK, or VIOLATED.
⚙️ Methodology
1. Context Detection
The script detects the active planning side using trend context and range location, or allows the user to force long-context or short-context evaluation.
2. Reference Mapping
It maps the active invalidation shelf from confirmed swing pivots, with a fallback structure reference when no fresh pivot is available.
3. Reaction Evaluation
The model scores swing clarity, defended shelf reactions, clean history, wick pressure, ATR-normalized shelf distance, volatility context, violation risk, and forward room.
4. Visual Output
The output is shown through an invalidation shelf zone, violation guide, forward-room guide, compact labels, deterministic alerts, and a premium AGPro panel.
🗺️ How to Read the Chart
Zones = the active invalidation shelf used by the planner. It is a risk reference, not a generic support/resistance zone.
Labels = compact state markers showing VALID, WATCH, DEFENDED, FRAGILE, DISTANT, WEAK, or VIOLATED context.
Colors = teal marks cleaner planning context, pink marks violation or weak context, amber marks caution, and indigo marks watch/transition context.
Panel = the panel summarizes Invalidation Quality, Distance, Structure Support, Violation Risk, and Action.
🚦 Signals & States
• VALID → the active invalidation shelf has enough structure and quality to deserve review.
• WATCH → the shelf is improving but not clean enough for VALID state.
• DEFENDED → price tested the shelf and closed back in favor of the active planning side.
• FRAGILE → price is too close to the shelf, making normal noise more important.
• DISTANT → the shelf is too far from price for clean planning context.
• WEAK → the shelf lacks enough structure, reaction memory, or clean history.
• VIOLATED → price crossed the active violation guide and the context should be rebuilt.
🔔 Alerts Logic
Alerts trigger when the planner enters VALID state, enters WATCH state, detects a defended shelf reaction, marks a weak/fragile/distant shelf, or detects a shelf violation.
These alerts are attention markers. They are not trade instructions, entry signals, exit commands, or automated strategy actions.
🧩 Confluence Logic
The strongest invalidation context appears when swing clarity, defended reactions, clean violation history, controlled wick pressure, balanced ATR distance, and sufficient forward room align.
When those factors align, the quality score rises and the panel can move from WATCH to VALID. If the shelf becomes too close, too distant, noisy, or violated, the state downgrades.
📊 When to Use
• Before evaluating a discretionary setup
• During pullbacks where a structural invalidation shelf is forming
• Around continuation setups where risk needs a clean reference
• Before breakout or reclaim attempts where the failure point matters
• When comparing whether one setup has a cleaner invalidation reference than another
⚠️ When NOT to Use
• Extremely low-liquidity symbols
• Very noisy micro-timeframes with unstable wicks
• News-driven volatility spikes
• Markets where recent structure is distorted and no useful invalidation shelf exists
• Situations where the user expects a signal-only entry tool
🎛️ Key Inputs
• Planning Side → controls Auto, Long Context, or Short Context evaluation.
• Shelf Pivot Left / Right → controls how strict the confirmed swing shelf detection is.
• Shelf Fallback Lookback → defines the backup structure reference when no fresh pivot exists.
• Reaction Memory Lookback → controls how far back defended reactions and violations are counted.
• Shelf Zone Buffer ATR → controls the width of the invalidation shelf zone.
• Violation Buffer ATR → controls when price is treated as crossing beyond the shelf.
• VALID / WATCH Thresholds → adjust how selective the planner is.
• Visual settings → control shelf zones, guide lines, memory zones, labels, panel location, theme, and font sizes.
🖥️ Interface & Visual Design
The interface is built around one primary chart object: the invalidation shelf zone.
The panel follows the AGPro public-release standard with one merged blue header row containing only the script name. The layout keeps the key planning information readable without turning the script into a dashboard-heavy overlay.
Labels are compact, offset away from candles, and controlled with cooldown and maximum-visible settings.
🧪 Practical Usage Workflow
1. Read the panel Invalidation Quality and Action state.
2. Check whether price is respecting, approaching, or violating the shelf zone.
3. Review the Distance row to see whether the shelf is balanced, fragile, or distant.
4. Compare Structure Support with Violation Risk.
5. Treat alerts as review prompts and confirm the broader market context before making any decision.
🔍 Interpretation Guidelines
A higher score means the planner sees stronger alignment between shelf structure, reaction memory, clean history, distance quality, violation risk, and forward room.
VALID does not mean a trade must be taken. It means the invalidation shelf is meaningful enough to deserve attention.
WATCH means the shelf may be developing but still needs stronger evidence.
FRAGILE, DISTANT, WEAK, and VIOLATED are caution states that help users avoid building a plan around a poor invalidation reference.
🚫 What This Script Is NOT
• Not a prediction engine
• Not financial advice
• Not auto trading
• Not guaranteed signals
• Not a generic support/resistance mapper
• Not a stop-loss optimizer
• Not a position sizing calculator
• Not a take-profit planner
⚠️ Limitations & Transparency
Pivot-based shelves are confirmed after the selected pivot strength completes, so the script is intentionally reactive rather than predictive.
Different timeframes can create different shelf references, reaction counts, and violation-risk readings.
Volatility changes can alter ATR-normalized distance, shelf width, and forward-room conditions.
The script is rule-based and should be interpreted as an analytical planning layer, not as certainty.
🧠 Market Context Notes
Invalidation quality is not only about distance. A shelf can be close but meaningful, distant but inefficient, or visually obvious but already weakened by violations.
The planner is most useful when it helps the user ask better questions before trusting a setup idea.
🧾 Use Case Examples
When price pulls back toward a clean swing shelf, defends it, and still has enough forward room, the planner may show DEFENDED or VALID context.
When price is sitting directly on the shelf with heavy wick pressure, the planner may mark FRAGILE even if the level looks visually interesting.
When price crosses beyond the violation guide, the planner marks VIOLATED so the old risk reference is not treated as still clean.
🧱 System Philosophy
Invalidation Quality Planner follows the AGPro Series decision-engine approach:
Context first.
Risk reference before target.
Structure before signal.
Attention markers instead of promises.
🔐 Non-Promise Statement
No indicator can remove uncertainty.
No state, score, label, alert, or visual zone should be interpreted as guaranteed market direction.
📉 Risk Disclosure
Trading involves risk.
All decisions remain the responsibility of the user.
This script is for educational and analytical chart review only and does not provide financial advice.
📚 Educational Note
Use the tool to study how invalidation references form, defend, weaken, or fail across different market conditions.
Pine Script® indicator
Clean Trendline (3 Touch + Break)Clean Trendline (3 Touch + Break Alerts)
This indicator automatically draws high-quality trendlines based on market structure, using a strict 3-touch rule to identify valid trends. It focuses on clarity and usability by displaying only the most recent confirmed trendlines, helping traders avoid chart clutter and noise.
Unlike basic trendline tools, this script uses pivot-based structure to detect higher lows (uptrends) and lower highs (downtrends), ensuring that only meaningful trendlines are plotted.
🔹 Key Features:
Automatic trendline detection using 3 confirmed pivot points
Identifies both uptrend (support) and downtrend (resistance) structures
Displays only the latest valid trendlines (no clutter)
Dynamic extension of trendlines into current price action
Breakout signals when price crosses a trendline
Built-in alert conditions for breakout events
🔹 How It Works:
The indicator tracks swing highs and lows using pivot logic. When three consecutive higher lows form, an uptrend line is drawn. When three consecutive lower highs form, a downtrend line is drawn. These trendlines are extended forward and continuously monitored for break conditions.
🔹 Break Signals:
Break↑: Price closes above a downtrend line (potential bullish breakout)
Break↓: Price closes below an uptrend line (potential bearish breakout)
🔹 Inputs:
Pivot Length: Controls sensitivity of swing detection
Show Break Signals: Toggle breakout markers on/off
🔹 Best Used For:
Trend-following strategies
Breakout trading
Market structure analysis
This tool is designed to complement your trading strategy by providing objective trendline analysis. For best results, combine with higher timeframe confirmation and proper risk management.
Note: This indicator does not guarantee profits and should be used as part of a broader trading plan.
Pine Script® indicator
Volume-Based Candles & Dual Moving AveragesDual Moving Averages (MA): The script plots two moving averages. You can customize the length and type (SMA, EMA, VWMA, etc.) for each via the settings menu. These serve as your primary trend filters.
Volume-Based Candle Coloring: Unlike standard charts where candles are simply Green (up) or Red (down), this script changes the intensity of the color based on whether the current volume is higher or lower than the previous candle.
Trend Direction: If the price is trading above the MAs, the bias is bullish. If below, it is bearish.
Crossovers: A "Golden Cross" (faster MA crossing above slower MA) often signals a trend reversal to the upside, while a "Death Cross" (faster crossing below) signals a potential shift to the downside.
Pine Script® indicator
Initial Balance Extensions - GOLDInitial Balance for Gold which starts at 8:20am EST
Lines are labelled
Stats Table
Range in Points
Pine Script® indicator
Ash @ 5M Pin Bar DetectorA pin bar is basically:
Small body
Long wick (rejection)
Wick is at least ~2–3× the body
Appears at key levels (but we’ll just detect structure here)
Pine Script® indicator
1st 15 ORB 1/5minThis is a:
Multi-phase Opening Range Breakout (ORB) + Trend Continuation + Compression Detection system
It breaks market behavior into 3 structured regimes:
1. Compression Phase (yellow background)
This is when:
*volatility is shrinking (ATR contraction)
*price is moving sideways
*no clear breakout yet
Meaning:
The market is “loading energy” — not moving decisively
What it is NOT:
*not a buy signal
*not a sell signal
*not directional yet
2. Breakout / Expansion Phase (ORB break)
Triggered when price breaks:
*above ORB high → bullish bias
*below ORB low → bearish bias
This is where:
*DROP / POP signals can appear (impulse moves)
*volatility expands
*direction begins to form
Meaning:
“The market chose a direction”
3. Trend Phase (background color)
After breakout:
🟩 Green = bullish trend active
🟥 Red = bearish trend active
Price is now:
*trending
*creating structure
*producing continuation setups
What each signal actually means
🔻 DROP
*aggressive sell expansion from inside ORB
*early bearish displacement
🔺 POP
*aggressive buy expansion from inside ORB
*early bullish displacement
REV (reversal)
*failed breakout at ORB boundary
*liquidity trap / rejection
CONT (continuation)
*pullback within trend
*re-entry into direction of breakout
How to use this “to the max”
This system is NOT for random entries. It is a phase-based execution model.
⚙️ Step-by-step usage model
🟨 STEP 1 — Wait for Compression
Do nothing
Identify when yellow background is active
Goal:
Let the market “build pressure”
🟦 STEP 2 — Wait for ORB break
*First break of ORB high/low defines bias
*This is your directional decision point
Rule:
You only start trading AFTER breakout
STEP 3 — Trade continuation only
Once trend is established:
Long setup:
*pullback toward structure
*continuation signal in trend direction
Short setup:
*pullback upward
*continuation down
👉 This is where consistency comes from
STEP 4 — Use DROP / POP sparingly
These are NOT primary entries.
They are:
*early expansion clues
*momentum alerts
*sometimes “first leg” entries (higher risk)
STEP 5 — REV signals = warning zones
Use REV for:
*failed breakout detection
*exit timing
*not primary entries
💡 Key concept (most important part)
This indicator is built around:
*Compression → Expansion → Trend → Continuation
Not:
*guessing tops/bottoms
*reacting to every candle
*overtrading signals
🧭 How professionals would actually use it
1. Morning (pre-breakout)
watch compression
2. First move
identify ORB breakout direction
3. Mid-session
only take continuation trades
4. Late session
stop trading unless clean structure remains
📉 What NOT to do
*don’t trade every DROP/POP
*don’t trade inside compression
*don’t counter-trade trend signals
*don’t ignore ORB bias
What makes this powerful
Most indicators try to predict moves.
This one instead:
organizes market behavior into phases so you only trade when probability is structurally in your favor.
Pine Script® indicator
Pine Script® indicator
Pine Script® indicator
Setup Lifecycle Tracker [AGPro Series]Setup Lifecycle Tracker
🧠 Core Idea
What stage is this setup in right now: forming, armed, triggered, invalidated, or expired?
📌 Overview / What it does
Setup Lifecycle Tracker is a chart-first setup planning tool that follows a developing market structure through a defined lifecycle window.
Instead of showing another isolated signal, it maps the setup stage, trigger rail, invalidation rail, expiry marker, time risk, and a 0-100 lifecycle quality score directly on the chart.
The script does not predict price, automate execution, or tell users what to trade. It organizes setup context so the trader can evaluate whether the setup is still valid, still early, close to activation, already invalidated, or simply too old.
🎯 Purpose & Design Philosophy
This script was built for traders who want a cleaner way to manage setup timing.
Many setups look interesting when they first appear, but they often decay, trigger too late, or lose their invalidation logic before the trader reacts. Setup Lifecycle Tracker fills that gap by turning setup timing into a visible planning structure.
The design philosophy is simple: a setup should have a stage, a deadline, a risk reference, and a clear next-action state. Without those elements, the chart can become another collection of loose signals.
⚡ Why This Script Is Different
Most tools focus on entry markers, setup scores, or generic support and resistance levels.
This script does NOT try to clone a setup scorecard, create a buy/sell system, or build a broad support/resistance map.
Instead, it tracks the lifecycle of one active setup window. It shows whether the setup is forming, armed near the trigger rail, already triggered, invalidated by its risk rail, or expired because too much time has passed.
⚙️ Methodology
1. Context Detection
The script reads trend context, recent range structure, volatility, candle behavior, and volume support to decide whether a clean setup window can be tracked.
2. Reference Mapping
When a setup forms, the script creates a trigger rail, an invalidation rail, and a lifecycle window between them.
3. Reaction Evaluation
The model evaluates setup maturity, trigger proximity, confirmation strength, time decay, and invalidation distance to produce a 0-100 lifecycle score.
4. Visual Output
The active lifecycle window, stage labels, trigger rail, invalidation rail, expiry marker, candle tint, and panel summarize the current state.
🗺️ How to Read the Chart
Zones = the lifecycle window between trigger and invalidation.
Labels = current lifecycle stage and optional score.
Colors = stage context:
• Blue / indigo = forming
• Yellow = armed
• Green = triggered
• Red / pink = invalidated or expired
Panel = the compact AG Pro summary showing Stage, Quality Score, Time Risk, Invalidation, and Action.
🚦 Signals & States
• FORMING → a setup window has been detected but is not yet close enough to the trigger rail.
• ARMED → price is close enough to the trigger rail and the lifecycle score is strong enough to deserve attention.
• TRIGGERED → the tracked setup moved beyond its configured trigger condition.
• INVALIDATED → price crossed the invalidation rail and the setup context is no longer valid.
• EXPIRED → the setup stayed active too long without a useful lifecycle resolution.
🔔 Alerts Logic
The script includes alerts for:
• New lifecycle window forming
• Setup armed near the trigger rail
• Setup triggered
• Setup invalidated
• Setup expired
• High-quality lifecycle threshold reached
Alerts are attention markers only. They are not trade instructions, automated entries, or guaranteed outcome signals.
🧩 Confluence Logic
The lifecycle score becomes stronger when setup maturity, trigger proximity, confirmation strength, time health, and invalidation fit align.
For example, a setup that is mature, close to the trigger rail, supported by directional candle behavior, and not too close to invalidation will generally score better than an old setup with weak confirmation and high time risk.
📊 When to Use
• Breakout preparation
• Pullback continuation planning
• Range compression before expansion
• Setups that need a time limit
• Charts where invalidation needs to stay visible
• Traders who want to separate early setups from late setups
⚠️ When NOT to Use
• Extremely low-liquidity markets
• Charts with unreliable volume and erratic candles
• Very noisy micro timeframes
• Extreme volatility spikes where ATR-based references expand too quickly
• Situations where the user wants a direct buy/sell signal instead of a planning map
🎛️ Key Inputs
• Setup Side → selects automatic, long-side, or short-side lifecycle tracking.
• Trigger Model → controls how the setup moves into TRIGGERED state.
• Setup Lookback → defines the forming range used for trigger and invalidation mapping.
• Sensitivity → changes how strict the lifecycle detection and confirmation logic feels.
• Expiry Bars → controls how long an untriggered setup can stay active.
• Minimum Quality Score → defines the threshold for stronger lifecycle contexts.
• Panel / Label Settings → control panel position, theme, font size, label size, and label density.
🖥️ Interface & Visual Design
The interface is built around a single chart-first lifecycle window.
The panel is intentionally compact. It does not replace the chart; it summarizes the active state so the user can quickly read the setup stage, score, time risk, invalidation, and next context action.
Labels are kept moderate and offset away from candles to preserve readability.
🧪 Practical Usage Workflow
1. Read the panel stage.
2. Check the lifecycle window between trigger and invalidation.
3. Watch whether the setup moves from FORMING to ARMED.
4. Review the trigger rail and invalidation rail.
5. Use the expiry marker to avoid stale setup interpretation.
6. Confirm the broader market context before making any decision.
🔍 Interpretation Guidelines
A high lifecycle score means the current setup context is cleaner according to the script's rule set.
An ARMED state means the setup is close to the trigger area, not that a trade must be taken.
An EXPIRED state means time quality has degraded.
An INVALIDATED state means the tracked setup lost its mapped risk reference.
🚫 What This Script Is NOT
• Not a prediction engine
• Not financial advice
• Not an auto-trading tool
• Not a guaranteed signal system
• Not a generic support/resistance mapper
• Not a clone of Setup Quality Scorecard
⚠️ Limitations & Transparency
Lifecycle windows depend on lookback, ATR behavior, and recent structure.
Different timeframes can produce different setup stages.
High-volatility conditions may expand rails and change score behavior.
Low-liquidity symbols can create unstable ranges and misleading candle structure.
🧠 Market Context Notes
Setup lifecycle quality is strongest when structure, volatility, and timing align.
A setup can be technically visible but still weak if it is too old, too far from the trigger rail, too close to invalidation, or unsupported by confirmation behavior.
🧾 Use Case Examples
When price compresses below a range edge and the lifecycle window turns ARMED, the trader can observe whether the trigger rail is reached before the expiry marker.
When a setup remains FORMING for too long, the time risk row helps identify whether the context is becoming stale.
When price crosses the invalidation rail, the script marks the lifecycle as INVALIDATED so the previous setup is no longer treated as active.
🧱 System Philosophy
AGPro tools are designed to help traders read market context with structure and restraint.
Setup Lifecycle Tracker follows that philosophy by converting setup timing into a visible planning workflow instead of adding another isolated signal marker.
🔐 Non-Promise Statement
No script can provide certainty.
No score, state, label, or alert guarantees future price behavior.
📉 Risk Disclosure
Trading involves risk.
This script is for educational and analytical use only.
It does not provide financial advice, investment advice, or guaranteed trading outcomes.
Users remain responsible for their own decisions, risk management, and position sizing.
📚 Educational Note
The main educational purpose of this script is to help users think in lifecycle stages: setup formation, activation risk, invalidation, time decay, and context review.
Pine Script® indicator
Market Seasonality & Volatility Analysis
📊 Market Seasonality & Volatility Dashboard
💡 The Concept
In trading, "When" is just as important as "What." Every financial asset has a unique "Seasonal DNA"—historical patterns driven by institutional rebalancing, tax cycles, and human psychology.
This indicator is a high-performance statistical engine that maps the historical behavior of any asset across three time-dimensions: Monthly, Quarterly, and Daily. It transforms raw historical data into a clean, Excel-style dashboard that helps you align your trades with the "Path of Least Resistance."
🔍 Key Metrics
Avg Performance (Directional Bias): Calculates the average percentage return for every period.
Green/Red bars: Instantly identify which months or days have a strong historical bullish or bearish bias.
Volatility (Risk & Range): Calculates the average High-to-Low range as a percentage.
Blue bars: Identify "Explosive" periods vs. "Quiet" periods. Use this to adjust your stop-loss width and take-profit targets based on expected market movement.
🛠 Unique Features
Excel-Style Visual Bars: Uses normalized block characters (█) to create a visual "heatmap" of data. This allows you to spot statistical outliers instantly without reading every digit.
Fully Modular UI: Your chart, your rules. Use the settings menu to toggle specific sections (Monthly, Quarterly, Daily) or specific columns (Performance, Volatility) on and off. The table dynamically resizes to stay compact.
Regime-Based Lookback: Markets evolve. Choose between All Time data, or filter for the Last N Years to see if traditional seasonality still holds up in the current market regime.
High-Contrast Design: Features a solid, non-transparent background with customizable framing and sizing, ensuring the data is readable regardless of the price action happening behind it.
📈 How to Use the Data
Alignment: If you are looking for a Long swing trade, check if the current Month and Quarter are historically positive. Trading with the seasonal wind at your back increases your probability.
The "Volatile Wednesday": If the "Daily" section shows massive Volatility bars for a specific day, prepare for wider price swings. Use a wider stop-loss to avoid being "wicked out" by noise.
Quarterly Rotations: Use the Quarterly section to prepare for broader institutional shifts (e.g., the Q1 "January Effect" or the Q3 "Summer Lull").
Customization: Day traders can hide Monthly/Quarterly stats to focus purely on Daily Volatility, while Investors can hide Daily/Volatility stats for a clean view of long-term performance.
⚙️ Settings Overview
Visibility: Toggle Monthly, Quarterly, Daily, Performance, or Volatility metrics.
Lookback: Set custom Year or Bar limits to analyze specific market eras.
Scaling: Choose table sizes from "Tiny" to "Huge" and adjust the maximum width of visual data bars.
Style: Fully customizable colors for background, borders, text, and data bars.
Pine Script® indicator
Trailing Stop Quality [AGPro Series]Trailing Stop Quality
🧠 Core Idea
Is the current trailing reference defending the move cleanly, or is it creating noise that deserves a risk review?
📌 Overview / What it does
Trailing Stop Quality is a trade-management planner built for traders who want more context around active trailing stops, defense rails, and risk-shift conditions.
The script compares a swing defense rail with a volatility defense rail, evaluates trend-defense quality, measures pullback depth, checks volatility expansion, and converts the result into a 0-100 trailing stop quality score.
It produces trail rails, a centered risk-shift zone, a target-room guide, compact state labels, alerts, and a clean AGPro panel. It does not predict price direction, automate trading, or tell users what to buy or sell.
🎯 Purpose & Design Philosophy
Many trailing stop tools show a stop line, but they do not explain whether the current trail is structurally clean, too close to noise, too loose, or in conflict with another management reference.
This script was built to fill that gap.
It helps traders who already have a move in progress and want to evaluate whether the active trail is still defending the move with enough quality to keep monitoring.
The design philosophy is simple: manage context before reacting to the line.
⚡ Why This Script Is Different
Most tools focus on plotting a trailing stop line, flipping side, or marking stop transitions.
This script does NOT clone a Chandelier Exit flip-zone tool, does not act as a stop-loss optimizer, and does not print direct trade commands.
Instead, it scores the quality of the current trail using swing defense, volatility defense, trend slope, pullback depth, volatility expansion, and rail conflict. The result is a management-readiness layer, not another raw stop signal.
⚙️ Methodology
1. Context Detection
The script reads the active management side automatically or lets the user force long-side or short-side evaluation.
2. Reference Mapping
It maps two trail references: a swing defense rail and a volatility defense rail. The tighter reference becomes the active defense rail.
3. Reaction Evaluation
It scores whether the active trail is balanced, too near, too loose, conflicted, or already broken.
4. Visual Output
It displays the active defense rail, swing rail, volatility rail, risk-shift zone, target guide, compact labels, alerts, and AGPro panel state.
🗺️ How to Read the Chart
Zones = the risk-shift zone shows the gap between the swing defense rail and volatility defense rail. Its centered label summarizes the active conflict or quiet state.
Labels = labels mark TRAIL HOLDS, RISK SHIFT, MONITOR, NOISE, ROOM LIMITED, or DEFENSE LOST contexts.
Colors = green highlights clean defense, pink highlights lost defense, amber highlights risk review, and indigo highlights monitor context.
Panel = the panel summarizes Trail Quality, Stop Distance, Trend Defense, Risk Shift, and Action.
🚦 Signals & States
• TRAIL HOLDS → the active trail is defending cleanly with enough score and no major risk-shift conflict.
• RISK SHIFT → price is close to the active rail or swing and volatility rails disagree enough to deserve review.
• MONITOR → trail quality is acceptable but not strong enough for a clean defense state.
• NOISE → the current trail reference is low quality or too unstable.
• ROOM LIMITED → forward room is limited relative to the active trail risk.
• DEFENSE LOST → price crossed the active defense rail and the current trail context should be reviewed.
🔔 Alerts Logic
Alerts trigger when the script detects a clean trail-hold state, risk-shift state, monitor state, noisy trail state, defense-loss event, or limited target-room condition.
Alerts are attention markers only.
They are not trade instructions and should be interpreted within broader market context.
🧩 Confluence Logic
The strongest context appears when swing defense and volatility defense are aligned, the active trail distance is balanced, trend slope supports the management side, pullback depth is controlled, and volatility is expanding without becoming chaotic.
When those conditions align, the 0-100 trail quality score improves.
📊 When to Use
• During active trend-following management
• After a move has already started and trailing references matter
• When comparing swing-based trail behavior with volatility-based defense
• During pullbacks where the trail may be too close to price
• When evaluating whether a move still has reasonable room before the next structure edge
⚠️ When NOT to Use
• Very low-liquidity symbols with erratic wick behavior
• Extremely noisy chop where no stable management side exists
• Event-driven spikes where volatility changes too quickly
• Charts where the user wants entry signals instead of trail-quality context
🎛️ Key Inputs
• Management Side → controls Auto, Long Management, or Short Management mode.
• Swing Trail Lookback → controls the structural defense rail.
• Volatility Rail Multiple → controls the ATR-based volatility defense rail.
• Sensitivity → adjusts how strict the trail-quality scoring model is.
• Minimum Clean Score → defines when the trail can qualify as a clean defense state.
• Target Guide R Multiple → sets the forward planning reference used for target-room context.
• Visual settings → control rails, risk-shift zone, target guide, labels, panel location, panel theme, and font sizes.
🖥️ Interface & Visual Design
The interface is intentionally chart-first.
The rails show the actual management references, the zone shows swing-versus-volatility conflict, and the panel gives a fast decision read without turning the script into a crowded dashboard.
The AGPro panel uses a single merged blue header row and keeps the key state visible at a glance.
🧪 Practical Usage Workflow
1. Read the panel Trail Quality state.
2. Check whether the active defense rail is still below price in long management or above price in short management.
3. Review the risk-shift zone to see whether swing and volatility references agree.
4. Check whether the target guide still has reasonable forward room.
5. Use the label state as an attention marker, then confirm with broader structure and market context.
🔍 Interpretation Guidelines
Think of the output as trail-quality context, not a trade signal.
A high score means the active trail is better aligned with structure, volatility, trend defense, and pullback depth.
A low score means the current trailing reference may be too noisy, too close, too loose, or already losing defensive value.
🚫 What This Script Is NOT
• Not a prediction engine
• Not financial advice
• Not auto trading
• Not guaranteed signals
• Not a Chandelier Exit clone
• Not a stop-loss optimizer
• Not a buy or sell signal tool
⚠️ Limitations & Transparency
Trailing stop quality can change quickly when volatility expands, contracts, or when price moves into noisy pullback conditions.
Different timeframes may produce different trail rails and score behavior.
Fast markets, low liquidity, and abnormal wick behavior can reduce the usefulness of any rule-based trail-quality model.
🧠 Market Context Notes
Trail quality is not only about distance from price.
It also depends on whether structure is still defending the move, whether volatility is stable enough to support the rail, and whether the next target area leaves enough room relative to current trail risk.
🧾 Use Case Examples
When price trends higher and both swing defense and volatility defense remain below price with a strong score, the script may mark TRAIL HOLDS.
When price compresses toward the active trail or swing and volatility rails separate too much, the script may mark RISK SHIFT.
When price crosses the active defense rail, the script may mark DEFENSE LOST so the user can review the management context.
🧱 System Philosophy
Trailing Stop Quality belongs to the AGPro planner-style family: tools designed to help traders evaluate context before decisions, rather than simply adding another signal to the chart.
🔐 Non-Promise Statement
No output from this script guarantees a result.
No score represents certainty.
📉 Risk Disclosure
Trading involves risk.
Users are responsible for their own decisions, position sizing, and risk management.
This script is for educational and analytical purposes only and does not provide financial advice.
📚 Educational Note
The goal is to make trailing stop context easier to inspect by separating clean defense, risk shift, noisy trails, limited room, and lost defense states.
Pine Script® indicator
Simple Relative Strength
This 'Simple Relative Strength' (SRS) indicator is similar to RSI in that it's a measure of relative strength, except that it's calculated entirely differently.
This means that although it may look similar, it may also look and behave very differently depending on the settings.
It is calculated from a time period, specified by a number of bars, hours or days.
The SRS value is the current price, expressed as a percentage of the price range, from low to high, of the specified time period.
This is my own invention, and not like anything else, that I'm aware of.
I currently use this SRS as one of the indicators, within a more complex live trading strategy for my bots, trading on Bitcoin and Gold.
I did initially try using an RSI or CMF within my strategy, but found this SRS to be more useful instead.
Pine Script® indicator
Fracture Threshold Strategy [JOAT]Fracture Threshold Strategy
Introduction
Fracture Threshold Strategy (FTS) is an open-source, automated Pine Script v6 trading strategy that combines three independent filters — a seven-condition MasterTrend EMA alignment score, a relative volume regime gate, and a session time restriction — into a single, unified entry system. Entry is triggered by an EMA 4/5 crossover when all three filters are simultaneously satisfied. Stop loss is placed at 1.5× ATR from entry. Take profit is set at a 3:1 reward-to-risk ratio by default. All orders are executed on bar close (process_orders_on_close=false), and signals are gated on barstate.isconfirmed to eliminate intrabar repainting.
FTS is designed to demonstrate how institutional-grade filtering layers can be combined into a programmatic strategy with realistic, auditable results. It is not a black box — every condition is visible in the dashboard and the source code is fully open. The strategy description explains the exact logic, the default backtesting parameters, and the limitations of any backtesting approach.
Core Concepts
1. MasterTrend Seven-EMA Alignment Score
Seven trend conditions are evaluated on each bar. Each satisfied condition contributes one point to a bull or bear score (0–7):
EMA 4 above/below EMA 5 — fast momentum direction
RSI above/below 50 — momentum confirmation
Price above/below EMA 21 — short-term trend
EMA 21 above/below SMA 50 — medium-term structure
SMA 50 above/below EMA 55 — medium-to-intermediate trend
EMA 55 above/below EMA 89 — intermediate trend
Price above/below EMA 750 — long-term macro trend
Entry requires the bull or bear score to equal or exceed the configurable minimum (default: 5 out of 7). This prevents entries during low-conviction, mixed-alignment market conditions.
2. Relative Volume Regime Gate
Volume regime is measured as the ratio of a short-term volume MA to a long-term volume MA, smoothed by an EMA:
float volRatio = ta.ema(volShort / math.max(volLong, 1.0), i_volSmth)
bool volOK = volRatio >= i_volMin
The default minimum ratio is 0.90 — entries are blocked when recent volume is more than 10% below the long-term average. This prevents the strategy from entering trades during dead, low-participation conditions where institutional order flow is absent.
3. Session Filter
Trading is restricted to the London session (08:00–17:00) and New York session (14:00–21:00) in the selected timezone, with both independently toggleable. Entries outside the active sessions are blocked. This keeps the strategy focused on the highest-liquidity periods of the trading day.
4. EMA 4/5 Crossover Entry Trigger
The entry trigger is an EMA 4 crossover above EMA 5 (for longs) or crossunder (for shorts), evaluated on confirmed bar closes. The crossover is a fast momentum signal — it fires at the beginning of a new short-term directional move. Combined with the full filter stack, it identifies the specific bar where momentum begins aligning with the broader structural trend.
5. ATR Stop Loss and 3:1 Take Profit
Stop loss is placed at 1.5× ATR from entry. Take profit is placed at 3× the stop distance (configurable). Both levels are computed at entry and fixed — they do not trail. The strategy uses Pine Script's strategy.exit() function with explicit stop and limit prices for clean, non-discretionary execution.
Default Backtesting Properties
The strategy has been published with the following default Properties settings. These values are used in all performance metrics shown on the chart:
Initial Capital: $10,000 (realistic for an individual trader)
Position Size: 2% of equity per trade (risk-managed sizing)
Commission: 0.05% per side (representative of standard exchange or broker fees)
Slippage: 2 ticks
Pyramiding: 0 (one trade open at a time)
process_orders_on_close: false (orders execute on the next bar open, not at the signal bar close)
Using 2% of equity per trade with a 1.5× ATR stop means the maximum percentage of equity at risk per trade scales with position size dynamically — at a 3:1 RR ratio, three losing trades in a row lose approximately 6% of equity, which is within the TradingView recommended range. A dataset that generates at least 100 trades is recommended for meaningful statistical evaluation. On lower timeframes (5m, 15m) on major equity indices or forex pairs with London and NY sessions active, the default settings typically produce sufficient trade counts.
Features
Three-Layer Entry Filter: MasterTrend score, volume regime, and session — all three must be satisfied simultaneously
Configurable Minimum Score: Adjustable minimum MasterTrend alignment score threshold (1–7, default: 5)
EMA 4/5 Crossover Trigger: Fast momentum crossover as entry signal within aligned conditions
ATR Stop Loss: Dynamic stop placement based on current ATR — adapts to instrument volatility
Fixed Ratio Take Profit: 3:1 default reward-to-risk — adjustable
Session Restriction: London and New York sessions independently configurable with timezone setting
Volume Regime Gate: Minimum volume ratio filter blocks entries during low-participation conditions
TP/SL Visualization: Active trade TP and SL boxes drawn from entry and extended on each bar — color changes on outcome
Entry Markers: Triangle plotshapes at long and short entry bars for clear chart identification
EMA Reference Plots: EMA 4, EMA 5, EMA 21, and EMA 750 plotted as reference
Non-Repainting: process_orders_on_close=false; all entry conditions gated on barstate.isconfirmed
Dashboard (Top Right): Live MasterTrend state, volume regime, session, current position, net P&L, win rate, profit factor, max drawdown, average win/loss, and RR ratio
Entry Context Labels: Each entry label now shows the MasterTrend score and volume regime tag at the moment of entry in the format "L 6/7 | V:HI" — full entry context visible on the chart without needing to consult the dashboard
Position Candle Tint: Candles colored green while a long position is open, red while a short position is open — provides an immediate visual record of all trade durations across the full chart history
Per-Session Performance Breakdown: London and New York win rates tracked and displayed separately in the dashboard — identifies which session produces the strongest historical edge for the current instrument and timeframe
Expanded Dashboard (15 Rows): Dashboard expanded to 15 rows — now includes a full session performance section with London and NY win rates alongside the existing strategy performance metrics
Input Parameters
MasterTrend EMA Stack:
EMA 4, EMA 5, EMA 21, SMA 50, EMA 55, EMA 89, EMA 750: All periods individually configurable
RSI Length: RSI period for momentum condition (default: 14)
Volume Regime Filter:
Short Vol MA / Long Vol MA: Volume baseline calculation periods (default: 10, 40)
Vol Smooth: EMA smoothing for ratio (default: 3)
Min Vol Ratio: Minimum ratio threshold for entry permission (default: 0.90)
Session Filter:
Timezone: Session evaluation timezone (default: America/New_York)
Session Filter: Master toggle (default: enabled)
Allow London / Allow NY: Independent session toggles (both default: enabled)
Entry Trigger:
EMA4/5 Cross Entry: Use crossover as trigger (default: enabled)
Min MasterTrend Score: Minimum score required for entry (default: 5)
Risk Management:
ATR Length: ATR period (default: 14)
ATR SL Multiplier: Stop distance as ATR multiple (default: 1.5)
Reward:Risk Ratio: TP multiple (default: 3.0)
How to Use This Strategy
Step 1: Verify the Filter Stack is Active
The dashboard shows MasterTrend state, volume regime, and current session at all times. Before a trade can occur, all three must be aligned — a bull score ≥ 5, volume ratio ≥ 0.90, and an active London or NY session window.
Step 2: Observe the EMA 4/5 Crossover
The entry trigger is the EMA 4 crossing EMA 5. With all filters active, the next crossover in the trend direction will generate an entry. The entry is executed at the open of the following bar (process_orders_on_close=false), which is the realistic execution point.
Step 3: Manage the Open Trade
The TP/SL boxes extend from the entry bar and update on each subsequent bar. The strategy's exit function manages the trade automatically — no manual management is required. The dashboard shows the current position state (LONG / SHORT / FLAT) at all times.
Step 4: Evaluate Backtesting Results Critically
Past results do not predict future performance. Before drawing conclusions from any backtest, ensure the trade count is at least 100. A small sample (under 50 trades) produces unreliable win rate and profit factor estimates. Test across multiple instruments and timeframes — a strategy that performs well on one asset in one period may not generalize.
Strategy Limitations
The EMA 750 requires 750 bars of chart history. On timeframes or instruments with limited bar history, the 750-period EMA will be inaccurate for the first 750 bars — backtest results including those bars should be discounted
Backtesting does not account for liquidity, market impact, or partial fills on real orders. The 2-tick slippage setting is an approximation — on illiquid instruments or during news events, actual slippage may be significantly higher
The EMA 4/5 crossover is a fast signal. In choppy, sideways markets where EMAs cross frequently, the strategy may enter multiple trades quickly that all exit at stop loss before the filter stack re-assesses. The session and volume filters reduce but do not eliminate this behavior
A fixed 3:1 RR ratio requires the market to travel 3× the initial risk without reversing. On short timeframes or on instruments with narrow average ranges relative to ATR, achieving the full TP target may be less frequent than on smoother-trending assets
Commissions, taxes, and regulatory fees vary by broker, instrument, and jurisdiction. The 0.05% commission default is a general estimate — actual trading costs should be substituted with broker-specific values before drawing performance conclusions
This strategy is one specific configuration of the underlying filter system. Adjusting the minimum MasterTrend score, volume threshold, session windows, or RR ratio will produce different results. Any configuration change constitutes a separate strategy with its own performance characteristics
Originality Statement
FTS implements a programmatic entry system by combining a seven-condition quantitative trend score, a relative volume regime gate, and a session time restriction into a unified, fully transparent open-source strategy. This is original for the following reasons:
The MasterTrend alignment score functions as a structural quality gate — rather than entering on any EMA crossover, the strategy explicitly requires a minimum number of the seven structural conditions to be simultaneously satisfied, producing a much stricter entry criterion than a standard crossover system
The volume regime gate uses a normalized ratio (not a raw volume level) to block entries during low-participation conditions — making the filter relevant across instruments and timeframes without requiring instrument-specific volume threshold calibration
The combination of structural alignment (EMA stack), activity quality (volume regime), and time context (session filter) as three independent prerequisites creates a compounding selectivity effect — the strategy only enters the specific intersection of all three conditions, which is a smaller, higher-conviction subset than any single filter alone
The live dashboard displaying all filter states, position context, and key performance metrics simultaneously provides full transparency into why any given bar does or does not produce a signal, making the strategy auditable in real time
Disclaimer
This strategy is provided for educational and informational purposes only. It is not financial advice or a recommendation to buy or sell any financial instrument. Trading involves substantial risk of loss. Backtesting results shown are based on historical data and do not guarantee or predict future performance. Past results are not indicative of future results. Commission and slippage values used in backtesting are estimates — actual trading costs will vary. The strategy does not account for all real-world execution factors. Always use proper risk management and consult a qualified financial professional before making trading decisions. The author is not responsible for any trading losses resulting from the use of this strategy.
-Made with passion by jackofalltrades
Pine Script® strategy
BTC 4H Pullback Buy Strategy
BTC 4H Pullback Buy Strategy
A trend-following strategy designed for Bitcoin on the 4-hour timeframe.
Trades only above the 200EMA
Targets pullbacks near the EMA
Uses Stochastic for timing
Confirms momentum with RSI
Filters signals with volume
Manages risk with ATR
👉 Focus on high-probability pullback entries
BTC 4H Pullback Buy Strategy
BTCの4時間足に特化した、トレンドフォロー型バックテスト戦略。
上昇トレンド中の“高確率な押し目”だけを狙う設計です。
主なロジック
200EMA上でのみトレード(トレンドフィルター)
EMA付近までの押し目を検出
ストキャスティクスで反転タイミングを確認
RSIでモメンタム回復を判断
出来高で信頼性を強化
ATRで損切り・利確を自動管理
👉 「トレンド+押し目+再加速」だけに集中
Pine Script® strategy
Entry Execution Readiness [AGPro Series]Entry Execution Readiness
🧠 Core Idea
Is this setup ready for execution attention now, or should it remain on watch?
📌 Overview / What it does
Entry Execution Readiness is a chart-first decision engine built to evaluate whether an active setup has enough structure, risk quality, and target room to deserve execution attention.
The script produces a 0-100 Readiness Score, a clear entry state, an entry pocket, an invalidation rail, a target-room band, premium state labels, and a compact AGPro panel. It is designed to organize setup quality, not to predict price or automate execution.
It does not publish buy or sell commands. It does not replace a trader's own execution model. Its purpose is to turn observable setup conditions into a cleaner readiness map.
🎯 Purpose & Design Philosophy
This script was built for traders who already see a potential setup but need a disciplined way to decide whether the setup is clean enough to keep under execution review.
The gap it fills is practical: many tools identify signals, levels, or zones, but they do not answer whether the setup has acceptable risk distance, enough target room, suitable volatility, and directional confirmation at the same time.
The design philosophy is simple: execution should be reviewed through readiness, not excitement.
⚡ Why This Script Is Different
Most tools focus on printing a signal or highlighting a level.
This script does NOT act as a full Position Planner, position sizing model, signal service, or trade automation system.
Instead, it evaluates execution readiness through a compact decision layer: trend alignment, candle efficiency, distance to invalidation, target-room quality, and volatility fit are compressed into one transparent score and one clear next-action state.
⚙️ Methodology
1. Context Detection
The script detects the active setup side automatically, or lets the user force a long-bias or short-bias readiness view.
2. Reference Mapping
It maps an entry pocket around the active trend reference, builds an invalidation rail from recent structure, and projects target room from nearby structure or ATR-adjusted continuation space.
3. Reaction Evaluation
It scores trend alignment, candle efficiency, risk distance, reward room, and volatility fit from 0 to 100.
4. Visual Output
The chart displays the readiness state through zones, labels, alerts, and a premium AGPro panel with the key decision fields.
🗺️ How to Read the Chart
Zones = the active entry pocket and target-room band.
Invalidation rail = the structural level that would weaken or reset the current setup context.
Labels = the current readiness state, score tier, and risk context.
Colors = teal for stronger long-readiness contexts, pink for bearish or invalidation contexts, amber for waiting states, and indigo for monitoring/transition states.
Panel = the fastest summary of score, state, risk distance, target room, and next action.
🚦 Signals & States
• READY → the setup meets the score threshold and confirmation filter.
• MONITOR → the setup is improving but still needs cleaner confirmation or score strength.
• WAIT → the setup exists, but risk, target room, or confirmation is not yet strong enough.
• BLOCKED → the current context does not offer a clean execution-readiness profile.
• INVALIDATED → price closed beyond the active invalidation rail.
🔔 Alerts Logic
READY alerts trigger when the state upgrades into READY.
Downgrade alerts trigger when the active setup weakens from a stronger state.
Invalidation alerts trigger when price closes beyond the current invalidation rail.
Confirmation alerts trigger when score and confirmation improve together near the READY threshold.
Alerts are attention markers. They are not trade instructions.
🧩 Confluence Logic
The setup becomes stronger when directional trend alignment, candle quality, controlled invalidation distance, acceptable volatility, and clean target room improve at the same time.
The score is intentionally multi-factor so a single strong candle or a single clean level cannot dominate the full readiness view.
📊 When to Use
• Trend continuation setups
• Pullback-to-reference execution reviews
• Breakout continuation contexts with enough target room
• Active trade-planning workflows where the trader already has a directional thesis
• Intraday or swing charts where risk and target room need to be evaluated quickly
• 4-hour swing/execution review charts where the active pocket, invalidation rail, and target room can be read without excessive label compression
⚠️ When NOT to Use
• Very low liquidity markets
• Extremely noisy sideways conditions
• News-driven volatility spikes
• Charts where the user has no independent setup thesis
• Markets with poor execution conditions, wide spreads, or unreliable fills
🎛️ Key Inputs
• Setup Direction → Auto, Long Bias, or Short Bias readiness mode.
• Sensitivity → controls how selective the model is.
• Structure Lookback → affects structure, risk rail, target room, and volatility context.
• Minimum READY Score → defines the threshold required for READY state.
• Confirmation Mode → controls how much candle and trend confirmation is required.
• Label Cooldown / Max Visible Labels → controls label density.
• Panel Location / Panel Theme / Font Sizes → controls visual presentation.
🖥️ Interface & Visual Design
The interface is built around a clean premium overlay.
The panel uses the AGPro standard single merged blue header row and summarizes only the most decision-relevant fields.
The chart visuals are deliberately limited to the current entry pocket, invalidation rail, target room, and moderate state labels so the script remains readable in publication screenshots.
🧪 Practical Usage Workflow
1. Read the panel state and Readiness Score.
2. Check whether price is interacting cleanly with the entry pocket.
3. Review the invalidation rail and risk distance.
4. Compare the target-room band against the current risk.
5. Treat READY as a review state, not as an automatic execution command.
🔍 Interpretation Guidelines
Think of the output as a readiness filter.
A high score means the modeled conditions are aligned more cleanly than usual. It does not mean the setup will work.
A WAIT or MONITOR state can still be useful because it shows what part of the setup is not yet ready.
An INVALIDATED state means the current setup context should be reset or reviewed again from a fresh structure.
🚫 What This Script Is NOT
• Not a prediction engine
• Not financial advice
• Not auto trading
• Not guaranteed signals
• Not a full position-sizing planner
• Not a buy/sell command system
⚠️ Limitations & Transparency
Timeframe differences can change how structure, volatility, and target room appear.
Volatility expansion or contraction can make the readiness state change quickly.
Market conditions can shift faster than any rule-based chart tool can summarize.
The model is transparent and deterministic, but it cannot know future price behavior.
🧠 Market Context Notes
Entry readiness is most useful when it is read together with liquidity, structure, session context, and broader volatility conditions.
The script is strongest when the trader already has a setup thesis and needs a cleaner way to review whether execution conditions are improving or weakening.
🧾 Use Case Examples
When price pulls back toward the entry pocket, trend alignment remains intact, risk distance stays controlled, and target room remains clean, the setup may upgrade into MONITOR or READY.
When price stretches too far from the pocket or target room becomes too thin relative to invalidation distance, the score can weaken even if direction still looks attractive.
When price closes beyond the invalidation rail, the active setup context is marked as INVALIDATED.
🧱 System Philosophy
AGPro tools are designed to support structured chart reading, decision clarity, and rule-based interpretation.
This script follows that philosophy by focusing on execution readiness instead of generic signals.
🔐 Non-Promise Statement
No script can provide certainty.
No score can guarantee a future outcome.
This tool organizes visible chart conditions so the user can make a more structured review.
📉 Risk Disclosure
Trading involves risk. Market movement can be unpredictable, and any setup can fail.
Users are responsible for their own analysis, execution, risk management, and decisions.
This script does not provide financial advice, investment advice, or guaranteed trading outcomes.
📚 Educational Note
Use the script as a structured decision-support layer. The strongest benefit comes from reviewing why the state is READY, WAIT, MONITOR, BLOCKED, or INVALIDATED rather than treating any single label as a standalone answer.
Pine Script® indicator
Previous high to Close Previous low to Close fib levelsThis script, Fib Bridge: H/L to First Close, is a specialized technical analysis tool designed to identify intraday support and resistance levels based on the relationship between previous period extremes and the opening price action.
Core Functionality
Anchor Periods: Automatically calculates levels based on the Previous Day or Previous Week high/low.
The "Fib Bridge": It constructs Fibonacci-style "bridges" between the previous period's high/low and the closing price of the first candle of the current session.
ORB Levels: Visualizes the Opening Range Breakout (ORB) High, Low, and Midpoint of the first candle for immediate bias.
Bull & Bear Zones: * Bull Bridge: Projects the 50% midpoint between the Previous Low and the first Close.
Bear Bridge: Projects the 50% midpoint between the Previous High and the first Close.
Dynamic Visuals: Includes real-time line extensions and customizable labels for price precision.
Pine Script® indicator
vasudevanCore Concept
The strategy is based on the idea that:
VWAP acts as a dynamic support/resistance
Price often retests VWAP before continuing trend
A breakout after retest provides a higher probability entry
🟢 Buy Logic
1. Price trades above VWAP
2. Price retests VWAP zone
Indicator marks a Buy Setup (SL Buy)
→ Stop loss is fixed at the retest candle low
Entry triggers when:
Price breaks previous candle high
RSI is above 40
🔴 Sell Logic
Price trades below VWAP
Price retests VWAP zone
Indicator marks a Sell Setup (SL Sell)
→ Stop loss is fixed at the retest candle high
Entry triggers when:
Price breaks previous candle low
RSI filter applied (below 60)
Features
✅ VWAP-based trend direction
✅ Retest detection zone
✅ 2-step signal system (Setup + Entry)
✅ Fixed Stop Loss from retest candle
✅ RSI strength filter
✅ Clean Buy/Sell labels
✅ Alert support
Pine Script® indicator






















