EMAs Personalizáveis (até 5)📘 Indicator Explanation – Customizable EMAs (up to 5)
This indicator was developed in Pine Script v6 to make it easier to visualize multiple Exponential Moving Averages (EMAs) on a single chart.
🔑 Main features:
Supports up to 5 different EMAs.
Ability to enable or disable each EMA individually.
Fully customizable period for each EMA.
Flexible color selection for better visual organization.
Adjustable line thickness to highlight the most relevant levels.
📌 How to use:
Open the indicator settings.
Select which EMAs you want to display (from 1 to 5).
Define the period (e.g., 20, 50, 100, 200, etc.).
Choose a color for each EMA.
Observe price behavior relative to the EMAs to identify:
Trends → price above long EMAs indicates bullish strength.
Reversals → EMA crossovers may signal a change in direction.
Dynamic support and resistance → EMAs often act as reaction zones for price.
💡 Practical example:
Short EMA (20) → shows short-term movement.
Mid-term EMA (50 or 100) → confirms trend direction.
Long EMA (200 or 500) → indicates the overall market trend.
👉 This indicator is flexible and can be used for scalping, swing trading, or position trading, depending on the chosen periods.
Indikator dan strategi
Intraday Equal Peaks Levels (threshold immediate)//@version=6
indicator("Intraday Equal Peaks Levels (threshold immediate)", overlay=true, max_lines_count=500, max_labels_count=500)
// ===== INPUTS =====
leftBars = input.int(5, "Bars Left", minval=1)
rightBars = input.int(5, "Bars Right", minval=1)
marketType = input.string("Crypto", "Market Type", options= )
cryptoThresh = input.float(1.0, "Crypto Threshold %", minval=0.0, maxval=3.0, step=0.1)
stockThreshC = input.int(1, "Stocks Threshold (cents)", minval=0) // 1 -> 0.01 price units
showPanel = input.bool(true, "Show Equal Peaks Panel (top-right)")
// ===== DAY CHANGE =====
isNewDay = time("D") != time("D") // true on first bar of new calendar day
// ===== PIVOT DETECTION =====
pHigh = ta.pivothigh(high, leftBars, rightBars)
pLow = ta.pivotlow(low, leftBars, rightBars)
// ===== THRESHOLD CHECK =====
f_within_threshold(oldLevel, newLevel) =>
if marketType == "Stocks"
threshPrice = stockThreshC * 0.01
math.abs(newLevel - oldLevel) <= threshPrice
else
pct = oldLevel != 0 ? math.abs((newLevel - oldLevel) / oldLevel * 100.0) : 0.0
pct <= cryptoThresh
f_exceed_threshold(oldLevel, price) =>
if marketType == "Stocks"
threshPrice = stockThreshC * 0.01
math.abs(price - oldLevel) > threshPrice
else
pct = oldLevel != 0 ? math.abs((price - oldLevel) / oldLevel * 100.0) : 0.0
pct > cryptoThresh
// ===== STORAGE =====
var array arrLines = array.new_line()
var array arrPrices = array.new_float()
var array arrColors = array.new_color()
var array arrTypes = array.new_int() // 1 = resistance, -1 = support
// ===== HELPER: CLEAR ALL =====
f_clear_all() =>
if array.size(arrLines) > 0
for i = array.size(arrLines) - 1 to 0
ln = array.get(arrLines, i)
if not na(ln)
line.delete(ln)
array.clear(arrLines)
array.clear(arrPrices)
array.clear(arrColors)
array.clear(arrTypes)
// ===== RESET ON NEW DAY =====
if isNewDay
f_clear_all()
// ===== ADD PEAK (grouping logic) =====
f_add_peak(level, isRes) =>
grouped = false
targetType = isRes ? 1 : -1
if array.size(arrPrices) > 0
for i = 0 to array.size(arrPrices) - 1
if array.get(arrTypes, i) == targetType
oldLvl = array.get(arrPrices, i)
if f_within_threshold(oldLvl, level)
grouped := true
if array.get(arrColors, i) != color.yellow
array.set(arrColors, i, color.yellow)
lnobj = array.get(arrLines, i)
line.set_color(lnobj, color.yellow)
break
if not grouped
startBar = bar_index - rightBars
lncol = isRes ? color.red : color.green
ln = line.new(x1 = startBar, y1 = level, x2 = bar_index, y2 = level, xloc = xloc.bar_index, extend = extend.right, color = lncol, width = 2)
array.push(arrLines, ln)
array.push(arrPrices, level)
array.push(arrColors, lncol)
array.push(arrTypes, targetType)
// ===== DELETE LINES WHEN THRESHOLD EXCEEDED =====
if array.size(arrPrices) > 0
for i = array.size(arrPrices) - 1 to 0
lvl = array.get(arrPrices, i)
ln = array.get(arrLines, i)
if f_exceed_threshold(lvl, high) or f_exceed_threshold(lvl, low)
line.delete(ln)
array.remove(arrLines, i)
array.remove(arrPrices, i)
array.remove(arrColors, i)
array.remove(arrTypes, i)
// ===== HANDLE NEW PIVOTS =====
if not na(pHigh)
f_add_peak(pHigh, true)
if not na(pLow)
f_add_peak(pLow, false)
// ===== INFO PANEL (top-right) =====
var table t = table.new(position.top_right, 1, 2, border_width = 1)
if showPanel and barstate.islast
yellow_count = 0
yellow_prices = array.new_string()
if array.size(arrPrices) > 0
for i = 0 to array.size(arrPrices) - 1
if array.get(arrColors, i) == color.yellow
yellow_count += 1
lvl = array.get(arrPrices, i)
s = str.tostring(lvl, format.mintick)
array.push(yellow_prices, s)
priceTxt = "None"
if array.size(yellow_prices) > 0
joined = ""
for j = 0 to array.size(yellow_prices) - 1
part = array.get(yellow_prices, j)
joined := j == 0 ? part : joined + ", " + part
priceTxt := joined
table.cell(t, 0, 0, "Equal peaks: " + str.tostring(yellow_count), text_halign = text.align_left, text_size = size.small, bgcolor = color.new(color.black, 0), text_color = color.white)
table.cell(t, 0, 1, "Equal peaks price: " + priceTxt, text_halign = text.align_left, text_size = size.small, bgcolor = color.new(color.black, 0), text_color = color.white)
else
table.clear(t, 0, 0)
Candle Range Theory (CRT) Enhanced✨ Key upgrades over your version:
Uses multi-timeframe high/low/mid as the reference range.
Adds false breakout candle filter (manipulation logic).
Adds liquidity sweep checks.
Filters out tiny candles (low range = noise).
Adds session filter (only valid during chosen active times).
Plots the HTF midpoint line for reference.
Leaves placeholders for order block / risk management logic.
Close Price & (% Change / Volume)this places the ratio of change with volume to give us idea if the price is moving or not with volume. If ratio is more more means percent change is high than volumne if ratio is less then % change is less than volume
Customizable MA 10/20/50/100/200Customizable EMA/SMA indicator. Select EMA (default) or SMA and support up to 5 timeframes.
AL-SAT (Dönüş Odaklı: EMA+RSI+MACD)AL-SAT (Reversal Focused: EMA+RSI+MACD) combines three indicators to catch trend reversals.
- EMA50/200 crossovers define the main trend.
- RSI (14) confirms oversold/overbought reversals.
- MACD crossovers confirm momentum shifts.
Signals are generated at crossover points and remain valid until the opposite signal appears.
Best used on 1D or 4H timeframes. Works well for spotting early trend reversals, but may produce noise in sideways markets.
BOCS Channel Scalper Indicator - Mean Reversion Alert System# BOCS Channel Scalper Indicator - Mean Reversion Alert System
## WHAT THIS INDICATOR DOES:
This is a mean reversion trading indicator that identifies consolidation channels through volatility analysis and generates alert signals when price enters entry zones near channel boundaries. **This indicator version is designed for manual trading with comprehensive alert functionality.** Unlike automated strategies, this tool sends notifications (via popup, email, SMS, or webhook) when trading opportunities occur, allowing you to manually review and execute trades. The system assumes price will revert to the channel mean, identifying scalp opportunities as price reaches extremes and preparing to bounce back toward center.
## INDICATOR VS STRATEGY - KEY DISTINCTION:
**This is an INDICATOR with alerts, not an automated strategy.** It does not execute trades automatically. Instead, it:
- Displays visual signals on your chart when entry conditions are met
- Sends customizable alerts to your device/email when opportunities arise
- Shows TP/SL levels for reference but does not place orders
- Requires you to manually enter and exit positions based on signals
- Works with all TradingView subscription levels (alerts included on all plans)
**For automated trading with backtesting**, use the strategy version. For manual control with notifications, use this indicator version.
## ALERT CAPABILITIES:
This indicator includes four distinct alert conditions that can be configured independently:
**1. New Channel Formation Alert**
- Triggers when a fresh BOCS channel is identified
- Message: "New BOCS channel formed - potential scalp setup ready"
- Use this to prepare for upcoming trading opportunities
**2. Long Scalp Entry Alert**
- Fires when price touches the long entry zone
- Message includes current price, calculated TP, and SL levels
- Notification example: "LONG scalp signal at 24731.75 | TP: 24743.2 | SL: 24716.5"
**3. Short Scalp Entry Alert**
- Fires when price touches the short entry zone
- Message includes current price, calculated TP, and SL levels
- Notification example: "SHORT scalp signal at 24747.50 | TP: 24735.0 | SL: 24762.75"
**4. Any Entry Signal Alert**
- Combined alert for both long and short entries
- Use this if you want a single alert stream for all opportunities
- Message: "BOCS Scalp Entry: at "
**Setting Up Alerts:**
1. Add indicator to chart and configure settings
2. Click the Alert (⏰) button in TradingView toolbar
3. Select "BOCS Channel Scalper" from condition dropdown
4. Choose desired alert type (Long, Short, Any, or Channel Formation)
5. Set "Once Per Bar Close" to avoid false signals during bar formation
6. Configure delivery method (popup, email, webhook for automation platforms)
7. Save alert - it will fire automatically when conditions are met
**Alert Message Placeholders:**
Alerts use TradingView's dynamic placeholder system:
- {{ticker}} = Symbol name (e.g., NQ1!)
- {{close}} = Current price at signal
- {{plot_1}} = Calculated take profit level
- {{plot_2}} = Calculated stop loss level
These placeholders populate automatically, creating detailed notification messages without manual configuration.
## KEY DIFFERENCE FROM ORIGINAL BOCS:
**This indicator is designed for traders seeking higher trade frequency.** The original BOCS indicator trades breakouts OUTSIDE channels, waiting for price to escape consolidation before entering. This scalper version trades mean reversion INSIDE channels, entering when price reaches channel extremes and betting on a bounce back to center. The result is significantly more trading opportunities:
- **Original BOCS**: 1-3 signals per channel (only on breakout)
- **Scalper Indicator**: 5-15+ signals per channel (every touch of entry zones)
- **Trade Style**: Mean reversion vs trend following
- **Hold Time**: Seconds to minutes vs minutes to hours
- **Best Markets**: Ranging/choppy conditions vs trending breakouts
This makes the indicator ideal for active day traders who want continuous alert opportunities within consolidation zones rather than waiting for breakout confirmation. However, increased signal frequency also means higher potential commission costs and requires disciplined trade selection when acting on alerts.
## TECHNICAL METHODOLOGY:
### Price Normalization Process:
The indicator normalizes price data to create consistent volatility measurements across different instruments and price levels. It calculates the highest high and lowest low over a user-defined lookback period (default 100 bars). Current close price is normalized using: (close - lowest_low) / (highest_high - lowest_low), producing values between 0 and 1 for standardized volatility analysis.
### Volatility Detection:
A 14-period standard deviation is applied to the normalized price series to measure price deviation from the mean. Higher standard deviation values indicate volatility expansion; lower values indicate consolidation. The indicator uses ta.highestbars() and ta.lowestbars() to identify when volatility peaks and troughs occur over the detection period (default 14 bars).
### Channel Formation Logic:
When volatility crosses from a high level to a low level (ta.crossover(upper, lower)), a consolidation phase begins. The indicator tracks the highest and lowest prices during this period, which become the channel boundaries. Minimum duration of 10+ bars is required to filter out brief volatility spikes. Channels are rendered as box objects with defined upper and lower boundaries, with colored zones indicating entry areas.
### Entry Signal Generation:
The indicator uses immediate touch-based entry logic. Entry zones are defined as a percentage from channel edges (default 20%):
- **Long Entry Zone**: Bottom 20% of channel (bottomBound + channelRange × 0.2)
- **Short Entry Zone**: Top 20% of channel (topBound - channelRange × 0.2)
Long signals trigger when candle low touches or enters the long entry zone. Short signals trigger when candle high touches or enters the short entry zone. Visual markers (arrows and labels) appear on chart, and configured alerts fire immediately.
### Cooldown Filter:
An optional cooldown period (measured in bars) prevents alert spam by enforcing minimum spacing between consecutive signals. If cooldown is set to 3 bars, no new long alert will fire until 3 bars after the previous long signal. Long and short cooldowns are tracked independently, allowing both directions to signal within the same period.
### ATR Volatility Filter:
The indicator includes a multi-timeframe ATR filter to avoid alerts during low-volatility conditions. Using request.security(), it fetches ATR values from a specified timeframe (e.g., 1-minute ATR while viewing 5-minute charts). The filter compares current ATR to a user-defined minimum threshold:
- If ATR ≥ threshold: Alerts enabled
- If ATR < threshold: No alerts fire
This prevents notifications during dead zones where mean reversion is unreliable due to insufficient price movement. The ATR status is displayed in the info table with visual confirmation (✓ or ✗).
### Take Profit Calculation:
Two TP methods are available:
**Fixed Points Mode**:
- Long TP = Entry + (TP_Ticks × syminfo.mintick)
- Short TP = Entry - (TP_Ticks × syminfo.mintick)
**Channel Percentage Mode**:
- Long TP = Entry + (ChannelRange × TP_Percent)
- Short TP = Entry - (ChannelRange × TP_Percent)
Default 50% targets the channel midline, a natural mean reversion target. These levels are displayed as visual lines with labels and included in alert messages for reference when manually placing orders.
### Stop Loss Placement:
Stop losses are calculated just outside the channel boundary by a user-defined tick offset:
- Long SL = ChannelBottom - (SL_Offset_Ticks × syminfo.mintick)
- Short SL = ChannelTop + (SL_Offset_Ticks × syminfo.mintick)
This logic assumes channel breaks invalidate the mean reversion thesis. SL levels are displayed on chart and included in alert notifications as suggested stop placement.
### Channel Breakout Management:
Channels are removed when price closes more than 10 ticks outside boundaries. This tolerance prevents premature channel deletion from minor breaks or wicks, allowing the mean reversion setup to persist through small boundary violations.
## INPUT PARAMETERS:
### Channel Settings:
- **Nested Channels**: Allow multiple overlapping channels vs single channel
- **Normalization Length**: Lookback for high/low calculation (1-500, default 100)
- **Box Detection Length**: Period for volatility detection (1-100, default 14)
### Scalping Settings:
- **Enable Long Scalps**: Toggle long alert generation on/off
- **Enable Short Scalps**: Toggle short alert generation on/off
- **Entry Zone % from Edge**: Size of entry zone (5-50%, default 20%)
- **SL Offset (Ticks)**: Distance beyond channel for stop (1+, default 5)
- **Cooldown Period (Bars)**: Minimum spacing between alerts (0 = no cooldown)
### ATR Filter:
- **Enable ATR Filter**: Toggle volatility filter on/off
- **ATR Timeframe**: Source timeframe for ATR (1, 5, 15, 60 min, etc.)
- **ATR Length**: Smoothing period (1-100, default 14)
- **Min ATR Value**: Threshold for alert enablement (0.1+, default 10.0)
### Take Profit Settings:
- **TP Method**: Choose Fixed Points or % of Channel
- **TP Fixed (Ticks)**: Static distance in ticks (1+, default 30)
- **TP % of Channel**: Dynamic target as channel percentage (10-100%, default 50%)
### Appearance:
- **Show Entry Zones**: Toggle zone labels on channels
- **Show Info Table**: Display real-time indicator status
- **Table Position**: Corner placement (Top Left/Right, Bottom Left/Right)
- **Long Color**: Customize long signal color (default: darker green for readability)
- **Short Color**: Customize short signal color (default: red)
- **TP/SL Colors**: Customize take profit and stop loss line colors
- **Line Length**: Visual length of TP/SL reference lines (5-200 bars)
## VISUAL INDICATORS:
- **Channel boxes** with semi-transparent fill showing consolidation zones
- **Colored entry zones** labeled "LONG ZONE ▲" and "SHORT ZONE ▼"
- **Entry signal arrows** below/above bars marking long/short alerts
- **TP/SL reference lines** with emoji labels (⊕ Entry, 🎯 TP, 🛑 SL)
- **Info table** showing channel status, last signal, entry/TP/SL prices, risk/reward ratio, and ATR filter status
- **Visual confirmation** when alerts fire via on-chart markers synchronized with notifications
## HOW TO USE:
### For 1-3 Minute Scalping with Alerts (NQ/ES):
- ATR Timeframe: "1" (1-minute)
- ATR Min Value: 10.0 (for NQ), adjust per instrument
- Entry Zone %: 20-25%
- TP Method: Fixed Points, 20-40 ticks
- SL Offset: 5-10 ticks
- Cooldown: 2-3 bars to reduce alert spam
- **Alert Setup**: Configure "Any Entry Signal" for combined long/short notifications
- **Execution**: When alert fires, verify chart visuals, then manually place limit order at entry zone with provided TP/SL levels
### For 5-15 Minute Day Trading with Alerts:
- ATR Timeframe: "5" or match chart
- ATR Min Value: Adjust to instrument (test 8-15 for NQ)
- Entry Zone %: 20-30%
- TP Method: % of Channel, 40-60%
- SL Offset: 5-10 ticks
- Cooldown: 3-5 bars
- **Alert Setup**: Configure separate "Long Scalp Entry" and "Short Scalp Entry" alerts if you trade directionally based on bias
- **Execution**: Review channel structure on alert, confirm ATR filter shows ✓, then enter manually
### For 30-60 Minute Swing Scalping with Alerts:
- ATR Timeframe: "15" or "30"
- ATR Min Value: Lower threshold for broader market
- Entry Zone %: 25-35%
- TP Method: % of Channel, 50-70%
- SL Offset: 10-15 ticks
- Cooldown: 5+ bars or disable
- **Alert Setup**: Use "New Channel Formation" to prepare for setups, then "Any Entry Signal" for execution alerts
- **Execution**: Larger timeframes allow more analysis time between alert and entry
### Webhook Integration for Semi-Automation:
- Configure alert webhook URL to connect with platforms like TradersPost, TradingView Paper Trading, or custom automation
- Alert message includes all necessary order parameters (direction, entry, TP, SL)
- Webhook receives structured data when signal fires
- External platform can auto-execute based on alert payload
- Still maintains manual oversight vs full strategy automation
## USAGE CONSIDERATIONS:
- **Manual Discipline Required**: Alerts provide opportunities but execution requires judgment. Not all alerts should be taken - consider market context, trend, and channel quality
- **Alert Timing**: Alerts fire on bar close by default. Ensure "Once Per Bar Close" is selected to avoid false signals during bar formation
- **Notification Delivery**: Mobile/email alerts may have 1-3 second delay. For immediate execution, use desktop popups or webhook automation
- **Cooldown Necessity**: Without cooldown, rapidly touching price action can generate excessive alerts. Start with 3-bar cooldown and adjust based on alert volume
- **ATR Filter Impact**: Enabling ATR filter dramatically reduces alert count but improves quality. Track filter status in info table to understand when you're receiving fewer alerts
- **Commission Awareness**: High alert frequency means high potential trade count. Calculate if your commission structure supports frequent scalping before acting on all alerts
## COMPATIBLE MARKETS:
Works on any instrument with price data including stock indices (NQ, ES, YM, RTY), individual stocks, forex pairs (EUR/USD, GBP/USD), cryptocurrency (BTC, ETH), and commodities. Volume-based features are not included in this indicator version. Multi-timeframe ATR requires higher-tier TradingView subscription for request.security() functionality on timeframes below chart timeframe.
## KNOWN LIMITATIONS:
- **Indicator does not execute trades** - alerts are informational only; you must manually place all orders
- **Alert delivery depends on TradingView infrastructure** - delays or failures possible during platform issues
- **No position tracking** - indicator doesn't know if you're in a trade; you must manage open positions independently
- **TP/SL levels are reference only** - you must manually set these on your broker platform; they are not live orders
- **Immediate touch entry can generate many alerts** in choppy zones without adequate cooldown
- **Channel deletion at 10-tick breaks** may be too aggressive or lenient depending on instrument tick size
- **ATR filter from lower timeframes** requires TradingView Premium/Pro+ for request.security()
- **Mean reversion logic fails** in strong breakout scenarios - alerts will fire but trades may hit stops
- **No partial closing capability** - full position management is manual; you determine scaling out
- **Alerts do not account for gaps** or overnight price changes; morning alerts may be stale
## RISK DISCLOSURE:
Trading involves substantial risk of loss. This indicator provides signals for educational and informational purposes only and does not constitute financial advice. Past performance does not guarantee future results. Mean reversion strategies can experience extended drawdowns during trending markets. Alerts are not guaranteed to be profitable and should be combined with your own analysis. Stop losses may not fill at intended levels during extreme volatility or gaps. Never trade with capital you cannot afford to lose. Consider consulting a licensed financial advisor before making trading decisions. Always verify alerts against current market conditions before executing trades manually.
## ACKNOWLEDGMENT & CREDITS:
This indicator is built upon the channel detection methodology created by **AlgoAlpha** in the "Smart Money Breakout Channels" indicator. Full credit and appreciation to AlgoAlpha for pioneering the normalized volatility approach to identifying consolidation patterns. The core channel formation logic using normalized price standard deviation is AlgoAlpha's original contribution to the TradingView community.
Enhancements to the original concept include: mean reversion entry logic (vs breakout), immediate touch-based alert generation, comprehensive alert condition system with customizable notifications, multi-timeframe ATR volatility filtering, cooldown period for alert management, dual TP methods (fixed points vs channel percentage), visual TP/SL reference lines, and real-time status monitoring table. This indicator version is specifically designed for manual traders who prefer alert-based decision making over automated execution.
MTL One-Stop PRO Here’s the English version you can paste into the script description or a Telegram post.
---
# MTL One-Stop PRO v6
**EMAs • PDH/PDL • PWH/PWL • PMH/PML • RSI/ADX/OBV/ATR • Readiness**
## What it draws on the chart
* **EMA bands (21/50/200)** on price + a **21–50 ribbon** — quick read of impulse/pullback and location vs. the moving averages.
* **Prior period levels:**
* **PDH/PDL** (previous day high/low) — *blue*.
* **PWH/PWL** (previous week high/low) — *orange dashed*.
* **PMH/PML** (previous month high/low) — *purple dashed*.
Labels are printed on the right margin to keep the chart clean.
* **“Readiness” panel** (bottom-right): summary metrics and quick long/short readiness scores.
## Readiness panel — fields & meaning
* **TF / Trend**
* `Trend 1 (21>50>200)` — bullish EMA stack.
* `Trend −1 (21<50<200)` — bearish EMA stack.
* `Trend = mix` — mixed/sideways structure.
* **RSI** (calculated on the selected TF) — momentum gauge. Rule of thumb: >50 bullish, <50 bearish.
* **ADX** — trend strength. Practical zone **20–25+**.
* **ATR %** — volatility as % of price (= ATR(14)/Close·100). Helps classify regime: low/normal/high.
* **OBV ↑/↓** — accumulation/distribution direction (arrow from the OBV slope/smoothing).
* **Near PDH? / Near PDL?** — proximity flags to key extremes (within a user-set threshold; handy for breakout/fakeout/retest scenarios).
* **LongScore / ShortScore (0–5)** — quick “readiness” rating:
* +1 for trend aligned with the scenario (EMA stack).
* +1 for RSI in favor.
* +1 for ADX in the working zone.
* +1 for OBV in favor.
* +1 for price positioning (for longs — closer to **PDL/PWL** pullback or **PDH/PWH** breakout; for shorts — the opposite).
Sum → priority: **4–5/5** aggressive, **2–3/5** only with a pattern, **0–1/5** skip.
## How to read & use (fits the “Top-setup 1D/3D/1W” flow)
## Settings (main groups)
* **EMAs (on price):** lengths/visibility 21/50/200, enable the 21–50 “ribbon”.
* **Levels:** toggles for **PDH/PDL**, **PWH/PWL**, **PMH/PML**.
* **Oscillators (calc TF):** choose the timeframe used to compute **RSI/ADX/OBV/ATR** (e.g., compute on **D** while analyzing 1H/3H).
* **Readiness:** proximity threshold to levels (in ATR fractions), working-zone bounds for ADX/RSI.
## Pro tips
* **Colors map to period:** purple = month, orange = week, blue = day.
* Watch **level clusters** (e.g., PWH≈PMH): frequent reversal/fakeout zones.
* **ATR %** guides tactics: in low vol, breakouts underperform; in higher vol, retests and fakeouts improve.
## Important
The indicator **does not generate auto-signals** or replace risk management. It structures levels/context and speeds up the workflow of your checklist (SMC/liquidity/EMA/ATR/RSI/ADX/OBV) in the 1D/3D/1W pipeline.
---
Want a mini “recommended thresholds” card (RSI/ADX/ATR%) per TF and a 60-second “how to build a trade” tutorial for the description?
BOCS Channel Scalper Strategy - Automated Mean Reversion System# BOCS Channel Scalper Strategy - Automated Mean Reversion System
## WHAT THIS STRATEGY DOES:
This is an automated mean reversion trading strategy that identifies consolidation channels through volatility analysis and executes scalp trades when price enters entry zones near channel boundaries. Unlike breakout strategies, this system assumes price will revert to the channel mean, taking profits as price bounces back from extremes. Position sizing is fully customizable with three methods: fixed contracts, percentage of equity, or fixed dollar amount. Stop losses are placed just outside channel boundaries with take profits calculated either as fixed points or as a percentage of channel range.
## KEY DIFFERENCE FROM ORIGINAL BOCS:
**This strategy is designed for traders seeking higher trade frequency.** The original BOCS indicator trades breakouts OUTSIDE channels, waiting for price to escape consolidation before entering. This scalper version trades mean reversion INSIDE channels, entering when price reaches channel extremes and betting on a bounce back to center. The result is significantly more trading opportunities:
- **Original BOCS**: 1-3 signals per channel (only on breakout)
- **Scalper Version**: 5-15+ signals per channel (every touch of entry zones)
- **Trade Style**: Mean reversion vs trend following
- **Hold Time**: Seconds to minutes vs minutes to hours
- **Best Markets**: Ranging/choppy conditions vs trending breakouts
This makes the scalper ideal for active day traders who want continuous opportunities within consolidation zones rather than waiting for breakout confirmation. However, increased trade frequency also means higher commission costs and requires tighter risk management.
## TECHNICAL METHODOLOGY:
### Price Normalization Process:
The strategy normalizes price data to create consistent volatility measurements across different instruments and price levels. It calculates the highest high and lowest low over a user-defined lookback period (default 100 bars). Current close price is normalized using: (close - lowest_low) / (highest_high - lowest_low), producing values between 0 and 1 for standardized volatility analysis.
### Volatility Detection:
A 14-period standard deviation is applied to the normalized price series to measure price deviation from the mean. Higher standard deviation values indicate volatility expansion; lower values indicate consolidation. The strategy uses ta.highestbars() and ta.lowestbars() to identify when volatility peaks and troughs occur over the detection period (default 14 bars).
### Channel Formation Logic:
When volatility crosses from a high level to a low level (ta.crossover(upper, lower)), a consolidation phase begins. The strategy tracks the highest and lowest prices during this period, which become the channel boundaries. Minimum duration of 10+ bars is required to filter out brief volatility spikes. Channels are rendered as box objects with defined upper and lower boundaries, with colored zones indicating entry areas.
### Entry Signal Generation:
The strategy uses immediate touch-based entry logic. Entry zones are defined as a percentage from channel edges (default 20%):
- **Long Entry Zone**: Bottom 20% of channel (bottomBound + channelRange × 0.2)
- **Short Entry Zone**: Top 20% of channel (topBound - channelRange × 0.2)
Long signals trigger when candle low touches or enters the long entry zone. Short signals trigger when candle high touches or enters the short entry zone. This captures mean reversion opportunities as price reaches channel extremes.
### Cooldown Filter:
An optional cooldown period (measured in bars) prevents signal spam by enforcing minimum spacing between consecutive signals. If cooldown is set to 3 bars, no new long signal will fire until 3 bars after the previous long signal. Long and short cooldowns are tracked independently, allowing both directions to signal within the same period.
### ATR Volatility Filter:
The strategy includes a multi-timeframe ATR filter to avoid trading during low-volatility conditions. Using request.security(), it fetches ATR values from a specified timeframe (e.g., 1-minute ATR while trading on 5-minute charts). The filter compares current ATR to a user-defined minimum threshold:
- If ATR ≥ threshold: Trading enabled
- If ATR < threshold: No signals fire
This prevents entries during dead zones where mean reversion is unreliable due to insufficient price movement.
### Take Profit Calculation:
Two TP methods are available:
**Fixed Points Mode**:
- Long TP = Entry + (TP_Ticks × syminfo.mintick)
- Short TP = Entry - (TP_Ticks × syminfo.mintick)
**Channel Percentage Mode**:
- Long TP = Entry + (ChannelRange × TP_Percent)
- Short TP = Entry - (ChannelRange × TP_Percent)
Default 50% targets the channel midline, a natural mean reversion target. Larger percentages aim for opposite channel edge.
### Stop Loss Placement:
Stop losses are placed just outside the channel boundary by a user-defined tick offset:
- Long SL = ChannelBottom - (SL_Offset_Ticks × syminfo.mintick)
- Short SL = ChannelTop + (SL_Offset_Ticks × syminfo.mintick)
This logic assumes channel breaks invalidate the mean reversion thesis. If price breaks through, the range is no longer valid and position exits.
### Trade Execution Logic:
When entry conditions are met (price in zone, cooldown satisfied, ATR filter passed, no existing position):
1. Calculate entry price at zone boundary
2. Calculate TP and SL based on selected method
3. Execute strategy.entry() with calculated position size
4. Place strategy.exit() with TP limit and SL stop orders
5. Update info table with active trade details
The strategy enforces one position at a time by checking strategy.position_size == 0 before entry.
### Channel Breakout Management:
Channels are removed when price closes more than 10 ticks outside boundaries. This tolerance prevents premature channel deletion from minor breaks or wicks, allowing the mean reversion setup to persist through small boundary violations.
### Position Sizing System:
Three methods calculate position size:
**Fixed Contracts**:
- Uses exact contract quantity specified in settings
- Best for futures traders (e.g., "trade 2 NQ contracts")
**Percentage of Equity**:
- position_size = (strategy.equity × equity_pct / 100) / close
- Dynamically scales with account growth
**Cash Amount**:
- position_size = cash_amount / close
- Maintains consistent dollar exposure regardless of price
## INPUT PARAMETERS:
### Position Sizing:
- **Position Size Type**: Choose Fixed Contracts, % of Equity, or Cash Amount
- **Number of Contracts**: Fixed quantity per trade (1-1000)
- **% of Equity**: Percentage of account to allocate (1-100%)
- **Cash Amount**: Dollar value per position ($100+)
### Channel Settings:
- **Nested Channels**: Allow multiple overlapping channels vs single channel
- **Normalization Length**: Lookback for high/low calculation (1-500, default 100)
- **Box Detection Length**: Period for volatility detection (1-100, default 14)
### Scalping Settings:
- **Enable Long Scalps**: Toggle long entries on/off
- **Enable Short Scalps**: Toggle short entries on/off
- **Entry Zone % from Edge**: Size of entry zone (5-50%, default 20%)
- **SL Offset (Ticks)**: Distance beyond channel for stop (1+, default 5)
- **Cooldown Period (Bars)**: Minimum spacing between signals (0 = no cooldown)
### ATR Filter:
- **Enable ATR Filter**: Toggle volatility filter on/off
- **ATR Timeframe**: Source timeframe for ATR (1, 5, 15, 60 min, etc.)
- **ATR Length**: Smoothing period (1-100, default 14)
- **Min ATR Value**: Threshold for trade enablement (0.1+, default 10.0)
### Take Profit Settings:
- **TP Method**: Choose Fixed Points or % of Channel
- **TP Fixed (Ticks)**: Static distance in ticks (1+, default 30)
- **TP % of Channel**: Dynamic target as channel percentage (10-100%, default 50%)
### Appearance:
- **Show Entry Zones**: Toggle zone labels on channels
- **Show Info Table**: Display real-time strategy status
- **Table Position**: Corner placement (Top Left/Right, Bottom Left/Right)
- **Color Settings**: Customize long/short/TP/SL colors
## VISUAL INDICATORS:
- **Channel boxes** with semi-transparent fill showing consolidation zones
- **Colored entry zones** labeled "LONG ZONE ▲" and "SHORT ZONE ▼"
- **Entry signal arrows** below/above bars marking long/short entries
- **Active TP/SL lines** with emoji labels (⊕ Entry, 🎯 TP, 🛑 SL)
- **Info table** showing position status, channel state, last signal, entry/TP/SL prices, and ATR status
## HOW TO USE:
### For 1-3 Minute Scalping (NQ/ES):
- ATR Timeframe: "1" (1-minute)
- ATR Min Value: 10.0 (for NQ), adjust per instrument
- Entry Zone %: 20-25%
- TP Method: Fixed Points, 20-40 ticks
- SL Offset: 5-10 ticks
- Cooldown: 2-3 bars
- Position Size: 1-2 contracts
### For 5-15 Minute Day Trading:
- ATR Timeframe: "5" or match chart
- ATR Min Value: Adjust to instrument (test 8-15 for NQ)
- Entry Zone %: 20-30%
- TP Method: % of Channel, 40-60%
- SL Offset: 5-10 ticks
- Cooldown: 3-5 bars
- Position Size: Fixed contracts or 5-10% equity
### For 30-60 Minute Swing Scalping:
- ATR Timeframe: "15" or "30"
- ATR Min Value: Lower threshold for broader market
- Entry Zone %: 25-35%
- TP Method: % of Channel, 50-70%
- SL Offset: 10-15 ticks
- Cooldown: 5+ bars or disable
- Position Size: % of equity recommended
## BACKTEST CONSIDERATIONS:
- Strategy performs best in ranging, mean-reverting markets
- Strong trending markets produce more stop losses as price breaks channels
- ATR filter significantly reduces trade count but improves quality during low volatility
- Cooldown period trades signal quantity for signal quality
- Commission and slippage materially impact sub-5-minute timeframe performance
- Shorter timeframes require tighter entry zones (15-20%) to catch quick reversions
- % of Channel TP adapts better to varying channel sizes than fixed points
- Fixed contract sizing recommended for consistent risk per trade in futures
**Backtesting Parameters Used**: This strategy was developed and tested using realistic commission and slippage values to provide accurate performance expectations. Recommended settings: Commission of $1.40 per side (typical for NQ futures through discount brokers), slippage of 2 ticks to account for execution delays on fast-moving scalp entries. These values reflect real-world trading costs that active scalpers will encounter. Backtest results without proper cost simulation will significantly overstate profitability.
## COMPATIBLE MARKETS:
Works on any instrument with price data including stock indices (NQ, ES, YM, RTY), individual stocks, forex pairs (EUR/USD, GBP/USD), cryptocurrency (BTC, ETH), and commodities. Volume-based features require data feed with volume information but are optional for core functionality.
## KNOWN LIMITATIONS:
- Immediate touch entry can fire multiple times in choppy zones without adequate cooldown
- Channel deletion at 10-tick breaks may be too aggressive or lenient depending on instrument tick size
- ATR filter from lower timeframes requires higher-tier TradingView subscription (request.security limitation)
- Mean reversion logic fails in strong breakout scenarios leading to stop loss hits
- Position sizing via % of equity or cash amount calculates based on close price, may differ from actual fill price
- No partial closing capability - full position exits at TP or SL only
- Strategy does not account for gap openings or overnight holds
## RISK DISCLOSURE:
Trading involves substantial risk of loss. Past performance does not guarantee future results. This strategy is for educational purposes and backtesting only. Mean reversion strategies can experience extended drawdowns during trending markets. Stop losses may not fill at intended levels during extreme volatility or gaps. Thoroughly test on historical data and paper trade before risking real capital. Use appropriate position sizing and never risk more than you can afford to lose. Consider consulting a licensed financial advisor before making trading decisions. Automated trading systems can malfunction - monitor all live positions actively.
## ACKNOWLEDGMENT & CREDITS:
This strategy is built upon the channel detection methodology created by **AlgoAlpha** in the "Smart Money Breakout Channels" indicator. Full credit and appreciation to AlgoAlpha for pioneering the normalized volatility approach to identifying consolidation patterns. The core channel formation logic using normalized price standard deviation is AlgoAlpha's original contribution to the TradingView community.
Enhancements to the original concept include: mean reversion entry logic (vs breakout), immediate touch-based signals, multi-timeframe ATR volatility filtering, flexible position sizing (fixed/percentage/cash), cooldown period filtering, dual TP methods (fixed points vs channel percentage), automated strategy execution with exit management, and real-time position monitoring table.
Today's Unbroken Support/Resistance grok 1 //@version=6
indicator("Today's Unbroken Support/Resistance", shorttitle="Today S/R", overlay=true, max_lines_count=500)
// Input parameters
lookback = input.int(5, title="Lookback Period", minval=1, maxval=50)
show_resistance = input.bool(true, title="Show Resistance Lines")
show_support = input.bool(true, title="Show Support Lines")
resistance_color = input.color(color.red, title="Resistance Color")
support_color = input.color(color.green, title="Support Color")
line_width = input.int(2, title="Line Width", minval=1, maxval=4)
// Get current date for today's filter
current_date = dayofmonth(time)
current_month = month(time)
// Variables to track lines and their status
var line resistance_lines = array.new()
var line support_lines = array.new()
var float resistance_levels = array.new()
var float support_levels = array.new()
var int resistance_dates = array.new()
var int support_dates = array.new()
// Function to check if current bar is a peak
is_peak() =>
ta.pivothigh(high, lookback, lookback)
// Function to check if current bar is a valley
is_valley() =>
ta.pivotlow(low, lookback, lookback)
// Function to check if a resistance level is broken
is_resistance_broken(level) =>
close > level
// Function to check if a support level is broken
is_support_broken(level) =>
close < level
// Function to remove broken lines
remove_broken_levels() =>
// Check resistance levels
if array.size(resistance_levels) > 0
for i = array.size(resistance_levels) - 1 to 0
level = array.get(resistance_levels, i)
if is_resistance_broken(level)
// Remove broken resistance
line_to_delete = array.get(resistance_lines, i)
line.delete(line_to_delete)
array.remove(resistance_lines, i)
array.remove(resistance_levels, i)
array.remove(resistance_dates, i)
// Check support levels
if array.size(support_levels) > 0
for i = array.size(support_levels) - 1 to 0
level = array.get(support_levels, i)
if is_support_broken(level)
// Remove broken support
line_to_delete = array.get(support_lines, i)
line.delete(line_to_delete)
array.remove(support_lines, i)
array.remove(support_levels, i)
array.remove(support_dates, i)
// Function to remove previous days' lines
remove_old_levels() =>
// Remove old resistance levels
if array.size(resistance_levels) > 0
for i = array.size(resistance_levels) - 1 to 0
line_date = array.get(resistance_dates, i)
if line_date != current_date
// Remove old resistance
line_to_delete = array.get(resistance_lines, i)
line.delete(line_to_delete)
array.remove(resistance_lines, i)
array.remove(resistance_levels, i)
array.remove(resistance_dates, i)
// Remove old support levels
if array.size(support_levels) > 0
for i = array.size(support_levels) - 1 to 0
line_date = array.get(support_dates, i)
if line_date != current_date
// Remove old support
line_to_delete = array.get(support_lines, i)
line.delete(line_to_delete)
array.remove(support_lines, i)
array.remove(support_levels, i)
array.remove(support_dates, i)
// Main logic
remove_old_levels()
remove_broken_levels()
// Check for new resistance peaks
if show_resistance
peak_price = is_peak()
if not na(peak_price)
// Check if this level already exists (avoid duplicates)
level_exists = false
if array.size(resistance_levels) > 0
for i = 0 to array.size(resistance_levels) - 1
existing_level = array.get(resistance_levels, i)
if math.abs(peak_price - existing_level) < (peak_price * 0.001) // Within 0.1%
level_exists := true
break
if not level_exists
// Create new resistance line extending to infinity
new_line = line.new(x1=bar_index - lookback, y1=peak_price, x2=bar_index - lookback, y2=peak_price, color=resistance_color, width=line_width, extend=extend.right)
array.push(resistance_lines, new_line)
array.push(resistance_levels, peak_price)
array.push(resistance_dates, current_date)
// Check for new support valleys
if show_support
valley_price = is_valley()
if not na(valley_price)
// Check if this level already exists (avoid duplicates)
level_exists = false
if array.size(support_levels) > 0
for i = 0 to array.size(support_levels) - 1
existing_level = array.get(support_levels, i)
if math.abs(valley_price - existing_level) < (valley_price * 0.001) // Within 0.1%
level_exists := true
break
if not level_exists
// Create new support line extending to infinity
new_line = line.new(x1=bar_index - lookback, y1=valley_price, x2=bar_index - lookback, y2=valley_price, color=support_color, width=line_width, extend=extend.right)
array.push(support_lines, new_line)
array.push(support_levels, valley_price)
array.push(support_dates, current_date)
// Clean up old lines if too many (keep last 50 of each type)
if array.size(resistance_lines) > 50
old_line = array.shift(resistance_lines)
line.delete(old_line)
array.shift(resistance_levels)
array.shift(resistance_dates)
if array.size(support_lines) > 50
old_line = array.shift(support_lines)
line.delete(old_line)
array.shift(support_levels)
array.shift(support_dates)
// Optional: Plot small markers for today's new levels
today_resistance = show_resistance and not na(is_peak()) and dayofmonth(time ) == current_date
today_support = show_support and not na(is_valley()) and dayofmonth(time ) == current_date
plotshape(today_resistance, title="Today's Resistance", location=location.abovebar, color=resistance_color, style=shape.triangledown, size=size.tiny)
plotshape(today_support, title="Today's Support", location=location.belowbar, color=support_color, style=shape.triangleup, size=size.tiny)
Peak Support/Resistance Lines v1//@version=6
indicator("Peak Support/Resistance Lines", shorttitle="Peak S/R", overlay=true, max_lines_count=500)
// Input parameters
lookback = input.int(5, title="Lookback Period", minval=1, maxval=50)
show_resistance = input.bool(true, title="Show Resistance Lines")
show_support = input.bool(true, title="Show Support Lines")
resistance_color = input.color(color.red, title="Resistance Color")
support_color = input.color(color.green, title="Support Color")
// Function to check if current bar is a peak
is_peak() =>
ta.pivothigh(high, lookback, lookback)
// Function to check if current bar is a valley
is_valley() =>
ta.pivotlow(low, lookback, lookback)
// Main logic
if barstate.isconfirmed
// Check for resistance peaks
if show_resistance
peak_price = is_peak()
if not na(peak_price)
line.new(x1=bar_index - lookback, y1=peak_price, x2=bar_index + 50, y2=peak_price, color=resistance_color, width=1)
// Check for support valleys
if show_support
valley_price = is_valley()
if not na(valley_price)
line.new(x1=bar_index - lookback, y1=valley_price, x2=bar_index + 50, y2=valley_price, color=support_color, width=1)
Volume Relativo - Candle Color - CriptoBraboAssinala pela cor do candle o volume relativo. Parametros customizáveis
Peak Support/Resistance Lines v1//@version=6
indicator("Peak Support/Resistance Lines", shorttitle="Peak S/R", overlay=true, max_lines_count=500)
// Input parameters
lookback = input.int(5, title="Lookback Period", minval=1, maxval=50)
show_resistance = input.bool(true, title="Show Resistance Lines")
show_support = input.bool(true, title="Show Support Lines")
resistance_color = input.color(color.red, title="Resistance Color")
support_color = input.color(color.green, title="Support Color")
// Function to check if current bar is a peak
is_peak() =>
ta.pivothigh(high, lookback, lookback)
// Function to check if current bar is a valley
is_valley() =>
ta.pivotlow(low, lookback, lookback)
// Main logic
if barstate.isconfirmed
// Check for resistance peaks
if show_resistance
peak_price = is_peak()
if not na(peak_price)
line.new(x1=bar_index - lookback, y1=peak_price, x2=bar_index + 50, y2=peak_price, color=resistance_color, width=1)
// Check for support valleys
if show_support
valley_price = is_valley()
if not na(valley_price)
line.new(x1=bar_index - lookback, y1=valley_price, x2=bar_index + 50, y2=valley_price, color=support_color, width=1)
Flat Day PredictorAdvanced technical indicator that predicts low-volatility "flat" trading days using multi-factor analysis. Designed for day traders and scalpers who need to identify when markets are likely to trade sideways.
Key Features:
Real-time flat day probability calculation (0-100%)
8-factor scoring system combining volatility, volume, and momentum indicators
Visual table displaying all indicator values and overall signal strength
Color-coded alerts for high-probability flat day signals
Works on all timeframes, optimized for intraday trading
Indicators Analyzed:
VIX volatility levels
Bollinger Band width compression
RSI momentum neutrality
ATR trend declining
Volume below average
Daily range percentage
Price action patterns
Market regime detection
Signal Levels:
75%+ = VERY HIGH flat probability (Red alert)
62-74% = HIGH flat probability (Orange)
50-61% = MODERATE flat probability (Yellow)
Below 50% = Trending day likely (Green)
Usage:
Add to any chart and monitor the probability percentage. Higher scores indicate increased likelihood of sideways price action. Use for position sizing, strategy selection, and risk management during low-volatility periods.
4 Stages of StockThis script uses 40Weekly MA to baseline larges trends in the stock. This is based on Puru's idea of 4 Stage of Stock.
Stage 1 (Basing)
Stage 2 (Advancing)
Stage 3 (Topping)
Stage 4 (Declining)
This is best viewed and understood on weekly charts.
Dr.Yazdani V063 Session OR + A-Lines
**ACD Indicator: Mark Fisher's Opening Range Breakout Strategy**
**Overview**
The ACD system, developed by legendary trader Mark Fisher in his book *The Logical Trader*, is a powerful methodology for identifying high-probability trade setups based on the market's opening range (OR). This indicator automates Layers 1 and 2 of the ACD strategy, helping you spot breakout opportunities, trend direction, and key support/resistance levels. Perfect for day traders, scalpers, and swing traders in forex, stocks, futures, or crypto.
**How It Works**
1. **Opening Range (OR)**: Calculated from the high/low of the first X minutes (default: 30-60 min) of major sessions (e.g., Tokyo, London, New York).
2. **A Levels**: Drawn at a percentage (default: 0.5% of OR range or ATR-based) above/below the OR. A breakout above A-Up signals a bullish setup; below A-Down signals bearish.
3. **C Levels**: Wider levels (default: 1-2% or ATR multiplier) for stronger confirmation. Breakouts here confirm trend strength and filter fakeouts.
4. **Pivot Ranges**: Includes daily and N-day pivots to gauge overall market bias (above pivots = bullish; below = bearish).
**Key Features**
- **Customizable Sessions**: Tokyo (00:00-01:00 GMT), London (08:00-09:00 GMT), New York (13:30-14:30 GMT) – adjustable.
- **ATR Integration**: Uses Average True Range for dynamic A/C levels (period: 14 by default).
- **Visual Alerts**: Color-coded lines (green for bullish, red for bearish) + optional labels for breakouts.
- **Pivot Display**: Show/hide daily or multi-day pivots with customizable colors.
- **Risk Management**: Built-in stop-loss suggestions based on OR width.
**Trading Rules**
- **Bullish Setup**: Price breaks and holds above A-Up → Enter long at C-Up confirmation. Target: Next pivot or 1:2 risk-reward.
- **Bearish Setup**: Price breaks below A-Down → Enter short at C-Down.
- **Avoid Fakeouts**: Wait for stabilization (e.g., close above/below level).
- **Trend Filter**: Combine with PMA (Pivot Moving Average) for Layer 3 confirmation (search "ACD PMA" in TradingView).
**Settings Guide**
- **OR Timeframe**: Session start time and duration (e.g., 30 min).
- **A Multiplier (%)**: Distance for A levels (default: 0.5).
- **C Multiplier (%)**: Distance for C levels (default: 1.0).
- **ATR Period**: For volatility-based levels (default: 14).
- **Show Pivots**: Toggle daily/N-day ranges.
This indicator balances supply/demand by analyzing volume and price action within the opening range. Backtest on your favorite pairs (e.g., EURUSD, BTCUSD) and adjust for your style. Not financial advice – always use proper risk management!
**Inspired by**: Mark Fisher's ACD Methodology. Open-source for community review. Questions? Comment below!
#ACD #OpeningRange #Breakout #DayTrading #FisherStrategy
Alain parfHammer signals only valid for longs above EMA200.
Inverted hammer signals only valid for shorts below EMA200.
EMA200 is plotted as an orange line.
Opening Range BoxThis indicator, called the "Opening Range Box," is a visual tool that helps you track the start of key trading sessions like London and New York (or whatever session you set).
It does three main things:
Finds the Daily 'First Move': It automatically calculates the High and Low reached during the first 30 minutes (or whatever time you set) of each defined session.
Draws a Box: It immediately draws a colored, transparent box on your chart from the moment the session starts. The top of the box is the OR High, and the bottom is the OR Low. This box acts as a clear reference for the session's initial boundaries.
Extends the Levels: After the initial 30 minutes are over, the box stops growing vertically (it locks in the OR High/Low) but continues to stretch out horizontally for the rest of the trading session. This allows you to easily see how the price reacts to the opening levels throughout the day.
In short: It visually highlights the most important price levels established at the very beginning of the major market sessions.
NY Open OR/ATR Diff Planner – v2.8 NY Open OR/ATR Diff Planner – v2.8 (Hi-Contrast)
Trade the Opening Range Breakout with a plan, not vibes.
This tool builds the NY Opening Range (OR) from the cash open and overlays a complete, risk-based execution plan: precise entry, structural stop, position size, targets, and R:R — all tied to the Daily ATR(14) and the remaining ATR “fuel” left in the day.
What it does
Opening Range: First N minutes after 09:30 ET (choose 5/15/30/60).
Today-only lines: Automatically resets at 09:30; no carry-over from prior days.
Session aware: Works on RTH or ETH charts. OR always anchors at 09:30 ET.
Fuel model: Computes Session Range (since 09:30) and ATR Diff Left = Daily ATR − Session Range.
Entries & Stops:
Long plan: Entry = ORH, Stop = ORL
Short plan: Entry = ORL, Stop = ORH
Targets:
TP1 = 1R (distance of entry→stop)
TP (ATR-diff cap): Entry ± ATR Diff Left (caps greed when the day’s ATR is nearly spent)
Sizing & R:R: Position size = Account × Risk% / Risk per share, with live R:R to ATR-diff target.
Hi-contrast table: Clear readout of Daily ATR, OR size, OR/ATR%, Session Range, ATR left, entries/stops/TPs, size, and max $ risk.
Inputs
Opening Range (minutes): 5 / 15 / 30 / 60
Account Size ($) and Risk % per trade
Session mode: RTH (09:30–16:00) or ETH (chart’s session; still anchored at 09:30)
Also show Short plan (toggle)
Show info table (toggle)
How to use
Add on a 1–5m chart.
Choose your OR window (e.g., 15m = 09:30–09:45).
Set Account Size and Risk % (e.g., 4–5% for small accounts; adjust to taste).
Wait for the OR to complete.
Trade the break/retest with the levels shown:
Long: Break of ORH, SL at ORL, TP1 = 1R, TP2 = ATR-diff cap.
Short: Mirror logic.
If OR/ATR% > ~50% (red), the “fuel” is thin — be selective.
Why it helps build an edge
Objective structure: Clear levels and sizing remove guesswork.
Context-aware targets: ATR-diff keeps targets realistic to the day’s potential.
Discipline by design: One framework that’s easy to review, journal, and iterate.
Notes
This is an indicator (visual planner), not an order-placing strategy.
If you want a back testable version (one trade/day, optional retest rule, TP/SL logic), say the word — I can publish a strategy variant.
Keywords: ORB, Opening Range, ATR, Risk Management, Position Sizing, Day Trading, NYSE Open, Mean Reversion Fuel, Execution Planner
Contrarian Period High & LowContrarian Period High & Low
This indicator pairs nicely with the Contrarian 100 MA and can be located here:
Overview
The "Contrarian Period High & Low" indicator is a powerful technical analysis tool designed for traders seeking to identify key support and resistance levels and capitalize on contrarian trading opportunities. By tracking the highest highs and lowest lows over user-defined periods (Daily, Weekly, or Monthly), this indicator plots historical levels and generates buy and sell signals when price breaks these levels in a contrarian manner. A unique blue dot counter and action table enhance decision-making, making it ideal for swing traders, trend followers, and those trading forex, stocks, or cryptocurrencies. Optimized for daily charts, it can be adapted to other timeframes with proper testing.
How It Works
The indicator identifies the highest high and lowest low within a specified period (e.g., daily, weekly, or monthly) and draws horizontal lines for the previous period’s extremes on the chart. These levels act as dynamic support and resistance zones. Contrarian signals are generated when the price crosses below the previous period’s low (buy signal) or above the previous period’s high (sell signal), indicating potential reversals. A blue dot counter tracks consecutive buy signals, and a table displays the count and recommended action, helping traders decide whether to hold or flip positions.
Key Components
Period High/Low Levels: Tracks the highest high and lowest low for each period, plotting red lines for highs and green lines for lows from the bar where they occurred, extending for a user-defined length (default: 200 bars).
Contrarian Signals: Generates buy signals (blue circles) when price crosses below the previous period’s low and sell signals (white circles) when price crosses above the previous period’s high, designed to capture potential reversals.
Blue Dot Tracker: Counts consecutive buy signals (“blue dots”). If three or more occur, it suggests a stronger trend, with the table recommending whether to “Hold Investment” or “Flip Investment.”
Action Table: A 2x2 table in the bottom-right corner displays the blue dot count and action (“Hold Investment” if count ≥ 4, else “Flip Investment”) for quick reference.
Mathematical Concepts
Period Detection: Uses an approximate bar count to define periods (1 bar for Daily, 5 bars for Weekly, 20 bars for Monthly on a daily chart). When a new period starts, the previous period’s high/low is finalized and plotted.
High/Low Tracking:
Highest high (periodHigh) and lowest low (periodLow) are updated within the period.
Lines are drawn at these levels when the period ends, starting from the bar where the extreme occurred (periodHighBar, periodLowBar).
Signal Logic:
Buy signal: ta.crossunder(close , prevPeriodLow) and not lowBroken and barstate.isconfirmed
Sell signal: ta.crossover(close , prevPeriodHigh) and not highBroken and barstate.isconfirmed
Flags (highBroken, lowBroken) prevent multiple signals for the same level within a period.
Blue Dot Counter: Increments on each buy signal, resets on a sell signal or if price exceeds the entry price after three or more buy signals.
Entry and Exit Rules
Buy Signal (Blue Circle): Triggered when the price crosses below the previous period’s low, suggesting a potential oversold condition and buying opportunity. The signal appears as a blue circle below the price bar.
Sell Signal (White Circle): Triggered when the price crosses above the previous period’s high, indicating a potential overbought condition and selling opportunity. The signal appears as a white circle above the price bar.
Blue Dot Tracker:
Increments blueDotCount on each buy signal and sets an entryPrice on the first buy.
Resets on a sell signal or if price exceeds entryPrice after three or more buy signals.
If blueDotCount >= 3, the table suggests holding; if >= 4, it reinforces “Hold Investment.”
Exit Rules: Exit a buy position on a sell signal or when price exceeds the entry price after three or more buy signals. Combine with other tools (e.g., trendlines, support/resistance) for additional confirmation. Always apply proper risk management.
Recommended Usage
The "Contrarian Period High & Low" indicator is optimized for daily charts but can be adapted to other timeframes (e.g., 1H, 4H) with adjustments to the period bar count. It excels in markets with clear support/resistance levels and potential reversal zones. Traders should:
Backtest the indicator on their chosen asset and timeframe to validate signal reliability.
Combine with other technical tools (e.g., moving averages, Fibonacci levels) for stronger trade confirmation.
Adjust barsPerPeriod (e.g., ~120 bars for Weekly on hourly charts) based on the chart timeframe and market volatility.
Monitor the action table to guide position management based on blue dot counts.
Customization Options
Period Type: Choose between Daily, Weekly, or Monthly periods (default: Monthly).
Line Length: Set the length of high/low lines in bars (default: 200).
Show Highs/Lows: Toggle visibility of period high (red) and low (green) lines.
Max Lines to Keep: Limit the number of historical lines displayed (default: 10).
Hide Signals: Toggle buy/sell signal visibility for a cleaner chart.
Table Display: A fixed table in the bottom-right corner shows the blue dot count and action, with yellow (Hold) or green (Flip) backgrounds based on the count.
Why Use This Indicator?
The "Contrarian Period High & Low" indicator offers a unique blend of support/resistance visualization and contrarian signal generation, making it a versatile tool for identifying potential reversals. Its clear visual cues (lines and signals), blue dot tracker, and actionable table provide traders with an intuitive way to monitor market structure and manage trades. Whether you’re a beginner or an experienced trader, this indicator enhances your ability to spot key levels and time entries/exits effectively.
Tips for Users
Test the indicator thoroughly on your chosen market and timeframe to optimize settings (e.g., adjust barsPerPeriod for non-daily charts).
Use in conjunction with price action or other indicators for stronger trade setups.
Monitor the action table to decide whether to hold or flip positions based on blue dot counts.
Ensure your chart timeframe aligns with the selected period type (e.g., daily chart for Monthly periods).
Apply strict risk management to protect against false breakouts.
Happy trading with the Contrarian Period High & Low indicator! Share your feedback and strategies in the TradingView community!
Opening Range BoxThis indicator, called the "Opening Range Box," is a visual tool that helps you track the start of key trading sessions like London and New York.
It does three main things:
Finds the Daily 'First Move': It automatically calculates the High and Low reached during the first 30 minutes (or whatever time you set) of each defined session.
Draws a Box: It immediately draws a colored, transparent box on your chart from the moment the session starts. This box acts as a clear reference for the session's initial boundaries.
Extends the Levels: After the initial 30 minutes are over, the box stops growing vertically (it locks in the OR High/Low) but continues to stretch out horizontally for the rest of the trading session. This allows you to easily see how the price reacts to the opening levels throughout the day.
In short: It visually highlights the most important price levels established at the very beginning of the major market sessions.
Double Pattern Screener v7 //@version=6
indicator("Double Pattern Screener", shorttitle="DPS", overlay=false)
// Screener Inputs
leftBars = input.int(5, "Left Bars", minval=3, maxval=10)
rightBars = input.int(5, "Right Bars", minval=3, maxval=10)
tolerance = input.float(0.02, "Max Difference", step=0.01)
atrLength = input.int(14, "ATR Length", minval=1)
// NEW: Filter for number of equal peaks
filterPeaks = input.int(3, "Filter: Show Only X Equal Peaks", minval=2, maxval=5)
enableFilter = input.bool(true, "Enable Peak Count Filter")
// Arrays for tracking swings
var array todaySwingLevels = array.new(0)
var array swingCounts = array.new(0)
var array isResistance = array.new(0)
var array swingBars = array.new(0)
var int maxEqualPeaks = 0
var float nearestEqualLevel = na
var float distanceToNearest = na
var bool hasPattern = false
// Detect swings
swingHigh = ta.pivothigh(high, leftBars, rightBars)
swingLow = ta.pivotlow(low, leftBars, rightBars)
// Track current day
currentDay = dayofmonth
isNewDay = currentDay != currentDay
// Clear on new day
if barstate.isfirst or isNewDay
array.clear(todaySwingLevels)
array.clear(swingCounts)
array.clear(isResistance)
array.clear(swingBars)
maxEqualPeaks := 0
nearestEqualLevel := na
distanceToNearest := na
hasPattern := false
// Function to find matching level
findMatchingLevel(newLevel, isHigh) =>
matchIndex = -1
if array.size(todaySwingLevels) > 0
for i = 0 to array.size(todaySwingLevels) - 1
existingLevel = array.get(todaySwingLevels, i)
existingIsResistance = array.get(isResistance, i)
if math.abs(newLevel - existingLevel) <= tolerance and existingIsResistance == isHigh
matchIndex := i
break
matchIndex
// Process swing highs
if not na(swingHigh)
matchIndex = findMatchingLevel(swingHigh, true)
if matchIndex >= 0
newCount = array.get(swingCounts, matchIndex) + 1
array.set(swingCounts, matchIndex, newCount)
// Update max equal peaks
if newCount > maxEqualPeaks
maxEqualPeaks := newCount
else
array.push(todaySwingLevels, swingHigh)
array.push(swingCounts, 1)
array.push(isResistance, true)
array.push(swingBars, bar_index)
// Process swing lows
if not na(swingLow)
matchIndex = findMatchingLevel(swingLow, false)
if matchIndex >= 0
newCount = array.get(swingCounts, matchIndex) + 1
array.set(swingCounts, matchIndex, newCount)
// Update max equal peaks
if newCount > maxEqualPeaks
maxEqualPeaks := newCount
else
array.push(todaySwingLevels, swingLow)
array.push(swingCounts, 1)
array.push(isResistance, false)
array.push(swingBars, bar_index)
// Remove broken levels
if array.size(todaySwingLevels) > 0
for i = array.size(todaySwingLevels) - 1 to 0
level = array.get(todaySwingLevels, i)
isRes = array.get(isResistance, i)
levelBroken = isRes ? close > level : close < level
if levelBroken
removedCount = array.get(swingCounts, i)
array.remove(todaySwingLevels, i)
array.remove(swingCounts, i)
array.remove(isResistance, i)
array.remove(swingBars, i)
// Recalculate max if we removed the highest count
if removedCount == maxEqualPeaks
maxEqualPeaks := 0
if array.size(swingCounts) > 0
for j = 0 to array.size(swingCounts) - 1
count = array.get(swingCounts, j)
if count > maxEqualPeaks
maxEqualPeaks := count
// Calculate nearest equal level and distance
nearestEqualLevel := na
distanceToNearest := na
smallestDistance = 999999.0
if array.size(todaySwingLevels) > 0
for i = 0 to array.size(todaySwingLevels) - 1
count = array.get(swingCounts, i)
level = array.get(todaySwingLevels, i)
// Only consider levels with 2+ touches
if count >= 2
distance = math.abs(close - level)
if distance < smallestDistance
smallestDistance := distance
nearestEqualLevel := level
distanceToNearest := distance
// Pattern detection with filter
hasPattern := false
if maxEqualPeaks >= 2
if enableFilter
hasPattern := maxEqualPeaks == filterPeaks
else
hasPattern := true
// Screener outputs
patternSignal = hasPattern ? 1 : 0
numberEqualPeaks = maxEqualPeaks
nearestLevelPrice = nearestEqualLevel
distanceCents = distanceToNearest
// Calculate ATR normalized distance
atr = ta.atr(atrLength)
atrDistance = not na(distanceToNearest) and not na(atr) and atr > 0 ? distanceToNearest / atr : na
// Plot screener values
plot(patternSignal, title="Pattern Signal", display=display.data_window)
plot(numberEqualPeaks, title="Number Equal Peaks", display=display.data_window)
plot(nearestLevelPrice, title="Nearest Equal Level Price", display=display.data_window)
plot(distanceCents, title="Distance to Nearest (Price Units)", display=display.data_window)
plot(atrDistance, title="ATR Normalized Distance", display=display.data_window)
// Table for current symbol info
if barstate.islast
var table infoTable = table.new(position.top_right, 2, 6, bgcolor=color.new(color.black, 70))
table.cell(infoTable, 0, 0, "Symbol:", bgcolor=color.new(color.gray, 50), text_color=color.white)
table.cell(infoTable, 1, 0, syminfo.ticker, bgcolor=color.new(color.blue, 50), text_color=color.white)
table.cell(infoTable, 0, 1, "Pattern:", bgcolor=color.new(color.gray, 50), text_color=color.white)
table.cell(infoTable, 1, 1, str.tostring(patternSignal), bgcolor=patternSignal == 1 ? color.new(color.purple, 50) : color.new(color.gray, 50), text_color=color.white)
table.cell(infoTable, 0, 2, "Equal Peaks:", bgcolor=color.new(color.gray, 50), text_color=color.white)
table.cell(infoTable, 1, 2, str.tostring(numberEqualPeaks), bgcolor=color.new(color.yellow, 50), text_color=color.black)
table.cell(infoTable, 0, 3, "Nearest Level:", bgcolor=color.new(color.gray, 50), text_color=color.white)
table.cell(infoTable, 1, 3, str.tostring(nearestLevelPrice, "#.####"), bgcolor=color.new(color.orange, 50), text_color=color.white)
table.cell(infoTable, 0, 4, "Distance:", bgcolor=color.new(color.gray, 50), text_color=color.white)
table.cell(infoTable, 1, 4, str.tostring(distanceCents, "#.####"), bgcolor=color.new(color.green, 50), text_color=color.white)
table.cell(infoTable, 0, 5, "Filter Active:", bgcolor=color.new(color.gray, 50), text_color=color.white)
filterText = enableFilter ? str.tostring(filterPeaks) + " peaks" : "OFF"
table.cell(infoTable, 1, 5, filterText, bgcolor=enableFilter ? color.new(color.red, 50) : color.new(color.gray, 50), text_color=color.white)