celenni//@version=6
strategy("Cruce SMA 5/20 – v6 (const TF, gap en puntos SOLO cortos, next bar open, 1 trade/ventana, anti-flip)",
overlay = true,
initial_capital = 10000,
default_qty_type = strategy.percent_of_equity,
default_qty_value = 10,
pyramiding = 0)
// === CONSTANTES ===
const string TF = "15" // fija el timeframe de cálculo (ej. "5","15","30","60","120","240","D")
const string SYM_ALLOWED = "QQQ" // símbolo permitido
// === Inputs ===
confirmOnClose = input.bool(true, "Confirmar señal al cierre (evita repaint)")
maxGapPtsShort = input.float(0.50, "Máx gap permitido en CORTOS (puntos)", 0.0, 1e6)
lenFast = input.int(5, "SMA rápida", 1)
lenSlow = input.int(20, "SMA lenta", 2)
tpPts = input.float(20.0, "Take Profit (puntos)", 0.01)
slPts = input.float(5.0, "Stop Loss (puntos)", 0.01)
// Ventanas (NY)
useSessions = input.bool(true, "Usar ventanas NY")
sess1 = input.session("1000-1130", "Ventana 1 (NY)")
sess2 = input.session("1330-1600", "Ventana 2 (NY)")
flatOutside = input.bool(true, "Cerrar posición al salir de la ventana")
// === Utilidades ===
isAllowedSymbol() =>
(syminfo.ticker == SYM_ALLOWED) or str.contains(str.upper(syminfo.ticker), str.upper(SYM_ALLOWED))
// === Series MTF (cálculo en TF) ===
closeTF = request.security(syminfo.tickerid, TF, close, barmerge.gaps_off, barmerge.lookahead_off)
smaFast = ta.sma(closeTF, lenFast)
smaSlow = ta.sma(closeTF, lenSlow)
// Señales MTF sin repaint
longSignalTF = request.security(syminfo.tickerid, TF,
ta.crossover(ta.sma(close, lenFast), ta.sma(close, lenSlow)),
barmerge.gaps_off, barmerge.lookahead_off)
shortSignalTF = request.security(syminfo.tickerid, TF,
ta.crossunder(ta.sma(close, lenFast), ta.sma(close, lenSlow)),
barmerge.gaps_off, barmerge.lookahead_off)
// === Sesiones (evaluadas en el TF del gráfico, zona NY) ===
inSess1 = useSessions ? not na(time(timeframe.period, sess1, "America/New_York")) : true
inSess2 = useSessions ? not na(time(timeframe.period, sess2, "America/New_York")) : true
inSession = inSess1 or inSess2
// Inicio de ventanas y contadores (1 trade por ventana)
var bool wasIn1 = false, wasIn2 = false
win1Start = inSess1 and not wasIn1
win2Start = inSess2 and not wasIn2
wasIn1 := inSess1
wasIn2 := inSess2
var int tradesWin1 = 0, tradesWin2 = 0
if win1Start
tradesWin1 := 0
if win2Start
tradesWin2 := 0
justOpened = strategy.position_size != 0 and strategy.position_size == 0
if justOpened
if inSess1
tradesWin1 += 1
if inSess2
tradesWin2 += 1
canTakeMore =
(inSess1 and tradesWin1 < 1) or
(inSess2 and tradesWin2 < 1) or
(not useSessions)
// === Filtro NO-GAP SOLO para CORTOS (en PUNTOS) ===
// Compara OPEN actual vs CLOSE previo; se evalúa en la barra donde se EJECUTA (apertura actual).
gapPts = math.abs(open - close )
shortGapOK = maxGapPtsShort <= 0 ? true : (gapPts <= maxGapPtsShort)
// === Anti-flip y gating ===
isFlat = strategy.position_size == 0
canSignal = (not confirmOnClose or barstate.isconfirmed)
canTrade = isAllowedSymbol() and inSession and canTakeMore and canSignal
// === ENTRADAS (se colocan al cierre; se llenan en la apertura siguiente) ===
// Largos: sin filtro de gap
if canTrade and isFlat and longSignalTF
strategy.entry("Long", strategy.long)
// Cortos: requieren shortGapOK
if canTrade and isFlat and shortSignalTF and shortGapOK
strategy.entry("Short", strategy.short)
// === TP/SL en puntos ===
if strategy.position_size > 0
e = strategy.position_avg_price
strategy.exit("TP/SL Long", from_entry="Long", limit=e + tpPts, stop=e - slPts)
if strategy.position_size < 0
e = strategy.position_avg_price
strategy.exit("TP/SL Short", from_entry="Short", limit=e - tpPts, stop=e + slPts)
// === Cierre fuera de sesión ===
if flatOutside and not inSession and strategy.position_size != 0
strategy.close_all("Fuera de sesión")
// === Visual ===
plot(smaFast, color=color.new(color.teal, 0), title="SMA 5 ("+TF+")")
plot(smaSlow, color=color.new(color.orange, 0), title="SMA 20 ("+TF+")")
plotshape(longSignalTF and canTrade and isFlat, title="Compra", style=shape.triangleup,
location=location.belowbar, color=color.new(color.teal,0), size=size.tiny, text="Long")
plotshape(shortSignalTF and canTrade and isFlat and shortGapOK, title="Venta", style=shape.triangledown,
location=location.abovebar, color=color.new(color.red,0), size=size.tiny, text="Short")
Candlestick analysis
LONG/SHORT Signals by YCGH CapitalThis indicator uses volatility as its primary input to help identify potential market
bottoms and tops. By measuring extreme price movements and volatility spikes, it generates
signals for both long (buy) and short (sell) opportunities.
BEST SUITED FOR:
This indicator works best when the market is in a clear trend - either uptrend or downtrend.
It excels at catching reversal points within trending markets and identifying exhaustion
points where trends may reverse.
HOW TO USE THIS INDICATOR:
1. IDENTIFY SIGNAL TYPES:
• Long Filtered (Dark Blue, Tiny): Conservative buy signals with higher probability
• Long Aggressive (Aqua, Small): Early buy signals for catching bottoms faster
• Short Filtered (Dark Red, Tiny): Conservative sell signals with confirmation
• Short Aggressive (Orange, Small): Early sell signals for catching tops
2. TRADING APPROACHES:
Conservative Traders:
- Focus only on Filtered signals (tiny arrows)
- Wait for full confirmation before entering
- Lower risk, fewer trades, higher win rate
Aggressive Traders:
- Use Aggressive signals (small arrows) for earlier entries
- Accept more risk for potentially larger profits
- More trades, catch moves from the beginning
Balanced Approach:
- Use Aggressive signals to spot opportunities early
- Confirm with Filtered signals or use them to add to positions
- Scale in with Aggressive, scale out with opposite signals
3. RISK MANAGEMENT:
- Always use stop losses below recent swing lows (long) or above swing highs (short)
- Risk less per trade on Aggressive signals (they have more false signals)
- Risk more per trade on Filtered signals (higher probability setups)
- Consider the broader trend - signals aligned with trend work better
4. COMBINATION STRATEGIES:
- Use with trend indicators (moving averages) to filter signals
- Combine with support/resistance levels for higher probability entries
- Look for signals near key price levels for best results
- Use volume confirmation to validate signal strength
5. TIMEFRAME RECOMMENDATIONS:
- 15min-1H charts: Day trading with quick reversals
- 4H-Daily charts: Swing trading with multi-day holds (RECOMMENDED)
- Weekly charts: Position trading for long-term trend reversals
IMPORTANT NOTES:
- Not all signals will result in profitable trades
- Best performance in trending markets, may produce false signals in sideways/choppy conditions
- Combine with your own analysis and risk management rules
- Past performance does not guarantee future results
SwingDetermines local minimums and maximums on the chart, where you can aim for liquidity in the future
Breakout Structure SignalsBreakout Structure Signals
Trend-following Donchian breakouts with optional retests, HTF trend filter, volume & ADX gates, and one-signal-per-direction control.
What it does
Prints LONG / SHORT when price breaks the prior Donchian High/Low and/or makes a qualified retest of that level.
Works with trend via EMAs on the chart TF; optional HTF EMA filter confirms higher-timeframe bias.
Optional Volume and ADX filters, plus soft candle-quality checks.
Signals confirm on bar close (no intrabar repaint on your chart TF). Duplicate signals can be suppressed until direction flips.
Core logic
Breakout Long: close > DonchianHigh AND EMAfast > EMAslow AND close > EMAslow .
Breakout Short: close < DonchianLow AND EMAfast < EMAslow AND close < EMAslow .
Retest (optional): after breakout, wait up to maxBarsWait for a pullback within ATR × retestTolATR around the breakout level; price must also align with the fast EMA (above for longs, below for shorts).
Filters (optional): Volume > SMA20 × volMult , ADX > 20 , candle-quality: close position within range ≥ closePosMin and body/range ≥ impulseBodyMin .
HTF trend (optional): Longs require HTF EMAfast > HTF EMAslow ; shorts require the opposite (via request.security on htf_tf ).
Inputs (key)
lengthRange — Donchian N (high/low lookback).
emaFastLen , emaSlowLen — chart-TF trend filter.
useVolumeFilt , volMult — volume gate (turn OFF where volume is unreliable).
useRetest , retestTolATR , maxBarsWait — retest behavior & tolerance.
useADX , adxLen — trend-strength filter.
useHTF , htf_tf , htfEmaFastLen , htfEmaSlowLen — higher-TF confirmation.
useCandleQual , closePosMin , impulseBodyMin — soft candle-quality checks.
confirmOnClose — confirm signals on close.
suppressSameSide — block repeats until reversal.
showBg — background highlight on signal bars.
Visuals
Plots: EMA Fast , EMA Slow , Donchian High/Low .
Markers: triangle LONG below bars, triangle SHORT above bars.
Optional background tint on signal bars.
Alerts
LONG signal — breakout or qualified retest (long).
SHORT signal — breakout or qualified retest (short).
How to use
Start with Donchian 20 , EMA 20/50 ; for LTF trading, consider HTF = 60m/240m.
Retests: try 0.3–0.6 ATR tolerance and 8–12 bars wait for cleaner fills.
Stops: beyond breakout/retest by 1–1.5 ATR or beyond fast EMA; manage with partials and a trailing exit.
Turn Volume filter OFF where volume isn’t informative.
This indicator provides signals only; always combine with risk management.
Unlock Your Trading Edge with the Boost AIBINANCE:BTCUSDT
Stop the guesswork. Stop the "analysis paralysis." Stop using tools that look great in hindsight but fail in live trading.
We've combined more than 10 years of trading expertise with cutting edge AI to bring to you Boost AI for one reason: to create a real, tradeable edge.
This isn't just another "signal" indicator. It's an AI-driven engine that has been rigorously backtested, showing a 55x return over the last 5 years of market data. This indicator is built for BTC and is ideal on a 20min timeframe.
Why it's the only indicator you'll need:
Crystal-Clear Signals: Get simple, actionable "Buy" and "Sell" signals. No more confusion.
100% NON-REPAINTING: This is our core promise. The signal you see is the signal you trade. What you see on the chart is what you would have seen in real-time. No repainting. No back-fitting. No excuses.
AI-Driven Edge: Our proprietary AI model adapts to changing market conditions, identifying high-probability setups that human analysis often misses.
Proven Performance: The 55x backtest isn't a "perfect scenario" guess. It's the result of 5 years of historical data, giving you a baseline of the algorithm's performance.
Disclaimer: Past performance is not indicative of future results. The 55x return is based on a historical backtest and does not guarantee future profits. All trading involves risk, and you should only trade with capital you can afford to lose.
How to Get Access:
Access is $9.99 USDT per month.
Send Payment: Transfer 9.99 USDT (on the ERC-20 network) to this address: 0x1d8cb08411bdd334781e290e4fc2e64c9da67c9c
After paying, send us a DM and we'll give you access.
Get Access: Payment verification and granting access to your TradingView account may take upto 24 hours (However, in most cases, users have been given access in a few hours)
First 5-Min Candle High/Low by grantratcliff7Draws two pale yellow lines at the open and the close of the first 5 min candle of the trading session (9:35 EDT)
🦁 Hunt and eat v14++My 🦁 Hunt & Eat v14++ strategy combines the best of both worlds: Peak and Valley (CYC) detection to capture precise market reversals, and Time-to-Move (TTM) filters to align with the overall trend, ensuring cleaner, less noisy trades.
Its main strengths are:
Adaptability: It can trade in both trending phases and reversal zones, thanks to its selectable modules.
Multiple Confirmation: It combines structural signals (pivots) with dynamic conditions such as ADX, EMA angle, and neutrality filters.
Disciplined Management: It avoids entering flat or directionless zones, reducing unnecessary trades.
Visual Clarity: It uses a performance panel and EMA colors that reflect the actual state of the position.
In short, it's a trend-chasing strategy with contextual intelligence, designed to capitalize on strong moves without getting caught in market indecision.
BTC MULTI-RSrelative strength 💪 its showing strenth relative 21 55 123 period of crypto....against btc...
TFL Indicator (BenFuturez)Smart Fair Value Gap Trading Tool
This indicator identifies high-probability trading opportunities by combining Fair Value Gaps (FVGs) with confirmation signals and trend filtering.
KEY FEATURES:
• Automatically detects bullish and bearish Fair Value Gaps on your chart
• Generates precise entry signals based on price action confirmation
• Includes built-in trend filter using 20 EMA for higher quality setups
• Visual FVG boxes with customizable colors and extension length
• Configurable signal sensitivity with adjustable timeframe parameters
HOW IT WORKS:
The indicator marks FVG zones on your chart and monitors price behavior when these zones are tested. Entry signals appear only when multiple conditions align, including proper price structure, gap interaction, and trend direction. This multi-layered approach helps filter out low-probability trades.
SETTINGS:
• Toggle bullish/bearish FVG boxes on/off
• Adjust box colors and extension length
• Configure signal timing sensitivity
• Show/hide the 20 EMA trend filter
• Customize EMA length and color
SIGNALS:
• Green triangle = Buy signal (bullish setup confirmed)
• Red triangle = Sell signal (bearish setup confirmed)
• Built-in alerts available for all signal types
BEST PRACTICES:
• Use on lower timeframes for more signals
• Combine with proper risk management and position sizing
• Signals work best when aligned with overall market structure
• Consider multiple timeframe confirmation for best results
• Use this as a confluence to your strategy, don't just blindly follow signals!
This indicator is designed for traders who understand market structure and want a systematic approach to identifying quality entry points based on institutional order flow concepts.
REJECTION DETECTOR🔥 CTR (Candle Terjepit - Rejection)
This indicator is specifically designed to detect Rejection Candles, which are moments when the price rejects a certain level and has the potential to form a strong reversal or rapid reaction — an important signal for scalpers and price action traders.
💡 Key Concept:
Rejection is a form of market reaction to areas of liquidity, support-resistance, or order block zones. Candles with long tails and small bodies indicate an imbalance between buyers and sellers, providing an early indication that the price may soon reverse.
⚙️ Key Features
🔍 Automatic Rejection Candle Detection (Buy & Sell)
🧠 Body-to-tail ratio filter for more precise signal validation
🎨 Customizable candle colors and appearance
📊 Suitable for all pairs and timeframes
VCP Detector it detects VCP before breakout,,,
⚡ How to Use
🕒 Timeframe:
15-min → Intraday contraction
Daily → Swing contraction
🟢 Green circles = VCP zones
→ price tightening, volume drying, volatility compressing.
SMC Adaptive Breakout v1XSMC Adaptive Breakout v1X — Adaptive Smart Money Breakout Strategy
SMC Adaptive Breakout v1X is a Smart-Money–inspired breakout strategy that adapts to changing volatility and market structure in real time. It identifies recent pivot structure, verifies volatility expansion, uses ATR-scaled stops, and manages exits with fixed profit targets plus price-based trailing.
Why this strategy is unique / original
This strategy combines three concept layers into a single, cohesive system: (1) structure detection using adaptive pivots, (2) a normalized volatility filter (range percentile over a long lookback) to permit only expansion-phase breakouts, and (3) context-aware trade management using ATR-scaled stops and percentage-based profit/ trailing rules. The combination reduces false breakouts during low-volatility periods while preserving entries when institutional-style expansion occurs.
Core logic (high level)
1. Structure detection: recent pivot highs and lows (configurable lookback) form the active Support and Resistance reference levels used to define breakouts.
2. Volatility confirmation: raw bar range is normalized into a percentile within a long volatility lookback window; breakouts are only considered when normalized volatility exceeds the user filter threshold.
3. Order-block / gap detection: the script detects large price gaps relative to ATR(200) and flags them as bullish/bearish gaps (order-block style footprints) to add confluence to entries.
4. Entry criteria: a long entry is signalled when price closes above the most recent resistance and the volatility filter is satisfied (or a bullish gap condition is met). Shorts mirror this logic below support. Debug/force flags allow manual/backtest forcing of trades.
5. Risk & exits: stops are ATR-based (ATR length configurable, multiplier configurable) giving context-aware stop distances. Each entry sets a profit target as a percent of entry and attaches a trailing exit (points and offset defined as percent of price) to protect profits. Exits are placed with one strategy.exit per entry so they are executed by the strategy engine.
6. Non-premature confirmation: entries are determined using closed-bar conditions (no intrabar triggers), consistent with strategy backtesting expectations.
Key inputs (and what they control)
1. Levels Period (length) — pivot lookback used to compute support/resistance structure; larger values = larger, fewer zones.
2. Volatility Filter (filter 0–100) — normalized volatility threshold (percentile) required to allow breakout signals. Increase to reduce signals during quiet markets.
3. Volatility lookback (volatility_len) — window length used to normalize the raw range into a percentile.
4. ATR length (atr_len) & ATR Stop Multiplier (atr_multiplier) — ATR parameters used for stop distance; ATR gives volatility-adaptive stop sizing.
5. Profit target (%) — target as percent of entry price.
6. Trailing points (%) & offset (%) — trailing stop size and activation offset, expressed as percent of price (converted internally to price points).
7. Visual & debug toggles — show/hide levels, entry markers, and enable debug/force entry flags for manual/backtest validation.
Practical Usage & Recommended Settings
Timeframes – Works efficiently across multiple time horizons.
• 5–15 minutes → Scalping setups.
• 15 minutes–1 hour → Intraday opportunities.
• 4 hours–1 day → Swing trading confirmation.
Adjust length and Volatility Filter parameters to match your timeframe and instrument behavior.
Default Sensitivity –
The default length = 20 offers balanced structure detection.
• Lower values → faster, more frequent signals.
• Higher values → smoother structure and fewer breakouts.
Volatility Tuning –
Modify the Volatility Filter (0–100) according to market conditions.
• Increase the filter during low-volume or choppy sessions to reduce false signals.
• Decrease it during trending or high-volatility markets for greater responsiveness.
Stop / Target Sizing –
ATR-based stop-losses automatically adapt to market volatility.
• Recommended starting point: ATR Multiplier = 1.5 and Profit Target = 1.5%.
• Fine-tune both based on each asset’s typical volatility profile.
Backtesting –
Use TradingView’s built-in Strategy Tester to analyze results over different symbols and timeframes.
The strategy executes only on bar close, ensuring accurate, non-repainting backtest results.
What the strategy plots / visual cues
•Forward-extended pivot lines for support/resistance (configurable color/transparency).
•Order-block / gap markers when large ATR-scaled gaps are detected.
•Entry labels (“LONG” / “SHORT”) at position changes if enabled.
•Strategy entries/exits are placed through strategy.entry and strategy.exit so performance reports are available in the Tester.
Risk management & notes
•This script is a discretionary tool — it automates entries and exits for backtesting and strategy simulation, but users should still confirm trades with broader market context and higher-timeframe bias.
•Always run thorough backtests (multi-symbol, multi-timeframe) and forward test on a paper account before any live deployment.
•Adjust position sizing externally; the strategy code sets orders and exits but does not enforce a specific money-management sizing rule. Use the strategy tester’s default position size controls or integrate a sizing method in your own workflow.
Technical details & behavior
•Pine Script v6 strategy.
•Uses closed-bar confirmation for signals (no repainting on close).
•Order-block / gap detection uses ATR(200) as a volatility reference to identify large structural gaps.
•Trail calculations convert percent-based inputs to absolute price units each bar to maintain consistent behavior across price levels.
Limitations & disclaimers
•Past performance is not indicative of future results. This strategy does not guarantee profits and will produce losing trades.
•Results depend on parameter choices, instrument volatility, market regime, and execution slippage. Always test on the exact symbol and timeframe you intend to trade.
Invite-only / Access note (for Publish window)
This strategy is invite-only. Please use the TradingView Request Access button on this page to request access.
Magik- OB findermarks Magic Orderblocks 15 min time frame... when price visits the ob go to 1 min tf.. after price makes a mss.. enter.. enjoy!!!
Market Structure Trailing Stop MTF [Inspired by LuxAlgo]# Market Structure Trailing Stop MTF
**OPEN-SOURCE SCRIPT**
*208k+ views on original · Modified for MTF Support*
This indicator is a direct adaptation of the renowned **Market Structure Trailing Stop** by **LuxAlgo** (original script: [Market Structure Trailing Stop ]()). The core logic remains untouched, providing dynamic trailing stops based on market structure breaks (CHoCH/BOS). The **only modification** is the addition of **Multi-Timeframe (MTF) support**, allowing users to apply the trailing stops and structures from **higher timeframes (HTF)** directly on their current chart. This enhances usability for traders analyzing cross-timeframe confluence without switching charts.
**Special thanks to LuxAlgo** for releasing this powerful open-source tool under CC BY-NC-SA 4.0. Your contributions to the TradingView community have inspired countless traders—grateful for the solid foundation!
## 🔶 How the Script Works: A Deep Dive
At its heart, this indicator detects **market structure shifts** (bullish or bearish breaks of swing highs/lows) and uses them to generate **adaptive trailing stops**. These stops trail the price while protecting profits and acting as dynamic support/resistance levels. The MTF enhancement pulls this logic from user-specified higher timeframes, overlaying HTF structures and stops on the lower timeframe chart for seamless multi-timeframe analysis.
### Core Logic (Unchanged from LuxAlgo's Original)
1. **Pivot Detection**:
- Uses `ta.pivothigh()` and `ta.pivotlow()` with a user-defined lookback (`length`) to identify swing highs (PH) and lows (PL).
- Coordinates (price `y` and bar index/time `x`) are stored in persistent variables (`var`) for tracking recent pivots.
2. **Market Structure Detection**:
- **Bullish Structure (BOS/CHoCH)**: Triggers when `close > recent PH` (break above swing high).
- If `resetOn = 'CHoCH'`, resets only on major shifts (Change of Character); otherwise, on all breaks.
- Sets trend state `os = 1` (bullish) and highlights the break with a horizontal line (dashed for CHoCH, dotted for BOS).
- Initializes trailing stop at the local minimum (lowest low since the pivot) using a backward loop: `btm = math.min(low , btm)`.
- **Bearish Structure**: Triggers when `close < recent PL`, mirroring the bullish logic (`os = -1`, local maximum for stop).
- Structure state `ms` tracks the break type (1 for bull, -1 for bear, 0 neutral), resetting based on user settings.
3. **Trailing Stop Calculation**:
- Tracks **trailing max/min**:
- On new bull structure: Reset `max = close`.
- On new bear: Reset `min = close`.
- Otherwise: `max = math.max(close, max)` / `min = math.min(close, min)`.
- **Stop Adjustment** (the "trailing" magic):
- On fresh structure: `ts = btm` (bull) or `top` (bear).
- In ongoing trend: Increment/decrement by a percentage of the max/min change:
- Bull: `ts += (max - max ) * (incr / 100)`
- Bear: `ts += (min - min ) * (incr / 100)`
- This creates a **ratcheting effect**: Stops move favorably with the trend but never against it, converging toward price at a controlled rate.
- **Visuals**:
- Plots `ts` line colored by trend (teal for bull, red for bear).
- Fills area between `close` and `ts` (orange on retracements).
- Draws structure lines from pivot to break point.
4. **Edge Cases**:
- Variables like `ph_cross`/`pl_cross` prevent multiple triggers on the same pivot.
- Neutral state (`ms = 0`) preserves prior `max/min` until a new structure.
### MTF Enhancement (Our Addition)
- **request.security() Integration**:
- Wraps the entire core function `f()` in a security call for each timeframe (`tf1`, `tf2`).
- Returns HTF values (e.g., `ts1`, `os1`, structure times/prices) to the chart's context.
- Uses `lookahead=barmerge.lookahead_off` for accurate historical repainting-free data.
- Structures are drawn using `xloc.bar_time` to align HTF lines precisely on the LTF chart.
- **Multi-Output Handling**:
- Separate plots/fills/lines for each TF (e.g., `plot_ts1`, `plot_ts2`).
- Colors and toggles per TF to distinguish HTF1 (e.g., teal/red) from HTF2 (e.g., blue/maroon).
- **Benefits**: Spot HTF bias on LTF entries, e.g., enter longs only if both TF1 (1H) and TF2 (4H) show bullish `os=1`.
This keeps the script lightweight—**no repainting, max 500 lines**, and fully compatible with LuxAlgo's original behavior when TFs are set to the chart's timeframe.
## 🔶 SETTINGS
### Core Parameters
- **Pivot Lookback** (`length = 14`): Bars left/right for pivot detection. Higher = smoother structures, fewer signals; lower = more noise.
- **Increment Factor %** (`incr = 100`): Speed of stop convergence (0-∞). 100% = full ratchet (mirrors max/min exactly); <100% = slower trail, reduces whipsaws.
- **Reset Stop On** (`'CHoCH'`): `'CHoCH'` = Reset only on major reversals (dashed lines); `'All'` = Reset on every BOS/CHoCH (tighter stops).
### MTF Support
- **Timeframe 1** (`tf1 = ""`): HTF for first set (e.g., "1H"). Empty = current chart.
- **Timeframe 2** (`tf2 = ""`): Second HTF (e.g., "4H"). Enables dual confluence.
### Display Toggles
- **Show Structures** (`true`): Draws horizontal lines for breaks (per TF colors).
- **Show Trailing Stop TF1/TF2** (`true`): Plots the stop line.
- **Show Fill TF1/TF2** (`true`): Area fill between close and stop.
### Candle Coloring (Optional)
- **Color Candles** (`false`): Enables custom `plotcandle` for body/wick/border.
- **Candle Color Based On TF** (`"None"`): `"TF1"`, `"TF2"`, or none. Colors bull trend green, bear red.
- **Candle Colors**: Separate inputs for bull/bear body, wick, border (e.g., solid green body, transparent wick).
### Alerts
- **Enable MS Break Alerts** (`false`): Notifies on structure breaks (bull/bear per TF) **only on bar close** (`barstate.isconfirmed` + `alert.freq_once_per_bar_close`).
- **Enable Stop Hit Alerts** (`false`): Triggers on stop breaches (long/short per TF), using `ta.crossunder/crossover`.
### Colors
- **TF1 Colors**: Bullish (teal), Bearish (red), Retracement (orange).
- **TF2 Colors**: Bullish (blue), Bearish (maroon), Retracement (orange).
- **Area Transparency** (`80`): Fill opacity (0-100).
## 🔶 USAGE
Trailing stops shine in **trend-following strategies**:
- **Entries**: Use structure breaks as signals (e.g., long on bullish BOS from HTF1).
- **Exits**: Trail stops for profit-locking; alert on hits for automation.
- **Confluence**: Overlay HTF1 (e.g., 1H) for bias, HTF2 (e.g., Daily) for major levels—enter LTF only on alignment.
- **Risk Management**: Lower `incr` avoids early stops in chop; reset on `'All'` for aggressive trailing.
! (i.imgur.com)
*HTF1 shows bullish structure (teal line), trailing stop ratchets up—long entry confirmed on LTF pullback.*
! (i.imgur.com)
*TF1 (blue) bearish, TF2 (red) neutral—avoid shorts until alignment.*
! (i.imgur.com)
*Colored based on TF1 trend: Green bodies on bull `os=1`.*
Pro Tip: Test on demo—pair with LuxAlgo's other tools like Smart Money Concepts for full structure ecosystem.
## 🔶 DETAILS: Mathematical Breakdown
On bullish break:
- Local min: `btm = ta.lowest(n - ph_x)` (optimized loop equivalent).
- Stop init: `ts = btm`.
- Update: `Δmax = max - max `, `ts_new = ts + Δmax * (incr/100)`.
Bearish mirrors with `Δmin` (negative, so decrements `ts`).
In MTF: HTF `time` aligns lines via `line.new(htf_time, level, current_time, level, xloc.bar_time)`.
No logs/math libs needed—pure Pine v5 efficiency.
## Disclaimer
This is for educational purposes. Not financial advice. Backtest thoroughly. Original by LuxAlgo—modify at your risk. See TradingView's (www.tradingview.com). Licensed under CC BY-NC-SA 4.0 (attribution to LuxAlgo required).
Oversold Screener · v4# Step-2 Oversold Screener · v3.3
US equities · 15-minute event engine · AVWAP entries A–F · optional CVD/RSI/Z guards
## What this script does
Finds short, emotion-driven selloffs in large, healthy US stocks and turns them into actionable, right-side opportunities.
On a qualified 15-minute close it:
1. emits a minimal webhook so your backend/AI can vet the news and fundamentals, and
2. anchors an Event-AVWAP and plots ±1/±2/±3σ bands to guide entries A–F as price mean-reverts.
The logic runs in a fixed 15-minute space, independent of the chart timeframe you view.
## How an event is detected (Step-2 signal)
All conditions are evaluated on 15-minute data, including extended hours.
Depth, measured vs yesterday’s RTH reference
* Reference = min(yesterday’s RTH VWAP proxy, yesterday’s Close).
* 4h depth: current price vs reference across 16×15m bars ≤ threshold (default −4%).
* 8h depth: lowest close across the last 32×15m bars vs reference ≤ threshold (default −6%).
Relative underperformance
* Versus market ETF (SPY/QQQ) and sector ETF (XLK/XLF/XLY… or KWEB/CQQQ).
* Uses the same 16/32×15m windows; stock must be weaker by at least the set margins (default −3%).
Macro circuit breakers (any one trips = suppress signal)
* VIX level ≥ fuse (default 28).
* Market 4h/8h drawdown ≤ limits (default −2.0% / −3.5%).
* Sector 4h/8h drawdown ≤ limits (default −2.5% / −4.0%).
Momentum and distribution guards
* RSI(1h) < 30 by default (computed from 15m series).
* Optional Z-score filters: stock Z ≤ zTrig, and macro Z floors for market/sector.
* Cooldown per symbol so you don’t get spammed by repeated events.
When the event closes, the script posts a tiny JSON to your alert webhook and pins an on-chart “S2” marker at the event bar.
## Event-AVWAP and bands
From the event bar forward the script computes AVWAP natively in 15m space and draws bands at ±1σ/±2σ/±3σ.
σ is a rolling standard deviation of typical price with optional EMA smoothing and an optional cap.
Why this helps
* AVWAP from the shock timestamp approximates the crowd’s average position after the selloff.
* Reclaiming key bands often marks the start of orderly mean reversion rather than a dead-cat bounce.
## Entry proposals A–F (right-side confirmations)
Each entry requires first touching a lower band, then reclaiming a higher band.
A touch ≤ −2σ, then cross up through −1σ
B touch ≤ −1σ, then reclaim AVWAP
C break above −1σ, retest near −1σ within N bars, then bounce
D after compression (low ATR%), reclaim AVWAP
E touch ≤ −3σ, then cross up through −2σ
F touch ≤ −3σ, then cross up through −1σ (fast, aggressive)
Labeling hygiene
* Only the first three occurrences of each type A–F are shown within a one-week window after the event.
* A debounce interval avoids over-labeling across adjacent bars.
## Optional CVD gate (order-flow confirmation)
When enabled, entries must also pass a 15-minute CVD gate that looks for sell pressure exhaustion and a turn-up in cumulative delta.
Defaults are conservative; start with CVD off until you’re comfortable, then enable to filter chop after capitulations.
## Alert payload (minimal by design)
On the event bar close the script fires one alert with a tiny JSON that is easy to route and process in bulk:
```json
{
"event": "Crash_signal_15m",
"symbol": "NVDA",
"symbol_id": "NASDAQ:NVDA",
"ts_alert_15m_ms": 1730898900000,
"ts_alert_15m_local": "2025-11-06 10:45"
}
```
Notes
* ts_alert_15m_ms is the 15-minute close time in milliseconds since epoch (UTC reference).
* ts_alert_15m_local uses your chart’s timezone for readability.
Optional: a 24-hour streaming mode can resend this minimal payload on every 15-minute close during the day after the event (tiny patch available on request).
## Inputs you will actually touch
Bench/Sector symbols
* Bench: SPY or QQQ. Sector: XLK/XLF/XLY… or KWEB/CQQQ depending on the name.
Depth and relative thresholds
* 4h depth ≤ −4%, 8h depth ≤ −6%.
* Relative to market/sector ≤ −3% each.
Macro fuses
* VIX ≥ 28; market ≤ −2.0%/−3.5%; sector ≤ −2.5%/−4.0%.
Z/RSI guards
* Z window 80 bars (15m), stock zTrig ≤ −1.5, macro floors ≥ −1.0.
* RSI(1h) < 30.
AVWAP band engine
* σ EMA length 3; σ cap off by default.
* Retest window for entry C: 24 bars (≈6 hours).
Presentation and hygiene
* One-week entry window; per-type cap 3; debounce 8×15m bars.
* Signal table on/off, label pinning on/off.
## How to run it
1. Open a 15-minute chart (extended hours enabled recommended).
2. Add the indicator and choose Bench/Sector for the names you are reviewing.
3. Create a single alert per chart with Condition = Any alert() function call and Options = Once per bar close.
4. Point the alert to your webhook URL (or use app/email if you don’t have a URL).
5. Let your backend/AI receive the minimal JSON, do the news/fundamentals check, and decide Allow / Hold / Reject.
6. For Allowed names, use the on-chart A–F markers to stage in; manage risk against Event-AVWAP and upper HVNs/POC.
## Defaults that work well
* RSI(1h) < 30
* Depth 4h/8h ≤ −4%/−6% vs yesterday’s reference
* Relative to market/sector ≤ −3%
* Z: stock ≤ −1.5; macro floors ≥ −1.0
* Fuses: VIX ≥ 28; market ≤ −2.0%/−3.5%; sector ≤ −2.5%/−4.0%
* Bands: σ EMA = 3; no σ cap; one-week window; 3 labels per type
## Notes and limitations
* This is an indicator, not an auto-trader. Position sizing and exits are up to you.
* Designed for liquid US equities; thin ADRs and micro-caps are noisy.
* All event logic and entries are evaluated on bar close; AVWAP and bands do not repaint.
* If you need to monitor many symbols without a server, a Scanner variant can batch 10–17 tickers per script and alert without a webhook.
Candle PA Scanner (Engulfing / Inside / Pin) by BK SahniHere’s how to read the “Candle PA Scanner (Engulfing / Inside / Pin)” and what each input means.
What the signals look like on your chart
B-ENG (label above/below bar)
Bullish Engulfing → “B-ENG” below the bar (green/teal).
Bearish Engulfing → “B-ENG” above the bar (red).
IB (small orange dot at the top)
Inside Bar (compression). Use the mother bar’s high/low for the break.
PIN (triangle)
Bullish Pin → triangle below the bar (long lower wick; rejection of support).
Bearish Pin → triangle above the bar (long upper wick; rejection of resistance).
Treat these as price-action alerts, not automatic buy/sell signals. Act only when they occur at your levels (VWAP band, Fib 38.2–61.8, PDH/PDL, OB/FVG, etc.).
How to trade the prints (quick rules)
A) Bullish Engulfing at support
Context: at VWAP/VAL/0.5–0.618 Fib.
Entry: next candle above the engulfing high (or market order on close if volume/momentum confirm).
Stop: a tick below the engulfing low (or below the level).
Targets: mid/range, VWAP, prior swing; trail with Chandelier/ATR if trend extends.
B) Bearish Engulfing at resistance
Mirror the above: trigger below the engulfing low; stop above its high.
C) Inside Bar
It’s compression. Mark the mother bar’s high/low.
Trade the breakout in the direction of bias (above VWAP for longs, below for shorts).
If the break fails (closes back inside), often sets up a reversal—manage fast.
D) Pin Bar (rejection)
Enter on break of the pin’s body in the direction away from the wick.
Stop beyond the wick tip (invalidated if wick gets closed through).
Scale at VWAP/mid or the opposite range edge.
What the Inputs do (the panel you showed)
Inside Bar lookback (default 1)
How many bars back can be the mother bar.
Keep 1 for strict IB; raise to 2–3 to catch nested/compression patterns (more signals, a bit noisier).
Pin wick:body min ratio (default 2)
How long the rejection wick must be compared to the body.
Higher (2.5–3.0) = pickier, great in chop.
Lower (1.5–1.8) = more pins, useful in strong trends where wicks are shorter.
Min body % of range (0–1) (default 0.25)
Filters out dojis. The body must be at least 25% of the bar’s high-low range.
If you want to allow slimmer bodies (more pins/dojis), drop to 0.15–0.20.
If you want only decisive bodies, raise to 0.30–0.35.
Suggested tuning by market state
Trending / high momentum:
IB lookback 1, Pin ratio 1.8–2.2, Min body 0.20–0.25 (to catch more continuation entries).
Ranging / choppy:
IB lookback 2, Pin ratio 2.5–3.0, Min body 0.30 (fewer, higher-quality reversals).
A simple confluence checklist (use before clicking)
Signal printed at a level (VWAP band, Fib, PDH/PDL, OB/FVG)?
Bias aligned (above VWAP for longs, below for shorts) or you’re intentionally fading a range edge?
For engulfing: did it close through nearby minor structure?
For IB: are you trading the mother bar break, not just the small inside candle?
Risk defined: stop beyond wick/zone, target mapped (mid/VWAP/swing/extension).
Common pitfalls
Taking signals mid-range (low R:R).
Treating an IB as a reversal without a break/shift.
Buying a bullish pin that closed below your level (no acceptance).
Ignoring volatility—during news spikes, patterns fail more often.
Engulf After 2 Same-Dir Candles – Dashed Linethis will tell you when engulf happens after 2 consecutrive bvearsh candle happens
Freedom Candlestick v5.0.5The is a momentum trading strategy for futures. There are also components of ICT, trend following, volume distribution, and volatility involved in the logic. We are currently using it on NQ and GC. We are also in the process of building a set up to work with ES.
GROK ALTIN B2 ))GROK GOLD PRO V2 is a high-performance scalping strategy designed for XAUUSD on the 5-minute timeframe, operating with a fixed 1-lot position. It generates signals using EMA 9/21 crossover, RSI above/below 50, and volume spikes, while an ATR × 2.0 dynamic stop protects against volatility. Profits are locked in three steps (+$20, +$50, +$100), with each exit triggering real-time phone alerts showing entry, exit price, and profit. One pip movement equals $100 P&L. The strategy delivers a 92%+ win rate, average profit of +$4,432 per trade, and max drawdown of -$1,280. Simple, transparent, and fully automated.






















