Cs Fenix Us30The price unbalances the Asia and Frankfurt range and if there is a structural change it highlights a possible entry with a stop and target level.
Графические паттерны
Price Between Tenkan & KijunThis is to find stocks that either breaking up or down from a large screener list
Price Between Tenkan & KijunThis is developed to find stocks on a weekly basis that are potentially breaking out or breaking down
First H4 Window Box with PanelThis indicator will explain in detail about the characterstics of first hour open in Gold
Percentage Change per 5 Candles
🔎 What this indicator does
This indicator calculates and displays the percentage change of each candlestick directly on the chart.
• If a candle closed higher than it opened (bullish candle), it shows a positive % change (green).
• If a candle closed lower than it opened (bearish candle), it shows a negative % change (red).
• Small moves below your chosen threshold (e.g., 0.1%) are ignored to avoid clutter.
• The labels are placed above, below, or in the center of the candle (you choose).
So essentially, every candle “tells you in numbers” exactly how much it changed relative to its opening price.
________________________________________
⚙️ How it operates (the logic inside)
1. Calculate the change
o Formula:
\text{% Change} = \frac{(\text{Close} - \text{Open})}{\text{Open}} \times 100
o Example: If a candle opens at 100 and closes at 105, that’s a +5% change.
2. Round it nicely
o You can control decimals (e.g., show 2 decimals → +5.23%).
3. Filter out noise
o If a candle barely moved (say 0.02%), the label won’t appear unless you reduce the threshold.
4. Style the labels
o Bullish = green text, slightly transparent green background.
o Bearish = red text, slightly transparent red background.
o Neutral (0%) = gray.
5. Place the labels
o Options: above the candle, below the candle, or centered.
o Small vertical offset is applied so labels don’t overlap the candle itself.
________________________________________
📊 How this helps traders
This indicator turns visual candles into quantifiable numbers at a glance. Instead of guessing whether a move was “big” or “small,” you see it clearly.
Key Benefits:
1. Quick volatility analysis
o You can instantly see if candles are making big % swings or just small moves.
o This is especially useful on higher timeframes (daily/weekly) where moves can be large.
2. Pattern confirmation
o For example, you might spot a strong bullish engulfing candle — the % change label helps confirm whether it was truly significant (e.g., +4.5%) or just modest (+0.7%).
3. Noise filtering
o By setting a minimum % threshold, you only see labels when moves are meaningful (say > 0.5%). This keeps focus on important candles.
4. Backtesting & comparison
o You can compare moves across time:
“How strong was this breakout candle compared to the last one?”
“Are today’s bearish candles weaker or stronger than yesterday’s bullish candles?”
5. Better decision-making
o If you’re trading breakouts, reversals, or trend-following, knowing the % size of each candle helps confirm if the move has enough momentum.
________________________________________
✅ In short:
This indicator quantifies price action. Instead of just seeing “green” or “red” candles, you now know exactly how much the price changed in percentage terms, directly on the chart, in real time. It helps you distinguish between strong and weak moves and makes your analysis more precise.
________________________________________
Clear Signal Trading Strategy V5Clear Signal Trading Strategy - Description
This strategy uses a simple 0-5 point scoring system to identify high-probability trades. It combines trend following with momentum confirmation to generate clear BUY/SELL signals while filtering out market noise.
How it works: The strategy waits for EMA crossovers, then scores the setup based on trend alignment, momentum, RSI position, and volume. Only trades scoring above your chosen threshold are executed.
Recommended Settings by Market Type
For Beginners / Risk-Averse Traders:
Signal Sensitivity: Conservative
Volume Confirmation: ON
Risk Per Trade: 1-2%
Stop Loss Type: ATR
ATR Multiplier: 2.5
Risk:Reward Ratio: 2.0
For Trending Markets (Strong Directional Movement):
Signal Sensitivity: Balanced
Volume Confirmation: ON
Risk Per Trade: 2%
Stop Loss Type: ATR
ATR Multiplier: 2.0
Risk:Reward Ratio: 2.5-3.0
For Ranging/Choppy Markets:
Signal Sensitivity: Conservative
Volume Confirmation: ON
Risk Per Trade: 1%
Stop Loss Type: Percentage
Percentage Stop: 2%
Risk:Reward Ratio: 1.5
For Volatile Markets (Crypto/High Beta Stocks):
Signal Sensitivity: Conservative
Volume Confirmation: ON
Risk Per Trade: 1%
Stop Loss Type: ATR
ATR Multiplier: 3.0
Risk:Reward Ratio: 2.0
Best Practices
Timeframes:
15-minute to 1-hour for day trading
4-hour to daily for swing trading
Works best on liquid instruments with good volume
When to avoid trading:
When dashboard shows "HIGH" volatility above 4%
During major news events
When win rate drops below 40%
In markets with no clear trend (prolonged NEUTRAL state)
Success tips:
Start with Conservative mode until you see 10+ successful trades
Only increase to Balanced mode when win rate exceeds 55%
Never use Aggressive mode unless market shows strong trend for 5+ days
Always honor the stop loss - no exceptions
Take partial profits at first target if unsure
Heikin-Ashi-Candles MTFHeikin-Ashi Higher Timeframe Candles
This indicator overlays higher-timeframe Heikin-Ashi candles (default: 5 minutes) onto a lower-timeframe chart (e.g., 1 minute). Instead of using standard candlesticks, it draws:
Semi-transparent rectangles to represent the candle bodies.
Vertical lines to represent wicks, centered on each body.
Key features:
Dynamic transparency: The current, still-forming higher-timeframe candle is plotted in green or red (depending on trend) with a separate, lighter transparency (default: 30) so you can easily distinguish it from completed candles.
Finalization on close: As soon as a higher-timeframe candle closes, its body and wicks update to the standard transparency level (default: 50), ensuring completed candles are visually distinct.
Customizable inputs: You can adjust
The higher timeframe (tf) for Heikin-Ashi calculations.
Body transparency for confirmed candles.
Transparency for unfinished candles.
Wick thickness.
Use case:
This is particularly useful for traders who analyze price action on lower timeframes but want to stay aware of the higher-timeframe Heikin-Ashi trend without switching charts. The fading effect on the active candle helps prevent confusion between fully formed candles and those still developing.
Ravi AlgoBot📌 Indicator Description (Publish Notes)
Indicator Name:
EoR / EoS Entry & SL/Target Manager (Put=Red, Call=Green)
Purpose:
यह indicator उन traders के लिए बनाया गया है जो अपनी manual levels (EoR, EoR+1 for Put, और EoS, EoS-1 for Call) को chart पर plot करना चाहते हैं और उनके आधार पर Entry, Stop Loss और Target manage करना चाहते हैं।
How it works:
आप manual prices (EoR, EoR+1, EoS, EoS-1) input fields में डालेंगे।
Put levels (EoR, EoR+1) लाल रंग में दिखेंगे।
Call levels (EoS, EoS-1) हरे रंग में दिखेंगे।
हर price पर chart पर horizontal line + label बनेगा।
आप अपने Stop Loss और Target prices भी manual डाल सकते हैं (Call और Put दोनों के लिए अलग-अलग)।
जब भी price किसी entry/SL/Target level को touch करेगा:
Chart पर signal shape बनेगा (triangle)
एक alertcondition trigger होगा।
आप TradingView में Alerts create करके इन alerts को webhook URL से connect कर सकते हैं।
Example: जब EoR Put level touch हो → webhook के ज़रिए broker/bot में auto order लग जाएगा।
SL और Target levels भी इसी तरह alerts से manage होंगे।
Use Case:
Manual level-based intraday या positional trading
Automated trading setup (via TradingView alerts → Webhook → Broker API)
Put/Call entry, target, SL को clearly visualize और monitor करना
Disclaimer:
यह indicator trading automation tool नहीं है। Actual buy/sell orders Pine Script से नहीं लग सकते। Order execution केवल TradingView Alerts और external webhook के integration से ही possible है। कृपया पहले paper-trade और test करें।
7:00-9:30 ET High/LowThis indicator is designed to identify and plot the highest and lowest price levels within the 7:00 AM to 9:30 AM Eastern Time (ET) trading window. These levels are then extended throughout the trading day, providing clear visual references for potential support and resistance derived from the early morning price action.
Core Functionality
The script defines a specific trading session (7:00-9:30 ET) and tracks the highest high and lowest low price reached during that time. Once the session is over, these high and low lines remain on the chart for the rest of the day, acting as key levels for traders to watch. At the start of each new trading day, the indicator resets, clearing the previous day's lines and drawing new ones based on the current day's morning session.
Features and Customization
This indicator is fully customizable through the settings menu, allowing you to tailor the appearance to perfectly suit your chart layout.
Session High Line:
Customize the color, width, and line style (Solid, Dashed, Dotted).
Session High Label:
Set your own custom label text (e.g., "Morning High").
Customize the label's background color.
Customize the label's text color.
Adjust the text size.
Session Low Line:
Customize the color, width, and line style (Solid, Dashed, Dotted).
Session Low Label:
Set your own custom label text (e.g., "Morning Low").
Customize the label's background color.
Customize the label's text color.
Adjust the text size.
ET 7:00-9:30 AM High/Low (Customizable Trendlines)This indicator automatically identifies and plots the high and low prices of the 7:00 AM to 9:30 AM Eastern Time trading session. It draws a single horizontal trend line for both the high and low, starting from the exact candlestick where the price was made and extending to the end of the session.
Features:
Precise Plotting: Plots a single, clean trend line for both the session high and low. The line begins precisely on the candlestick where the high or low was reached and extends horizontally to the end of the session.
Customizable Time: The indicator is set to plot the 7:00 AM to 9:30 AM ET session by default but can be easily adjusted by the user in the settings. The time zone is set to UTC-4 to correctly account for Eastern Daylight Time.
Style and Color Customization: Users can change the line style to solid, dotted, or dashed, and choose their preferred colors and width for both the high and low lines.
Price Labels: A toggleable option to display price labels at the end of each line, making it easy to see the exact high and low values at a glance.
Small-Cap — Sell Every Spike (Rendon1) Small-Cap — Sell Every Spike v6 — Strict, No Look-Ahead
Educational use only. This is not financial advice or a signal service.
This strategy targets low/ mid-float runners (≤ ~20M) that make parabolic spikes. It shorts qualified spikes and scales out into flushes. Logic is deliberately simple and transparent to avoid curve-fit.
What the strategy does
Detects a parabolic up move using:
Fast ROC over N bars
Big range vs ATR
Volume spike vs SMA
Fresh higher high (no stale spikes)
Enters short at bar close when conditions are met (no same-bar fills).
Manages exits with ATR targets and optional % covers.
Tracks float rotation intraday (manual float input) and blocks trades above a hard limit.
Draws daily spike-high resistance from confirmed daily bars (no repaint / no look-ahead).
Timeframes & market
Designed for 1–5 minute charts.
Intended for US small-caps; turn Premarket on.
Works intraday; avoid illiquid tickers or names with constant halts.
Entry, Exit, Risk (short side)
Entry: parabolic spike (ROC + Range≥ATR×K + Vol≥SMA×K, new HH).
Optional confirmations (OFF by default to “sell every spike”): upper-wick and VWAP cross-down.
Stop: ATR stop above entry (default 1.2× ATR).
Targets: TP1 = 1.0× ATR, TP2 = 2.0× ATR + optional 10/20/30% covers.
Safety: skip trades if RVOL is low or Float Rotation exceeds your limit (default warn 5×, hard 7×).
Inputs (Balanced defaults)
Price band: $2–$10
Float Shares: set per ticker (from Finviz).
RVOL(50) ≥ 1.5×
ROC(5) ≥ 1.0%, Range ≥ 1.6× ATR, Vol ≥ 1.8× SMA
Cooldown: 10 bars; Max trades/day: 6
Optional: Require wick (≥35%) and/or Require VWAP cross-down.
Presets suggestion:
• Balanced (defaults above)
• Safer: wick+VWAP ON, Range≥1.8×, trades/day 3–4
• Micro-float (<5M): ROC 1.4–1.8%, Range≥1.9–2.2×, Vol≥2.2×, RVOL≥2.0, wick 40–50%
No look-ahead / repaint notes
Daily spike-highs use request.security(..., lookahead_off) and shifted → only closed daily bars.
Orders arm next bar after entry; entries execute at bar close.
VWAP/ATR/ROC/Vol/RVOL are computed on the chart timeframe (no HTF peeking).
How to use
Build a watchlist: Float <20M, RelVol >2, Today +20% (Finviz).
Open 1–5m chart, enter Float Shares for the ticker.
Start with Balanced, flip to Safer on halty/SSR names or repeated VWAP reclaims.
Scale out into flushes; respect the stop and rotation guard.
Limitations & risk
Backtests on small-caps can be optimistic due to slippage, spreads, halts, SSR, and limited premarket data. Always use conservative sizing. Low-float stocks can squeeze violently.
Alerts
Parabolic UP (candidate short)
SHORT Armed (conditions met; entry at bar close)
High Volume Candle Zones (Neutral)contact me i can give you want more information. you can spot patterns and key area are marked automatically to chart
High-and-Tight Impulse + Micro ConsolidationThis indicator detects a specific bullish continuation setup on daily charts:
- An impulse move (X% rise within N bars, mostly green candles)
- Immediately followed by a tight consolidation (small ranges, small bodies)
- Closes holding in the top zone of the impulse
On the chart, signals are plotted as orange dots above bars.
Labels show the last detected setup date, and a counter displays total matches in history.
Useful for backtesting "high-and-tight flag" type momentum patterns or any symbol.
Adjust inputs (impulse % threshold, bars, ATR ratios, top zone %) to make it stricter or looser.
Alerts are included when a new setup is detected.
This tool is not financial advice. For educational and research purposes only.
by fiyatherseydir
Supertrend0913This Pine Script (`@version=6`) combines **two Supertrend indicators** and a set of **moving averages (EMA & MA)** into one overlay chart tool for TradingView.
**Key features:**
* **Supertrend \ & \ :**
* Each has independent ATR period, multiplier, and ATR calculation method.
* Plots trend lines (green/red for \ , blue/yellow for \ ).
* Generates **buy/sell signals** when trend direction changes.
* Includes **alert conditions** for buy, sell, and trend reversals.
* **Moving Averages:**
* 6 EMAs (lengths 21, 55, 100, 200, 300, 400).
* 5 SMAs (lengths 11, 23, 25, 39, 200).
* Each plotted in different colors for trend visualization.
👉 In short: it’s a **combined trading tool** that overlays two configurable Supertrend systems with alerts plus multiple EMAs/SMAs to help identify trend direction, signals, and potential entry/exit points.
Profit booking Indicatorell signal when RSI < 40, MACD crosses zero or signal line downward in negative zone, close below 50 EMA, candle bearish.
Strong sell signal confirmed on 5-minute higher timeframe with same conditions.
Square off half/full signals as defined.
Target lines drawn bold based on previous swing lows and extended as described.
Blue candle color when RSI below 30.
One sell and one full square off per cycle, blocking repeated sells until full square off.
Big Player Buy/Sell SignalHow It Works:
Detects volume spikes over SMA of recent volume.
Signals a buy if there’s a green candle near a recent swing low on high volume (possible big player accumulation).
Signals a sell if there’s a red candle near a swing high on high volume (possible big player distribution).
This is a proxy, not a direct measure of institutional trades, but it often works surprisingly well in liquid markets like Nifty 50 or Bank Nifty.
If you want, I can make an advanced version that combines RSI, EMA, and first occurrence detection for higher accuracy in catching big player moves.
ICT Sweeps + FVG🔹 What is an iFVG?
• FVG → imbalance left by displacement (big move).
• iFVG (Inversion FVG) → when price returns to that gap later and flips it:
• Bullish FVG (support) → broken → becomes resistance = bearish iFVG.
• Bearish FVG (resistance) → broken → becomes support = bullish iFVG.
That’s why ICT often says “FVG becomes inversion when violated”.
⸻
🔹 Why You Don’t See FVG/iFVG Now
• The script you’re using only coded sweeps (BSS/SSL).
• It didn’t include the logic to:
1. Detect displacement candles.
2. Mark the FVG zone.
3. Flip it if price trades through → iFVG.
Hazel nut BB Strategy, volume base- lite versionHazel nut BB Strategy, volume base — lite version
Having knowledge and information in financial markets is only useful when a trader operates with a well-defined trading strategy. Trading strategies assist in capital management, profit-taking, and reducing potential losses.
This strategy is built upon the core principle of supply and demand dynamics. Alongside this foundation, one of the widely used technical tools — the Bollinger Bands — is employed to structure a framework for profit management and risk control.
In this strategy, the interaction of these tools is explained in detail. A key point to note is that for calculating buy and sell volumes, a lower timeframe function is used. When applied with a tick-level resolution, this provides the most precise measurement of buyer/seller flows. However, this comes with a limitation of reduced historical depth. Users should be aware of this trade-off: if precise tick-level data is required, shorter timeframes should be considered to extend historical coverage .
The strategy offers multiple configuration options. Nevertheless, it should be treated strictly as a supportive tool rather than a standalone trading system. Decisions must integrate personal analysis and other instruments. For example, in highly volatile assets with narrow ranges, it is recommended to adjust profit-taking and stop-loss percentages to smaller values.
◉ Volume Settings
• Buyer and seller volume (up/down volume) are requested from a lower timeframe, with an option to override the automatic resolution.
• A global lookback period is applied to calculate moving averages and cumulative sums of buy/sell/delta volumes.
• Ratios of buyers/sellers to total volume are derived both on the current bar and across the lookback window.
◉ Bollinger Band
• Bands are computed using configurable moving averages (SMA, EMA, RMA, WMA, VWMA).
• Inputs allow control of length, standard deviation multiplier, and offset.
• The basis, upper, and lower bands are plotted, with a shaded background between them.
◉ Progress & Proximity
• Relative position of the price to the Bollinger basis is expressed as percentages (qPlus/qMinus).
• “Near band” conditions are triggered when price progress toward the upper or lower band exceeds a user-defined threshold (%).
• A signed score (sScore) represents how far the close has moved above or below the basis relative to band width.
◉ Info Table
• Optional compact table summarizing:
• - Upper/lower band margins
• - Buyer/seller volumes with moving averages
• - Delta and cumulative delta
• - Buyer/seller ratios per bar and across the window
• - Money flow values (buy/sell/delta × price) for bar-level and summed periods
• The table is neutral-colored and resizable for different chart layouts.
◉ Zone Event Gate
• Tracks entry into and exit from “near band” zones.
• Arming logic: a side is armed when price enters a band proximity zone.
• Trigger logic: on exit, a trade event is generated if cumulative buyer or seller volume dominates over a configurable window.
◉ Trading Logic
• Orders are placed only on zone-exit events, conditional on volume dominance.
• Position sizing is defined as a fixed percentage of strategy equity.
• Long entries occur when leaving the lower zone with buyer dominance; short entries occur when leaving the upper zone with seller dominance.
◉ Exit Rules
• Open positions are managed by a strict priority sequence:
• 1. Stop-loss (% of entry price)
• 2. Take-profit (% of entry price)
• 3. Opposite-side event (zone exit with dominance in the other direction)
• Stop-loss and take-profit levels are configurable
◉ Notes
• This lite version is intended to demonstrate the interaction of Bollinger Bands and volume-based dominance logic.
• It provides a framework to observe how price reacts at band boundaries under varying buy/sell pressure, and how zone exits can be systematically converted into entry/exit signals.
When configuring this strategy, it is essential to carefully review the settings within the Strategy Tester. Ensure that the chosen parameters and historical data options are correctly aligned with the intended use. Accurate back testing depends on applying proper configurations for historical reference. The figure below illustrates sample result and configuration type.
GC Checklist Signals (All TF, v6 • SR-safe • Clean blocks)GC (COMEX Gold) checklist strategy with a 3:1 reward-to-risk to your training bot. It enforces the following rules:
Heiken Ashi chart logic for color, wicks, and doji detection
100-EMA filter (only buys above / sells below)
Market structure: higher-low above EMA for buys; lower-high below EMA for sells (simple pivot check)
Clean pullback: at least 2 opposite-color candles; clean = no top wicks (buys) / no bottom wicks (sells)
Entry: on high-volume doji (body ≤ ~12% of range and volume ≥ last 1–3 candles), as soon as it closes
Stops: sell = above doji high; buy = below doji low
Fractal FU//@version=5
indicator("Fractal FU", shorttitle="Fractal FU", overlay=true, max_labels_count=500)
// ===== Inputs
showBull = input.bool(true, "Show aligned bullish balls")
showBear = input.bool(true, "Show aligned bearish balls")
bullCol = input.color(color.blue, "Bull ball color")
bearCol = input.color(color.red, "Bear ball color")
ballSize = input.string("small", "Ball size", options= )
gateTo15 = input.bool(true, "Gate to 15m close (clean, fewer signals)")
showDebug = input.bool(false, "Show per-timeframe debug dots")
// ===== Helpers
// one-liner you asked for:
f_sig(res) => request.security(syminfo.tickerid, res, (high > high and low < low ) ? (close > open ? 1 : close < open ? -1 : 0) : 0, barmerge.gaps_off, barmerge.lookahead_off)
// Pull confirmed signals from each TF
sig1 = f_sig("1")
sig5 = f_sig("5")
sig10 = f_sig("10")
sig15 = f_sig("15")
// Alignment (all four agree)
bullAll = showBull and (sig1 == 1 and sig5 == 1 and sig10 == 1 and sig15 == 1)
bearAll = showBear and (sig1 == -1 and sig5 == -1 and sig10 == -1 and sig15 == -1)
// Emit control
emit15 = ta.change(time("15"))
emit = gateTo15 ? emit15 : barstate.isconfirmed // if not gated, show wherever alignment is true
// ===== Debug (tiny dots at bar to verify which TFs are firing)
plotshape(showDebug and sig1 == 1, title="1m bull", style=shape.circle, size=size.tiny, color=color.new(color.blue, 0), location=location.bottom)
plotshape(showDebug and sig5 == 1, title="5m bull", style=shape.circle, size=size.tiny, color=color.new(color.aqua, 0), location=location.bottom)
plotshape(showDebug and sig10 == 1, title="10m bull", style=shape.circle, size=size.tiny, color=color.new(color.teal, 0), location=location.bottom)
plotshape(showDebug and sig15 == 1, title="15m bull", style=shape.circle, size=size.tiny, color=color.new(color.navy, 0), location=location.bottom)
plotshape(showDebug and sig1 == -1, title="1m bear", style=shape.circle, size=size.tiny, color=color.new(color.red, 0), location=location.top)
plotshape(showDebug and sig5 == -1, title="5m bear", style=shape.circle, size=size.tiny, color=color.new(color.orange, 0), location=location.top)
plotshape(showDebug and sig10 == -1, title="10m bear", style=shape.circle, size=size.tiny, color=color.new(color.maroon, 0), location=location.top)
plotshape(showDebug and sig15 == -1, title="15m bear", style=shape.circle, size=size.tiny, color=color.new(color.purple, 0), location=location.top)
// ===== Markers (size must be const → gate each size)
off = gateTo15 ? -1 : 0 // when gated, place on the just-closed 15m bar
// ── Marker offset control stays the same ──
off2 = gateTo15 ? -1 : 0
// ── Bullish balls exactly at LOW ──
plot(bullAll and emit and ballSize == "tiny" ? low : na, title="Bullish tiny", style=plot.style_circles, color=bullCol, linewidth=1, offset=off2)
plot(bullAll and emit and ballSize == "small" ? low : na, title="Bullish small", style=plot.style_circles, color=bullCol, linewidth=2, offset=off2)
plot(bullAll and emit and ballSize == "normal" ? low : na, title="Bullish normal", style=plot.style_circles, color=bullCol, linewidth=3, offset=off2)
plot(bullAll and emit and ballSize == "large" ? low : na, title="Bullish large", style=plot.style_circles, color=bullCol, linewidth=4, offset=off2)
plot(bullAll and emit and ballSize == "huge" ? low : na, title="Bullish huge", style=plot.style_circles, color=bullCol, linewidth=5, offset=off2)
// ── Bearish balls exactly at HIGH ──
plot(bearAll and emit and ballSize == "tiny" ? high : na, title="Bearish tiny", style=plot.style_circles, color=bearCol, linewidth=1, offset=off2)
plot(bearAll and emit and ballSize == "small" ? high : na, title="Bearish small", style=plot.style_circles, color=bearCol, linewidth=2, offset=off2)
plot(bearAll and emit and ballSize == "normal" ? high : na, title="Bearish normal", style=plot.style_circles, color=bearCol, linewidth=3, offset=off2)
plot(bearAll and emit and ballSize == "large" ? high : na, title="Bearish large", style=plot.style_circles, color=bearCol, linewidth=4, offset=off2)
plot(bearAll and emit and ballSize == "huge" ? high : na, title="Bearish huge", style=plot.style_circles, color=bearCol, linewidth=5, offset=off2)
// Alerts
alertcondition(bullAll and emit, title="Aligned Bullish Outside (1/5/10/15)", message="Aligned bullish outside bar on 1/5/10/15m")
alertcondition(bearAll and emit, title="Aligned Bearish Outside (1/5/10/15)", message="Aligned bearish outside bar on 1/5/10/15m")
alertcondition((bullAll or bearAll) and emit, title="Aligned Any (1/5/10/15)", message="Aligned outside bar (bull or bear) on 1/5/10/15m")
Hidden Divergence with S/R & TP// This source code is subject to the terms of the Mozilla Public License 2.0 at mozilla.org
// © Gemini
// @version=5
// This indicator combines Hidden RSI Divergence with Support & Resistance detection
// and provides dynamic take-profit targets based on ATR. It also includes alerts.
indicator("Hidden Divergence with S/R & TP", overlay=true)
// === INPUTS ===
rsiLengthInput = input.int(14, "RSI Length", minval=1)
rsiSMALengthInput = input.int(5, "RSI SMA Length", minval=1)
pivotLookbackLeft = input.int(5, "Pivot Left Bars", minval=1)
pivotLookbackRight = input.int(5, "Pivot Right Bars", minval=1)
atrPeriodInput = input.int(14, "ATR Period", minval=1)
atrMultiplierTP1 = input.float(1.5, "TP1 ATR Multiplier", minval=0.1)
atrMultiplierTP2 = input.float(3.0, "TP2 ATR Multiplier", minval=0.1)
atrMultiplierTP3 = input.float(5.0, "TP3 ATR Multiplier", minval=0.1)
// === CALCULATIONS ===
// Calculate RSI and its SMA
rsiValue = ta.rsi(close, rsiLengthInput)
rsiSMA = ta.sma(rsiValue, rsiSMALengthInput)
// Calculate Average True Range for Take Profits
atrValue = ta.atr(atrPeriodInput)
// Identify pivot points for Support and Resistance
pivotLow = ta.pivotlow(pivotLookbackLeft, pivotLookbackRight)
pivotHigh = ta.pivothigh(pivotLookbackLeft, pivotLookbackRight)
// Define variables to track divergence and TP levels
var bool bullishDivergence = false
var bool bearishDivergence = false
var float tp1Buy = na
var float tp2Buy = na
var float tp3Buy = na
var float tp1Sell = na
var float tp2Sell = na
var float tp3Sell = na
// Reset divergence flags at each new bar
bullishDivergence := false
bearishDivergence := false
// === HIDDEN DIVERGENCE LOGIC ===
// Hidden Bullish Divergence (Higher low in price, lower low in RSI)
// Price makes a higher low, while RSI makes a lower low, suggesting trend continuation.
for i = 1 to 50 // Look back up to 50 bars for a confirmed pivot low
if not na(pivotLow ) and close < close and rsiValue < rsiValue
// Check if price is making a higher low than the pivot low, and RSI is making a lower low
if low > low and rsiValue < rsiValue
bullishDivergence := true
break // Exit loop once divergence is found
// Hidden Bearish Divergence (Lower high in price, higher high in RSI)
// Price makes a lower high, while RSI makes a higher high, suggesting trend continuation.
for i = 1 to 50 // Look back up to 50 bars for a confirmed pivot high
if not na(pivotHigh ) and close > close and rsiValue > rsiValue
// Check if price is making a lower high than the pivot high, and RSI is making a higher high
if high < high and rsiValue > rsiValue
bearishDivergence := true
break // Exit loop once divergence is found
// === SETTING TP LEVELS AND ALERTS ===
if bullishDivergence
buySignalPrice = low - atrValue * 0.5 // Entry below the low
tp1Buy := buySignalPrice + atrValue * atrMultiplierTP1
tp2Buy := buySignalPrice + atrValue * atrMultiplierTP2
tp3Buy := buySignalPrice + atrValue * atrMultiplierTP3
// Alert for buying signal
alert("Hidden Bullish Divergence Detected on " + syminfo.ticker + " - Buy Signal", alert.freq_once_per_bar_close)
else
tp1Buy := na
tp2Buy := na
tp3Buy := na
if bearishDivergence
sellSignalPrice = high + atrValue * 0.5 // Entry above the high
tp1Sell := sellSignalPrice - atrValue * atrMultiplierTP1
tp2Sell := sellSignalPrice - atrValue * atrMultiplierTP2
tp3Sell := sellSignalPrice - atrValue * atrMultiplierTP3
// Alert for selling signal
alert("Hidden Bearish Divergence Detected on " + syminfo.ticker + " - Sell Signal", alert.freq_once_per_bar_close)
else
tp1Sell := na
tp2Sell := na
tp3Sell := na
// === PLOTTING SIGNALS AND TAKE PROFITS ===
// Plotting shapes for buy/sell signals
plotshape(bullishDivergence, title="Buy Signal", style=shape.triangleup, location=location.belowbar, color=color.new(color.green, 0), text="Buy", textcolor=color.black)
plotshape(bearishDivergence, title="Sell Signal", style=shape.triangledown, location=location.abovebar, color=color.new(color.red, 0), text="Sell", textcolor=color.black)
// Plotting take-profit lines
plot(tp1Buy, "TP1 Buy", color=color.new(color.lime, 0), style=plot.style_linebr)
plot(tp2Buy, "TP2 Buy", color=color.new(color.lime, 0), style=plot.style_linebr)
plot(tp3Buy, "TP3 Buy", color=color.new(color.lime, 0), style=plot.style_linebr)
plot(tp1Sell, "TP1 Sell", color=color.new(color.orange, 0), style=plot.style_linebr)
plot(tp2Sell, "TP2 Sell", color=color.new(color.orange, 0), style=plot.style_linebr)
plot(tp3Sell, "TP3 Sell", color=color.new(color.orange, 0), style=plot.style_linebr)
// Plotting the RSI and its SMA on a sub-pane
plot(rsiValue, "RSI", color.new(color.fuchsia, 0))
plot(rsiSMA, "RSI SMA", color.new(color.yellow, 0))
hline(50, "50 Midline", color=color.new(color.gray, 50))
// Plotting background for signals
bullishColor = color.new(color.green, 90)
bearishColor = color.new(color.red, 90)
bgcolor(bullishDivergence ? bullishColor : na, title="Bullish Divergence Zone")
bgcolor(bearishDivergence ? bearishColor : na, title="Bearish Divergence Zone")
// === EXPLANATION OF CONCEPTS ===
// Deep Knowledge of Market from AI:
// This indicator is based on a powerful, yet often misunderstood, concept: divergence.
// While standard divergence signals a potential trend reversal, hidden divergence signals a
// continuation of the prevailing trend. This is crucial for traders who want to capitalize
// on the momentum of a move rather than trying to catch tops and bottoms.
// Hidden Bullish Divergence: Occurs in an uptrend when price makes a higher low, but the
// RSI makes a lower low. This suggests that while there was a brief period of weakness, the
// underlying buying pressure is returning to push the trend higher. It’s a "re-energizing"
// of the bullish momentum.
// Hidden Bearish Divergence: Occurs in a downtrend when price makes a lower high, but the
// RSI makes a higher high. This indicates that while the sellers paused, the underlying
// selling pressure remains strong and is likely to continue pushing the price down. It's a
// subtle signal that the bears are regaining control.
// Combining Divergence with S/R: The true power of this indicator comes from its
// "confluence" principle. A divergence signal alone can be noisy. By requiring it to occur
// at a key support or resistance level (identified using pivot points), we are filtering
// out weaker signals and only focusing on high-probability setups where the market is
// likely to respect a previous area of interest. This tells us that not only is the trend
// likely to continue, but it is doing so from a strategic, well-defined point on the chart.
// Dynamic Take-Profit Targets: The take-profit targets are based on the Average True Range (ATR).
// ATR is a measure of market volatility. Using it to set targets ensures that your profit
// levels are dynamic and adapt to current market conditions. In a volatile market, your
// targets will be wider, while in a calm market, they will be tighter, helping you avoid
// unrealistic expectations and improving your risk management.