BTC Macro Composite Global liquidity Index -OffsetThis indicator is based on the thesis that Bitcoin price movements are heavily influenced by macro liquidity trends. It calculates a weighted composite index based on the following components:
• Global Liquidity (41%): Sum of central bank balance sheets (Fed , ECB , BoJ , and PBoC ), adjusted to USD.
• Investor Risk Appetite (22%): Derived from the Copper/Gold ratio, inverse VIX (as a risk-on signal), and the spread between High Yield and Investment Grade bonds (HY vs IG OAS).
• Gold Sensitivity (15–20%): Combines the XAUUSD price with BTC/Gold ratio to reflect the historical influence of gold on Bitcoin pricing.
Each component is normalized and then offset forward by 90 days to attempt predictive alignment with Bitcoin’s price.
The goal is to identify macro inflection points with high predictive value for BTC. It is not a trading signal generator but rather a macro trend context indicator.
❗ Important: This script should be used with caution. It does not account for geopolitical shocks, regulatory events, or internal BTC market structure (e.g., miner behavior, on-chain metrics).
💡 How to use:
• Use on the 1D timeframe.
• Look for divergences between BTC price and the macro index.
• Apply in confluence with other technical or fundamental frameworks.
🔍 Originality:
While similar components exist in macro dashboards, this script combines them uniquely using time-forward offsets and custom weighting specifically tailored for BTC behavior.
Cari skrip untuk "西布罗姆vs伯恩利"
BB Expansion Oscillator (BEXO)BB Expansion Oscillator (BEXO) is a custom indicator designed to measure and visualize the expansion and contraction phases of Bollinger Bands in a normalized way.
🔹 Core Features:
Normalized BB Width: Transforms Bollinger Band Width into a 0–100 scale for easier comparison across different timeframes and assets.
Signal Line: EMA-based smoothing line to detect trend direction shifts.
Histogram: Highlights expansion vs contraction momentum.
OB/OS Zones: Detects Over-Expansion and Over-Contraction states to spot potential volatility breakouts or squeezes.
Dynamic Coloring & Ribbon: Visual cues for trend bias and crossovers.
Info Table: Displays real-time values and status (Expansion, Contraction, Over-Expansion, Over-Contraction).
Background Highlighting: Optional visual aid for trend phases.
🔹 How to Use:
When BEXO rises above the Signal Line, the market is in an Expansion phase → potential trend continuation.
When BEXO falls below the Signal Line, the market is in a Contraction phase → potential consolidation or trend weakness.
Overbought/Over-Expansion zone (above OB level): Signals high volatility; watch for possible reversal or breakout exhaustion.
Oversold/Over-Contraction zone (below OS level): Indicates a squeeze or low volatility; often precedes strong breakout moves.
🔹 Best Application:
Identify volatility cycles (squeeze & expansion).
Filter trades by volatility conditions.
Combine with price action, volume, or momentum indicators for confirmation.
⚠️ Disclaimer:
This indicator is for educational and research purposes only. It should not be considered financial advice. Always combine with proper risk management and your own trading strategy.
Smart Multi-Confirm Reversal DetectorHow the Smart Multi-Confirm Reversal Detector Works
The indicator works by analyzing candlestick patterns, trend, and technical confirmations and then scoring each bar to determine the strength of a potential reversal. Here’s the step-by-step logic:
Step 1: Analyze Candlestick Patterns
For each new candle, the indicator checks if any of the selected patterns occur:
Wick Reversal (Long Lower Wick):
Looks for candles with a small body and a long lower shadow.
Indicates buying pressure (potential bullish reversal).
Inverted Wick (Long Upper Wick):
Looks for candles with a small body and a long upper shadow.
Indicates selling pressure (potential bearish reversal).
Body Engulf:
The current candle completely “engulfs” the previous candle.
Signals a strong change in momentum.
Tweezer Patterns:
Two consecutive candles with almost identical highs or lows.
Suggests a potential reversal zone.
3-Bar Pattern:
Three consecutive bullish or bearish candles in a row.
Shows strong momentum continuation or exhaustion, used to confirm reversal.
Each pattern can be turned on/off by the user. If a pattern is detected, it contributes points to the overall signal score.
Step 2: Confirm Trend Direction
The indicator checks EMA trend alignment:
Fast EMA vs Slow EMA:
Fast EMA above Slow EMA → bullish trend.
Fast EMA below Slow EMA → bearish trend.
Optional Higher Timeframe EMA (HTF) Alignment:
Checks if the trend on a higher timeframe matches the current trend.
Adds extra weight to the signal if alignment is true.
This ensures the signal goes in the direction of the prevailing trend, reducing false signals.
Step 3: Check Technical Confirmations
Optional filters increase reliability:
ADX (Average Directional Index):
Measures the strength of the current trend.
Only strong trends contribute to the score.
RSI (Relative Strength Index):
Bullish confirmation: RSI is oversold.
Bearish confirmation: RSI is overbought.
Volume Spike:
Compares current volume to the average volume.
High volume validates the signal’s momentum.
Body Momentum:
Compares current candle’s body size to its average.
Larger than average body indicates stronger momentum.
Each of these confirmations can be enabled/disabled and has a weight in the scoring system.
Step 4: Calculate Score
Each pattern and confirmation has a user-defined weight (0–100).
The indicator sums the active weights that pass conditions and normalizes to 100.
Example:
Wick Reversal detected → 30 points
Trend EMA confirmed → 15 points
ADX confirmed → 10 points
Score = 55/100 → may or may not trigger a signal depending on threshold.
Score Threshold:
Only bars above the user-defined threshold are considered a confirmed signal.
Bars above a lower “label threshold” still show a label, even if not strong enough for alerts.
Step 5: Visualize Signals
Bullish Signals: Green triangle below the candle.
Bearish Signals: Red triangle above the candle.
Labels: Show the type of pattern and the score.
Purpose: Quickly identify potential reversals and assess their strength visually.
Step 6: Optional Alerts
Fixed alert messages can be enabled for confirmed bullish or bearish signals.
Alerts do not recommend trades; they just notify you of pattern confirmations.
Complies with TradingView’s policy for safe alert use.
Step 7: Weighted Decision
The final decision is not binary.
Instead, the indicator combines multiple signals into a score, so stronger signals are more reliable.
This reduces false positives and gives traders a professional, multi-confirmation approach to detect potential reversals.
Frank-Setup EMA, RS & RSI ✅It is a clean and simple indicator designed to identify weakness in stocks using two proven methods: RSI and Relative Strength (RS) vs. a benchmark (e.g., NIFTY).
🔹 Features
RSI Weakness Signals
Plots when RSI crosses below 50 (weakness begins).
Plots when RSI moves back above 50 (weakness ends).
Relative Strength (RS) vs Benchmark
Compares stock performance to a chosen benchmark.
Signals when RS drops below 1 (stock underperforming).
Signals when RS recovers above 1 (strength resumes).
Clear Visual Markers
Circles for RSI signals.
Triangles for RS signals.
Optional RSI labels for clarity.
Built-in Alerts
Get notified instantly when RSI or RS weakness starts or ends.
No need to constantly watch charts.
🎯 Use Case
This tool is built for traders who want to:
Spot shorting opportunities when a stock shows weakness.
Track underperformance vs. the index.
Manage risk by exiting longs when weakness appears.
Frank-Setup ✅ (RSI + RS only)Frank-Shorting Setup ✅ is an indicator designed to help traders spot weakness in a stock by combining RSI and Relative Strength (RS) analysis.
🔹 Key Features
RSI Weakness Signals
Marks when RSI falls below 50 (downside pressure begins).
Marks when RSI moves back above 50 (weakness ends).
Relative Strength (RS) vs Benchmark
Compares stock performance to a benchmark (e.g., NIFTY).
Signals when RS drops below 1 (stock underperforming).
Signals when RS moves back above 1 (strength resumes).
Clear Chart Markings
Circles for RSI signals.
Triangles for RS signals.
Optional labels for extra clarity.
Alerts Built-In
Get notified when RSI or RS weakness starts/ends.
No need to monitor charts all the time
Frank-Shorting Setup ✅ (RSI + RS only)An indicator designed to help traders spot weakness in a stock by combining RSI and Relative Strength (RS) analysis.
🔹 Key Features
RSI Weakness Signals
Marks when RSI falls below 50 (downside pressure begins).
Marks when RSI moves back above 50 (weakness ends).
Relative Strength (RS) vs Benchmark
Compares stock performance to a benchmark (e.g., NIFTY).
Signals when RS drops below 1 (stock underperforming).
Signals when RS moves back above 1 (strength resumes).
Clear Chart Markings
Circles for RSI signals.
Triangles for RS signals.
Optional labels for extra clarity.
Alerts Built-In
Get notified when RSI or RS weakness starts/ends.
No need to monitor charts all the time
J12Matic Builder by galgoomA flexible Renko/tick strategy that lets you choose between two entry engines (Multi-Source 3-way or QBand+Moneyball), with a unified trailing/TP exit engine, NY-time trading windows with auto-flatten, daily profit/loss and trade-count limits (HALT mode), and clean webhook routing using {{strategy.order.alert_message}}.
Highlights
Two entry engines
Multi-Source (3): up to three long/short sources with Single / Dual / Triple logic and optional lookback.
QBand + Moneyball: Gate → Trigger workflow with timing windows, OR/AND trigger modes, per-window caps, optional same-bar fire.
Unified exit engine: Trailing by Bricks or Ticks, plus optional static TP/SL.
Session control (NY time): Evening / Overnight / NY Session windows; auto-flatten at end of any enabled window.
Day controls: Profit/Loss (USD) and Trade-count limits. When hit, strategy HALTS new entries, shows an on-chart label/background.
Alert routing designed for webhooks: Every order sets alert_message= so you can run alerts with:
Condition: this strategy
Notify on: Order fills only
Message: {{strategy.order.alert_message}}
Default JSONs or Custom payloads: If a Custom field is blank, a sensible default JSON is sent. Fill a field to override.
How to set up alerts (the 15-second version)
Create a TradingView alert with this strategy as Condition.
Notify on: Order fills only.
Message: {{strategy.order.alert_message}} (exactly).
If you want your own payloads, paste them into Inputs → 08) Custom Alert Payloads.
Leave blank → the strategy sends a default JSON.
Fill in → your text is sent as-is.
Note: Anything you type into the alert dialog’s Message box is ignored except the {{strategy.order.alert_message}} token, which forwards the payload supplied by the strategy at order time.
Publishing notes / best practices
Renko users: Make sure “Renko Brick Size” in Inputs matches your chart’s brick size exactly.
Ticks vs Bricks: Exit distances switch instantly when you toggle Exit Units.
Same-bar flips: If enabled, a new opposite signal will first close the open trade (with its exit payload), then enter the new side.
HALT mode: When day profit/loss limit or trade-count limit triggers, new entries are blocked for the rest of the session day. You’ll see a label and a soft background tint.
Session end flatten: Auto-closes positions at window ends; these exits use the “End of Session Window Exit” payload.
Bar magnifier: Strategy is configured for on-close execution; you can enable Bar Magnifier in Properties if needed.
Default JSONs (used when a Custom field is empty)
Open: {"event":"open","side":"long|short","symbol":""}
Close: {"event":"close","side":"long|short|flat","reason":"tp|sl|flip|session|limit_profit|limit_loss","symbol":""}
You can paste any text/JSON into the Custom fields; it will be forwarded as-is when that event occurs.
Input sections — user guide
01) Entries & Signals
Entry Logic: Choose Multi-Source (3) or QBand + Moneyball (pick one).
Enable Long/Short Signals: Master on/off switches for entering long/short.
Flip on opposite signal: If enabled, a new opposite signal will close the current position first, then open the other side.
Signal Logic (Multi-Source):
Single: any 1 of the 3 sources > 0
Dual: Source1 AND Source2 > 0
Triple (default): 1 AND 2 AND 3 > 0
Long/Short Signal Sources 1–3: Provide up to three series (often indicators). A positive value (> 0) is treated as a “pulse”.
Use Lookback: Keeps a source “true” for N bars after it pulses (helps catch late triggers).
Long/Short Lookback (bars): How many bars to remember that pulse.
01b) QBands + Moneyball (Gate -> Trigger)
Allow same-bar Gate->Trigger: If ON, a trigger can fire on the same bar as the gate pulse.
Trigger must fire within N bars after Gate: Size of the gate window (in bars).
Max signals per window (0 = unlimited): Cap the number of entries allowed while a gate window is open.
Buy/Sell Source 1 – Gate: Gate pulse sources that open the buy/sell window (often a regime/zone, e.g., QBands bull/bear).
Trigger Pulse Mode (Buy/Sell): How to detect a trigger pulse from the trigger sources (Change / Appear / Rise>0 / Fall<0).
Trigger A/B sources + Extend Bars: Primary/secondary triggers plus optional extension to persist their pulse for N bars.
Trigger Mode: Pick S2 only, S3 only, S2 OR S3, or S2 AND S3. AND mode remembers both pulses inside the window before firing.
02) Exit Units (Trailing/TP)
Exit Units: Choose Bricks (Renko) or Ticks. All distances below switch accordingly.
03) Tick-based Trailing / Stops (active when Exit Units = Ticks)
Initial SL (ticks): Starting stop distance from entry.
Start Trailing After (ticks): Start trailing once price moves this far in your favor.
Trailing Distance (ticks): Offset of the trailing stop from peak/trough once trailing begins.
Take Profit (ticks): Optional static TP distance.
Stop Loss (ticks): Optional static SL distance (overrides trailing if enabled).
04) Brick-based Trailing / Stops (active when Exit Units = Bricks)
Renko Brick Size: Must match your chart’s brick size.
Initial SL / Start Trailing After / Trailing Distance (bricks): Same definitions as tick mode, measured in bricks.
Take Profit / Stop Loss (bricks): Optional static distances.
05) TP / SL Switch
Enable Static Take Profit: If ON, closes the trade at the fixed TP distance.
Enable Static Stop Loss (Overrides Trailing): If ON, trailing is disabled and a fixed SL is used.
06) Trading Windows (NY time)
Use Trading Windows: Master toggle for all windows.
Evening / Overnight / NY Session: Define each session in NY time.
Flatten at End of : Auto-close any open position when a window ends (sends the Session Exit payload).
07) Day Controls & Limits
Enable Profit Limits / Profit Limit (Dollars): When daily net PnL ≥ limit → auto-flatten and HALT.
Enable Loss Limits / Loss Limit (Dollars): When daily net PnL ≤ −limit → auto-flatten and HALT.
Enable Trade Count Limits / Number of Trades Allowed: After N entries, HALT new entries (does not auto-flatten).
On-chart HUD: A label and soft background tint appear when HALTED; a compact status table shows Day PnL, trade count, and mode.
08) Custom Alert Payloads (used as strategy.order.alert_message)
Long/Short Entry: Payload sent on entries (if blank, a default open JSON is sent).
Regular Long/Short Exit: Payload sent on closes from SL/TP/flip (if blank, a default close JSON is sent).
End of Session Window Exit: Payload sent when any enabled window ends and positions are flattened.
Profit/Loss/Trade Limit Close: Payload sent when daily profit/loss limit causes auto-flatten.
Tip: Any tokens you include here are forwarded “as is”. If your downstream expects variables, do the substitution on the receiver side.
Known limitations
No bracket orders from Pine: This strategy doesn’t create OCO/attached brackets on the broker; it simulates exits with strategy logic and forwards your payloads for external automation.
alert_message is per order only: Alerts fire on order events. General status pings aren’t sent unless you wire a separate indicator/alert.
Renko specifics: Backtests on synthetic Renko can differ from live execution. Always forward-test on your instrument and settings.
Quick checklist before you publish
✅ Brick size in Inputs matches your Renko chart
✅ Exit Units set to Bricks or Ticks as you intend
✅ Day limits/Windows toggled as you want
✅ Custom payloads filled (or leave blank to use defaults)
✅ Your alert uses Order fills only + {{strategy.order.alert_message}}
Dual Adaptive Movings### Dual Adaptive Movings
By Gurjit Singh
A dual-layer adaptive moving average system that adjusts its responsiveness dynamically using market-derived factors (CMO, RSI, Fractal Roughness, or Stochastic Acceleration). It plots:
* Primary Adaptive MA (MA): Fast, reacts to changes in volatility/momentum.
* Following Adaptive MA (FAMA): A smoother, half-alpha version for trend confirmation.
Instead of fixed smoothing, it adapts dynamically using one of four methods:
* ACMO: Adaptive CMO (momentum)
* ARSI: Adaptive RSI (relative strength)
* FRMA: Fractal Roughness (volatility + fractal dimension)
* ASTA: Adaptive Stochastic Acceleration (%K acceleration)
### ⚙️ Inputs & Options
* Source: Price input (default: close).
* Moving (Type): ACMO, ARSI, FRMA, ASTA.
* MA Length (Primary): Core adaptive window.
* Following (FAMA) Length: Optional; can match MA length.
* Use Wilder’s: Toggles Wilder vs EMA-style smoothing.
* Colors & Fill: Bullish/Bearish tones with transparency control.
### 🔑 How to Use
1. Identify Trend:
* When MA > FAMA → Bullish (fills bullish color).
* When MA < FAMA → Bearish (fills bearish color).
2. Crossovers:
* MA crosses above FAMA → Bullish signal 🐂
* MA crosses below FAMA → Bearish signal 🐻
3. Adaptive Edge:
* Select method (ACMO/ARSI/FRMA/ASTA) depending on whether you want sensitivity to momentum, strength, volatility, or acceleration.
4. Alerts:
* Built-in alerts trigger on crossovers.
### 💡 Tips
* Wilder’s smoothing is gentler than EMA, reducing whipsaws in sideways conditions.
* ACMO and ARSI are best for momentum-driven directional markets, but may false-signal in ranges.
* FRMA and ASTA excels in choppy markets where volatility clusters.
👉 In short: Dual Adaptive Movings adapts moving averages to the market’s own behavior, smoothing noise yet staying responsive. Crossovers mark possible trend shifts, while color fills highlight bias.
Momentum x Volume (Thrust + Surge)highlights bars where trend, momentum, and volume align. It filters for an uptrend (EMA pair or VWAP), confirms thrust with MACD histogram, measures momentum quality with volume-weighted RSI (vwRSI), and requires a volume surge vs a rolling average before signaling. The goal: surface higher-conviction breakouts and breakdowns while avoiding weak, low-volume moves.
🏆 AI Gold Master IndicatorsAI Gold Master Indicators - Technical Overview
Core Purpose: Advanced Pine Script indicator that analyzes 20 technical indicators simultaneously for XAUUSD (Gold) trading, generating automated buy/sell signals through a sophisticated scoring system.
Key Features
📊 Multi-Indicator Analysis
Processes 20 indicators: RSI, MACD, Bollinger Bands, EMA crossovers, Stochastic, Williams %R, CCI, ATR, Volume, ADX, Parabolic SAR, Ichimoku, MFI, ROC, Fibonacci retracements, Support/Resistance, Candlestick patterns, MA Ribbon, VWAP, Market Structure, and Cloud MA
Each indicator generates BUY (🟢), SELL (🔴), or NEUTRAL (⚪) signals
⚖️ Dual Scoring Systems
Weighted System: Each indicator has configurable weights (10-200 points, total 1000), with higher weights for critical indicators like RSI (150) and MACD (150)
Simple Count System: Basic counting of BUY vs SELL signals across all indicators
🎯 Signal Generation
Configurable thresholds for both systems (weighted score threshold: 400-600 recommended)
Dynamic risk management with ATR-based TP/SL levels
Signal strength filtering to reduce false positives
📈 Advanced Configuration
Customizable thresholds for all 20 indicators (RSI levels, Stochastic bounds, Williams %R zones, etc.)
Dynamic weight bonuses that adapt to dominant market trends
Risk management with configurable TP1/TP2 multipliers and stop losses
🎛️ Visual Interface
Real-time master table displaying all indicators, their values, weights, and current signals
Visual trading signals (triangles) with detailed labels
Optional TP/SL lines and performance statistics
💡 Optimization Features
Gold-specific parameter tuning
Trend analysis with configurable lookback periods
Volume spike detection and volatility analysis
Multi-timeframe compatibility (15m, 1H, 4H recommended)
The system combines traditional technical analysis with modern weighting algorithms to provide comprehensive market analysis specifically optimized for gold trading.
Ragazzi è una meraviglia, pronto all uso, già configurato provatelo divertitevi e fate tanti soldoni poi magari una piccola donazione spontanea sarebbe molto gradita visto il tempo, risorse e gli insulti della moglie che mi diceva che perdevo tempo, fatemi sapere se vi piace.
nel codice troverete una descrizione del funzionamento se vi vengono in mente delle idee per migliorarlo contattatemi troverete i mie contatti in tabella un saluto.
TCLC - Multi TimeFrame VWAPVWAP :
VWAP, or Volume Weighted Average Price, is a trading indicator that represents the average price of a security over a specific period, weighted by the volume of trades at each price level. It is calculated by taking the sum of the product of price and volume and dividing it by the total volume for the period. Essentially, VWAP shows the average price at which most trades occurred, giving more weight to prices with higher trading volumes.
The Indicator Plots the VWAP in Daily, WEEKLY , MONTHLY , YEARLY which helps to gauage the trend where the Volume vs Price exists....
Persistence# Persistence
## What it does
Measures **price change persistence**, defined as the percentage of bars within a lookback window that closed higher than the prior close. A high value means the instrument has been closing up frequently, which can indicate durable momentum. This mirrors Stockbee’s idea: *select stocks with high price change persistence*, and then combine **momentum plus persistence**.
## Can be used for scanning in PineScreener
## Calculation
* `isUp` is true when `close > close `.
* `countUp` counts true instances over the last `len` bars.
* `pctUp = 100 * countUp / len`, bounded between 0 and 100.
* A 50% level is a natural baseline. Above 50% suggests more up closes than down closes in the window.
## Inputs
* **Lookback bars (`len`)**: default 252 for roughly one trading year on a daily chart. On weekly charts use something like 52, on monthly charts use 12.
## How to use
1. **Screen for persistence**
Sort a watchlist by the plotted value, higher is better. Many momentum traders start looking above 58 to 65 percent, then layer a trend filter.
2. **Combine with momentum**
Examples, pick tickers with:
* `pctUp > 60`, and price above a rising EMA50 or EMA100.
* `pctUp rising` and weekly ROC positive.
3. **Switch timeframe to change the horizon**
* Daily chart with `len = 252` approximates one year.
* Weekly chart with `len = 52` approximates one year.
* Monthly chart with `len = 12` approximates one year.
## TC2000 equivalence
Stockbee’s TC2000 expression:
```
CountTrue(c > c1, 252)
```
## Interpretation guide
* **70 to 90**: very strong persistence; often trend leaders, check for extensions and risk controls.
* **60 to 70**: constructive persistence; good hunting ground for swing setups that also pass momentum filters.
* **50**: neutral baseline; around random up vs down frequency.
* **Below 50**: persistent weakness; consider only for mean reversion or short strategies.
## Practical tips
* **Event effects**: ex-dividend gaps can reduce persistence on high yield names. Earnings gaps can swing the value sharply.
* **Survivorship bias**: when backtesting on curated lists, persistence can look cleaner than in live scans.
* **Liquidity**: thin names may show noisy persistence due to erratic prints.
## Reference to Stockbee
* “One way to select stocks for swing trading is to find those with high price change persistence.”
* “Persistence can be calculated on a daily, monthly, or weekly timeframe.”
* TC2000 function: `CountTrue(c > c1, 252)`
* Example noted in the tweet: CVNA had very high one-year price persistence at the time of that post.
* Takeaway: **look for momentum plus persistence**, not persistence alone.
🚀⚠️ Aggressive + Confirmed Long Strategy (v2)//@version=5
strategy("🚀⚠️ Aggressive + Confirmed Long Strategy (v2)",
overlay=true,
pyramiding=0,
initial_capital=10000,
default_qty_type=strategy.percent_of_equity,
default_qty_value=10, // % of equity per trade
commission_type=strategy.commission.percent,
commission_value=0.05)
// ========= Inputs =========
lenRSI = input.int(14, "RSI Length")
lenSMA1 = input.int(20, "SMA 20")
lenSMA2 = input.int(50, "SMA 50")
lenBB = input.int(20, "Bollinger Length")
multBB = input.float(2, "Bollinger Multiplier", step=0.1)
volLen = input.int(20, "Volume MA Length")
smaBuffP = input.float(1.0, "Margin above SMA50 (%)", step=0.1)
confirmOnClose = input.bool(true, "Confirm signals only after candle close")
useEarly = input.bool(true, "Allow Early entries")
// Risk
atrLen = input.int(14, "ATR Length", minval=1)
slATR = input.float(2.0, "Stop = ATR *", step=0.1)
tpRR = input.float(2.0, "Take-Profit RR (TP = SL * RR)", step=0.1)
useTrail = input.bool(false, "Use Trailing Stop instead of fixed SL/TP")
trailATR = input.float(2.5, "Trailing Stop = ATR *", step=0.1)
moveToBE = input.bool(true, "Move SL to breakeven at 1R TP")
// ========= Indicators =========
// MAs
sma20 = ta.sma(close, lenSMA1)
sma50 = ta.sma(close, lenSMA2)
// RSI
rsi = ta.rsi(close, lenRSI)
rsiEarly = rsi > 45 and rsi < 55
rsiStrong = rsi > 55
// MACD
= ta.macd(close, 12, 26, 9)
macdCross = ta.crossover(macdLine, signalLine)
macdEarly = macdCross and macdLine < 0
macdStrong = macdCross and macdLine > 0
// Bollinger
= ta.bb(close, lenBB, multBB)
bollBreakout = close > bbUpper
// Candle & Volume
bullishCandle = close > open
volCondition = volume > ta.sma(volume, volLen)
// Price vs MAs
smaCondition = close > sma20 and close > sma50 and close > sma50 * (1 + smaBuffP/100.0)
// Confirm-on-close helper
useSignal(cond) =>
confirmOnClose ? (cond and barstate.isconfirmed) : cond
// Entries
confirmedEntry = useSignal(rsiStrong and macdStrong and bollBreakout and bullishCandle and volCondition and smaCondition)
earlyEntry = useSignal(rsiEarly and macdEarly and close > sma20 and bullishCandle) and not confirmedEntry
longSignal = confirmedEntry or (useEarly and earlyEntry)
// ========= Risk Mgmt =========
atr = ta.atr(atrLen)
slPrice = close - atr * slATR
tpPrice = close + (close - slPrice) * tpRR
trailPts = atr * trailATR
// ========= Orders =========
if strategy.position_size == 0 and longSignal
strategy.entry("Long", strategy.long)
if strategy.position_size > 0
if useTrail
// Trailing Stop
strategy.exit("Exit", "Long", trail_points=trailPts, trail_offset=trailPts)
else
// Normal SL/TP
strategy.exit("Exit", "Long", stop=slPrice, limit=tpPrice)
// Move SL to breakeven when TP1 hit
if moveToBE and high >= tpPrice
strategy.exit("BE", "Long", stop=strategy.position_avg_price)
// ========= Plots =========
plot(sma20, title="SMA 20", color=color.orange, linewidth=2)
plot(sma50, title="SMA 50", color=color.new(color.blue, 0), linewidth=2)
plot(bbUpper, title="BB Upper", color=color.new(color.fuchsia, 0))
plot(bbBasis, title="BB Basis", color=color.new(color.gray, 50))
plot(bbLower, title="BB Lower", color=color.new(color.fuchsia, 0))
plotshape(confirmedEntry, title="🚀 Confirmed", location=location.belowbar,
color=color.green, style=shape.labelup, text="🚀", size=size.tiny)
plotshape(earlyEntry, title="⚠️ Early", location=location.belowbar,
color=color.orange, style=shape.labelup, text="⚠️", size=size.tiny)
// ========= Alerts =========
alertcondition(confirmedEntry, title="🚀 Confirmed Entry", message="🚀 {{ticker}} confirmed entry on {{interval}}")
alertcondition(earlyEntry, title="⚠️ Early Entry", message="⚠️ {{ticker}} early entry on {{interval}}")
9 EMA vs VWAP - v6 (fixed)Simply gives a BUY signal when the 9EMA crosses the VWAP to the upside, and a SELL signal when the 9EMA crosses the VWAP to the downside. Mostly useful between the hours of 9:30am EST and 11am EST.
ForecastForecast (FC), indicator documentation
Type: Study, not a strategy
Primary timeframe: 1D chart, most plots and the on-chart table only render on daily bars
Inspiration: Robert Carver’s “forecast” concept from Advanced Futures Trading Strategies, using normalized, capped signals for comparability across markets
⸻
What the indicator does
FC builds a volatility-normalized momentum forecast for a chosen symbol, optionally versus a benchmark. It combines an EWMAC composite with a channel breakout composite, then caps the result to a common scale. You can run it in three data modes:
• Absolute: Forecast of the selected symbol
• Relative: Forecast of the ratio symbol / benchmark
• Combined: Average of Absolute and Relative
A compact table can summarize the current forecast, short-term direction on the forecast EMAs, correlation versus the benchmark, and ATR-scaled distances to common price EMAs.
⸻
PineScreener, relative-strength screening
This indicator is excellent for screening on relative strength in PineScreener, since the forecast is volatility-normalized and capped on a common scale.
Available PineScreener columns
PineScreener reads the plotted series. You will see at least these columns:
• FC, the capped forecast
• from EMA20, (price − EMA20) / ATR in ATR multiples
• from EMA50, (price − EMA50) / ATR in ATR multiples
• ATR, ATR as a percent of price
• Corr, weekly correlation with the chosen benchmark
Relative mode and Combined mode are recommended for cross-sectional screens. In Relative mode the calculation uses symbol / benchmark, so ensure the ratio ticker exists for your data source.
⸻
How it works, step by step
1. Volatility model
Compute exponentially weighted mean and variance of daily percent returns on D, annualize, optionally blend with a long lookback using 10y %, then convert to a price-scaled sigma.
2. EWMAC momentum, three legs
Daily legs: EMA(8) − EMA(32), EMA(16) − EMA(64), EMA(32) − EMA(128).
Divide by price-scaled sigma, multiply by leg scalars, cap to Cap = 20, average, then apply a small FDM factor.
3. Breakout momentum, three channels
Smoothed position inside 40, 80, and 160 day channels, each scaled, then averaged.
4. Composite forecast
Average the EWMAC composite and the breakout composite, then cap to ±20.
Relative mode runs the same logic on symbol / benchmark.
Combined mode averages Absolute and Relative composites.
5. Weekly correlation
Pearson correlation between weekly closes of the asset and the benchmark over a user-set length.
6. Direction overlay
Two EMAs on the forecast series plus optional green or red background by sign, and optional horizontal level shading around 0, ±5, ±10, ±15, ±20.
⸻
Plots
• FC, capped forecast on the daily chart
• 8-32 Abs, 8-32 Rel, single-leg EWMAC plus breakout view
• 8-32-128 Abs, 8-32-128 Rel, three-leg composite views
• from EMA20, from EMA50, (price − EMA) / ATR
• ATR, ATR as a percent of price
• Corr, weekly correlation with the benchmark
• Forecast EMA1 and EMA2, EMAs of the forecast with an optional fill
• Backgrounds and guide lines, optional sign-based background, optional 0, ±5, ±10, ±15, ±20 guides
Most plots and the table are gated by timeframe.isdaily. Set the chart to 1D to see them.
⸻
Inputs
Symbol selection
• Absolute, Relative, Combined
• Vs. benchmark for Relative mode and correlation, choices: SPY, QQQ, XLE, GLD
• Ticker or Freeform, for Freeform use full TradingView notation, for example NASDAQ:AAPL
Engine selection
• Include:
• 8-32-128, three EWMAC legs plus three breakouts
• 8-32, simplified view based on the 8-32 leg plus a 40-day breakout
EMA, applied to the forecast
• EMA1, EMA2, with line-width controls, plus color and opacity
Volatility
• Span, EW volatility span for daily returns
• 10y %, blend of long-run volatility
• Thresh, Too volatile, placeholders in this version
Background
• Horizontal bg, level shading, enabled by default
• Long BG, Hedge BG, colors and opacities
Show
• Table, Header, Direction, Gain, Extension
• Corr, Length for correlation row
Table settings
• Position, background, opacity, text size, text color
Lines
• 0-lines, 10-lines, 5-lines, level guides
⸻
Reading the outputs
• Forecast > 0, bullish tilt; Forecast < 0, bearish or hedge tilt
• ±10 and ±20 indicate strength on a uniform scale
• EMA1 vs EMA2 on the forecast, EMA1 above EMA2 suggests improving momentum
• Table rows, label colored by sign, current forecast value plus a green or red dot for the forecast EMA cross, optional daily return percent, weekly correlation, and ATR-scaled EMA9, EMA20, EMA50 distances
⸻
Data handling, repainting, and performance
• Daily and weekly series are fetched with request.security().
• Calculations use closed bars, values can update until the bar closes.
• No lookahead, historical values do not repaint.
• Weekly correlation updates during the week, it finalizes on weekly close.
• On intraday charts most visuals are hidden by design.
⸻
Good practice and limitations
• This is a research indicator, not a trading system.
• The fixed Cap = 20 keeps a common scale, extreme moves will be clipped.
• Relative mode depends on the ratio symbol / benchmark, ensure both legs have data for your feed.
⸻
Credits
Concept inspired by Robert Carver’s forecast methodology in Advanced Futures Trading Strategies. Implementation details, parameters, and visuals are specific to this script.
⸻
Changelog
• First version
⸻
Disclaimer
For education and research only, not financial advice. Always test on your market and data feed, consider costs and slippage before using any indicator in live decisions.
Price vs SMAThis indicator displays the current price in percentage terms, indicating whether it is above or below a selected simple moving average (SMA). It’s designed to be clean and minimal, with the option to display a brief sentence on the chart for added clarity.
The script calculates the distance between the current price and a chosen simple moving average (SMA) and expresses that distance as a percentage. By default, it uses the 200-period SMA, but you can adjust the length to any value, such as 50 or 100, depending on your trading style. A positive percentage means price is trading above the SMA, while a negative percentage means it is below.
The percentage difference is rounded to whole numbers and can be displayed directly in the chart legend if the “Indicator values” box is checked in the TradingView settings. This keeps the chart clean while still providing at-a-glance information about the price relative to your selected moving average.
For extra clarity, the script also includes an option to display a short sentence on the chart itself. This sentence will read “Price is x% above SMA” in green when price is above the SMA, or “Price is x% below SMA” in red when price is below. This visual cue makes it easy to interpret the relationship between price and the moving average without adding clutter.
BE-Volume Footprint & Pressure Candles█ Overview:
BE-Volume Footprint & Pressure Candles, is an indicator which is preliminarily designed to analyze the supply and demand patterns based on Rally Base Rally (RBR), Drop Base Drop (DBD), Drop Base Rally (DBR) & Rally Base Drop (RBD) concepts in conjunction to volume pressure. Understanding these concepts are crucial. Let's break down why the "Base" is you Best friend in this context.
Commonness in RBR, DBD, DBR, RBD patterns ?
There is an impulse price movement at first, be it rally (price moving up) or the Drop (price moving down), followed by a period of consolidation which is referred as "BASE" and later with another impulse move of price (Rally or Drop).
Why is the Base Important
1. Market Balance: Base represents a balance between buyers and sellers. This is where decisions are made.
2. Confirmation: It confirms the strength of previous impulse move which has happened.
Base & the Liquidity Play:
Supply & Demand Zone predict the presence of all large orders within the limits of the Base Zone. Price is expected to return to the zone to fill the unfilled orders placed by large players.
For the price to move in the intended direction Liquidity plays the major role. hence indicator aims to help traders in identifying those zones where liquidity exists and the volume pressure helps in confirming that liquidity is making its play.
Bottom pane in the below snapshots is a visual representation of Buyers volume pressure (Green Line & the Green filled area) making the price move upwards vs Sellers volume pressure (Red Line & the Red filled area) making the price move downwards.
Top pane in the below snapshots is a visual representation on the pattern identification (Blue marked zone & the Blue line referred as Liquidity level)
Bullish Pressure On Buy Liquidity:
Bearish Pressure On Sell Liquidity:
█ How It Works:
1. Indicator computes technical & mathematical operations such as ATR, delta of Highs & Lows of the candle and Candle ranges to identify the patterns and marks the liquidity lines accordingly.
2. Indicator then waits for price to return to the liquidity levels and checks if Directional volume pressure to flow-in while the prices hover near the Liquidity zones.
3. Once the Volume pressure is evident, loop in to the ride.
█ When It wont Work:
When there no sufficient Liquidity or sustained Opposite volume pressure, trades are expected to fail.
█ Limitations:
Works only on the scripts which has volume info. Relays on LTF candles to determine intra-bar volumes. Hence, Use on TF greater than 1 min and lesser than 15 min.
█ Indicator Features:
1. StrictEntries: employs' tighter rules (rather most significant setups) on the directional volume pressure applied for the price to move. If unchecked, liberal rules applied on the directional volume pressure leading to more setups being identified.
2. Setup Confirmation period: Indicates Waiting period to analyze the directional volume pressure. Early (lesser wait period) is Risky and Late (longer wait period) is too late for the
ride. Find the quant based on the accuracy of the setup provided in the bottom right table.
3. Algo Enabled with Place Holders:
Indicator is equipped with algo alerts, supported with necessary placeholders to trade any instrument like stock, options etc.
Accepted PlaceHolders (Case Sensitive!!)
1. {{ticker}}-->InstrumentName
2. {{datetime}}-->Date & Time Of Order Placement
3. {{close}}-->LTP Price of Script
4. {{TD}}-->Current Level:
Note: Negative Numbers for Short Setup
5. {{EN}} {{SL}} {{TGT}} {{T1}} {{T2}} --> Trade Levels
6. {{Qty}} {{Qty*x}} --> Qty -> Trade Qty mapped in Settings. Replace x with actual number of your choice for the multiplier
7. {{BS}}-->Based on the Direction of Trade Output shall be with B or S (B == Long Trade & S == Short Trade)
8. {{BUYSELL}}-->Based on the Direction of Trade Output shall be with BUY or SELL (BUY == Long Trade & SELL == Short Trade)
9. {{IBUYSELL}}-->Based on the Direction of Trade Output shall be with BUY or SELL (BUY == SHORT Trade & SELL == LONG Trade)
Dynamic Alerts:
10. { {100R0} }-->Dynamic Place Holder 100 Refers to Strike Difference and Zero refers to ATM
11. { {100R-1} }-->Dynamic Place Holder 100 Refers to Strike Difference and -1 refers to
ATM - 100 strike
12. { {50R2} }-->Dynamic Place Holder 50 Refers to Strike Difference and 2 refers to
ATM + (2 * 50 = 100) strike
13. { {"ddMMyy", 0} }-->Dynamically Picks today date in the specified format.
14. { {"ddMMyy", n} }-->replace n with actual number of your choice to Pick date post today date in the specified format.
15. { {"ddMMyy", "MON"} }-->dynamically pick Monday date (coming Monday, if today is not Monday)
Note. for the 2nd Param-->you can choose to specify either Number OR any letter from =>
16. {{CEPE}} {{ICEPE}} {{CP}} {{ICP}} -> Dynamic Option Side CE or C refers to Calls and PE or P refers to Puts. If "I" is used in PlaceHolder text, On long entries PUTs shall be used
Indicator is equipped with customizable Trade & Risk management settings like multiple Take profit levels, Trailing SL.
Goldbach Time Indicator🔧 Key Fixes Applied:
1. Time Validation & Bounds Checking:
Hour/Minute Bounds: Ensures hours stay 0-23, minutes stay 0-59
Edge Case Handling: Prevents invalid time calculations from causing missing data
UTC Conversion Safety: Better handling of timezone edge cases
2. Enhanced Value Validation:
NA Checking: Validates all calculated values before using them
Goldbach Detection: Only flags valid, non-NA values as Goldbach hits
Plot Safety: Prevents plotting invalid or NA values that could cause gaps
3. Improved Plot Logic:
Core Level Colors: Blue for core levels (29,35,71,77), yellow/lime/orange for regular hits
Debug Mode Enhanced: Shows all calculations with gray dots when enabled
Better Filtering: Only plots positive, valid values for minus calculations
4. Background vs Dots Issue:
The large green/blue background you see suggests the indicator is detecting Goldbach times correctly, but the dots weren't plotting due to validation issues. This should now be fixed.
Big Mo’s Glaskugel — Macro Drawdown Risk (v1.1.2)What it does / what you see
An at-a-glance drawdown-risk oscillator that blends several macro US signals.
• A smooth, color-blended line (green→orange→red) shows the scaled risk score (0–100).
• Subtle shading marks “re-steepen warning windows” (starts when the yield curve re-steepens after an inversion; ends on normalization/cool-down).
• A compact status table summarizes: overall risk level, Yield Curve (10y–3m), Credit Stress (Baa–10y), Economy (LEI), and Valuation (CAPE).
Data used & why
Yield Curve (10y–3m) — FRED:T10Y3M. Inversions and subsequent re-steepens often precede recessions/equity drawdowns.
Credit Stress — FRED:BAA10Y vs its 1-year average (deviation in bps). Widening credit spreads flag tightening financial conditions.
Economy (LEI) — ECONOMICS:USLEI. 6-month annualized growth below a cutoff highlights macro deterioration.
Valuation (CAPE) — SHILLER_PE_RATIO_MONTH. Elevated valuations can amplify downside risk.
VIX spikes — optional boost that recognizes sudden risk repricings.
Important disclaimer
This is not a reliable or predictive indicator in all regimes. No guarantees or warranties of any kind are provided. It is not financial advice. Signals can be early, late, or wrong.
That said, it leans on well-studied warning factors (yield-curve dynamics, credit spreads, LEI weakness, valuation extremes) that have flagged major market downturns in the past.
Key customization / tweaks
Weights for each component (Yield, Credit, LEI, VIX, CAPE).
Thresholds: yield inversion months, re-steepen lookback, credit-stress bps, LEI cutoff, CAPE level, VIX spike levels.
Re-steepen boost: enable/disable, base points, half-life decay.
Shading behavior: cool-down bars to “unwarn,” max warning duration, only shade when risk ≠ green.
Scaling & smoothing: dynamic rolling max, EMA length, yellow/red thresholds.
Status table: position, and a snapshot mode to view values at a chosen historical time.
Smart Money Precision Structure [BullByte]Smart Money Precision Structure
Advanced Market Structure Analysis Using Institutional Order Flow Concepts
---
OVERVIEW
Smart Money Precision Structure (SMPS) is a comprehensive market analysis indicator that combines six analytical frameworks to identify high-probability market structure patterns. The indicator uses multi-dimensional scoring algorithms to evaluate market conditions through institutional order flow concepts, providing traders with professional-grade market analysis.
---
PURPOSE AND ORIGINALITY
Why This Indicator Was Developed
• Addresses the gap between retail and institutional analysis methods
• Consolidates multiple analysis techniques that professionals use separately
• Automates complex market structure evaluation into actionable insights
• Eliminates the need for multiple indicators by providing comprehensive analysis
What Makes SMPS Original
• Six-Layer Confluence System - Unique combination of market regime, structure, volume flow, momentum, price action, and adaptive filtering
• Institutional Pattern Recognition - Identifies smart money accumulation and distribution patterns
• Adaptive Intelligence - Parameters automatically adjust based on detected market conditions
• Real-Time Market Scoring - Proprietary algorithm rates market quality from 0-100%
• Structure Break Detection - Advanced pivot analysis identifies trend reversals early
---
HOW IT WORKS - TECHNICAL METHODOLOGY
1. Market Regime Analysis Engine
The indicator evaluates five core market dimensions:
• Volatility Score - Measures current volatility against 50-period historical baseline
• Trend Score - Analyzes alignment between 8, 21, and 50-period EMAs
• Momentum Score - Combines RSI divergence with MACD signal alignment
• Structure Score - Evaluates pivot point formation clarity
• Efficiency Score - Calculates directional movement efficiency ratio
These scores combine to classify markets into five regimes:
• TRENDING - Strong directional movement with aligned indicators
• RANGING - Sideways movement with mixed directional signals
• VOLATILE - Elevated volatility with unpredictable price swings
• QUIET - Low volatility consolidation periods
• TRANSITIONAL - Market shifting between different regimes
2. Market Structure Analysis
Advanced pivot point analysis identifies:
• Higher Highs and Higher Lows for bullish structure
• Lower Highs and Lower Lows for bearish structure
• Structure breaks when established patterns fail
• Dynamic support and resistance from recent pivot points
• Key level proximity detection using ATR-based buffers
3. Volume Flow Decoding
Institutional activity detection through:
• Volume surge identification when volume exceeds 2x average
• Buy versus sell pressure analysis using price-volume correlation
• Flow strength measurement through directional volume consistency
• Divergence detection between volume and price movements
• Institutional threshold alerts when unusual volume patterns emerge
4. Multi-Period Momentum Synthesis
Weighted momentum calculation across four timeframes:
• 1-period momentum weighted at 40%
• 3-period momentum weighted at 30%
• 5-period momentum weighted at 20%
• 8-period momentum weighted at 10%
Result smoothed with 6-period EMA for noise reduction.
5. Price Action Quality Assessment
Each bar evaluated for:
• Range quality relative to 20-period average
• Body-to-range ratio for directional conviction
• Wick analysis for rejection pattern identification
• Pattern recognition including engulfing and hammer formations
• Sequential price movement analysis
6. Adaptive Parameter System
Parameters automatically adjust based on detected regime:
• Trending markets reduce sensitivity and confirmation requirements
• Volatile markets increase filtering and require additional confirmations
• Ranging markets maintain neutral settings
• Transitional markets use moderate adjustments
---
COMPLETE SETTINGS GUIDE
Section 1: Core Analysis Settings
Analysis Sensitivity (0.3-2.0)
• Default: 1.0
• Lower values require stronger price movements
• Higher values detect more subtle patterns
• Scalpers use 0.8-1.2, swing traders use 1.5-2.0
Noise Reduction Level (2-7)
• Default: 4
• Controls filtering of false patterns
• Higher values reduce pattern frequency
• Increase in volatile markets
Minimum Move % (0.05-0.50)
• Default: 0.15%
• Sets minimum price movement threshold
• Adjust based on instrument volatility
• Forex: 0.05-0.10%, Stocks: 0.15-0.25%, Crypto: 0.20-0.50%
High Confirmation Mode
• Default: True (Enabled)
• Requires all technical conditions to align
• Reduces frequency but increases reliability
• Disable for more aggressive pattern detection
Section 2: Market Regime Detection
Enable Regime Analysis
• Default: True (Enabled)
• Activates market environment evaluation
• Essential for adaptive features
• Keep enabled for best results
Regime Analysis Period (20-100)
• Default: 50 bars
• Determines regime calculation lookback
• Shorter for responsive, longer for stable
• Scalping: 20-30, Swing: 75-100
Minimum Market Clarity (0.2-0.8)
• Default: 0.4
• Quality threshold for pattern generation
• Higher values require clearer conditions
• Lower for more patterns, higher for quality
Adaptive Parameter Adjustment
• Default: True (Enabled)
• Enables automatic parameter optimization
• Adjusts based on market regime
• Highly recommended to keep enabled
Section 3: Market Structure Analysis
Enable Structure Validation
• Default: True (Enabled)
• Validates patterns against support/resistance
• Confirms trend structure alignment
• Essential for reliability
Structure Analysis Period (15-50)
• Default: 30 bars
• Period for structure pattern analysis
• Affects support/resistance calculation
• Match to your trading timeframe
Minimum Structure Alignment (0.3-0.8)
• Default: 0.5
• Required structure score for valid patterns
• Higher values need stronger structure
• Balance with desired frequency
Section 4: Analysis Configuration
Minimum Strength Level (3-5)
• Default: 4
• Minimum confirmations for pattern display
• 5 = Maximum reliability, 3 = More patterns
• Beginners should use 4-5
Required Technical Confirmations (4-6)
• Default: 5
• Number of aligned technical factors
• Higher = fewer but better patterns
• Works with High Confirmation Mode
Pattern Separation (3-20 bars)
• Default: 8 bars
• Minimum bars between patterns
• Prevents clustering and overtrading
• Increase for cleaner charts
Section 5: Technical Filters
Momentum Validation
• Default: True (Enabled)
• Requires momentum alignment
• Filters counter-trend patterns
• Essential for trend following
Volume Confluence Analysis
• Default: True (Enabled)
• Requires volume confirmation
• Identifies institutional participation
• Critical for reliability
Trend Direction Filter
• Default: True (Enabled)
• Only shows patterns with trend
• Reduces counter-trend signals
• Disable for reversal hunting
Section 6: Volume Flow Analysis
Institutional Activity Threshold (1.2-3.5)
• Default: 2.0
• Multiplier for unusual volume detection
• Lower finds more institutional activity
• Stock: 2.0-2.5, Forex: 1.5-2.0, Crypto: 2.5-3.5
Volume Surge Multiplier (1.8-4.5)
• Default: 2.5
• Defines significant volume increases
• Adjust per instrument characteristics
• Higher for stocks, lower for forex
Volume Flow Period (12-35)
• Default: 18 bars
• Smoothing for volume analysis
• Shorter = responsive, longer = smooth
• Match to timeframe used
Section 7: Analysis Frequency Control
Maximum Analysis Points Per Hour (1-5)
• Default: 3
• Limits pattern frequency
• Prevents overtrading
• Scalpers: 4-5, Swing traders: 1-2
Section 8: Target Level Configuration
Target Calculation Method
• Default: Market Adaptive
• Three modes available:
- Fixed: Uses set point distances
- Dynamic: ATR-based calculations
- Market Adaptive: Structure-based levels
Minimum Target/Risk Ratio (1.0-3.0)
• Default: 1.5
• Minimum acceptable reward vs risk
• Higher filters lower probability setups
• Professional standard: 1.5-2.0
Fixed Mode Settings:
• Fixed Target Distance: 50 points default
• Fixed Invalidation Distance: 30 points default
• Use for consistent instruments
Dynamic Mode Settings:
• Dynamic Target Multiplier: 1.8x ATR default
• Dynamic Invalidation Multiplier: 1.0x ATR default
• Adapts to volatility automatically
Market Adaptive Settings:
• Use Structure Levels: True (default)
• Structure Level Buffer: 0.1% default
• Places levels at actual support/resistance
Section 9: Visual Display Settings
Color Theme Options
• Professional (Teal/Red)
- Bullish: Teal (#26a69a)
- Bearish: Red (#ef5350)
- Neutral: Gray (#78909c)
- Best for: Traditional traders, clean appearance
• Dark (Neon Green/Pink)
- Bullish: Neon Green (#00ff88)
- Bearish: Hot Pink (#ff0044)
- Neutral: Dark Gray (#333333)
- Best for: Dark theme users, high contrast
• Light (Green/Red Classic)
- Bullish: Green (#4caf50)
- Bearish: Red (#f44336)
- Neutral: Light Gray (#9e9e9e)
- Best for: Light backgrounds, traditional colors
• Vibrant (Cyan/Magenta)
- Bullish: Cyan (#00ffff)
- Bearish: Magenta (#ff00ff)
- Neutral: Medium Gray (#888888)
- Best for: High visibility, modern appearance
Dashboard Position
• Options: Top Left, Top Right, Bottom Left, Bottom Right, Middle Left, Middle Right
• Default: Top Right
• Choose based on chart layout preference
Dashboard Size
• Full: Complete information display (desktop)
• Mobile: Compact view for small screens
• Default: Full
Analysis Display Style
• Arrows : Simple directional markers
• Labels : Detailed text information
• Zones : Colored areas showing pattern regions
• Default: Labels (most informative)
Display Options:
• Display Analysis Strength: Shows star rating
• Display Target Levels: Shows target/invalidation lines
• Display Market Regime: Shows regime in pattern labels
---
HOW TO USE SMPS - DETAILED GUIDE
Understanding the Dashboard
Top Row - Header
• SMPS Dashboard title
• VALUE column: Current readings
• STATUS column: Condition assessments
Market Regime Row
• Shows: TRENDING, RANGING, VOLATILE, QUIET, or TRANSITIONAL
• Color coding: Green = Favorable, Red = Caution
• Status: FAVORABLE or CAUTION trading conditions
Market Score Row
• Percentage from 0-100%
• Above 60% = Strong conditions
• 40-60% = Moderate conditions
• Below 40% = Weak conditions
Structure Row
• Direction: BULLISH, BEARISH, or NEUTRAL
• Status: INTACT or BREAK
• Orange BREAK indicates structure failure
Volume Flow Row
• Direction: BUYING or SELLING
• Intensity: STRONG or WEAK
• Color indicates dominant pressure
Momentum Row
• Numerical momentum value
• Positive = Upward pressure
• Negative = Downward pressure
Volume Status Row
• INST = Institutional activity detected
• HIGH = Above average volume
• NORM = Normal volume levels
Adaptive Mode Row
• ACTIVE = Parameters adjusting
• STATIC = Fixed parameters
• Shows required confirmations
Analysis Level Row
• Minimum strength level setting
• Pattern separation in bars
Market State Row
• Current analysis: BULLISH, BEARISH, NEUTRAL
• Shows analysis price level when active
T:R Ratio Row
• Current target to risk ratio
• GOOD = Meets minimum requirement
• LOW = Below minimum threshold
Strength Row
• BULL or BEAR dominance
• Numerical strength value 0-100
Price Row
• Current price
• Percentage change
Last Analysis Row
• Previous pattern direction
• Bars since last pattern
Reading Pattern Signals
Bullish Structure Pattern
• Upward triangle or "Bullish Structure" label
• Star rating shows strength (★★★★★ = strongest)
• Green line = potential target level
• Red dashed line = invalidation level
• Appears below price bars
Bearish Structure Pattern
• Downward triangle or "Bearish Structure" label
• Star rating indicates reliability
• Green line = potential target level
• Red dashed line = invalidation level
• Appears above price bars
Pattern Strength Interpretation
• ★★★★★ = 6 confirmations (exceptional)
• ★★★★☆ = 5 confirmations (strong)
• ★★★☆☆ = 4 confirmations (moderate)
• ★★☆☆☆ = 3 confirmations (minimum)
• Below minimum = filtered out
Visual Elements on Chart
Lines and Levels:
• Gray Line = 21 EMA trend reference
• Green Stepline = Dynamic support level
• Red Stepline = Dynamic resistance level
• Green Solid Line = Active target level
• Red Dashed Line = Active invalidation level
Pattern Markers:
• Triangles = Arrow display mode
• Text Labels = Label display mode
• Colored Boxes = Zone display mode
Target Completion Labels:
• "Target" = Price reached target level
• "Invalid" = Pattern invalidated by price
---
RECOMMENDED USAGE BY TIMEFRAME
1-Minute Charts (Scalping)
• Sensitivity: 0.8-1.2
• Noise Reduction: 3-4
• Pattern Separation: 3-5 bars
• High Confirmation: Optional
• Best for: Quick intraday moves
5-Minute Charts (Precision Intraday)
• Sensitivity: 1.0 (default)
• Noise Reduction: 4 (default)
• Pattern Separation: 8 bars
• High Confirmation: Enabled
• Best for: Day trading
15-Minute Charts (Short Swing)
• Sensitivity: 1.0-1.5
• Noise Reduction: 4-5
• Pattern Separation: 10-12 bars
• High Confirmation: Enabled
• Best for: Intraday swings
30-Minute to 1-Hour (Position Trading)
• Sensitivity: 1.5-2.0
• Noise Reduction: 5-7
• Pattern Separation: 15-20 bars
• Regime Period: 75-100
• Best for: Multi-day positions
Daily Charts (Swing Trading)
• Sensitivity: 1.8-2.0
• Noise Reduction: 6-7
• Pattern Separation: 20 bars
• All filters enabled
• Best for: Long-term analysis
---
MARKET-SPECIFIC SETTINGS
Forex Pairs
• Minimum Move: 0.05-0.10%
• Institutional Threshold: 1.5-2.0
• Volume Surge: 1.8-2.2
• Target Mode: Dynamic or Market Adaptive
Stock Indices (ES, NQ, YM)
• Minimum Move: 0.10-0.15%
• Institutional Threshold: 2.0-2.5
• Volume Surge: 2.5-3.0
• Target Mode: Market Adaptive
Individual Stocks
• Minimum Move: 0.15-0.25%
• Institutional Threshold: 2.0-2.5
• Volume Surge: 2.5-3.5
• Target Mode: Dynamic
Cryptocurrency
• Minimum Move: 0.20-0.50%
• Institutional Threshold: 2.5-3.5
• Volume Surge: 3.0-4.5
• Target Mode: Dynamic
• Increase noise reduction
---
PRACTICAL APPLICATION EXAMPLES
Example 1: Strong Trending Market
Dashboard Reading:
• Market Regime: TRENDING
• Market Score: 75%
• Structure: BULLISH, INTACT
• Volume Flow: BUYING, STRONG
• Momentum: +0.45
Interpretation:
• Strong uptrend environment
• Institutional buying present
• Look for bullish patterns as continuation
• Higher probability of success
• Consider using lower sensitivity
Example 2: Range-Bound Conditions
Dashboard Reading:
• Market Regime: RANGING
• Market Score: 35%
• Structure: NEUTRAL
• Volume Flow: SELLING, WEAK
• Momentum: -0.05
Interpretation:
• No clear direction
• Low opportunity environment
• Patterns are less reliable
• Consider waiting for regime change
• Or switch to a range-trading approach
Example 3: Structure Break Alert
Dashboard Reading:
• Previous: BULLISH structure
• Current: Structure BREAK
• Volume: INST flag active
• Momentum: Shifting negative
Interpretation:
• Trend reversal potentially beginning
• Institutional participation detected
• Watch for bearish pattern confirmation
• Adjust bias accordingly
• Increase caution on long positions
Example 4: Volatile Market
Dashboard Reading:
• Market Regime: VOLATILE
• Market Score: 45%
• Adaptive Mode: ACTIVE
• Confirmations: Increased to 6
Interpretation:
• Choppy conditions
• Parameters auto-adjusted
• Fewer but higher quality patterns
• Wider stops may be needed
• Consider reducing position size
Below are a few chart examples of the Smart Money Precision Structure (SMPS) indicator in action.
• Example 1 – Bullish Structure Detection on SOLUSD 5m
• Example 2 – Bearish Structure Detected with Strong Confluence on SOLUSD 5m
---
TROUBLESHOOTING GUIDE
No Patterns Appearing
Check these settings:
• High Confirmation Mode may be too restrictive
• Minimum Strength Level may be too high
• Market Clarity threshold may be too high
• Regime filter may be blocking patterns
• Try increasing sensitivity
Too Many Patterns
Adjust these settings:
• Enable High Confirmation Mode
• Increase Minimum Strength Level to 5
• Increase Pattern Separation
• Reduce Sensitivity below 1.0
• Enable all technical filters
Dashboard Shows "CAUTION"
This indicates:
• Market conditions are unfavorable
• Regime is RANGING or QUIET
• Market score is low
• Consider waiting for better conditions
• Or adjust expectations accordingly
Patterns Not Reaching Targets
Consider:
• Market may be choppy
• Volatility may have changed
• Try Dynamic target mode
• Reduce target/risk ratio requirement
• Check if regime is VOLATILE
---
ALERTS CONFIGURATION
Alert Message Format
Alerts include:
• Pattern type (Bullish/Bearish)
• Strength rating
• Market regime
• Analysis price level
• Target and invalidation levels
• Strength percentage
• Target/Risk ratio
• Educational disclaimer
Setting Up Alerts
• Click Alert button on TradingView
• Select SMPS indicator
• Choose alert frequency
• Customize message if desired
• Alerts fire on pattern detection
---
DATA WINDOW INFORMATION
The Data Window displays:
• Market Regime Score (0-100)
• Market Structure Bias (-1 to +1)
• Bullish Strength (0-100)
• Bearish Strength (0-100)
• Bull Target/Risk Ratio
• Bear Target/Risk Ratio
• Relative Volume
• Momentum Value
• Volume Flow Strength
• Bull Confirmations Count
• Bear Confirmations Count
---
BEST PRACTICES AND TIPS
For Beginners
• Start with default settings
• Use High Confirmation Mode
• Focus on TRENDING regime only
• Paper trade first
• Learn one timeframe thoroughly
For Intermediate Users
• Experiment with sensitivity settings
• Try different target modes
• Use multiple timeframes
• Combine with price action analysis
• Track pattern success rate
For Advanced Users
• Customize per instrument
• Create setting templates
• Use regime information for bias
• Combine with other indicators
• Develop systematic rules
---
IMPORTANT DISCLAIMERS
• This indicator is for educational and informational purposes only
• Not financial advice or a trading system
• Past performance does not guarantee future results
• Trading involves substantial risk of loss
• Always use appropriate risk management
• Verify patterns with additional analysis
• The author is not a registered investment advisor
• No liability accepted for trading losses
---
VERSION NOTES
Version 1.0.0 - Initial Release
• Six-layer confluence system
• Adaptive parameter technology
• Institutional volume detection
• Market regime classification
• Structure break identification
• Real-time dashboard
• Multiple display modes
• Comprehensive settings
## My Final Thoughts
Smart Money Precision Structure represents an advanced approach to market analysis, bringing institutional-grade techniques to retail traders through intelligent automation and multi-dimensional evaluation. By combining six analytical frameworks with adaptive parameter adjustment, SMPS provides comprehensive market intelligence that single indicators cannot achieve.
The indicator serves as an educational tool for understanding how professional traders analyze markets, while providing practical pattern detection for those seeking to improve their technical analysis. Remember that all trading involves risk, and this tool should be used as part of a complete analysis approach, not as a standalone trading system.
- BullByte
Adaptive Rolling Quantile Bands [CHE] Adaptive Rolling Quantile Bands
Part 1 — Mathematics and Algorithmic Design
Purpose. The indicator estimates distribution‐aware price levels from a rolling window and turns them into dynamic “buy” and “sell” bands. It can work on raw price or on *residuals* around a baseline to better isolate deviations from trend. Optionally, the percentile parameter $q$ adapts to volatility via ATR so the bands widen in turbulent regimes and tighten in calm ones. A compact, latched state machine converts these statistical levels into high-quality discretionary signals.
Data pipeline.
1. Choose a source (default `close`; MTF optional via `request.security`).
2. Optionally compute a baseline (`SMA` or `EMA`) of length $L$.
3. Build the *working series*: raw price if residual mode is off; otherwise price minus baseline (if a baseline exists).
4. Maintain a FIFO buffer of the last $N$ values (window length). All quantiles are computed on this buffer.
5. Map the resulting levels back to price space if residual mode is on (i.e., add back the baseline).
6. Smooth levels with a short EMA for readability.
Rolling quantiles.
Given the buffer $X_{t-N+1..t}$ and a percentile $q\in $, the indicator sorts a copy of the buffer ascending and linearly interpolates between adjacent ranks to estimate:
* Buy band $\approx Q(q)$
* Sell band $\approx Q(1-q)$
* Median $Q(0.5)$, plus optional deciles $Q(0.10)$ and $Q(0.90)$
Quantiles are robust to outliers relative to means. The estimator uses only data up to the current bar’s value in the buffer; there is no look-ahead.
Residual transform (optional).
In residual mode, quantiles are computed on $X^{res}_t = \text{price}_t - \text{baseline}_t$. This centers the distribution and often yields more stationary tails. After computing $Q(\cdot)$ on residuals, levels are transformed back to price space by adding the baseline. If `Baseline = None`, residual mode simply falls back to raw price.
Volatility-adaptive percentile.
Let $\text{ATR}_{14}(t)$ be current ATR and $\overline{\text{ATR}}_{100}(t)$ its long SMA. Define a volatility ratio $r = \text{ATR}_{14}/\overline{\text{ATR}}_{100}$. The effective quantile is:
Smoothing.
Each level is optionally smoothed by an EMA of length $k$ for cleaner visuals. This smoothing does not change the underlying quantile logic; it only stabilizes plots and signals.
Latched state machines.
Two three-step processes convert levels into “latched” signals that only fire after confirmation and then reset:
* BUY latch:
(1) HLC3 crosses above the median →
(2) the median is rising →
(3) HLC3 prints above the upper (orange) band → BUY latched.
* SELL latch:
(1) HLC3 crosses below the median →
(2) the median is falling →
(3) HLC3 prints below the lower (teal) band → SELL latched.
Labels are drawn on the latch bar, with a FIFO cap to limit clutter. Alerts are available for both the simple band interactions and the latched events. Use “Once per bar close” to avoid intrabar churn.
MTF behavior and repainting.
MTF sourcing uses `lookahead_off`. Quantiles and baselines are computed from completed data only; however, any *intrabar* cross conditions naturally stabilize at close. As with all real-time indicators, values can update during a live bar; prefer bar-close alerts for reliability.
Complexity and parameters.
Each bar sorts a copy of the $N$-length window (practical $N$ values keep this inexpensive). Typical choices: $N=50$–$100$, $q_0=0.15$–$0.25$, $k=2$–$5$, baseline length $L=20$ (if used), adaptation strength $s=0.2$–$0.7$.
Part 2 — Practical Use for Discretionary/Active Traders
What the bands mean in practice.
The teal “buy” band marks the lower tail of the recent distribution; the orange “sell” band marks the upper tail. The median is your dynamic equilibrium. In residual mode, these tails are deviations around trend; in raw mode they are absolute price percentiles. When ATR adaptation is on, tails breathe with regime shifts.
Two core playbooks.
1. Mean-reversion around a stable median.
* Context: The median is flat or gently sloped; band width is relatively tight; instrument is ranging.
* Entry (long): Look for price to probe or close below the buy band and then reclaim it, especially after HLC3 recrosses the median and the median turns up.
* Stops: Place beyond the most recent swing low or $1.0–1.5\times$ ATR(14) below entry.
* Targets: First scale at the median; optional second scale near the opposite band. Trail with the median or an ATR stop.
* Symmetry: Mirror the rules for shorts near the sell band when the median is flat to down.
2. Continuation with latched confirmations.
* Context: A developing trend where you want fewer but cleaner signals.
* Entry (long): Take the latched BUY (3-step confirmation) on close, or on the next bar if you require bar-close validation.
* Invalidation: A close back below the median (or below the lower band in strong trends) negates momentum.
* Exits: Trail under the median for conservative exits or under the teal band for trend-following exits. Consider scaling at structure (prior swing highs) or at a fixed $R$ multiple.
Parameter guidance by timeframe.
* Scalping / LTF (1–5m): $N=30$–$60$, $q_0=0.20$, $k=2$–3, residual mode on, baseline EMA $L=20$, adaptation $s=0.5$–0.7 to handle micro-vol spikes. Expect more signals; rely on latched logic to filter noise.
* Intraday swing (15–60m): $N=60$–$100$, $q_0=0.15$–0.20, $k=3$–4. Residual mode helps but is optional if the instrument trends cleanly. $s=0.3$–0.6.
* Swing / HTF (4H–D): $N=80$–$150$, $q_0=0.10$–0.18, $k=3$–5. Consider `SMA` baseline for smoother residuals and moderate adaptation $s=0.2$–0.4.
Baseline choice.
Use EMA for responsiveness (fast trend shifts) and SMA for stability (smoother residuals). Turning residual mode on is advantageous when price exhibits persistent drift; turning it off is useful when you explicitly want absolute bands.
How to time entries.
Prefer bar-close validation for both band recaptures and latched signals. If you must act intrabar, accept that crosses can “un-cross” before close; compensate with tighter stops or reduced size.
Risk management.
Position size to a fixed fractional risk per trade (e.g., 0.5–1.0% of equity). Define invalidation using structure (swing points) plus ATR. Avoid chasing when distance to the opposite band is small; reward-to-risk degrades rapidly once you are deep inside the distribution.
Combos and filters.
* Pair with a higher-timeframe median slope as a regime filter (trade only in the direction of the HTF median).
* Use band width relative to ATR as a range/trend gauge: unusually narrow bands suggest compression (mean-reversion bias); expanding bands suggest breakout potential (favor latched continuation).
* Volume or session filters (e.g., avoid illiquid hours) can materially improve execution.
Alerts for discretion.
Enable “Cross above Buy Level” / “Cross below Sell Level” for early notices and “Latched BUY/SELL” for conviction entries. Set alerts to “Once per bar close” to avoid noise.
Common pitfalls.
Do not interpret band touches as automatic signals; context matters. A strong trend will often ride the far band (“band walking”) and punish counter-trend fades—use the median slope and latched logic to separate trend from range. Do not oversmooth levels; you will lag breaks. Do not set $q$ too small or too large; extremes reduce statistical meaning and practical distance for stops.
A concise checklist.
1. Is the median flat (range) or sloped (trend)?
2. Is band width expanding or contracting vs ATR?
3. Are we near the tail level aligned with the intended trade?
4. For continuation: did the 3 steps for a latched signal complete?
5. Do stops and targets produce acceptable $R$ (≥1.5–2.0)?
6. Are you trading during liquid hours for the instrument?
Summary. ARQB provides statistically grounded, regime-aware bands and a disciplined, latched confirmation engine. Use the bands as objective context, the median as your equilibrium line, ATR adaptation to stay calibrated across regimes, and the latched logic to time higher-quality discretionary entries.
Disclaimer
No indicator guarantees profits. Adaptive Rolling Quantile Bands is a decision aid; always combine with solid risk management and your own judgment. Backtest, forward test, and size responsibly.
The content provided, including all code and materials, is strictly for educational and informational purposes only. It is not intended as, and should not be interpreted as, financial advice, a recommendation to buy or sell any financial instrument, or an offer of any financial product or service. All strategies, tools, and examples discussed are provided for illustrative purposes to demonstrate coding techniques and the functionality of Pine Script within a trading context.
Any results from strategies or tools provided are hypothetical, and past performance is not indicative of future results. Trading and investing involve high risk, including the potential loss of principal, and may not be suitable for all individuals. Before making any trading decisions, please consult with a qualified financial professional to understand the risks involved.
By using this script, you acknowledge and agree that any trading decisions are made solely at your discretion and risk.
Enhance your trading precision and confidence 🚀
Best regards
Chervolino