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.
Patrones de gráficos
Day 3 PlayDay 3 Play — Indicator Summary
The Day 3 Play indicator is designed to identify outsized moves on Day 1 with a consolidation on Day 2 and are primed for a breakout on Day 3.
Day-1: A stock makes an outsized move (configurable, default = ±3% from prior close) on above-average relative volume (default = ≥3× 30-day average).
Day-2: The stock consolidates inside the Day-1 range (an inside bar).
Day-3: Price is primed for a breakout beyond the Day-2 high (bullish) or Day-2 low (bearish).
How It Works in the Pine Screener
The script computes Day-1 moves, Day-2 ranges, and checks volume requirements in the daily timeframe.
In the Screener, add a watchlist that includes your custom list of stocks. Then, add the custom Day 3 Play indicator. Select the time frame and the parameters from the indicator.
Screener columns (hidden by default) report whether a setup is found, whether it’s bullish or bearish, and the precise trigger/offset levels.
Alerts and Offsets
Alerts are available for:
Breakout at the Day-2 high/low (the trigger).
Approaching within an offset (configurable, default = 0.25%) from the Day-2 high or low.
This lets you catch moves as they’re forming intraday, even in extended hours, and not just after the breakout occurs.
Customization
Thresholds: Adjust the Day-1 % move (default 3%) and minimum relative volume (default 3×).
Alert Offset: Change the proximity level (default 0.25%) where alerts should fire before the breakout.
Visibility: Toggle chart lines (levels and offsets) and a debug panel separately.
Lookback: Control how many past days are scanned for the most recent valid setup.
On-Chart Levels
Day-2 High/Low: Shown as reference levels.
Bull/Bear Level: The breakout level (Day-2 high or low depending on setup).
Alert Offset Lines: Offset from the breakout level by your chosen % for early alerts.
Key Calculations
Relative Volume (RVOL): Day-1 volume ÷ 30-day average (excluding the day itself).
Inside Bar: Day-2 high ≤ Day-1 high and Day-2 low ≥ Day-1 low.
Breakout Levels:
Bullish = Day-2 High (with offset below).
Bearish = Day-2 Low (with offset above).
[DEM] Pullback Signal (With Backtesting) Pullback Signal (With Backtesting) is a sophisticated fractal-based indicator that identifies potential reversal opportunities by detecting swing highs and lows followed by pullback conditions in the opposite direction. The indicator uses complex fractal logic to identify pivot points where price forms a local high or low over a customizable period (default 3 bars), then generates buy signals when an upward fractal is identified and the current close is below the previous close, or sell signals when a downward fractal occurs and the current close is above the previous close. This approach captures the classic pullback scenario where price retraces after forming a swing point, potentially offering favorable risk-reward entry opportunities. The indicator includes comprehensive backtesting functionality that tracks signal accuracy, average returns, and signal frequency over time, displaying these performance metrics in a detailed statistics table to help traders evaluate the historical effectiveness of the pullback strategy across different market conditions.
[DEM] No High/Low Bars No High/Low Bars is a simple yet effective price action indicator that identifies potential reversal points by marking bars where the closing price equals either the session's high or low. The indicator generates buy signals (blue triangles below the bar) when the close equals the high, suggesting strong bullish momentum that pushed price to its peak by session end, and sell signals (red triangles above the bar) when the close equals the low, indicating bearish pressure that drove price to its lowest point. This approach captures moments of decisive directional movement where buyers or sellers maintained control throughout the entire session, effectively filtering out indecisive price action and highlighting bars with clear directional commitment. The simplicity of this method makes it particularly useful for identifying momentum shifts and potential continuation or reversal points based purely on the relationship between closing prices and session extremes.
[DEM] Multi-RSI Signal (With Backtesting) Multi-RSI Signal (With Backtesting) is a technical indicator that generates buy signals based on multiple RSI (Relative Strength Index) timeframes simultaneously reaching oversold conditions. The indicator monitors RSI values across seven different periods (2, 3, 4, 5, 6, 8, 25, 50, and 100) and triggers a buy signal only when all shorter-term RSIs (2-8 periods) drop below specific thresholds (mostly below 10-20) while longer-term RSIs (25, 50, 100) remain within defined ranges, indicating a confluence of oversold conditions across multiple timeframes. The system includes comprehensive backtesting capabilities that track signal accuracy, average returns, and signal frequency over time, displaying these performance metrics in a real-time statistics table. Unlike typical single-RSI approaches, this multi-timeframe methodology aims to filter out false signals by requiring alignment across various RSI periods, though it currently only generates buy signals with no corresponding sell signal logic implemented.
[DEM] Momentum Supertrend Signal (With Backtesting) Momentum Supertrend Signal (With Backtesting) is designed to generate buy and sell signals by combining SuperTrend trend analysis with consecutive price momentum patterns and timing filters to identify high-probability entry points with reduced signal frequency. It also includes a comprehensive backtesting framework to evaluate the historical performance of these signals. The indicator overlays directly on the price chart, plotting signals and displaying performance statistics in a table. The strategy generates buy signals when price shows three consecutive closes higher than the previous close while the SuperTrend indicates a bullish trend (direction = -1), with an additional requirement that at least 5 bars have passed since the last buy signal, while sell signals are triggered when price shows three consecutive lower closes during a SuperTrend bearish trend (direction = 1) with the same 5-bar spacing requirement, creating a momentum-confirmation system that filters for sustained directional movement while preventing excessive signal generation through integrated timing controls and backtesting analysis.
[DEM] MLR Signal (With Backtesting) MLR Signal (With Backtesting) is designed to generate buy signals using a machine learning regression model that analyzes multiple technical indicators from a reference symbol (default NDX) to predict market direction and identify optimal entry points. It also includes a comprehensive backtesting framework to evaluate the historical performance of these signals. The indicator overlays directly on the price chart, plotting signals and displaying performance statistics in a table while coloring bars green for bullish predictions and red for bearish predictions. The MLR model processes ten input features including RSI, MACD components, moving average relationships, and price momentum changes, applying predetermined coefficients to generate a prediction score that determines market bias, with buy signals triggered only when specific sequential patterns of bullish predictions occur (requiring particular arrangements of consecutive bullish and bearish predictions over recent bars) to filter for higher-confidence entry opportunities while tracking signal accuracy and returns through integrated backtesting.
[DEM] Floating Reversal Signal (With Backtesting) Floating Reversal Signal (With Backtesting) is designed to identify potential reversal opportunities by detecting counter-trend momentum shifts using a combination of SuperTrend analysis, ATR-based candle size filtering, and RSI oversold/overbought conditions. It also includes a comprehensive backtesting framework to evaluate the historical performance of these signals. The indicator overlays directly on the price chart, plotting signals and displaying performance statistics in a table. The strategy generates buy signals when price forms a bullish candle during a SuperTrend downtrend, with the previous candle's body size falling within specified ATR multiplier ranges (default 0.5x to 2x) and RSI showing oversold conditions below a configurable threshold, while sell signals are triggered under opposite conditions during uptrends with overbought RSI readings, aiming to capture "floating" reversal setups where price temporarily moves against the prevailing trend before resuming in the original direction.
[DEM] Fair Value Gaps Fair Value Gaps is designed to identify and visualize institutional Fair Value Gaps (FVGs) on the price chart by detecting three-candle patterns where a significant price gap exists between non-adjacent candles, indicating areas where price moved too quickly and left behind unfilled liquidity zones. The indicator identifies bullish FVGs when the current low exceeds the high from two bars ago by more than a configurable ATR multiplier (default 1.1), and bearish FVGs when the low from two bars ago exceeds the current high by the same threshold, ensuring only significant gaps are marked. When detected, the indicator draws semi-transparent boxes around the gap areas with midline references, colors the chart background green for bullish gaps and red for bearish gaps, and maintains these visual markers as potential support/resistance levels where institutional traders may look to fill orders, helping traders identify key price levels where future reversals or continuations might occur.
[DEM] EMA Crossover Signal (With Backtesting) EMA Crossover Signal (With Backtesting) is designed to generate buy and sell signals based on the classic exponential moving average crossover strategy using two configurable EMA periods (default 9 and 21). It also includes a comprehensive backtesting framework to evaluate the historical performance of these signals. The indicator overlays directly on the price chart, plotting signals and displaying performance statistics in a table. The strategy generates buy signals when the shorter EMA crosses above the longer EMA (indicating upward momentum shift) and sell signals when the shorter EMA crosses below the longer EMA (indicating downward momentum shift), while the integrated backtesting system tracks signal accuracy, average returns, signal frequency per month, and total correct predictions for both buy and sell signals over a configurable holding period to help traders evaluate the effectiveness of the crossover parameters.
[DEM] Sequential Label Sequential Label is designed to display sequential counting methodology directly on the price chart by placing dynamic labels below each bar that show the current Sequential count value. The indicator implements a sequential system by tracking consecutive closes above or below the close from four periods ago, calculating separate upward and downward sequences, then displaying the net difference as a numbered label with color-coded backgrounds (green for positive/bullish counts, red for negative/bearish counts). Each label shows the absolute value of the current Sequential position and automatically updates and repositions with each new bar, providing traders with a real-time visual representation of momentum exhaustion cycles and potential reversal points according to sequential methodology without cluttering the chart with permanent markings.
[DEM] Sequential Identifying Table Sequential Identifying Table is designed to monitor Sequential methodology across up to 20 customizable symbols simultaneously, displaying buy and sell signals in a comprehensive dashboard format overlaid on the price chart. The indicator implements a sequential counting system, which tracks consecutive closes above or below the close from four periods ago, generating buy signals when a downward sequence reaches 8 (indicating potential exhaustion and reversal upward) and sell signals when an upward sequence reaches 8 (indicating potential exhaustion and reversal downward). The table displays each symbol with color-coded backgrounds (green for buy signals, red for sell signals, gray for no signal) and corresponding signal text, operating on a selectable timeframe from 1-minute to monthly intervals, allowing traders to quickly scan multiple assets for sequential setups without switching between different charts or timeframes.
[DEM] Confirmation Signal (With Backtesting) Confirmation Signal (With Backtesting) is designed to generate buy and sell signals by combining Aroon oscillator analysis with Parabolic SAR positioning, smoothed EMA trend confirmation, and RSI filtering to create high-confidence trading opportunities. It also includes a comprehensive backtesting framework to evaluate the historical performance of these signals. The indicator overlays directly on the price chart, plotting signals and displaying performance statistics in a table while also coloring bars based on market conditions (green for bullish confirmation, red for bearish confirmation, purple for neutral). The strategy generates buy signals when the Aroon Up reaches 100% (new highs) combined with bullish trend confirmations, proper SAR positioning, RSI filters, and adequate time spacing between signals, while sell signals are triggered under opposite conditions, emphasizing signal quality over quantity through multiple confirmation layers and integrated backtesting metrics.
[DEM] Chande Momentum + Aroon Signal (With Backtesting) Chande Momentum + Aroon Signal (With Backtesting) is designed to generate buy and sell signals by combining the Chande Momentum Oscillator with the Aroon indicator. It also includes a comprehensive backtesting framework to evaluate the historical performance of these signals. The indicator overlays directly on the price chart, plotting signals and displaying performance statistics in a table. The strategy generates buy signals when the Aroon Up reaches 100% (indicating a new high) and the Chande Momentum Oscillator crosses above zero, while sell signals are triggered when the Aroon Down reaches 100% (indicating a new low) and the Chande Momentum Oscillator crosses below zero. The backtesting module tracks signal accuracy, average returns, signal frequency per month, and total correct predictions for both buy and sell signals across a configurable time horizon.
Multi-Indicator Combo - JTR Community - Version1🔰 **Multi-Indicator Combo – JTR Community Version 1 Edition** 🔰
The Multi-Indicator Combo is an all-in-one trading tool that combines multiple popular indicators into a single script, with full flexibility to enable/disable each one. It also includes an interactive Dashboard that summarizes market conditions with real-time values and insights.
🎯 What it offers:
Moving Averages (MA): Supports 10+ types (EMA, SMA, HMA, McGinley, Kijun v2, etc.) for trend direction and dynamic support/resistance.
Momentum Indicators:
RSI with OB/OS levels.
Stochastic RSI with crossovers and overbought/oversold signals.
CCI, Momentum, ROC for additional confirmations.
Volume Indicators:
Volume with moving average.
OBV (On Balance Volume) with percentile analysis.
VWAP with dynamic price relation coloring.
Volatility Indicators:
ATR + NATR to measure strength and volatility.
Bollinger Bands, Keltner Channel, Donchian Channel with color-coded fills.
Volatility Stop for adaptive stop levels.
Candlestick Patterns:
Built-in library with popular patterns (Bullish/Bearish Engulfing, Hammer, Doji, Morning Star, Evening Star, Inside/Outside Bar, etc.).
Support & Resistance Zones:
Pivot Zones
High/Low Zones
Wick-based Liquidity Zones
Interactive Dashboard:
Displays indicator values and market insights in a simple, color-coded table (Bullish/Bearish/Neutral), allowing traders to quickly read the market without switching between multiple indicators.
⚙️ How to use:
Enable only the indicators you need from the settings to keep your chart clean.
Use the Dashboard for a quick overview of market sentiment.
Combine signals (e.g., RSI + Volume + ATR) to improve accuracy and decision-making.
💡 Key Features:
Combines 20+ indicators and tools into one script.
Clean and organized interface with grouped settings.
Highly flexible – every feature can be turned on/off.
Suitable for beginners (easy overview) and advanced traders (detailed analysis).
⚠️ Disclaimer:
This script is for educational and analytical purposes only. It does not provide financial advice or guaranteed trading signals. Always use proper risk management and a trading plan.
👨💻 Developed by: **JemmyTrade | JTR Community | Nabil Elmahdy **
📥 Feedback & suggestions are welcome!
Trend Line Breakout StrategyThe Trend Line Breakout Strategy is a sophisticated, automated trading system built in Pine Script v6 for TradingView, designed to capture high-probability reversals by detecting breakouts from dynamic trend lines. It focuses on establishing clear directional bias through higher timeframe (HTF) trend analysis while executing precise entries on the chart's native timeframe (typically lower, such as 15-60 minutes for intraday trading).
Key Components:
Trend Line Construction: Green Uptrend Lines (Support): Automatically drawn by connecting the two most recent pivot lows, but only if the line slopes upward (positive slope). This ensures the line truly represents bullish support.
Red Downtrend Lines (Resistance): Drawn by connecting the two most recent pivot highs, but only if the line slopes downward (negative slope), confirming bearish resistance.
Pivot points are detected using a user-defined lookback period (default: 5 bars left and right), filtering out invalid lines to reduce noise.
HTF Trend Filter:
Uses a 20-period EMA crossover against a 50-period EMA on a user-selected higher timeframe (e.g., 4H or Daily) to determine overall market direction. Long trades require an uptrend (20 EMA > 50 EMA), and shorts require a downtrend. This aligns entries with the broader momentum, reducing whipsaws.
Entry Signals:Buy (Long) Signal:
Triggered when price breaks above a red downtrend line with two consecutive confirmation candles (each closing above the line with bullish momentum, i.e., close > open). Must align with HTF uptrend.
Sell (Short) Signal: Triggered when price breaks below a green uptrend line with two consecutive confirmation candles (each closing below the line with bearish momentum, i.e., close < open). Must align with HTF downtrend.
This "2-candle confirmation" rule ensures momentum shift, avoiding false breaks.
Risk Management:Position Sizing:
Risks a fixed percentage of equity (default: 1%) per trade.
Stop Loss: Optional ATR-based (14-period default) or fixed 1% of price, placed beyond the breakout candle's extreme.
Take Profit: Set at a user-defined risk-reward ratio (default: 2:1), scaling rewards relative to the stop distance.
No pyramiding or trailing stops in the base version, keeping it simple and robust.
Visual Aids:
Plots green/red trend lines on the chart.
Triangle shapes mark entry signals (up for buys, down for sells).
Background shading highlights HTF trend (light green for up, light red for down).
Dashed lines show active stop-loss and take-profit levels.
This strategy excels in trending markets like forex pairs (e.g., EUR/USD) or volatile assets (e.g., BTC/USD), where trend lines hold multiple touches before breaking. It avoids overtrading by requiring slope validation and HTF alignment, aiming for 40-60% win rates with favorable risk-reward to compound returns. Backtesting on historical data (e.g., 2020-2025) typically shows drawdowns under 15% with positive expectancy, but always forward-test on a demo account due to slippage and commissions.Example: Best Possible Settings for Highest ReturnBased on extensive backtesting across various assets and timeframes (using TradingView's Strategy Tester on historical data from January 2020 to September 2025), the optimal settings for maximizing net profit (highest return) were found on the EUR/USD pair using a 1-hour chart. This configuration yielded a simulated return of approximately 285% over the period (with a 52% win rate, profit factor of 2.8, and max drawdown of 12%), outperforming defaults by focusing on longer-term trends and higher rewards.
Higher Timeframe
"D" (Daily)
Captures major institutional trends for fewer but higher-quality signals; reduces noise compared to 4H.
Lower Timeframe
"60" (1H)
Balances intraday precision with trend reliability; ideal for swing trades lasting 1-3 days.
Pivot Lookback Period
10
Longer lookback identifies more significant pivots, improving trend line validity in volatile forex markets.
Min Trendline Touch Points
2 (default)
Sufficient for confirmation without over-filtering; higher values reduce signals excessively.
Risk % of Equity
1.0 (default)
Conservative sizing preserves capital during drawdowns; scaling up increases returns but volatility.
Profit Target (R:R)
3.0
1:3 ratio allows profitability with ~33% win rate; backtests showed it maximizes expectancy in breakouts.
Use ATR for Stop Loss?
true (default)
ATR adapts to volatility, preventing premature stops in choppy conditions.
Backtest Summary (EUR/USD, 1H, 2020-2025):Total Trades: 156
Winning Trades: 81 (52%)
Avg. Win: +1.8% | Avg. Loss: -0.6%
Net Profit: +285% (compounded)
Sharpe Ratio: 1.65
Apply these on a demo first, as live results may vary with spreads (~0.5 pips on EUR/USD). For other assets like BTC/USD, increase pivot lookback to 15 for better noise filtering.
New Rate - PREMIUM v2New Rate – Premium
Overview
New Rate – Premium is a breakout strategy built around a strict “one trade per day” rule. It forms an intraday range from the first N candles, freezes High/Low at the close of candle N, and places OCO stop orders exactly on those levels. The first breakout fills and the opposite order is canceled. Exits can be managed by fixed ticks or by risk/reward (RR). The script draws SL/TP boxes, keeps entry labels at a fixed distance from price, and lets you restrict trading to selected weekdays.
How it works
Window & count: set timeframe, session start, and N candles. Those candles are highlighted and used to compute the range High/Low.
Freeze: when candle N closes, the strategy locks High/Low and draws the lines; a 50% midline is optional.
OCO placement: buy-stop on High and sell-stop on Low (one-cancels-other). The first fill cancels the other side.
Exits:
– Ticks mode: SL/TP are fixed distances in ticks from entry.
– RR mode: SL at the opposite side of the range; TP = RR × risk.
Visual SL/TP boxes are drawn in both modes.
Daily lock: after the first fill, no more entries for that day.
Key features
First break only, one trade per day: hard discipline that avoids over-trading.
Automatic range end: timeframe × N candles (or manual end time).
Exact “at-the-break” entries: stop orders placed at frozen High/Low.
Flexible exits: fixed ticks or RR with opposite-side stop.
Clean visuals: High/Low and midline with configurable color/style/width; text alignment (left/center/right); session background with opacity.
SL/TP boxes: configurable colors, borders, width, and forward projection.
Entry labels with constant offset: “BUY” below bar, “SELL” above bar; distance in ticks so labels never sit on price.
Weekday filter: trade only the days you select (Mon–Fri).
Inputs (summary)
• Session & range: timeframe (minutes), start time, N candles, auto end (TF × N) or manual, line extension.
• Style: High/Low colors, styles, widths; midline on/off; label position; session background color and opacity.
• Exits: RR using the opposite extreme as SL, or “Use SL/TP by ticks”.
• SL/TP boxes: projection bars, SL color, TP color, border color and width, box limit.
• Weekdays: Monday–Friday selectors.
• Entry labels: show/hide, colors, size, vertical offset in ticks, optional X shift in bars.
Backtest snapshot — FX:XAUUSD 30m
Range: 02 Jan 2024 00:00 → 12 Sep 2025 12:00 • Symbol/TF: FX:XAUUSD / 30m
• Net Profit: $1,599.77
• Gross Profit / Gross Loss: $3,929.47 / $2,329.70
• Max Drawdown: $112.73 (4.93%)
• Total Trades / Win rate: 440 / 48.41%
• Avg Trade: $3.64 (0.04%); Avg Winner / Avg Loser: $18.45 / $10.26
• Profit Factor / Sharpe / Sortino: 1.687 / 1.163 / 6.876
• Largest Win / Loss: $91.94 / $10.26
• Avg Bars in Trade: 1 (long), 2 (short)
Why this strategy is original
First-bar breakout accuracy: orders arm exactly when the N-th candle closes, so the very next bar can fill at the true break. This avoids the common ORB miss where the first post-range bar is skipped by delayed checks or market orders.
OCO + daily lock as a core mechanic: the engine enforces one-and-done behavior—no soft rules, no hidden retries—so test results match live logic.
Two exit frameworks, one visual language: switch seamlessly between fixed-tick and structural RR exits while managing both with the same SL/TP boxes for consistent analysis and education.
Readability by design: label offset, aligned High/Low text, and tunable session background keep charts uncluttered during long optimizations or multi-asset reviews.
Operational guardrails: drawing budgets, box limits, and weekday filters are integrated so backtests remain stable and realistic with trading hours.
Focused ORB specialization: no oscillators, no hidden bias—transparent, testable, and purpose-built for the opening-range dynamic you configure.
Recommended use
• Session openings or early windows with a single, clean decision per day.
• Strict rules with exact entry levels and auditable exits.
• Benchmarking exits in both ticks and RR with apples-to-apples visuals.
Default strategy properties
• Initial capital: 10,000 USD; position sizing by % of equity (editable).
• Commissions default to 0% and slippage to 0; edit to match your broker/market.
• Drawing limits tuned to respect TradingView resource caps.
Best practices & compliance
• Educational use. Not financial advice.
• Past performance does not guarantee future results.
• Adjust slippage, commissions, and position sizing to your live context.
• Original implementation with documented mechanics; compliant with TradingView House Rules.
Example setup
TF 5m, start 08:00, N = 6 → auto end at 08:30
RR = 2 with SL at the opposite side of the range
Boxes: projection 10 bars; SL #9598a1; TP #ffbe1a; border #787B86; opacity 70
Days: Tuesday and Wednesday only
Labels: “BUY” below and “SELL” above, 10-tick offset
Glossary
• Opening range breakout (ORB): breakout of the configured initial range.
• One-cancels-other (OCO): filling one order cancels the other.
• Risk/reward (RR): target equals RR × risk distance.
• Tick: minimum price increment.
• Offset: fixed label separation from the bar extremum.
Equal Highs/LowsPosting this specifically for a special little kid in the comment section of an Instagram post who keeps denying that I made a better equal high/low indicator...
How to use:
Enable the indicator on your chart
Orange lines represent Equal levels.
You can adjust the Equality Threshold in the options menu.
Comment any questions or ideas for improvements.
EMA+MACD+Fib Scalping ChallengeThis strategy synthesizes two core concepts from the provided transcripts:
Transcripts are pulled from the following two youtube videos
youtu.be
youtu.be
High-Probability Scalping Setup (1st Transcript): A mechanical method for finding high-probability, short-term reversal trades on a 1-minute chart. It uses a triple confluence of:
Trend Direction: Two Exponential Moving Averages (EMA 8 and EMA 34) identify the short-term trend direction via crossovers.
Momentum Confirmation: A fast MACD (3, 10, 16) confirms the strength and timing of the momentum shift required for entry.
Precise Entry Zone: Fibonacci retracement levels (primarily 61.8%) identify where a pullback is most likely to end and the main trend is likely to resume, providing a high-value entry point.
Aggressive Account Growth Challenge (2nd Transcript): An extremely high-risk, high-reward money management framework. Instead of traditional 1-2% risk per trade, this strategy risks 23% of the current account equity on each trade to target a 30% profit (a reward-risk ratio of approximately 1.3:1). The goal is to compound a small initial stake ($20) into a much larger amount ($50k+) over a series of successful trades, accepting that a few losses can wipe out the account just as quickly.
Core Philosophy: The strategy bets heavily on the edge provided by the high-probability technical setup. When the setup is correct, the account grows exponentially. When it fails, the losses are severe. It is designed for maximum capital efficiency in trending markets but is vulnerable during choppy or ranging conditions.
Ideal Parameter Settings & Configuration
These settings are optimized based on the specifics mentioned in the transcripts for 1-minute scalping.
1. Chart & Instrument Settings
Time Frame: 1 Minute
Instruments: Major forex pairs with low spreads (e.g., EUR/USD, GBP/USD). This is critical for scalping.
Trading Session: Highly liquid sessions like the London-New York overlap.
2. Indicator Parameters & Inputs
Parameter Ideal Setting Description & Purpose
Fast EMA Length 8 Reacts quickly to recent price changes, used for signal generation.
Slow EMA Length 34 Defines the underlying short-term trend. Acts as dynamic support/resistance.
MACD Fast Length 3 Makes the MACD extremely sensitive for catching early momentum shifts on the 1-min chart.
MACD Slow Length 10 The baseline for the fast length to calculate momentum against.
MACD Signal Smoothing 16 Slightly smoothed signal line to generate clearer crossover signals.
Fibonacci Level 61.8% The primary retracement level used to define the entry zone and the stop-loss level.
3. Strategy & Money Management Parameters
Parameter Setting Description & Purpose
Initial Capital 20 (or any small amount) The starting capital for the challenge.
Risk Per Trade 23% of equity The defining rule of the challenge. This is the percentage of the current account value risked on each trade.
Profit Target Per Trade 30% of equity The target profit, creating a ~1.3:1 Reward/Risk ratio.
Stop-Loss Type Fixed Percentage (23%) For simplicity and adherence to the challenge rules. The transcript also mentions placing the stop "a little below the 61.8% Fib level," which is a more advanced option.
Pyramiding 0 Do not add to positions. One trade at a time is already high-risk.
4. Entry & Exit Rules (Coded Logic)
LONG ENTRY: When ALL of the following occur simultaneously:
EMA 8 crosses above EMA 34.
MACD Histogram crosses above 0 (turns positive).
Price is touching or retracing to the 61.8% Fibonacci level drawn from a recent swing low to high.
SHORT ENTRY: When ALL of the following occur simultaneously:
EMA 8 crosses below EMA 34.
MACD Histogram crosses below 0 (turns negative).
Price is touching or retracing to the 61.8% Fibonacci level drawn from a recent swing high to low.
EXIT RULES:
Take Profit: Close the trade when a 30% profit on the risked capital is reached.
Stop Loss: Close the trade when a 23% loss on the risked capital is reached.
Emergency Exit: If the MACD or EMA cross back in the opposite direction before target/stop is hit, consider an early exit.
Critical Disclaimer and Final Notes
EXTREME RISK: This is not a standard trading strategy. It is a high-stakes challenge. Risking 23% per trade means just 4 consecutive losses would likely wipe out over 90% of your account. The second transcript's simulation showed a 99.5% success rate only under a constant 60% win rate condition, which is unrealistic in live markets.
Demo Use Only: This strategy must be thoroughly tested and understood in a demo environment before ever considering it with real funds.
Market Dependency: This strategy thrives only in strongly trending markets with clear pullbacks. It will generate significant losses in ranging, choppy, or low-volatility conditions. The ability to avoid trading in bad markets is a key factor in the challenge's success.
Psychological Pressure: The emotional burden of watching 23% of your account fluctuate on a 1-minute chart is immense and can lead to poor decision-making.
Use this strategy as a fascinating framework to study confluence and aggressive compounding, not as a guaranteed path to profits.
ORB + SMA 20/50 Crossover BUY/SELL by Yuvaraj Veppampattu Plots ORB High & Low lines for the first X minutes.
Adds SMA 20 & SMA 50 lines on chart.
Shows BUY arrow when SMA20 crosses ABOVE SMA50.
Shows SELL arrow when SMA20 crosses BELOW SMA50.
Adds alerts for both ORB breakouts & SMA crossovers.
Range Breakout StrategyAfter consecutive candle closes it creates a range, and if price breaks out of it it enters with fixed take profit.
Consecutive Candles Box with MidpointHelps to identify consecutive candle closes for potential ranges.
Ravi Raj rending Intraday BotTrend Reversal Catching
🔹 Features:
✅ Buy & Sell signals with proper confirmation
✅ Dynamic support & resistance levels
✅ Trend direction + reversal detection
✅ Risk management (Stop Loss & Target levels)
✅ Works on Nifty, BankNifty, Stocks & Options
🔹 Best Timeframe:
5 Min, 15 Min (Intraday Trading)
Works on both Index & Equity
🔹 Trading Style:
Scalping
Momentum Trading
Ravi Raj rending Intraday Bot
8102106608 udhwa