Buy/Sell Signal - RSI + EMA + MACDSignal 'Buy' if all of the following three conditions are true
Rsi crosses above 55
Ema 9 crosses over ema 21
Macd histogram shows second green on
Signal 'Sell' if all of the following three conditions are true
Rsi crosses below 45
Ema 9 crosses below Ema 21
Macd histogram shows second red on
Pattern grafici
Daily Range % with Conditional SPX DirectionThis indicator visualizes the short-term market sentiment by combining the trend of the S&P 500 index (SPX) with daily price volatility (DP%).
Key Features:
Calculates a 5-period Exponential Moving Average (EMA) of SPX to detect trend direction:
Rising EMA → Uptrend
Falling EMA → Downtrend
Calculates a 5-period Simple Moving Average (SMA) of Daily Price Range % (DP%) to assess volatility trend:
Rising DP% → Increasing volatility
Falling DP% → Decreasing volatility
Background Colors:
Green: SPX trend up & volatility down → Bullish
Yellow:
SPX trend up & volatility up, or
SPX trend down & volatility down → Neutral
Red: SPX trend down & volatility up → Bearish
On-screen Labels:
Displays SPX trend direction (⬆️ / ⬇️)
Displays volatility direction (⬆️ / ⬇️)
Displays overall market sentiment: Bullish / Neutral / Bearish
This tool is designed to help traders quickly assess the relationship between trend and volatility, aiding in market environment analysis and discretionary trading decisions.
Daily Range % with Conditional SPX DirectionThis indicator visualizes the short-term market sentiment by combining the trend of the S&P 500 index (SPX) with daily price volatility (DP%).
Key Features:
Calculates a 5-period Exponential Moving Average (EMA) of SPX to detect trend direction:
Rising EMA → Uptrend
Falling EMA → Downtrend
Calculates a 5-period Simple Moving Average (SMA) of Daily Price Range % (DP%) to assess volatility trend:
Rising DP% → Increasing volatility
Falling DP% → Decreasing volatility
Background Colors:
Green: SPX trend up & volatility down → Bullish
Yellow:
SPX trend up & volatility up, or
SPX trend down & volatility down → Neutral
Red: SPX trend down & volatility up → Bearish
On-screen Labels:
Displays SPX trend direction (⬆️ / ⬇️)
Displays volatility direction (⬆️ / ⬇️)
Displays overall market sentiment: Bullish / Neutral / Bearish
This tool is designed to help traders quickly assess the relationship between trend and volatility, aiding in market environment analysis and discretionary trading decisions.
Automated Trading Session: New York KillzoneAutomated Trading Session: New York Killzone (Timezone & DST Aware)
This indicator tracks the New York Killzone session using intraday data and real-time timezone adjustments. It draws high/low boxes after the session ends and highlights the active session on your chart, making it ideal for traders focused on U.S. market volatility.
Key Features
Timezone & DST Support
Accurately reflects session timing based on your selected timezone and daylight saving settings.
Custom Session Input
Set your preferred New York Killzone hours (default: 08:00–09:30 New York time).
Visual Session Boxes
High/low ranges of the session are boxed on the chart for quick reference.
End-of-Session Alert
Get notified when the session closes, supporting both manual and automated workflows.
On-Chart Info Table
Displays active session time and timezone directly on the chart.
Guppy Multiple Moving Average (GMMA)The GMMA Momentum Indicator plots 12 EMAs on your chart, divided into two groups:
Short-term EMAs (6 lines, default periods: 3, 5, 8, 10, 12, 15): Represent short-term trader sentiment and momentum.
Long-term EMAs (6 lines, default periods: 30, 35, 40, 45, 50, 60): Reflect long-term investor behavior and broader market trends.
By analyzing the interaction between these two groups, the indicator identifies:
Bullish and bearish trends based on the relative positions of the short- and long-term EMAs.
Momentum strength through the spread or convergence of the EMAs.
Potential reversals or breakouts via compression signals.
This PineScript version enhances the traditional GMMA by adding visual cues like background colors, bearish signals, and compression detection, making it ideal for swing traders seeking clear, actionable insights.
The GMMA Momentum Indicator provides several key features:
1. Trend Identification
Bullish Trend: When the short-term EMAs (green lines) are above the long-term EMAs (blue lines) and spreading apart, it signals strong upward momentum. The chart background turns light green to highlight this condition.
Bearish Trend: When the short-term EMAs cross below the long-term EMAs and converge, it indicates downward momentum. The background turns light red, and an orange downward triangle appears above the bar to mark a new bearish signal.
2. Momentum Analysis
The spread between the short-term EMAs reflects the strength of short-term momentum. A wide spread suggests strong momentum, while a tight grouping indicates weakening momentum or consolidation. Similarly, the long-term EMAs act as dynamic support or resistance, guiding traders on the broader trend.
3. Compression Detection
Compression occurs when both the short-term and long-term EMAs converge, signaling low volatility and a potential breakout or reversal. A yellow upward triangle appears below the bar when compression is detected, alerting traders to watch for price action.
4. Visual Cues
Green short-term EMAs: Show short-term trader activity.
Blue long-term EMAs: Represent long-term investor sentiment.
Background colors: Light green for bullish trends, light red for bearish trends, and transparent for neutral conditions.
Orange downward triangles: Mark new bearish trends.
Yellow upward triangles: Indicate compression, hinting at potential breakouts.
How to Use the GMMA Momentum Indicator for Swing Trading
Swing trading involves capturing price moves over days to weeks, and the GMMA Momentum Indicator is an excellent tool for this strategy. Here’s how to use it effectively:
1. Identifying Trade Entries
Buy Opportunities:
Look for a bullish trend (green background) where the short-term EMAs are above the long-term EMAs and spreading apart, indicating strong momentum.
A compression signal (yellow triangle) followed by a breakout above resistance or a bullish candlestick pattern can confirm an entry.
Example: On a daily chart, if the short-term EMAs cross above the long-term EMAs and the background turns green, consider entering a long position, especially if volume supports the move.
Sell Opportunities:
Watch for a bearish signal (orange downward triangle) or a bearish trend (red background) where the short-term EMAs cross below the long-term EMAs.
Example: If the short-term EMAs collapse below the long-term EMAs and an orange triangle appears, it may signal a shorting opportunity or a time to exit longs.
2. Managing Trades
Use the long-term EMAs as dynamic support (in uptrends) or resistance (in downtrends) to set stop-loss levels or trail stops.
Monitor the spread of the short-term EMAs. A widening spread suggests the trend is strong, while convergence may indicate it’s time to take profits or tighten stops.
3. Anticipating Reversals
Compression signals (yellow triangles) highlight periods of low volatility, often preceding significant price moves. Combine these with price action (e.g., breakouts or reversals) or other indicators (e.g., RSI or volume) for confirmation.
Example: If a compression signal appears near a key support level and the price breaks upward, it could signal the start of a new bullish swing.
4. Best Practices
Timeframes: The indicator works well on daily or 4-hour charts for swing trading, but you can adjust the EMA periods for shorter (e.g., 1-hour) or longer (e.g., weekly) timeframes.
Confirmation: Combine the GMMA with other tools like support/resistance levels, candlestick patterns, or oscillators (e.g., MACD) to reduce false signals.
Risk Management: Always use proper position sizing and stop-losses, as EMAs are lagging indicators and may produce delayed signals in choppy markets.
Yosef26 - Hierarchical Decision Model//@version=5
indicator("Yosef26 - Hierarchical Decision Model", overlay=true)
// === Moving Averages ===
ema20 = ta.ema(close, 20)
ema50 = ta.ema(close, 50)
ema100 = ta.ema(close, 100)
// === Candle Components ===
priceRange = high - low
body = math.abs(close - open)
upperWick = high - math.max(close, open)
lowerWick = math.min(close, open) - low
volSMA = ta.sma(volume, 20)
// === Volume Momentum ===
volUp3 = (volume > volume ) and (volume > volume )
// === Candlestick Pattern Detection ===
bullishEngulfing = (close < open ) and (close > open) and (close > open ) and (open < close )
bearishEngulfing = (close > open ) and (close < open) and (close < open ) and (open > close )
doji = body < (priceRange * 0.1)
hammer = (lowerWick > body * 2) and (upperWick < body) and (close > open)
shootingStar = (upperWick > body * 2) and (lowerWick < body) and (close < open)
// === Multi-Timeframe Trend Detection ===
monthlyTrendUp = request.security(syminfo.tickerid, "M", close > ta.sma(close, 50))
weeklyTrendUp = request.security(syminfo.tickerid, "W", close > ta.sma(close, 50))
dailyTrendUp = close > ta.sma(close, 50)
// === Support/Resistance Zones ===
atSupport = low <= ta.lowest(low, 5)
atResistance = high >= ta.highest(high, 5)
// === Breakout Detection ===
breakoutAboveResistance = close > ta.highest(high , 5) and volume > volSMA and close > ema50
// === Confirming Candles ===
twoGreenCandles = (close > open) and (close > open )
twoRedCandles = (close < open) and (close < open )
// === Overextension Filter ===
overbought = close > ema20 * 1.05
// === Entry/Exit Conditions Tracking ===
var int lastEntryBar = na
var int lastExitBar = na
minBarsBetweenEntries = 10
canEnter = na(lastEntryBar) or (bar_index - lastEntryBar >= minBarsBetweenEntries and bar_index - lastExitBar >= minBarsBetweenEntries)
// === Continuation Filter (3 green candles with volume rise) ===
bullContinuation = (close > open) and (close > open ) and (close > open ) and (volume > volume ) and (volume > volume )
// === Entry Price Tracking ===
var float entryPrice = na
// === Weakness After Uptrend for Exit ===
recentGreenTrend = (close > open ) and (close > open ) and (close > open )
reversalCandle = shootingStar or bearishEngulfing or doji
reversalVolumeDrop = (volume < volume ) and (volume < volume )
signalWeakness = recentGreenTrend and reversalCandle and reversalVolumeDrop
// === Scoring System ===
entryScore = 0
entryScore := entryScore + (atSupport ? 3 : 0)
entryScore := entryScore + (bullishEngulfing ? 3 : 0)
entryScore := entryScore + (hammer ? 2 : 0)
entryScore := entryScore + (volUp3 ? 2 : 0)
entryScore := entryScore + ((volume > volSMA) ? 2 : 0)
entryScore := entryScore + ((close > ema20 or close > ema50) ? 1 : 0)
entryScore := entryScore + ((close > close ) ? 1 : 0)
entryScore := entryScore + (breakoutAboveResistance ? 2 : 0)
entryScore := entryScore + (twoGreenCandles ? 1 : 0)
entryScore := entryScore - (overbought ? 2 : 0)
entryScore := entryScore + ((monthlyTrendUp and weeklyTrendUp and dailyTrendUp) ? 2 : 0)
exitScore = 0
exitScore := exitScore + (atResistance ? 3 : 0)
exitScore := exitScore + (bearishEngulfing ? 3 : 0)
exitScore := exitScore + (shootingStar ? 2 : 0)
exitScore := exitScore + (doji ? 1 : 0)
exitScore := exitScore + ((volume < volSMA * 1.1) ? 1 : 0)
exitScore := exitScore + ((close < ema50) ? 1 : 0)
exitScore := exitScore + ((close < close ) ? 1 : 0)
exitScore := exitScore + (twoRedCandles ? 1 : 0)
exitScore := exitScore + ((not dailyTrendUp and not weeklyTrendUp) ? 2 : 0)
exitScore := exitScore + (signalWeakness ? 2 : 0)
// === Profit Target Exit Condition ===
profitTargetHit = not na(entryPrice) and close >= entryPrice * 1.09
profitZoneSignal = (atResistance or shootingStar or bearishEngulfing) and volume > volSMA
isNewHigh = high >= ta.highest(high, 50)
exitAtProfitTarget = profitTargetHit and profitZoneSignal and not isNewHigh
// === Final Decision Thresholds ===
entryCond1 = entryScore >= 8
entryCond2 = entryScore >= 6 and breakoutAboveResistance and volume > volSMA and close > ema50
entryCond3 = monthlyTrendUp and weeklyTrendUp and (close > ema50 or volume > volSMA or twoGreenCandles)
entryCond = (entryCond1 or entryCond2 or entryCond3) and canEnter
exitCondRaw = (exitScore >= 7)
exitCond = (exitCondRaw and not bullContinuation) or exitAtProfitTarget
// === Position Tracking ===
var bool inPosition = false
var int barsInPosition = 0
var label entryLabel = na
var label exitLabel = na
if entryCond and not inPosition
inPosition := true
barsInPosition := 0
lastEntryBar := bar_index
entryPrice := close
entryLabel := label.new(bar_index, close, "Entry @" + str.tostring(close), style=label.style_label_up, color=color.green, textcolor=color.white)
if inPosition
barsInPosition += 1
if exitCond and inPosition
inPosition := false
barsInPosition := 0
lastExitBar := bar_index
exitLabel := label.new(bar_index, close, "Exit @" + str.tostring(close), style=label.style_label_down, color=color.red, textcolor=color.white)
// === Alerts ===
alertcondition(entryCond, title="Entry Alert", message="Yosef26: Entry Signal (Hierarchical Model)")
alertcondition(exitCond, title="Exit Alert", message="Yosef26: Exit Signal (Hierarchical Model)")
Forex Sessions - Simple//@version=5
indicator("Forex Sessions - Simple", overlay=true)
// === INPUTS === //
showSydney = input.bool(true, "Show Sydney")
showTokyo = input.bool(true, "Show Tokyo")
showLondon = input.bool(true, "Show London")
showNY = input.bool(true, "Show New York")
// Color customization
colorSydney = input.color(color.new(color.blue, 70), "Sydney Color")
colorTokyo = input.color(color.new(color.orange, 70), "Tokyo Color")
colorLondon = input.color(color.new(color.green, 70), "London Color")
colorNY = input.color(color.new(color.red, 70), "New York Color")
// === SESSION LOGIC (UTC TIME) === //
sydneySession = showSydney and ((hour >= 22) or (hour < 7))
tokyoSession = showTokyo and (hour >= 0 and hour < 9)
londonSession = showLondon and (hour >= 8 and hour < 17)
nySession = showNY and (hour >= 13 and hour < 22)
// Determine active session (priority order: NY > London > Tokyo > Sydney)
sessionColor = color(na)
if nySession
sessionColor := colorNY
else if londonSession
sessionColor := colorLondon
else if tokyoSession
sessionColor := colorTokyo
else if sydneySession
sessionColor := colorSydney
// === BACKGROUND COLOR === //
bgcolor(sessionColor, title="Session Highlight")
// === SESSION LEGEND === //
var table legend = table.new(position.top_right, 1, 5, border_width=1)
if bar_index == 0
table.cell(legend, 0, 0, "Sessions", bgcolor=color.gray, text_color=color.white)
table.cell(legend, 0, 1, "Sydney", bgcolor=colorSydney)
table.cell(legend, 0, 2, "Tokyo", bgcolor=colorTokyo)
table.cell(legend, 0, 3, "London", bgcolor=colorLondon)
table.cell(legend, 0, 4, "New York", bgcolor=colorNY)
Color Coded Volume IndicatorColor Coded Volume Indicator
Overview
Splits each bar’s total volume into estimated buy-side vs. sell-side components and displays them as stacked two-tone columns (red = sell, green = buy). Axis labels and tooltips use “K”/“M” formatting.
Features
Stacked Two-Tone Columns
Red Base : estimated sell volume (50% opacity)
Green Top : remaining buy volume (50% opacity)
Automatic K/M Formatting via format=format.volume
Zero Baseline for clean reference at zero
Positive-Only Bars (no negatives)
How It Works
True-Range Guard
Skips bars where high == low to avoid divide-by-zero.
Volume Split
BuyVol = Volume × (Close − Low) / (High − Low)
SellVol = Volume × (High − Close) / (High − Low)
Both series clamped ≥ 0.
Layered Plot
Draw semi-transparent green at full height, then overlay red sell portion.
Usage
Open TradingView’s Pine Editor
Paste in the full script
Click “Save & Add to Chart”
In the Publish dialog, title it “Color Coded Volume Indicator” and paste this description.
Interpretation
Green-dominant bars → strong buying pressure
Red-dominant bars → strong selling pressure
Equal halves → balanced activity
Reintegration OPR zone 9h30📝 Indicator Description (for TradingView):
Name: Reintegration OPR Zone – 9:30 AM EST (UTC-4)
Purpose:
This indicator is designed for US indices like NAS100, US30, or SPX500. It helps identify potential false breakouts or retests by tracking when the price re-enters the Opening Price Range (OPR) after an initial breakout.
🔍 How it works:
At 9:30 AM New York time (UTC-4), the script captures the high and low of the first 15-minute candle (which is key for the US session open).
It then draws a horizontal box (rectangle) from the high to the low of that candle.
The box extends horizontally for 7 hours (28 candles on a 15-minute chart).
The script tracks if price:
Breaks above or below the OPR zone
Then re-enters the zone (a potential "fakeout" or "retest" signal)
No label or text is displayed on the chart (you requested it to be hidden).
🕒 Timeframe:
Designed for the 15-minute chart (M15)
Assumes New York session open at 9:30 AM EST (UTC-4)
Support & Resistance Automatically draws the crucial support and resistance lines.
Todays High and Low in Red.
Yesterdays High and Low in Orange.
ORB 15 min w/ PDHL + bands = $$$This indicator was created for the 15 min Opening Range Breakout Strategy. The goal was to incorporate Previous Day High and Low levels (PDHL).
For visual ease, the bands can be filled in and you can easily fill in an overlay color when the ORB intersects the PDHL.
Timeframe StrategyThis is a multi-timeframe trading strategy inspired by Ross Cameron's style, optimized for scalping and trend-following across various timeframes (1m, 5m, 15m, 1h, and 1D). The strategy integrates a comprehensive set of technical indicators, dynamic risk management, and visual tools.
Core Features
Dynamic Take Profit, Stop Loss & Trailing Stop
> Separate settings per timeframe for:
-TP% (Take Profit)
-SL% (Stop Loss)
-Trailing Stop %
-Cooldown bars
> Configurable via UI inputs.
>Smart Entry Conditions
Bullish entry: EMA9 crossover EMA20 and EMA50 > EMA200
Bearish entry: EMA9 crossunder EMA20 and EMA50 < EMA200
>Additional confirmation filters:
-Volume Filter (enabled/disabled via UI)
-Time Filter (e.g., only between 15:00–20:00 UTC)
-Spike Filter: rejects high-volatility candles
-RSI Filter: above/below 50 for trend confirmation
-ADX Filter (only applied on 1m, e.g., ADX > 15)
-Micro-Volatility Filter: minimum range percentage (1m only)
-Trend Filter (1m only): price must be above/below EMA200
>Trailing Stop Logic
-Configurable for each timeframe.
- Optional via toggle (use_trailing).
>Trade Cooldown Logic
-Prevents consecutive trades within X bars, configurable per timeframe.
>Technical Indicators Used
-EMA 9 / 20 / 50 / 200
-VWAP
-RSI (14)
-ATR (14) for volatility-based spike filtering
-Custom-calculated ADX (14) (manually implemented)
>Visual Elements
🔼/🔽 Entry signals (long/short) plotted on the chart.
📉 Table in bottom-left:
Displays current values of EMA/VWAP/volume/ATR/ADX.
> Optional "Tab info" panel in top-right (toggleable):
-Timeframe & strategy settings
-Live status of filters (volume, time, cooldown, spike, RSI, ADX, range, trend)
-Uses emoji (✅ / ❌) for quick diagnostics.
>User Customization
-Inputs per timeframe for all key parameters.
-Toggle switches for:
-Trailing stop
-Volume filter
-Info table visibility
This strategy is designed for active traders seeking a balance between momentum entry, risk control, and adaptability across timeframes. It's ideal for backtesting quick reversals or breakout setups in fast markets, especially at lower timeframes like 1m or 5m.
BIZ: Multi Purpose Indicator V3Multi Purpose Indicator:
1. MTF Table for all Timeframes
2. Support Resistance Zones: Yesterday + Today
3. Trend colored background
4. 200 Ema + 50 Ema + 9 Ema
5. Doji + Hammer Candles Indentify
Intraday Trading IndicatorIndicator Overview
Moving Averages: Uses a fast EMA (9-period) and a slow EMA (21-period) to determine the trend direction.
Market Profile Approximation: Utilizes VWAP (Volume Weighted Average Price) as a simplified proxy for value area, acting as a dynamic support/resistance level.
SMC: Incorporates the concept of trend confirmation and price interaction with key levels, focusing on pullbacks to the fast EMA within a trending market.
Signals: Generates buy and sell signals when price crosses the fast EMA, filtered by the trend (fast EMA vs. slow EMA) and VWAP position, aiming for high-probability setups.
This design ensures responsiveness on short timeframes while filtering out noise, aligning with the goal of accurate signals for intraday trading.
EMA+RSI Strong Confirmed Signals//@version=5
indicator("EMA+RSI Strong Confirmed Signals", overlay=true)
// --- Индикаторы
ema100 = ta.ema(close, 100)
ema200 = ta.ema(close, 200)
rsi = ta.rsi(close, 14)
vol = ta.sma(volume, 20) // средний объём
// --- Фильтры тренда
isUptrend = ema100 > ema200
isDowntrend = ema100 < ema200
// --- Усиленные условия входа
longCondition = isUptrend and ta.crossover(close, ema100) and rsi < 28 and volume > vol * 1.5
shortCondition = isDowntrend and ta.crossunder(close, ema100) and rsi > 72 and volume > vol * 1.5
// --- Take Profit и Stop Loss уровни
tpLong = close * 1.03
slLong = close * 0.975
tpShort = close * 0.97
slShort = close * 1.025
// --- Отображение на графике
plot(ema100, color=color.orange, title="EMA 100")
plot(ema200, color=color.red, title="EMA 200")
plot(longCondition ? tpLong : na, title="TP LONG", color=color.green)
plot(longCondition ? slLong : na, title="SL LONG", color=color.red)
plot(shortCondition ? tpShort : na, title="TP SHORT", color=color.green)
plot(shortCondition ? slShort : na, title="SL SHORT", color=color.red)
plotshape(longCondition, location=location.belowbar, color=color.lime, style=shape.labelup, text="STRONG LONG")
plotshape(shortCondition, location=location.abovebar, color=color.red, style=shape.labeldown, text="STRONG SHORT")
// --- Alertconditions для webhook
alertcondition(longCondition, title="STRONG LONG Signal", message='{"chat_id": "@exgosignal", "text": "{{ticker}} STRONG LONG сигнал по цене {{close}} (TP 3%, SL -2.5%)"}')
alertcondition(shortCondition, title="STRONG SHORT Signal", message='{"chat_id": "@exgosignal", "text": "{{ticker}} STRONG SHORT сигнал по цене {{close}} (TP 3%, SL -2.5%)"}')
stracturre.x// This source code is subject to the terms of the Mozilla Public License 2.0 at mozilla.org
// © @mr_khan_smc
////////////////////////////////////////
// Commercial Use Protection Notice:
// This code is protected for commercial use. Any unauthorized reproduction, distribution, or modification
// of this code for commercial purposes is strictly prohibited and may result in legal actions.
////////////////////////////////////////
//@version=5
indicator("stracturre.x", "KHAN SMC", true,
max_bars_back = 5000, max_labels_count = 500, max_lines_count = 500)
//#region variable declaration
var bool mnUp = na
var bool mnDn = na
float mnStrc = na
var top = high
var bot = low
var puUp = high
var puDn = low
var L = low
var H = high
var idmB = low
var idmS = high
var lastH = high
var lastL = low
var lastHH = high
var lastLL = low
//bar indexes
var int puUpbar = na
var int puDnbar = na
var int idmB_bar = na
var int idmS_bar = na
var int Hbar = bar_index
var int Lbar = bar_index
var int lastHbar = bar_index
var int lastLbar = bar_index
var int lastHHbar = bar_index
var int lastLLbar = bar_index
//structure confirmaions
lastHL = math.max(Hbar, Lbar)
var bool isBosUp = 0
var bool isBosDn = 0
var bool isCocUp = 1
var bool isCocDn = 1
//color
color transp = color.new(#59ff62, 5)
//drawing options
equalHL = input.bool(0,"Use equal H/L", "To calculate valid pullbacks and minor structure", group = "Calculation method")
showHL = input.bool(1, "Mark H/L", group = "H/L marking options")
HLcolor = input.color(color.rgb(0, 0, 0), "H/L color", group = "H/L marking options")
showMn = input.bool(0, "Mark out internal structure", group = "Internal structue")
puUpco = input.color(color.rgb(255, 82, 82) , "High pivots", inline = "mnco", group = "Internal structue")
puDnco = input.color(color.green, "Low pivots" , inline = "mnco", group = "Internal structue")
showBC = input.bool(1, "Mark BoS/ChoCH", group = "BoS/Choch")
bull = input.color(color.green, "Bull color", inline = "BSclor" ,group = "BoS/Choch")
bear = input.color(color.red , "Bear color", inline = "BSclor" ,group = "BoS/Choch")
showbarcolor = input.bool(0,"Bar color", group = "Bar color")
showSCOB = input.bool(1, "Show SCOB pattern", group = "Bar color")
scobUp = input.color(color.aqua , "Bullish SCOB", inline = "scob" , group = "Bar color")
scobDn = input.color(color.fuchsia, "Bearish SCOB", inline = "scob" , group = "Bar color")
showIDM = input.bool(1,"Mark previous IDM", group = "IDM")
showliveIDM = input.bool(1,"Mark live IDM", group = "IDM")
idmColor = input.color(color.rgb(21, 6, 230), "IDM color", group = "IDM")
var label lv_lbl = na
var line lv_line = na
showSw = input.bool(1, "Show H/L sweeping lines", group = "H/L sweeps")
markX = input.bool(1, 'Mark "X"', group = "H/L sweeps")
swColor = input.color(color.white, "Sweeping line color", group = "H/L sweeps")
//max line length
maxlen = bar_index - 500
//#endregion
//#region drawing functions
mnMark(bool UD) =>
if showMn
label.new(
x = UD ? puUpbar : puDnbar,
y = UD ? puUp : puDn,
yloc = UD ? yloc.abovebar : yloc.belowbar,
text = "",
color = UD ? puUpco : puDnco,
style = UD ? label.style_arrowdown : label.style_arrowup,
size = size.tiny
)
BoS_ChoCh(bool B_C, bool UpDn) =>
= switch
B_C == 1 and UpDn == 1 =>
B_C == 0 and UpDn == 1 =>
B_C == 0 and UpDn == 0 =>
B_C == 1 and UpDn == 0 =>
HLbarid := HLbarid < maxlen ? maxlen : HLbarid
if showBC
line.new(HLbarid, BCprc, bar_index, BCprc, color = BCcolor, style = line.style_dashed)
label.new(
int( math.avg(bar_index,HLbarid) ), BCprc
,BCtxt
,color = transp
,style = BCstyle
,textcolor = BCcolor
)
cfHL(bool ifHL) =>
= switch
ifHL =>
if high > H
else
=>
if low < L
else
ifHL_txt = if ifHL
if H == lastHH
"HH"
else
"LH"
else
if L == lastLL
"LL"
else
"HL"
cfHLStyle = ifHL ? label.style_label_down : label.style_label_up
if showHL
label.new(ifHLbarid,HLprc,ifHL_txt, color = transp, textcolor = HLcolor, style = cfHLStyle)
sweep(bool swHL, bool swHrLr) =>
swStyle = swHL ? label.style_label_down : label.style_label_up
= switch
swHL == 1 and swHrLr == 1 =>
swHL == 1 and swHrLr == 0 =>
swHL == 0 and swHrLr == 1 =>
swHL == 0 and swHrLr == 0 =>
swHLbarid := swHLbarid < maxlen ? maxlen : swHLbarid
//draw sweeping line
if showSw
line.new(swHLbarid,swprc,bar_index,swprc,color = swColor,style = line.style_dotted)
if markX
label.new(int(math.avg(bar_index,swHLbarid)),swprc, "X", color = transp, textcolor = swColor, style = swStyle, size = size.small)
IDM(bool BS) =>
IDMid = BS ? idmB_bar : idmS_bar
idmprc = BS ? idmB : idmS
idmStyle = BS ? label.style_label_up : label.style_label_down
IDMid := IDMid < maxlen ? maxlen : IDMid
//draw idm takeout line
if showIDM
line.new(IDMid,idmprc,bar_index,idmprc,color = idmColor,style = line.style_dotted)
label.new(int(math.avg(bar_index,IDMid)),idmprc, "IDM", color = transp, textcolor = idmColor, style = idmStyle,size = size.small)
//Bar color
ba_color = if showSCOB
if low == puDn and low >= low and close > high and close > low
scobUp
else if high == puUp and high <= high and close < low and close < high
scobDn
else if showbarcolor
isCocUp?bull:bear
else
na
barcolor(ba_color,-1)
//#endregion
//#region structure mapping
//update IDM
if (high > H or (high == H and equalHL)) and low > idmB
if low <= puDn
idmB := low
idmB_bar := bar_index
else
idmB := puDn
idmB_bar := puDnbar
if (low < L or (low == L and equalHL)) and high < idmS
if high >= puUp
idmS := high
idmS_bar := bar_index
else
idmS := puUp
idmS_bar := puUpbar
//Check for IDM and ChoCh
if isCocUp and lastHL != Lbar
if low < idmB
if idmB != lastL
IDM(1)
isBosUp := 0
lastH := H
lastHbar := Hbar
lastHH := H
lastHHbar := Hbar
cfHL(1)
L := low
Lbar := bar_index
else if lastH != lastHH and high > lastH
cfHL(0)
isCocDn := 0
isBosDn := 0
if close > lastH
BoS_ChoCh(0,1)
isCocUp := 1
else
sweep(1,0)
if isCocDn and lastHL != Hbar
if high > idmS
if idmS != lastH
IDM(0)
isBosDn := 0
lastL := L
lastLbar := Lbar
lastLL := L
lastLLbar := Lbar
cfHL(0)
H := high
Hbar := bar_index
else if low < lastL and lastL != lastLL
if close < lastL
BoS_ChoCh(0,0)
cfHL(1)
isCocDn := 1
isCocUp := 0
isBosUp := 0
else
sweep(0,1)
//Check for BoS
if isBosUp == 0
if high > lastHH
if close > lastHH
BoS_ChoCh(1,1)
cfHL(0)
lastL := L
lastLbar := Lbar
isCocUp := 1
isBosUp := 1
isCocDn := 0
isBosDn := 0
else
sweep(1,1)
if isBosDn == 0
if low < lastLL
if close < lastLL
BoS_ChoCh(1,0)
cfHL(1)
lastH := H
lastHbar := Hbar
isCocUp := 0
isBosUp := 0
isCocDn := 1
isBosDn := 1
else
sweep(0,0)
//#endregion
//#region internal structure
if equalHL
if high >= top
if low > bot
mnDn :=0
mnUp := 1
if low <= bot
if high < top
mnUp := 0
mnDn := 1
if mnUp and not mnUp
mnMark(1)
if mnDn and not mnDn
mnMark(0)
else
if high > top
if low > bot
mnDn :=0
mnUp := 1
if low < bot
if high < top
mnUp := 0
mnDn := 1
if mnUp and not mnUp
mnMark(1)
if mnDn and not mnDn
mnMark(0)
if equalHL
if high >= top
puUp := high
puUpbar := bar_index
if low <= bot
puDn := low
puDnbar := bar_index
top := high
bot := low
if high >= top
top := high
bot := low
else
if high > top
puUp := high
puUpbar := bar_index
if low < bot
puDn := low
puDnbar := bar_index
top := high
bot := low
if high > top
top := high
bot := low
//#endregion
//#region auto update High and Low vars
if high > H or (high == H and equalHL)
H := high
Hbar := bar_index
if high > idmS
idmS := high
idmS_bar := bar_index
if high > lastH or (high == lastH and equalHL)
lastH := high
lastHbar := bar_index
if high > lastHH or (high == lastHH and equalHL)
lastHH := high
lastHHbar := bar_index
if low < L or (low == L and equalHL)
L := low
Lbar := bar_index
if low < idmB
idmB := low
idmB_bar := bar_index
if low < lastL or (low == lastL and equalHL)
lastL := low
lastLbar := bar_index
if low < lastLL or (low == lastLL and equalHL)
lastLL := low
lastLLbar := bar_index
//#endregion
//#region live IDM
if showliveIDM and barstate.islast
= if isCocUp and lastHL == Hbar
else if isCocDn and lastHL == Lbar
lv_line := line.new(liveIDMbar, liveIDM, bar_index + 20, liveIDM, color = idmColor, style = line.style_dotted),
lv_lbl := label.new(bar_index + 20, liveIDM, "IDM", color = transp, textcolor = idmColor, style = isCocUp ? label.style_label_down : label.style_label_up, size = size.small)
else
lv_line := na
lv_lbl := na
line.delete(lv_line )
label.delete(lv_lbl )
//#endregion
//#region fixing bugs
// plot(H,"H")
// plot(lastH, "lastH")
// plot(lastHH, "lastHH")
// plot(idmS, "idmS")
// plot(puUp, "puUp")
// plot(L,"L")
// plot(lastL, "lastL")
// plot(lastLL, "lastLL")
// plot(idmB, "idmB")
// plot(puDn, "puDn")
//#endregion
HAHAHAThe "ICT Killzones + Macros" indicator is a comprehensive market structure and session visualizer built for day traders and ICT (Inner Circle Trader) method followers. It plots key session zones, previous highs/lows, and macro time blocks to help identify liquidity zones, entry windows, and price reactions.
ICT Killzones + Macros [TakingProphets]The "ICT Killzones + Macros" indicator is a comprehensive market structure and session visualizer built for day traders and ICT (Inner Circle Trader) method followers. It plots key session zones, previous highs/lows, and macro time blocks to help identify liquidity zones, entry windows, and price reactions.
Model+ - Trendlines & S/R//@version=5
indicator("Model+ - Trendlines & S/R", overlay=true)
// === Parameters ===
length = input.int(20, title="Pivot Length")
lookback = input.int(252, title="Lookback Period (trading days ~ 1 year)", minval=1, maxval=5000)
minTouches = input.int(2, title="Minimum Touches for Valid S/R")
maxLines = input.int(15, title="Max Lines")
tolerance = input.float(1.5, title="Price Tolerance for S/R Match")
// === Arrays to Store Pivot Points ===
var line supportLines = array.new_line()
var line resistanceLines = array.new_line()
var float supportLevels = array.new_float()
var float resistanceLevels = array.new_float()
// === Function to Check Pivot High ===
isPivotHigh(src, len, idx) =>
idxValid = idx - len >= 0 and idx + len < bar_index and idx < 5000
result = true
if idxValid
for j = 1 to len
result := result and src > src and src > src
else
result := false
result
// === Function to Check Pivot Low ===
isPivotLow(src, len, idx) =>
idxValid = idx - len >= 0 and idx + len < bar_index and idx < 5000
result = true
if idxValid
for j = 1 to len
result := result and src < src and src < src
else
result := false
result
// === Helper Function: Count Nearby Pivots ===
countTouches(src, level, lookbackBars) =>
count = 0
maxBack = math.min(lookbackBars, bar_index)
for j = 0 to maxBack - 1
if math.abs(src - level) <= tolerance
count := count + 1
count
// === Loop Over Past Bars to Find S/R Levels ===
startIdx = math.max(length, bar_index - math.min(lookback, 4500))
endIdx = bar_index - length
if bar_index > startIdx + length
for i = startIdx to endIdx by 1
if isPivotHigh(high, length, i)
lvl = high
touches = countTouches(high, lvl, lookback)
if touches >= minTouches
l = line.new(x1=i, y1=lvl, x2=bar_index, y2=lvl, color=color.red, width=1)
array.push(resistanceLines, l)
array.push(resistanceLevels, lvl)
if isPivotLow(low, length, i)
lvl = low
touches = countTouches(low, lvl, lookback)
if touches >= minTouches
l = line.new(x1=i, y1=lvl, x2=bar_index, y2=lvl, color=color.green, width=1)
array.push(supportLines, l)
array.push(supportLevels, lvl)
// === Clean Up Old Lines ===
while array.size(resistanceLines) > maxLines
line.delete(array.shift(resistanceLines))
array.shift(resistanceLevels)
while array.size(supportLines) > maxLines
line.delete(array.shift(supportLines))
array.shift(supportLevels)
Model+ - Trendlines Only// === Model+ Trendlines (Support/Resistance) ===
//@version=5
indicator("Model+ - Trendlines Only", overlay=true)
// Input parameters
pivotLookback = input.int(10, title="Pivot Lookback", minval=1)
minTouches = input.int(2, title="Minimum Touches for Trendline", minval=2)
// === Identify Highs and Lows ===
ph = ta.pivothigh(high, pivotLookback, pivotLookback)
pl = ta.pivotlow(low, pivotLookback, pivotLookback)
// === Store trendline candidate points ===
var line supportLines = array.new_line()
var line resistanceLines = array.new_line()
// === Function: draw horizontal level if repeated ===
plotSupportLevel(_price, _color) =>
line.new(x1=bar_index - pivotLookback, y1=_price, x2=bar_index, y2=_price, extend=extend.right, color=_color, width=1)
// === Find repeating lows (support) ===
var float supportLevels = array.new_float()
if pl
level = low
count = 0
for i = 0 to array.size(supportLevels) - 1
if math.abs(level - array.get(supportLevels, i)) <= syminfo.mintick * 20
count := count + 1
if count == 0
array.push(supportLevels, level)
plotSupportLevel(level, color.green)
// === Find repeating highs (resistance) ===
var float resistanceLevels = array.new_float()
if ph
level = high
count = 0
for i = 0 to array.size(resistanceLevels) - 1
if math.abs(level - array.get(resistanceLevels, i)) <= syminfo.mintick * 20
count := count + 1
if count == 0
array.push(resistanceLevels, level)
plotSupportLevel(level, color.red)
// === Notes ===
// This code marks horizontal support and resistance levels based on pivot points.
// It adapts automatically to different timeframes, showing relevant levels for each.
// Next step: add diagonal trendlines (ascending/descending) and pattern recognition.
Model+ - Dynamic Trendlines//@version=5
indicator("Model+ - Dynamic Trendlines", overlay=true)
// === Helper: Detect Swing Highs and Lows ===
isSwingLow(idx) => low < low and low < low
isSwingHigh(idx) => high > high and high > high
// === Function to find trendlines ===
findTrendline(_isLow, length) =>
var float point1 = na
var float point2 = na
var int idx1 = na
var int idx2 = na
for i = length to 1 by -1
if _isLow ? isSwingLow(i) : isSwingHigh(i)
if na(point1)
point1 := _isLow ? low : high
idx1 := bar_index - i
else if na(point2)
point2 := _isLow ? low : high
idx2 := bar_index - i
break
slope = (point2 - point1) / (idx2 - idx1)
offset = bar_index - idx2
start = point2 + slope * (-offset)
end = point2 + slope * (1 - offset)
// === Dynamic detection per timeframe ===
timeframeName = timeframe.period
len = switch timeframeName
"D" => 50
"W" => 30
"M" => 20
=> 50
// === Detect trendlines ===
= findTrendline(true, len)
= findTrendline(false, len)
// === Draw lines ===
var line trendSupport = na
var line trendResistance = na
if not na(startLow) and not na(endLow)
line.delete(trendSupport)
trendSupport := line.new(x1=bar_index - 1, y1=startLow, x2=bar_index, y2=endLow, color=color.green, width=2, style=line.style_solid)
if not na(startHigh) and not na(endHigh)
line.delete(trendResistance)
trendResistance := line.new(x1=bar_index - 1, y1=startHigh, x2=bar_index, y2=endHigh, color=color.red, width=2, style=line.style_solid)
// === Support/Resistance Horizontal (based on swing points) ===
getHorizontalLevels(n) =>
var float support = na
var float resistance = na
for i = n to 1 by -1
if isSwingLow(i) and na(support)
support := low
if isSwingHigh(i) and na(resistance)
resistance := high
if not na(support) and not na(resistance)
break
= getHorizontalLevels(len)
var line srSupportLine = na
var line srResistanceLine = na
if not na(supportLine)
line.delete(srSupportLine)
srSupportLine := line.new(x1=bar_index - len, y1=supportLine, x2=bar_index, y2=supportLine, color=color.green, style=line.style_dashed)
if not na(resistanceLine)
line.delete(srResistanceLine)
srResistanceLine := line.new(x1=bar_index - len, y1=resistanceLine, x2=bar_index, y2=resistanceLine, color=color.red, style=line.style_dashed)
AAPL Covered Call + CSP Alerts (Enhanced)This is a work-in-progress tool designed to help identify ideal setups for selling covered calls (CC) and cash-secured puts (CSP) on Apple (AAPL) using price levels, volume confirmation, and moving average context.
📈 What It Does
🔴 CC SELL Alert
Triggers when:
Price breaks above a custom resistance level
A volume spike confirms momentum
Designed to catch strong upside pushes where call premiums are rich.
🟠 CC WATCH Alert
Triggers when:
Price is near the 200-day MA
Volume is elevated but there’s no breakout yet
A pre-alert to watch for potential call-selling setups near resistance.
🟢 CSP BUY Alert
Triggers when:
Price drops below a custom support level
A volume flush signals potential short-term capitulation
Meant to time CSP entries when downside panic sets in.
⚙️ Adjustable Settings
Input Description
ccPriceTrigger Resistance level to trigger CC SELL
ccVolumeMultiplier Volume threshold for CC confirmation
maProximityBuffer Distance from 200 MA to trigger WATCH
cspSupportLevel Support level to trigger CSP BUY
cspVolumeMultiplier Volume threshold for CSP confirmation
🧭 Timeframe + Expiration Guidelines
Timeframe Use Case Recommended Option Expirations
1H Primary strategy view 21–30 days to expiration
15m Scalping / fast alerts 7–14 DTE (more sensitive)
Daily Swing or macro setups 30–45+ DTE for stability
📣 Alerts (How-To)
This script supports TradingView alerts — just right-click any chart and choose:
"Add Alert" → Select one of the following conditions:
"AAPL CC SELL Alert"
→ Triggers when breakout and volume spike align
"AAPL CC WATCH Alert"
→ Triggers when price approaches 200 MA with volume
"AAPL CSP Alert"
→ Triggers when support breaks with high volume
These alerts are great for traders who want real-time notification when premium-selling setups form — whether you're at your desk or mobile.
🧠 Strategy Context
Built after months of active trading on AAPL, this script distills real trading lessons from volume-based breakouts and support flushes into a signal system for timing covered call and CSP entries. We found these triggers especially reliable when paired with option delta targeting and open interest zones.
Feel free to clone, fork, or improve. Suggestions welcome — this is a living tool.
53 ToolkitTest
No functions
5-minute candlestick 3-tick rule: How to find a rebound point (short-term bottom) when a correction comes after an uptrend
The most stable way to make a profit when trading short-term is to accurately determine the point of rebound in the 'rise -> fall -> rebound' pattern.
Based on the premise that a decline is followed by a rebound, this is a formula created by analyzing the patterns of coins that frequently rebound.
Prevents being bitten at the high point by forcibly delaying the entry point according to market conditions. (HOW?)
Mostly 5-minute and 15-minute candles are used, but 30-minute candles can also be used depending on the situation.