Multiple Colored Moving AveragesMULTIPLE COLORED MOVING AVERAGES - USER GUIDE
DISCLAIMER
----------
Both the code and this documentation were created heavily using artificial intelligence. I'm lazy...
This indicator was inspired by repo32's "Moving Average Colored EMA/SMA" indicator. *
What is this indicator?
-----------------------
This is a TradingView indicator that displays up to 4 different moving averages on your chart simultaneously. Each moving average can be customized with different calculation methods, colors, and filtering options.
Why would I use multiple moving averages?
-----------------------------------------
- See trend direction across different timeframes at once
- Identify support and resistance levels
- Spot crossover signals between fast and slow MAs
- Reduce false signals with filtering options
- Compare how different MA types react to price action
What moving average types are available?
----------------------------------------
11 different types:
- SMA: Simple average, equal weight to all periods
- EMA: Exponential, more weight to recent prices
- WMA: Weighted, linear weighting toward recent data
- RMA: Running average, smooth like EMA
- DEMA: Double exponential, reduced lag
- TEMA: Triple exponential, even less lag
- HMA: Hull, fast and smooth combination
- VWMA: Volume weighted, includes volume data
- LSMA: Least squares, based on linear regression
- TMA: Triangular, double-smoothed
- ZLEMA: Zero lag exponential, compensated for lag
How do I set up the indicator?
------------------------------
Each MA has these settings:
- Enable/Disable: Turn each MA on or off
- Type: Choose from the 11 calculation methods
- Length: Number of periods (21, 50, 100, 200 are common)
- Smoothing: 0-10 levels of extra smoothing
- Noise Filter: 0-5% to ignore small changes
- Colors: Bullish (rising) and bearish (falling) colors
- Line Width: 1-5 pixels thickness
What does the smoothing feature do?
-----------------------------------
Smoothing applies extra calculations to make the moving average line smoother. Higher levels reduce noise but make the MA respond slower to price changes. Use higher smoothing in choppy markets, lower smoothing in trending markets.
What is the noise filter?
--------------------------
The noise filter ignores small percentage changes in the moving average. For example, a 0.3% filter will ignore any MA movement smaller than 0.3%. This helps eliminate false signals from minor price fluctuations.
When should I use this indicator?
---------------------------------
- Trend analysis: See if market is going up, down, or sideways
- Entry timing: Look for price bounces off MA levels
- Exit signals: Watch for MA slope changes or crossovers
- Support/resistance: MAs often act as dynamic levels
- Multi-timeframe analysis: Use different lengths for different perspectives
What are some good settings to start with?
-------------------------------------------
Conservative approach:
- MA 1: EMA 21 (short-term trend)
- MA 2: SMA 50 (medium-term trend)
- MA 3: SMA 200 (long-term trend)
- Low noise filtering (0.1-0.3%)
Active trading:
- MA 1: HMA 9 (very responsive)
- MA 2: EMA 21 (short-term)
- MA 3: EMA 50 (medium-term)
- Minimal or no smoothing
How do I interpret the colors?
------------------------------
Each MA changes color based on its direction:
- Bullish color: MA is rising (upward trend)
- Bearish color: MA is falling (downward trend)
- Gray: MA is flat or unchanged
What should I look for in crossovers?
-------------------------------------
- Golden Cross: Fast MA crosses above slow MA (bullish signal)
- Death Cross: Fast MA crosses below slow MA (bearish signal)
- Multiple crossovers in same direction can confirm trend changes
- Wait for clear separation between MAs after crossover
How do I use MAs for support and resistance?
---------------------------------------------
- In uptrends: MAs often provide support when price pulls back
- In downtrends: MAs may act as resistance on rallies
- Multiple MAs create support/resistance zones
- Stronger levels where multiple MAs cluster together
Can I use this with other indicators?
-------------------------------------
Yes, it works well with:
- Volume indicators for confirmation
- RSI or MACD for timing entries
- Bollinger Bands for volatility context
- Price action patterns for setup confirmation
What if I get too many signals?
-------------------------------
- Increase smoothing levels
- Raise noise filter percentages
- Use longer MA periods
- Focus on major crossovers only
- Wait for multiple MA confirmation
What if signals are too slow?
-----------------------------
- Reduce smoothing to 0
- Lower noise filter values
- Switch to faster MA types (HMA, ZLEMA, DEMA)
- Use shorter periods
- Focus on the fastest MA only
Which MA types work best in different markets?
----------------------------------------------
Trending markets: EMA, DEMA, TEMA (responsive to trends)
Choppy markets: SMA, TMA, HMA with smoothing (less whipsaws)
High volatility: Use higher smoothing and noise filtering
Low volatility: Use minimal filtering for better responsiveness
Do I need all the advanced features?
------------------------------------
No. Start with basic settings:
- Choose MA type and length
- Set colors you prefer
- Leave smoothing at 0
- Leave noise filter at 0
Add complexity only if needed to improve signal quality.
How do I know if my settings are working?
-----------------------------------------
- Backtest on historical data
- Paper trade the signals first
- Adjust based on market conditions
- Keep a trading journal to track performance
- Be willing to modify settings as markets change
Can I save different configurations?
------------------------------------
Yes, save different indicator templates in TradingView for:
- Different trading styles (scalping, swing trading)
- Different market conditions (trending, ranging)
- Different instruments (stocks, forex, crypto)
Индикаторы и стратегии
VIX CCI Oscillator [Compression + EMA Trigger + Bounce Glow]VIX CCI OSCILLATOR
ADJ CHART FOR YOUR LIKING
NOT AS SMOOTH AS PREVIOUS VERSION (STOCH)
SHOWS TIGER SIGNAL ON EMA
SAMEOUTPUT
HUD Box: emoji-coded tactical feedback
bounce 100 "💥 Expansion" :
bounce 0.8 "🔴 Overbought" :
bounce 0.618 "📉 Distribution" :
bounce 0.5 "🧠 Midline" :
bounce 0.382 "📈 Accumulation" :
bounce 0.2 "🟢 Oversold" :
bounce0.0 "💣 Expansion" : "⚪ Neutral"
Tiger EMA/STOCH
This logic checks if the oscillator is trending above or below its 48-period EMA,
If above, it paints the line GREEN🟢 (bullish),
If below, it paints it RED🔴 (bearish),
If compression is active, it overrides both with purple🟣 to highlight tactical squeeze conditions,
⚠️WARNING⚠️
ALWAYS REMEMBER THIS CHART IS VIX/USD
IN MOST CASES SPY MOVES VICE VERSA
I AM NOT RESPOSIBLE FOR YOUR OWN ACTIONS/TRADE IDEAS
Key Levels: Daily, Weekly, Monthly [BackQuant]Key Levels: Daily, Weekly, Monthly
Map the market’s “memory” in one glance—yesterday’s range, this week’s chosen day high/low, and D/W/M opens—then auto-clean levels once they break.
What it does
This tool plots three families of high-signal reference lines and keeps them tidy as price evolves:
Chosen Day High/Low (per week) — Pick a weekday (e.g., Monday). For each past week, the script records that day’s session high and low and projects them forward for a configurable number of bars. These act like “memory levels” that price often revisits.
Daily / Weekly / Monthly Opens — Plots the opening price of each new day, week, and month with separate styling. These opens frequently behave like magnets/flip lines intraday and anchors for regime on higher timeframes.
Auto-pruning — When price breaks a stored level, the script can automatically remove it to reduce clutter and refocus you on still-active lines. See: (broken levels removed).
Why these levels matter
Liquidity pockets — Prior day’s high/low and the daily open concentrate stops and pending orders. Mapping them quickly reveals likely sweep or fade zones. Example: previous day highs + daily open highlighting liquidity:
Context & regime — Monthly opens frame macro bias; trading above a rising cluster of monthly opens vs. below gives a clean top-down read. Example: monthly-only “macro outlook” view:
Cleaner charts — Auto-remove broken lines so you focus on what still matters right now.
What it plots (at a glance)
Past Chosen Day High/Low for up to N prior weeks (your choice), extended right.
Current Daily Open , Weekly Open , and Monthly Open , each with its own color, label, and forward extension.
Optional short labels (e.g., “Mon High”) or full labels (with week/month info).
How breaks are detected & cleaned
You control both the evidence and the timing of a “break”:
Break uses — Choose Close (more conservative) or Wick (more sensitive).
Inclusive? — If enabled, equality counts (≥ high or ≤ low). If disabled, you need a strict cross.
Allow intraday breaks? — If on, a level can break during the tracked day; if off, the script only counts breaks after the session completes.
Remove Broken Levels — When a break is confirmed, the line/label is deleted automatically. (See the demo: )
Quick start
Pick a Day of Week to Track (e.g., Monday).
Set how many weeks back to show (e.g., 8–10).
Choose how far to extend each family (bars to the right for chosen-day H/L and D/W/M opens).
Decide if a break uses Close or Wick , and whether equality counts.
Toggle Remove Broken Levels to keep the chart clean automatically.
Tips by use-case
Intraday bias — Watch the Daily Open as a magnet/flip. If price gaps above and holds, pullbacks to the daily open often decide direction. Pair with last day’s high/low for sweep→reversal or true breakout cues. See:
Weekly structure — Track the week’s chosen day (e.g., Monday) high/low across prior weeks. If price stalls near a cluster of old “Monday Highs,” look for sweep/reject patterns or continuation on reclaim.
Macro regime — Hide daily/weekly lines and keep only Monthly Opens to read bigger cycles at a glance (BTC/crypto especially). Example:
Customization
Use wicks or bodies for highs/lows (wicks capture extremes; bodies are stricter).
Line style & thickness — solid/dashed/dotted, width 1–5, plus global transparency.
Labels — Abbreviated (“Mon High”, “D Open”) or full (month/week/day info).
Color scheme — Separate colors for highs, lows, and each of D/W/M opens.
Capacity controls — Set how many daily/weekly/monthly opens and how many weeks of chosen-day H/L to keep visible.
What’s under the hood
On your selected weekday, the script records that session’s true high and true low (using wicks or body-based extremes—your choice), then projects a horizontal line forward for the next bars.
At each new day/week/month , it records the opening price and projects that line forward as well.
Each bar, the script checks your “break” rules; once broken, lines/labels are removed if auto-cleaning is on.
Everything updates in real time; past levels don’t repaint after the session finishes.
Recommended presets
Day trading — Weeks back: 6–10; extend D/W opens: 50–100 bars; Break uses: Close ; Inclusive: off; Auto-remove: on.
Swing — Fewer daily opens, more weekly opens (2–6), and 8–12 weeks of chosen-day H/L.
Macro — Show only Monthly Opens (1–6 months), dashed style, thicker lines for clarity.
Reading the examples
Broken lines disappear — decluttering in action:
Macro outlook — monthly opens as cycle rails:
Liquidity map — previous day highs + daily open:
Final note
These are not “signals”—they’re reference points that many participants watch. By standardising how you draw them and automatically clearing the ones that no longer matter, you turn a noisy chart into a focused map: where liquidity likely sits, where price memory lives, and which lines are still in play.
RMA Smoothed RSIRMA Smoothed RSI
Description:
An enhanced RSI built for cleaner intraday and swing reads. It applies RMA smoothing to damp noise.
How It Works
RSI (RMA-Smoothed):
Computes classic RSI from price changes and smooths the result with an additional RMA (user-controlled 3–7, where 5 is the sweet spot). This reduces whipsaw while preserving shifts in momentum.
How to Interpret
50 Midline = Bias Filter: Above 50 favors strength; below 50 favors weakness.
RSI vs RSI-MA Crosses: Cross up can precede thrust or mean-revert toward 50; cross down the opposite.
Inputs
Length: RSI period (default 14).
Source: Price source for RSI (default Close).
Smoothing: RMA smoothing length on RSI (3–7; default 3; 5 sweet spot).
Calculate Divergence: Toggle to compute pivots/divergences and enable alerts.
Moving Average Type: None, SMA, EMA, WMA, VWMA (default EMA).
MA Length: Length of the RSI-based MA (separate from RSI length).
Best For
Traders who want a cleaner RSI read without losing responsiveness.
Scalpers timing momentum shifts around the 50 line and MA crosses.
Swing traders using divergences as early reversal context.
Pro Tips
For fast intraday charts, start with Length 14, Smoothing 3–5, and EMA as the RSI-MA.
Use 50 reclaims/rejections as a simple regime filter.
Combine divergence labels with volume surges, key S/R, or volatility tools (e.g., BBW/TTM squeeze) to time entries.
Divergence alerts fire only if Calculate Divergence is enabled—keep it on if you rely on signals.
Chanpreet Moving AveragesChanpreet Moving Averages
by Chanpreet Singh
This script plots up to four customizable moving averages (SMA, EMA, SMMA/RMA, WMA, VWMA).
You can adjust:
Moving average type
Source (close, open, hl2, etc.)
Length
Color
An optional input lets you select a higher or custom timeframe for the moving averages (e.g., daily MA on a 1-hour chart). If left empty, the script calculates them on the current chart timeframe, so the lines scale and move naturally when zooming or panning.
This tool is designed for educational and visualization purposes, helping traders see trend direction and potential areas of dynamic support/resistance.
⚠️ Disclaimer: This script does not provide financial advice or trading signals. Use it at your own risk. Always do your own research before making trading decisions.
Ravi AlgoBot📌 Indicator Description (Publish Notes)
Indicator Name:
EoR / EoS Entry & SL/Target Manager (Put=Red, Call=Green)
Purpose:
यह indicator उन traders के लिए बनाया गया है जो अपनी manual levels (EoR, EoR+1 for Put, और EoS, EoS-1 for Call) को chart पर plot करना चाहते हैं और उनके आधार पर Entry, Stop Loss और Target manage करना चाहते हैं।
How it works:
आप manual prices (EoR, EoR+1, EoS, EoS-1) input fields में डालेंगे।
Put levels (EoR, EoR+1) लाल रंग में दिखेंगे।
Call levels (EoS, EoS-1) हरे रंग में दिखेंगे।
हर price पर chart पर horizontal line + label बनेगा।
आप अपने Stop Loss और Target prices भी manual डाल सकते हैं (Call और Put दोनों के लिए अलग-अलग)।
जब भी price किसी entry/SL/Target level को touch करेगा:
Chart पर signal shape बनेगा (triangle)
एक alertcondition trigger होगा।
आप TradingView में Alerts create करके इन alerts को webhook URL से connect कर सकते हैं।
Example: जब EoR Put level touch हो → webhook के ज़रिए broker/bot में auto order लग जाएगा।
SL और Target levels भी इसी तरह alerts से manage होंगे।
Use Case:
Manual level-based intraday या positional trading
Automated trading setup (via TradingView alerts → Webhook → Broker API)
Put/Call entry, target, SL को clearly visualize और monitor करना
Disclaimer:
यह indicator trading automation tool नहीं है। Actual buy/sell orders Pine Script से नहीं लग सकते। Order execution केवल TradingView Alerts और external webhook के integration से ही possible है। कृपया पहले paper-trade और test करें।
AI+ Scalper [BigMoneyMazz Enhanced]Overview:
A professional-grade multi-factor trading indicator that combines trend, momentum, volatility, and volume analysis into a single composite oscillator. It provides clear visual buy/sell signals on your chart with automatic stop-loss and take-profit levels.
How It Works:
4-Way Market Analysis: Analyzes trend strength (ADX), momentum (your choice of 3 oscillators), volatility (ATR), and volume (OBV)
Smart Signal Generation: Only generates signals when multiple factors align (price above/below dynamic thresholds, trend confirmation, and sufficient volatility)
Visual Trading Plan: Plots clear LONG/SHORT labels on your chart with dashed lines showing exact stop-loss (red) and take-profit (green) levels
Live Dashboard: Real-time monitoring of all market conditions in a handy table
Key Features:
🎯 Clear Chart Signals: Green "LONG" and red "SHORT" labels with arrows
⚡ Risk Management: Automatic ATR-based stop-loss and take-profit levels
📊 Smart Dashboard: All key metrics in one view (ADX, Oscillator, Trend, Volume)
🔒 Non-Repainting: Uses only confirmed closing prices for reliable signals
⚙️ Fully Customizable: Adjust every aspect to your trading style
Recommended Settings for Day Trading:
Timeframe: 5-15 minutes
ATR Multiplier SL: 1.5 (tight stop)
ATR Multiplier TP: 3.0 (2:1 risk-reward)
Momentum Mode: Stochastic RSI (most responsive)
Use HTF Filter: ON (15-minute timeframe)
Latching Mode: ON (avoids whipsaws)
Recommended Settings for Swing Trading:
Timeframe: 1H-4H
ATR Multiplier SL: 2.0
ATR Multiplier TP: 4.0 (2:1 risk-reward)
Momentum Mode: Fisher RSI (smoother)
Use HTF Filter: ON (4H or Daily timeframe)
Latching Mode: ON
How to Use:
Wait for LONG/SHORT labels to appear on your chart
Enter trade when price touches your preferred entry level
Set stop-loss at the red dashed line
Set take-profit at the green dashed line
Use the dashboard to confirm market conditions (ADX > 25 = strong trend)
Signal Interpretation:
LONG ▲: Strong buy signal - trend bullish, oscillator above upper threshold
SHORT ▼: Strong sell signal - trend bearish, oscillator below lower threshold
EXIT: Close position (SL/TP hit)
Pro Tip: The dashboard is your best friend! Check that ADX is above 25 (strong trend) and volume is confirming before entering any trade.
This indicator works best as a confirmation tool alongside your existing strategy rather than a completely automated system. Always practice proper risk management!
Mayfair FX Scalper V-10 Price Action + SMC//@version=5
indicator("Mayfair FX Scalper V-10 Price Action + SMC", overlay=true)
// === INPUTS ===
rsiLength = input.int(14, title="RSI Length")
overbought = input.float(73, title="SELL Level")
oversold = input.float(31, title="BUY Level")
rsiSrc = input.source(open, title="RSI Source")
// === Color Inputs ===
entryLineColor = input.color(color.white, title="entry Label Color")
entryLabelColor = input.color(color.white, title="entry Lable Color")
slLineColor = input.color(color.red, title="Stop Loss Line Color")
slLabelColor = input.color(color.red, title="Stop Loss Label Color")
tpLineColor = input.color(color.blue, title="Take Profit Line Color")
tpLabelColor = input.color(color.blue, title="Take Profit Color")
entryTextColor = input.color(color.rgb(0, 0, 0) , title="entry Text Color")
slTextColor = input.color(color.white, title="Stop Lose Color")
tpTextColor = input.color(color.white, title="Take Profit Text Color")
//indicator("Author Info Display"
// Create table
var table infoTable = table.new(position.top_right, 2, 6, bgcolor=color.new(#000000, 1), border_width=1)
if barstate.islast
table.cell(infoTable, 0, 0, "Author:", text_color=color.white, text_size=size.small)
table.cell(infoTable, 1, 0, "MR WOW", text_color=color.rgb(255, 251, 0), text_size=size.large)
table.cell(infoTable, 0, 1, "YouTube:", text_color=color.white, text_size=size.small)
table.cell(infoTable, 1, 1, "www.youtube.com/@iammrwow", text_color=color.rgb(255, 251, 0), text_size=size.small)
table.cell(infoTable, 0, 3, "Website:", text_color=color.white, text_size=size.small)
table.cell(infoTable, 1, 3, "www.mrwowea.com", text_color=color.rgb(255, 251, 0), text_size=size.small)
// === RSI CALCULATION ===
rsi = ta.rsi(rsiSrc, rsiLength)
rawBuySignal = rsi < oversold
rawSellSignal = rsi > overbought
// === Confirmed Signals ===
isBullish = close > open
isBearish = close < open
newBuy = rawBuySignal and isBullish and close > open == false
newSell = rawSellSignal and isBearish and close < open == false
// === Trade State Variables ===
var bool inPosition = false
var bool isBuy = false
var float entryPrice = na
var float slPrice = na
var float tp1Price = na
var float tp2Price = na
var float tp3Price = na
var int entryBarIndex = na
var label labels = array.new()
var line lines = array.new()
// === Instrument & Timeframe SL/TP Setup ===
isGold = str.contains(syminfo.ticker, "XAU") or str.contains(syminfo.ticker, "GOLD")
instrumentType = syminfo.type == "crypto" ? "Crypto" : isGold ? "Gold" : syminfo.currency == "JPY" ? "JPY" : "Forex"
tf = timeframe.period
slPipsGold = tf == "1" ? 30 : tf == "3" ? 45 : tf == "5" ? 50 : tf == "15" ? 60 : 70
slPipsCrypto = tf == "1" ? 5 : tf == "3" ? 8 : tf == "5" ? 12 : tf == "15" ? 15 : 10
slPipsForex = tf == "1" ? 6 : tf == "3" ? 9 : tf == "5" ? 11 : tf == "15" ? 15 : 15
gold_slDist = 0.1 * slPipsGold
gold_tp1Dist = gold_slDist
gold_tp2Dist = gold_slDist * 2
gold_tp3Dist = gold_slDist * 3
pipSize = instrumentType == "Crypto" ? 1.0 : instrumentType == "Gold" or instrumentType == "JPY" ? 0.01 : 0.0001
slPips = instrumentType == "Crypto" ? slPipsCrypto : instrumentType == "Gold" ? slPipsGold : slPipsForex
slDist = slPips * pipSize
tp1Dist = slDist
tp2Dist = slDist * 2
tp3Dist = slDist * 3
// === Draw Line & Label ===
drawLine(y, txt, col, lblCol, extendToCurrent) =>
int lineEnd = extendToCurrent ? bar_index : entryBarIndex + 2
array.push(lines, line.new(entryBarIndex, y, lineEnd, y, color=col, width=2, extend=extend.none))
textCol = str.contains(txt, "Entry") ? entryTextColor : str.contains(txt, "Stop") ? slTextColor : tpTextColor
array.push(labels, label.new(lineEnd, y, txt, style=label.style_label_left, color=color.new(lblCol, 0), textcolor=textCol, size=size.small))
// === Check Exit ===
slHit = inPosition and ((isBuy and low <= slPrice) or (not isBuy and high >= slPrice))
tp3Hit = inPosition and ((isBuy and high >= tp3Price) or (not isBuy and low <= tp3Price))
shouldExit = slHit or tp3Hit
if shouldExit
for l in labels
label.delete(l)
array.clear(labels)
for ln in lines
line.delete(ln)
array.clear(lines)
inPosition := false
entryPrice := na
slPrice := na
tp1Price := na
tp2Price := na
tp3Price := na
entryBarIndex := na
// === Confirmed Signal with No Position ===
confirmedBuy = not inPosition and newBuy
confirmedSell = not inPosition and newSell
// === Signal Markers ===
plotshape(series=confirmedBuy, location=location.belowbar, color=color.rgb(33, 150, 243), style=shape.triangleup, text="BUY", textcolor=color.rgb(33, 150, 243))
plotshape(series=confirmedSell, location=location.abovebar, color=color.rgb(254, 254, 255), style=shape.triangledown, text="SELL", textcolor=color.rgb(239, 238, 247))
// === Entry Execution ===
if confirmedBuy or confirmedSell
entryPrice := close
entryBarIndex := bar_index
isBuy := confirmedBuy
inPosition := true
if isGold
slPrice := isBuy ? entryPrice - gold_slDist : entryPrice + gold_slDist
tp1Price := isBuy ? entryPrice + gold_tp1Dist : entryPrice - gold_tp1Dist
tp2Price := isBuy ? entryPrice + gold_tp2Dist : entryPrice - gold_tp2Dist
tp3Price := isBuy ? entryPrice + gold_tp3Dist : entryPrice - gold_tp3Dist
else
slPrice := isBuy ? entryPrice - slDist : entryPrice + slDist
tp1Price := isBuy ? entryPrice + tp1Dist : entryPrice - tp1Dist
tp2Price := isBuy ? entryPrice + tp2Dist : entryPrice - tp2Dist
tp3Price := isBuy ? entryPrice + tp3Dist : entryPrice - tp3Dist
drawLine(entryPrice, "Entry Price - After Candle Above Entry Price Then Place Trade: " + str.tostring(entryPrice), entryLineColor, entryLabelColor, false)
drawLine(slPrice, "Stop Loss: " + str.tostring(slPrice), slLineColor, slLabelColor, false)
drawLine(tp1Price, "(1:1) Take Profit: " + str.tostring(tp1Price), tpLineColor, tpLabelColor, false)
drawLine(tp2Price, "(2:1) Take Profit: " + str.tostring(tp2Price), tpLineColor, tpLabelColor, false)
drawLine(tp3Price, "(3:1) Take Profit: " + str.tostring(tp3Price), tpLineColor, tpLabelColor, false)
// === Update TP/SL Lines if Still in Trade ===
if inPosition and not (confirmedBuy or confirmedSell)
for ln in lines
line.delete(ln)
array.clear(lines)
for l in labels
label.delete(l)
array.clear(labels)
drawLine(entryPrice, "After Candle Closed Above Entry Line Buy & Below Sell :Entry Price-" + str.tostring(entryPrice), entryLineColor, entryLabelColor, true)
drawLine(slPrice, "Stop Loss: " + str.tostring(slPrice), slLineColor, slLabelColor, true)
drawLine(tp1Price, "(1:1) Take Profit: " + str.tostring(tp1Price), tpLineColor, tpLabelColor, true)
drawLine(tp2Price, "(2:1) Take Profit: " + str.tostring(tp2Price), tpLineColor, tpLabelColor, true)
drawLine(tp3Price, "(3:1) Take Profit: " + str.tostring(tp3Price), tpLineColor, tpLabelColor, true)
// === Bollinger Bands Inputs ===
bb_length = input.int(20, title="SMA & StdDev Length")
src = input.source(close, title="Source")
// === Bollinger Band Colors ===
color_upper_2_3 = input.color(color.new(#0db107, 64), title="Upper Band 2–3 Color")
color_upper_3_4 = input.color(color.new(#05c41f, 58), title="Upper Band 3–4 Color")
color_lower_2_3 = input.color(color.new(#bdbc9d, 80), title="Lower Band 2–3 Color")
color_lower_3_4 = input.color(color.new(#e9e6bf, 63), title="Lower Band 3–4 Color")
// === Bollinger Band Calculations ===
sma = ta.sma(src, bb_length)
stdev = ta.stdev(src, bb_length)
bb2_upper = sma + 2 * stdev
bb2_lower = sma - 2 * stdev
bb3_upper = sma + 3 * stdev
bb3_lower = sma - 3 * stdev
bb4_upper = sma + 4 * stdev
bb4_lower = sma - 4 * stdev
// === Hidden Plots for Fill ===
p_bb2_upper = plot(bb2_upper, color=na)
p_bb3_upper = plot(bb3_upper, color=na)
p_bb4_upper = plot(bb4_upper, color=na)
p_bb2_lower = plot(bb2_lower, color=na)
p_bb3_lower = plot(bb3_lower, color=na)
p_bb4_lower = plot(bb4_lower, color=na)
// === Band Zone Fills ===
fill(p_bb2_upper, p_bb3_upper, color=color_upper_2_3)
fill(p_bb3_upper, p_bb4_upper, color=color_upper_3_4)
fill(p_bb2_lower, p_bb3_lower, color=color_lower_2_3)
fill(p_bb3_lower, p_bb4_lower, color=color_lower_3_4)
//SMc
BULLISH_LEG = 1
BEARISH_LEG = 0
BULLISH = +1
BEARISH = -1
GREEN = #9c9c9c
RED = #9c9c9c
BLUE = #9c9c9c
GRAY = #ffffff
MONO_BULLISH = #b2b5be
MONO_BEARISH = #5d606b
HISTORICAL = 'Historical'
PRESENT = 'Present'
COLORED = 'Colored'
MONOCHROME = 'Monochrome'
ALL = 'All'
BOS = 'BOS'
CHOCH = 'CHoCH'
TINY = size.tiny
SMALL = size.small
NORMAL = size.normal
ATR = 'Atr'
RANGE = 'Cumulative Mean Range'
CLOSE = 'Close'
HIGHLOW = 'High/Low'
SOLID = '⎯⎯⎯'
DASHED = '----'
DOTTED = '····'
SMART_GROUP = 'Smart Money Concepts'
INTERNAL_GROUP = 'Real Time Internal Structure'
SWING_GROUP = 'Real Time Swing Structure'
BLOCKS_GROUP = 'Order Blocks'
EQUAL_GROUP = 'EQH/EQL'
GAPS_GROUP = 'Fair Value Gaps'
LEVELS_GROUP = 'Highs & Lows MTF'
ZONES_GROUP = 'Premium & Discount Zones'
modeTooltip = 'Allows to display historical Structure or only the recent ones'
styleTooltip = 'Indicator color theme'
showTrendTooltip = 'Display additional candles with a color reflecting the current trend detected by structure'
showInternalsTooltip = 'Display internal market structure'
internalFilterConfluenceTooltip = 'Filter non significant internal structure breakouts'
showStructureTooltip = 'Display swing market Structure'
showSwingsTooltip = 'Display swing point as labels on the chart'
showHighLowSwingsTooltip = 'Highlight most recent strong and weak high/low points on the chart'
showInternalOrderBlocksTooltip = 'Display internal order blocks on the chart Number of internal order blocks to display on the chart'
showSwingOrderBlocksTooltip = 'Display swing order blocks on the chart Number of internal swing blocks to display on the chart'
orderBlockFilterTooltip = 'Method used to filter out volatile order blocks It is recommended to use the cumulative mean range method when a low amount of data is available'
orderBlockMitigationTooltip = 'Select what values to use for order block mitigation'
showEqualHighsLowsTooltip = 'Display equal highs and equal lows on the chart'
equalHighsLowsLengthTooltip = 'Number of bars used to confirm equal highs and equal lows'
equalHighsLowsThresholdTooltip = 'Sensitivity threshold in a range (0, 1) used for the detection of equal highs & lows Lower values will return fewer but more pertinent results'
showFairValueGapsTooltip = 'Display fair values gaps on the chart'
fairValueGapsThresholdTooltip = 'Filter out non significant fair value gaps'
fairValueGapsTimeframeTooltip = 'Fair value gaps timeframe'
fairValueGapsExtendTooltip = 'Determine how many bars to extend the Fair Value Gap boxes on chart'
showPremiumDiscountZonesTooltip = 'Display premium, discount, and equilibrium zones on chart'
modeInput = input.string( HISTORICAL, 'Mode', group = SMART_GROUP, tooltip = modeTooltip, options = )
styleInput = input.string( COLORED, 'Style', group = SMART_GROUP, tooltip = styleTooltip,options = )
showTrendInput = input( false, 'Color Candles', group = SMART_GROUP, tooltip = showTrendTooltip)
showInternalsInput = input( true, 'Show Internal Structure', group = INTERNAL_GROUP, tooltip = showInternalsTooltip)
showInternalBullInput = input.string( ALL, 'Bullish Structure', group = INTERNAL_GROUP, inline = 'ibull', options = )
internalBullColorInput = input( GREEN, '', group = INTERNAL_GROUP, inline = 'ibull')
showInternalBearInput = input.string( ALL, 'Bearish Structure' , group = INTERNAL_GROUP, inline = 'ibear', options = )
internalBearColorInput = input( RED, '', group = INTERNAL_GROUP, inline = 'ibear')
internalFilterConfluenceInput = input( false, 'Confluence Filter', group = INTERNAL_GROUP, tooltip = internalFilterConfluenceTooltip)
internalStructureSize = input.string( TINY, 'Internal Label Size', group = INTERNAL_GROUP, options = )
showStructureInput = input( true, 'Show Swing Structure', group = SWING_GROUP, tooltip = showStructureTooltip)
showSwingBullInput = input.string( ALL, 'Bullish Structure', group = SWING_GROUP, inline = 'bull', options = )
swingBullColorInput = input( GREEN, '', group = SWING_GROUP, inline = 'bull')
showSwingBearInput = input.string( ALL, 'Bearish Structure', group = SWING_GROUP, inline = 'bear', options = )
swingBearColorInput = input( RED, '', group = SWING_GROUP, inline = 'bear')
swingStructureSize = input.string( SMALL, 'Swing Label Size', group = SWING_GROUP, options = )
showSwingsInput = input( false, 'Show Swings Points', group = SWING_GROUP, tooltip = showSwingsTooltip,inline = 'swings')
swingsLengthInput = input.int( 50, '', group = SWING_GROUP, minval = 10, inline = 'swings')
showHighLowSwingsInput = input( true, 'Show Strong/Weak High/Low',group = SWING_GROUP, tooltip = showHighLowSwingsTooltip)
showInternalOrderBlocksInput = input( true, 'Internal Order Blocks' , group = BLOCKS_GROUP, tooltip = showInternalOrderBlocksTooltip, inline = 'iob')
internalOrderBlocksSizeInput = input.int( 5, '', group = BLOCKS_GROUP, minval = 1, maxval = 20, inline = 'iob')
showSwingOrderBlocksInput = input( false, 'Swing Order Blocks', group = BLOCKS_GROUP, tooltip = showSwingOrderBlocksTooltip, inline = 'ob')
swingOrderBlocksSizeInput = input.int( 5, '', group = BLOCKS_GROUP, minval = 1, maxval = 20, inline = 'ob')
orderBlockFilterInput = input.string( 'Atr', 'Order Block Filter', group = BLOCKS_GROUP, tooltip = orderBlockFilterTooltip, options = )
orderBlockMitigationInput = input.string( HIGHLOW, 'Order Block Mitigation', group = BLOCKS_GROUP, tooltip = orderBlockMitigationTooltip, options = )
internalBullishOrderBlockColor = input.color(color.new(#808080, 80), 'Internal Bullish OB', group = BLOCKS_GROUP)
internalBearishOrderBlockColor = input.color(color.new(#808080, 80), 'Internal Bearish OB', group = BLOCKS_GROUP)
swingBullishOrderBlockColor = input.color(color.new(#808080, 80), 'Bullish OB', group = BLOCKS_GROUP)
swingBearishOrderBlockColor = input.color(color.new(#808080, 80), 'Bearish OB', group = BLOCKS_GROUP)
showEqualHighsLowsInput = input( true, 'Equal High/Low', group = EQUAL_GROUP, tooltip = showEqualHighsLowsTooltip)
equalHighsLowsLengthInput = input.int( 3, 'Bars Confirmation', group = EQUAL_GROUP, tooltip = equalHighsLowsLengthTooltip, minval = 1)
equalHighsLowsThresholdInput = input.float( 0.1, 'Threshold', group = EQUAL_GROUP, tooltip = equalHighsLowsThresholdTooltip, minval = 0, maxval = 0.5, step = 0.1)
equalHighsLowsSizeInput = input.string( TINY, 'Label Size', group = EQUAL_GROUP, options = )
showFairValueGapsInput = input( false, 'Fair Value Gaps', group = GAPS_GROUP, tooltip = showFairValueGapsTooltip)
fairValueGapsThresholdInput = input( true, 'Auto Threshold', group = GAPS_GROUP, tooltip = fairValueGapsThresholdTooltip)
fairValueGapsTimeframeInput = input.timeframe('', 'Timeframe', group = GAPS_GROUP, tooltip = fairValueGapsTimeframeTooltip)
fairValueGapsBullColorInput = input.color(color.new(#00ff68, 70), 'Bullish FVG' , group = GAPS_GROUP)
fairValueGapsBearColorInput = input.color(color.new(#ff0008, 70), 'Bearish FVG' , group = GAPS_GROUP)
fairValueGapsExtendInput = input.int( 1, 'Extend FVG', group = GAPS_GROUP, tooltip = fairValueGapsExtendTooltip, minval = 0)
showDailyLevelsInput = input( false, 'Daily', group = LEVELS_GROUP, inline = 'daily')
dailyLevelsStyleInput = input.string( SOLID, '', group = LEVELS_GROUP, inline = 'daily', options = )
dailyLevelsColorInput = input( BLUE, '', group = LEVELS_GROUP, inline = 'daily')
showWeeklyLevelsInput = input( false, 'Weekly', group = LEVELS_GROUP, inline = 'weekly')
weeklyLevelsStyleInput = input.string( SOLID, '', group = LEVELS_GROUP, inline = 'weekly', options = )
weeklyLevelsColorInput = input( BLUE, '', group = LEVELS_GROUP, inline = 'weekly')
showMonthlyLevelsInput = input( false, 'Monthly', group = LEVELS_GROUP, inline = 'monthly')
monthlyLevelsStyleInput = input.string( SOLID, '', group = LEVELS_GROUP, inline = 'monthly', options = )
monthlyLevelsColorInput = input( BLUE, '', group = LEVELS_GROUP, inline = 'monthly')
showPremiumDiscountZonesInput = input( false, 'Premium/Discount Zones', group = ZONES_GROUP , tooltip = showPremiumDiscountZonesTooltip)
premiumZoneColorInput = input.color( RED, 'Premium Zone', group = ZONES_GROUP)
equilibriumZoneColorInput = input.color( GRAY, 'Equilibrium Zone', group = ZONES_GROUP)
discountZoneColorInput = input.color( GREEN, 'Discount Zone', group = ZONES_GROUP)
//---------------------------------------------------------------------------------------------------------------------}
//DATA STRUCTURES & VARIABLES
//---------------------------------------------------------------------------------------------------------------------{
// @type UDT representing alerts as bool fields
// @field internalBullishBOS internal structure custom alert
// @field internalBearishBOS internal structure custom alert
// @field internalBullishCHoCH internal structure custom alert
// @field internalBearishCHoCH internal structure custom alert
// @field swingBullishBOS swing structure custom alert
// @field swingBearishBOS swing structure custom alert
// @field swingBullishCHoCH swing structure custom alert
// @field swingBearishCHoCH swing structure custom alert
// @field internalBullishOrderBlock internal order block custom alert
// @field internalBearishOrderBlock internal order block custom alert
// @field swingBullishOrderBlock swing order block custom alert
// @field swingBearishOrderBlock swing order block custom alert
// @field equalHighs equal high low custom alert
// @field equalLows equal high low custom alert
// @field bullishFairValueGap fair value gap custom alert
// @field bearishFairValueGap fair value gap custom alert
type alerts
bool internalBullishBOS = false
bool internalBearishBOS = false
bool internalBullishCHoCH = false
bool internalBearishCHoCH = false
bool swingBullishBOS = false
bool swingBearishBOS = false
bool swingBullishCHoCH = false
bool swingBearishCHoCH = false
bool internalBullishOrderBlock = false
bool internalBearishOrderBlock = false
bool swingBullishOrderBlock = false
bool swingBearishOrderBlock = false
bool equalHighs = false
bool equalLows = false
bool bullishFairValueGap = false
bool bearishFairValueGap = false
// @type UDT representing last swing extremes (top & bottom)
// @field top last top swing price
// @field bottom last bottom swing price
// @field barTime last swing bar time
// @field barIndex last swing bar index
// @field lastTopTime last top swing time
// @field lastBottomTime last bottom swing time
type trailingExtremes
float top
float bottom
int barTime
int barIndex
int lastTopTime
int lastBottomTime
// @type UDT representing Fair Value Gaps
// @field top top price
// @field bottom bottom price
// @field bias bias (BULLISH or BEARISH)
// @field topBox top box
// @field bottomBox bottom box
type fairValueGap
float top
float bottom
int bias
box topBox
box bottomBox
// @type UDT representing trend bias
// @field bias BULLISH or BEARISH
type trend
int bias
// @type UDT representing Equal Highs Lows display
// @field l_ine displayed line
// @field l_abel displayed label
type equalDisplay
line l_ine = na
label l_abel = na
// @type UDT representing a pivot point (swing point)
// @field currentLevel current price level
// @field lastLevel last price level
// @field crossed true if price level is crossed
// @field barTime bar time
// @field barIndex bar index
type pivot
float currentLevel
float lastLevel
bool crossed
int barTime = time
int barIndex = bar_index
// @type UDT representing an order block
// @field barHigh bar high
// @field barLow bar low
// @field barTime bar time
// @field bias BULLISH or BEARISH
type orderBlock
float barHigh
float barLow
int barTime
int bias
// @variable current swing pivot high
var pivot swingHigh = pivot.new(na,na,false)
// @variable current swing pivot low
var pivot swingLow = pivot.new(na,na,false)
// @variable current internal pivot high
var pivot internalHigh = pivot.new(na,na,false)
// @variable current internal pivot low
var pivot internalLow = pivot.new(na,na,false)
// @variable current equal high pivot
var pivot equalHigh = pivot.new(na,na,false)
// @variable current equal low pivot
var pivot equalLow = pivot.new(na,na,false)
// @variable swing trend bias
var trend swingTrend = trend.new(0)
// @variable internal trend bias
var trend internalTrend = trend.new(0)
// @variable equal high display
var equalDisplay equalHighDisplay = equalDisplay.new()
// @variable equal low display
var equalDisplay equalLowDisplay = equalDisplay.new()
// @variable storage for fairValueGap UDTs
var array fairValueGaps = array.new()
// @variable storage for parsed highs
var array parsedHighs = array.new()
// @variable storage for parsed lows
var array parsedLows = array.new()
// @variable storage for raw highs
var array highs = array.new()
// @variable storage for raw lows
var array lows = array.new()
// @variable storage for bar time values
var array times = array.new()
// @variable last trailing swing high and low
var trailingExtremes trailing = trailingExtremes.new()
// @variable storage for orderBlock UDTs (swing order blocks)
var array swingOrderBlocks = array.new()
// @variable storage for orderBlock UDTs (internal order blocks)
var array internalOrderBlocks = array.new()
// @variable storage for swing order blocks boxes
var array swingOrderBlocksBoxes = array.new()
// @variable storage for internal order blocks boxes
var array internalOrderBlocksBoxes = array.new()
// @variable color for swing bullish structures
var swingBullishColor = styleInput == MONOCHROME ? MONO_BULLISH : swingBullColorInput
// @variable color for swing bearish structures
var swingBearishColor = styleInput == MONOCHROME ? MONO_BEARISH : swingBearColorInput
// @variable color for bullish fair value gaps
var fairValueGapBullishColor = styleInput == MONOCHROME ? color.new(MONO_BULLISH,70) : fairValueGapsBullColorInput
// @variable color for bearish fair value gaps
var fairValueGapBearishColor = styleInput == MONOCHROME ? color.new(MONO_BEARISH,70) : fairValueGapsBearColorInput
// @variable color for premium zone
var premiumZoneColor = styleInput == MONOCHROME ? MONO_BEARISH : premiumZoneColorInput
// @variable color for discount zone
var discountZoneColor = styleInput == MONOCHROME ? MONO_BULLISH : discountZoneColorInput
// @variable bar index on current script iteration
varip int currentBarIndex = bar_index
// @variable bar index on last script iteration
varip int lastBarIndex = bar_index
// @variable alerts in current bar
alerts currentAlerts = alerts.new()
// @variable time at start of chart
var initialTime = time
// we create the needed boxes for displaying order blocks at the first execution
if barstate.isfirst
if showSwingOrderBlocksInput
for index = 1 to swingOrderBlocksSizeInput
swingOrderBlocksBoxes.push(box.new(na,na,na,na,xloc = xloc.bar_time,extend = extend.right))
if showInternalOrderBlocksInput
for index = 1 to internalOrderBlocksSizeInput
internalOrderBlocksBoxes.push(box.new(na,na,na,na,xloc = xloc.bar_time,extend = extend.right))
// @variable source to use in bearish order blocks mitigation
bearishOrderBlockMitigationSource = orderBlockMitigationInput == CLOSE ? close : high
// @variable source to use in bullish order blocks mitigation
bullishOrderBlockMitigationSource = orderBlockMitigationInput == CLOSE ? close : low
// @variable default volatility measure
atrMeasure = ta.atr(200)
// @variable parsed volatility measure by user settings
volatilityMeasure = orderBlockFilterInput == ATR ? atrMeasure : ta.cum(ta.tr)/bar_index
// @variable true if current bar is a high volatility bar
highVolatilityBar = (high - low) >= (2 * volatilityMeasure)
// @variable parsed high
parsedHigh = highVolatilityBar ? low : high
// @variable parsed low
parsedLow = highVolatilityBar ? high : low
// we store current values into the arrays at each bar
parsedHighs.push(parsedHigh)
parsedLows.push(parsedLow)
highs.push(high)
lows.push(low)
times.push(time)
//---------------------------------------------------------------------------------------------------------------------}
//USER-DEFINED FUNCTIONS
//---------------------------------------------------------------------------------------------------------------------{
// @function Get the value of the current leg, it can be 0 (bearish) or 1 (bullish)
// @returns int
leg(int size) =>
var leg = 0
newLegHigh = high > ta.highest( size)
newLegLow = low < ta.lowest( size)
if newLegHigh
leg := BEARISH_LEG
else if newLegLow
leg := BULLISH_LEG
leg
// @function Identify whether the current value is the start of a new leg (swing)
// @param leg (int) Current leg value
// @returns bool
startOfNewLeg(int leg) => ta.change(leg) != 0
// @function Identify whether the current level is the start of a new bearish leg (swing)
// @param leg (int) Current leg value
// @returns bool
startOfBearishLeg(int leg) => ta.change(leg) == -1
// @function Identify whether the current level is the start of a new bullish leg (swing)
// @param leg (int) Current leg value
// @returns bool
startOfBullishLeg(int leg) => ta.change(leg) == +1
// @function create a new label
// @param labelTime bar time coordinate
// @param labelPrice price coordinate
// @param tag text to display
// @param labelColor text color
// @param labelStyle label style
// @returns label ID
drawLabel(int labelTime, float labelPrice, string tag, color labelColor, string labelStyle) =>
var label l_abel = na
if modeInput == PRESENT
l_abel.delete()
l_abel := label.new(chart.point.new(labelTime,na,labelPrice),tag,xloc.bar_time,color=color(na),textcolor=labelColor,style = labelStyle,size = size.small)
// @function create a new line and label representing an EQH or EQL
// @param p_ivot starting pivot
// @param level price level of current pivot
// @param size how many bars ago was the current pivot detected
// @param equalHigh true for EQH, false for EQL
// @returns label ID
drawEqualHighLow(pivot p_ivot, float level, int size, bool equalHigh) =>
equalDisplay e_qualDisplay = equalHigh ? equalHighDisplay : equalLowDisplay
string tag = 'EQL'
color equalColor = swingBullishColor
string labelStyle = label.style_label_up
if equalHigh
tag := 'EQH'
equalColor := swingBearishColor
labelStyle := label.style_label_down
if modeInput == PRESENT
line.delete( e_qualDisplay.l_ine)
label.delete( e_qualDisplay.l_abel)
e_qualDisplay.l_ine := line.new(chart.point.new(p_ivot.barTime,na,p_ivot.currentLevel), chart.point.new(time ,na,level), xloc = xloc.bar_time, color = equalColor, style = line.style_dotted)
labelPosition = math.round(0.5*(p_ivot.barIndex + bar_index - size))
e_qualDisplay.l_abel := label.new(chart.point.new(na,labelPosition,level), tag, xloc.bar_index, color = color(na), textcolor = equalColor, style = labelStyle, size = equalHighsLowsSizeInput)
// @function store current structure and trailing swing points, and also display swing points and equal highs/lows
// @param size (int) structure size
// @param equalHighLow (bool) true for displaying current highs/lows
// @param internal (bool) true for getting internal structures
// @returns label ID
getCurrentStructure(int size,bool equalHighLow = false, bool internal = false) =>
currentLeg = leg(size)
newPivot = startOfNewLeg(currentLeg)
pivotLow = startOfBullishLeg(currentLeg)
pivotHigh = startOfBearishLeg(currentLeg)
if newPivot
if pivotLow
pivot p_ivot = equalHighLow ? equalLow : internal ? internalLow : swingLow
if equalHighLow and math.abs(p_ivot.currentLevel - low ) < equalHighsLowsThresholdInput * atrMeasure
drawEqualHighLow(p_ivot, low , size, false)
p_ivot.lastLevel := p_ivot.currentLevel
p_ivot.currentLevel := low
p_ivot.crossed := false
p_ivot.barTime := time
p_ivot.barIndex := bar_index
if not equalHighLow and not internal
trailing.bottom := p_ivot.currentLevel
trailing.barTime := p_ivot.barTime
trailing.barIndex := p_ivot.barIndex
trailing.lastBottomTime := p_ivot.barTime
if showSwingsInput and not internal and not equalHighLow
drawLabel(time , p_ivot.currentLevel, p_ivot.currentLevel < p_ivot.lastLevel ? 'LL' : 'HL', swingBullishColor, label.style_label_up)
else
pivot p_ivot = equalHighLow ? equalHigh : internal ? internalHigh : swingHigh
if equalHighLow and math.abs(p_ivot.currentLevel - high ) < equalHighsLowsThresholdInput * atrMeasure
drawEqualHighLow(p_ivot,high ,size,true)
p_ivot.lastLevel := p_ivot.currentLevel
p_ivot.currentLevel := high
p_ivot.crossed := false
p_ivot.barTime := time
p_ivot.barIndex := bar_index
if not equalHighLow and not internal
trailing.top := p_ivot.currentLevel
trailing.barTime := p_ivot.barTime
trailing.barIndex := p_ivot.barIndex
trailing.lastTopTime := p_ivot.barTime
if showSwingsInput and not internal and not equalHighLow
drawLabel(time , p_ivot.currentLevel, p_ivot.currentLevel > p_ivot.lastLevel ? 'HH' : 'LH', swingBearishColor, label.style_label_down)
// @function draw line and label representing a structure
// @param p_ivot base pivot point
// @param tag test to display
// @param structureColor base color
// @param lineStyle line style
// @param labelStyle label style
// @param labelSize text size
// @returns label ID
drawStructure(pivot p_ivot, string tag, color structureColor, string lineStyle, string labelStyle, string labelSize) =>
var line l_ine = line.new(na,na,na,na,xloc = xloc.bar_time)
var label l_abel = label.new(na,na)
if modeInput == PRESENT
l_ine.delete()
l_abel.delete()
l_ine := line.new(chart.point.new(p_ivot.barTime,na,p_ivot.currentLevel), chart.point.new(time,na,p_ivot.currentLevel), xloc.bar_time, color=structureColor, style=lineStyle)
l_abel := label.new(chart.point.new(na,math.round(0.5*(p_ivot.barIndex+bar_index)),p_ivot.currentLevel), tag, xloc.bar_index, color=color(na), textcolor=structureColor, style=labelStyle, size = labelSize)
// @function delete order blocks
// @param internal true for internal order blocks
// @returns orderBlock ID
deleteOrderBlocks(bool internal = false) =>
array orderBlocks = internal ? internalOrderBlocks : swingOrderBlocks
for in orderBlocks
bool crossedOderBlock = false
if bearishOrderBlockMitigationSource > eachOrderBlock.barHigh and eachOrderBlock.bias == BEARISH
crossedOderBlock := true
if internal
currentAlerts.internalBearishOrderBlock := true
else
currentAlerts.swingBearishOrderBlock := true
else if bullishOrderBlockMitigationSource < eachOrderBlock.barLow and eachOrderBlock.bias == BULLISH
crossedOderBlock := true
if internal
currentAlerts.internalBullishOrderBlock := true
else
currentAlerts.swingBullishOrderBlock := true
if crossedOderBlock
orderBlocks.remove(index)
// @function fetch and store order blocks
// @param p_ivot base pivot point
// @param internal true for internal order blocks
// @param bias BULLISH or BEARISH
// @returns void
storeOrdeBlock(pivot p_ivot,bool internal = false,int bias) =>
if (not internal and showSwingOrderBlocksInput) or (internal and showInternalOrderBlocksInput)
array a_rray = na
int parsedIndex = na
if bias == BEARISH
a_rray := parsedHighs.slice(p_ivot.barIndex,bar_index)
parsedIndex := p_ivot.barIndex + a_rray.indexof(a_rray.max())
else
a_rray := parsedLows.slice(p_ivot.barIndex,bar_index)
parsedIndex := p_ivot.barIndex + a_rray.indexof(a_rray.min())
orderBlock o_rderBlock = orderBlock.new(parsedHighs.get(parsedIndex), parsedLows.get(parsedIndex), times.get(parsedIndex),bias)
array orderBlocks = internal ? internalOrderBlocks : swingOrderBlocks
if orderBlocks.size() >= 100
orderBlocks.pop()
orderBlocks.unshift(o_rderBlock)
// @function draw order blocks as boxes
// @param internal true for internal order blocks
// @returns void
drawOrderBlocks(bool internal = false) =>
array orderBlocks = internal ? internalOrderBlocks : swingOrderBlocks
orderBlocksSize = orderBlocks.size()
if orderBlocksSize > 0
maxOrderBlocks = internal ? internalOrderBlocksSizeInput : swingOrderBlocksSizeInput
array parsedOrdeBlocks = orderBlocks.slice(0, math.min(maxOrderBlocks,orderBlocksSize))
array b_oxes = internal ? internalOrderBlocksBoxes : swingOrderBlocksBoxes
for in parsedOrdeBlocks
orderBlockColor = styleInput == MONOCHROME ? (eachOrderBlock.bias == BEARISH ? color.new(MONO_BEARISH,80) : color.new(MONO_BULLISH,80)) : internal ? (eachOrderBlock.bias == BEARISH ? internalBearishOrderBlockColor : internalBullishOrderBlockColor) : (eachOrderBlock.bias == BEARISH ? swingBearishOrderBlockColor : swingBullishOrderBlockColor)
box b_ox = b_oxes.get(index)
b_ox.set_top_left_point( chart.point.new(eachOrderBlock.barTime,na,eachOrderBlock.barHigh))
b_ox.set_bottom_right_point(chart.point.new(last_bar_time,na,eachOrderBlock.barLow))
b_ox.set_border_color( internal ? na : orderBlockColor)
b_ox.set_bgcolor( orderBlockColor)
// @function detect and draw structures, also detect and store order blocks
// @param internal true for internal structures or order blocks
// @returns void
displayStructure(bool internal = false) =>
var bullishBar = true
var bearishBar = true
if internalFilterConfluenceInput
bullishBar := high - math.max(close, open) > math.min(close, open - low)
bearishBar := high - math.max(close, open) < math.min(close, open - low)
pivot p_ivot = internal ? internalHigh : swingHigh
trend t_rend = internal ? internalTrend : swingTrend
lineStyle = internal ? line.style_dashed : line.style_solid
labelSize = internal ? internalStructureSize : swingStructureSize
extraCondition = internal ? internalHigh.currentLevel != swingHigh.currentLevel and bullishBar : true
bullishColor = styleInput == MONOCHROME ? MONO_BULLISH : internal ? internalBullColorInput : swingBullColorInput
if ta.crossover(close,p_ivot.currentLevel) and not p_ivot.crossed and extraCondition
string tag = t_rend.bias == BEARISH ? CHOCH : BOS
if internal
currentAlerts.internalBullishCHoCH := tag == CHOCH
currentAlerts.internalBullishBOS := tag == BOS
else
currentAlerts.swingBullishCHoCH := tag == CHOCH
currentAlerts.swingBullishBOS := tag == BOS
p_ivot.crossed := true
t_rend.bias := BULLISH
displayCondition = internal ? showInternalsInput and (showInternalBullInput == ALL or (showInternalBullInput == BOS and tag != CHOCH) or (showInternalBullInput == CHOCH and tag == CHOCH)) : showStructureInput and (showSwingBullInput == ALL or (showSwingBullInput == BOS and tag != CHOCH) or (showSwingBullInput == CHOCH and tag == CHOCH))
if displayCondition
drawStructure(p_ivot,tag,bullishColor,lineStyle,label.style_label_down,labelSize)
if (internal and showInternalOrderBlocksInput) or (not internal and showSwingOrderBlocksInput)
storeOrdeBlock(p_ivot,internal,BULLISH)
p_ivot := internal ? internalLow : swingLow
extraCondition := internal ? internalLow.currentLevel != swingLow.currentLevel and bearishBar : true
bearishColor = styleInput == MONOCHROME ? MONO_BEARISH : internal ? internalBearColorInput : swingBearColorInput
if ta.crossunder(close,p_ivot.currentLevel) and not p_ivot.crossed and extraCondition
string tag = t_rend.bias == BULLISH ? CHOCH : BOS
if internal
currentAlerts.internalBearishCHoCH := tag == CHOCH
currentAlerts.internalBearishBOS := tag == BOS
else
currentAlerts.swingBearishCHoCH := tag == CHOCH
currentAlerts.swingBearishBOS := tag == BOS
p_ivot.crossed := true
t_rend.bias := BEARISH
displayCondition = internal ? showInternalsInput and (showInternalBearInput == ALL or (showInternalBearInput == BOS and tag != CHOCH) or (showInternalBearInput == CHOCH and tag == CHOCH)) : showStructureInput and (showSwingBearInput == ALL or (showSwingBearInput == BOS and tag != CHOCH) or (showSwingBearInput == CHOCH and tag == CHOCH))
if displayCondition
drawStructure(p_ivot,tag,bearishColor,lineStyle,label.style_label_up,labelSize)
if (internal and showInternalOrderBlocksInput) or (not internal and showSwingOrderBlocksInput)
storeOrdeBlock(p_ivot,internal,BEARISH)
// @function draw one fair value gap box (each fair value gap has two boxes)
// @param leftTime left time coordinate
// @param rightTime right time coordinate
// @param topPrice top price level
// @param bottomPrice bottom price level
// @param boxColor box color
// @returns box ID
fairValueGapBox(leftTime,rightTime,topPrice,bottomPrice,boxColor) => box.new(chart.point.new(leftTime,na,topPrice),chart.point.new(rightTime + fairValueGapsExtendInput * (time-time ),na,bottomPrice), xloc=xloc.bar_time, border_color = boxColor, bgcolor = boxColor)
// @function delete fair value gaps
// @returns fairValueGap ID
deleteFairValueGaps() =>
for in fairValueGaps
if (low < eachFairValueGap.bottom and eachFairValueGap.bias == BULLISH) or (high > eachFairValueGap.top and eachFairValueGap.bias == BEARISH)
eachFairValueGap.topBox.delete()
eachFairValueGap.bottomBox.delete()
fairValueGaps.remove(index)
// @function draw fair value gaps
// @returns fairValueGap ID
drawFairValueGaps() =>
= request.security(syminfo.tickerid, fairValueGapsTimeframeInput, [close , open , time , high , low , time , high , low ],lookahead = barmerge.lookahead_on)
barDeltaPercent = (lastClose - lastOpen) / (lastOpen * 100)
newTimeframe = timeframe.change(fairValueGapsTimeframeInput)
threshold = fairValueGapsThresholdInput ? ta.cum(math.abs(newTimeframe ? barDeltaPercent : 0)) / bar_index * 2 : 0
bullishFairValueGap = currentLow > last2High and lastClose > last2High and barDeltaPercent > threshold and newTimeframe
bearishFairValueGap = currentHigh < last2Low and lastClose < last2Low and -barDeltaPercent > threshold and newTimeframe
if bullishFairValueGap
currentAlerts.bullishFairValueGap := true
fairValueGaps.unshift(fairValueGap.new(currentLow,last2High,BULLISH,fairValueGapBox(lastTime,currentTime,currentLow,math.avg(currentLow,last2High),fairValueGapBullishColor),fairValueGapBox(lastTime,currentTime,math.avg(currentLow,last2High),last2High,fairValueGapBullishColor)))
if bearishFairValueGap
currentAlerts.bearishFairValueGap := true
fairValueGaps.unshift(fairValueGap.new(currentHigh,last2Low,BEARISH,fairValueGapBox(lastTime,currentTime,currentHigh,math.avg(currentHigh,last2Low),fairValueGapBearishColor),fairValueGapBox(lastTime,currentTime,math.avg(currentHigh,last2Low),last2Low,fairValueGapBearishColor)))
// @function get line style from string
// @param style line style
// @returns string
getStyle(string style) =>
switch style
SOLID => line.style_solid
DASHED => line.style_dashed
DOTTED => line.style_dotted
// @function draw MultiTimeFrame levels
// @param timeframe base timeframe
// @param sameTimeframe true if chart timeframe is same as base timeframe
// @param style line style
// @param levelColor line and text color
// @returns void
drawLevels(string timeframe, bool sameTimeframe, string style, color levelColor) =>
= request.security(syminfo.tickerid, timeframe, [high , low , time , time],lookahead = barmerge.lookahead_on)
float parsedTop = sameTimeframe ? high : topLevel
float parsedBottom = sameTimeframe ? low : bottomLevel
int parsedLeftTime = sameTimeframe ? time : leftTime
int parsedRightTime = sameTimeframe ? time : rightTime
int parsedTopTime = time
int parsedBottomTime = time
if not sameTimeframe
int leftIndex = times.binary_search_rightmost(parsedLeftTime)
int rightIndex = times.binary_search_rightmost(parsedRightTime)
array timeArray = times.slice(leftIndex,rightIndex)
array topArray = highs.slice(leftIndex,rightIndex)
array bottomArray = lows.slice(leftIndex,rightIndex)
parsedTopTime := timeArray.size() > 0 ? timeArray.get(topArray.indexof(topArray.max())) : initialTime
parsedBottomTime := timeArray.size() > 0 ? timeArray.get(bottomArray.indexof(bottomArray.min())) : initialTime
var line topLine = line.new(na, na, na, na, xloc = xloc.bar_time, color = levelColor, style = getStyle(style))
var line bottomLine = line.new(na, na, na, na, xloc = xloc.bar_time, color = levelColor, style = getStyle(style))
var label topLabel = label.new(na, na, xloc = xloc.bar_time, text = str.format('P{0}H',timeframe), color=color(na), textcolor = levelColor, size = size.small, style = label.style_label_left)
var label bottomLabel = label.new(na, na, xloc = xloc.bar_time, text = str.format('P{0}L',timeframe), color=color(na), textcolor = levelColor, size = size.small, style = label.style_label_left)
topLine.set_first_point( chart.point.new(parsedTopTime,na,parsedTop))
topLine.set_second_point( chart.point.new(last_bar_time + 20 * (time-time ),na,parsedTop))
topLabel.set_point( chart.point.new(last_bar_time + 20 * (time-time ),na,parsedTop))
bottomLine.set_first_point( chart.point.new(parsedBottomTime,na,parsedBottom))
bottomLine.set_second_point(chart.point.new(last_bar_time + 20 * (time-time ),na,parsedBottom))
bottomLabel.set_point( chart.point.new(last_bar_time + 20 * (time-time ),na,parsedBottom))
// @function true if chart timeframe is higher than provided timeframe
// @param timeframe timeframe to check
// @returns bool
higherTimeframe(string timeframe) => timeframe.in_seconds() > timeframe.in_seconds(timeframe)
// @function update trailing swing points
// @returns int
updateTrailingExtremes() =>
trailing.top := math.max(high,trailing.top)
trailing.lastTopTime := trailing.top == high ? time : trailing.lastTopTime
trailing.bottom := math.min(low,trailing.bottom)
trailing.lastBottomTime := trailing.bottom == low ? time : trailing.lastBottomTime
// @function draw trailing swing points
// @returns void
drawHighLowSwings() =>
var line topLine = line.new(na, na, na, na, color = swingBearishColor, xloc = xloc.bar_time)
var line bottomLine = line.new(na, na, na, na, color = swingBullishColor, xloc = xloc.bar_time)
var label topLabel = label.new(na, na, color=color(na), textcolor = swingBearishColor, xloc = xloc.bar_time, style = label.style_label_down, size = size.tiny)
var label bottomLabel = label.new(na, na, color=color(na), textcolor = swingBullishColor, xloc = xloc.bar_time, style = label.style_label_up, size = size.tiny)
rightTimeBar = last_bar_time + 20 * (time - time )
topLine.set_first_point( chart.point.new(trailing.lastTopTime, na, trailing.top))
topLine.set_second_point( chart.point.new(rightTimeBar, na, trailing.top))
topLabel.set_point( chart.point.new(rightTimeBar, na, trailing.top))
topLabel.set_text( swingTrend.bias == BEARISH ? 'Strong High' : 'Weak High')
bottomLine.set_first_point( chart.point.new(trailing.lastBottomTime, na, trailing.bottom))
bottomLine.set_second_point(chart.point.new(rightTimeBar, na, trailing.bottom))
bottomLabel.set_point( chart.point.new(rightTimeBar, na, trailing.bottom))
bottomLabel.set_text( swingTrend.bias == BULLISH ? 'Strong Low' : 'Weak Low')
// @function draw a zone with a label and a box
// @param labelLevel price level for label
// @param labelIndex bar index for label
// @param top top price level for box
// @param bottom bottom price level for box
// @param tag text to display
// @param zoneColor base color
// @param style label style
// @returns void
drawZone(float labelLevel, int labelIndex, float top, float bottom, string tag, color zoneColor, string style) =>
var label l_abel = label.new(na,na,text = tag, color=color(na),textcolor = zoneColor, style = style, size = size.small)
var box b_ox = box.new(na,na,na,na,bgcolor = color.new(zoneColor,80),border_color = color(na), xloc = xloc.bar_time)
b_ox.set_top_left_point( chart.point.new(trailing.barTime,na,top))
b_ox.set_bottom_right_point(chart.point.new(last_bar_time,na,bottom))
l_abel.set_point( chart.point.new(na,labelIndex,labelLevel))
// @function draw premium/discount zones
// @returns void
drawPremiumDiscountZones() =>
drawZone(trailing.top, math.round(0.5*(trailing.barIndex + last_bar_index)), trailing.top, 0.95*trailing.top + 0.05*trailing.bottom, 'Premium', premiumZoneColor, label.style_label_down)
equilibriumLevel = math.avg(trailing.top, trailing.bottom)
drawZone(equilibriumLevel, last_bar_index, 0.525*trailing.top + 0.475*trailing.bottom, 0.525*trailing.bottom + 0.475*trailing.top, 'Equilibrium', equilibriumZoneColorInput, label.style_label_left)
drawZone(trailing.bottom, math.round(0.5*(trailing.barIndex + last_bar_index)), 0.95*trailing.bottom + 0.05*trailing.top, trailing.bottom, 'Discount', discountZoneColor, label.style_label_up)
//---------------------------------------------------------------------------------------------------------------------}
//MUTABLE VARIABLES & EXECUTION
//---------------------------------------------------------------------------------------------------------------------{
parsedOpen = showTrendInput ? open : na
candleColor = internalTrend.bias == BULLISH ? swingBullishColor : swingBearishColor
plotcandle(parsedOpen,high,low,close,color = candleColor, wickcolor = candleColor, bordercolor = candleColor)
if showHighLowSwingsInput or showPremiumDiscountZonesInput
updateTrailingExtremes()
if showHighLowSwingsInput
drawHighLowSwings()
if showPremiumDiscountZonesInput
drawPremiumDiscountZones()
if showFairValueGapsInput
deleteFairValueGaps()
getCurrentStructure(swingsLengthInput,false)
getCurrentStructure(5,false,true)
if showEqualHighsLowsInput
getCurrentStructure(equalHighsLowsLengthInput,true)
if showInternalsInput or showInternalOrderBlocksInput or showTrendInput
displayStructure(true)
if showStructureInput or showSwingOrderBlocksInput or showHighLowSwingsInput
displayStructure()
if showInternalOrderBlocksInput
deleteOrderBlocks(true)
if showSwingOrderBlocksInput
deleteOrderBlocks()
if showFairValueGapsInput
drawFairValueGaps()
if barstate.islastconfirmedhistory or barstate.islast
if showInternalOrderBlocksInput
drawOrderBlocks(true)
if showSwingOrderBlocksInput
drawOrderBlocks()
lastBarIndex := currentBarIndex
currentBarIndex := bar_index
newBar = currentBarIndex != lastBarIndex
if barstate.islastconfirmedhistory or (barstate.isrealtime and newBar)
if showDailyLevelsInput and not higherTimeframe('D')
drawLevels('D',timeframe.isdaily,dailyLevelsStyleInput,dailyLevelsColorInput)
if showWeeklyLevelsInput and not higherTimeframe('W')
drawLevels('W',timeframe.isweekly,weeklyLevelsStyleInput,weeklyLevelsColorInput)
if showMonthlyLevelsInput and not higherTimeframe('M')
drawLevels('M',timeframe.ismonthly,monthlyLevelsStyleInput,monthlyLevelsColorInput)
//---------------------------------------------------------------------------------------------------------------------}
//ALERTS
//---------------------------------------------------------------------------------------------------------------------{
alertcondition(currentAlerts.internalBullishBOS, 'Internal Bullish BOS', 'Internal Bullish BOS formed')
alertcondition(currentAlerts.internalBullishCHoCH, 'Internal Bullish CHoCH', 'Internal Bullish CHoCH formed')
alertcondition(currentAlerts.internalBearishBOS, 'Internal Bearish BOS', 'Internal Bearish BOS formed')
alertcondition(currentAlerts.internalBearishCHoCH, 'Internal Bearish CHoCH', 'Internal Bearish CHoCH formed')
alertcondition(currentAlerts.swingBullishBOS, 'Bullish BOS', 'Internal Bullish BOS formed')
alertcondition(currentAlerts.swingBullishCHoCH, 'Bullish CHoCH', 'Internal Bullish CHoCH formed')
alertcondition(currentAlerts.swingBearishBOS, 'Bearish BOS', 'Bearish BOS formed')
alertcondition(currentAlerts.swingBearishCHoCH, 'Bearish CHoCH', 'Bearish CHoCH formed')
alertcondition(currentAlerts.internalBullishOrderBlock, 'Bullish Internal OB Breakout', 'Price broke bullish internal OB')
alertcondition(currentAlerts.internalBearishOrderBlock, 'Bearish Internal OB Breakout', 'Price broke bearish internal OB')
alertcondition(currentAlerts.swingBullishOrderBlock, 'Bullish Swing OB Breakout', 'Price broke bullish swing OB')
alertcondition(currentAlerts.swingBearishOrderBlock, 'Bearish Swing OB Breakout', 'Price broke bearish swing OB')
alertcondition(currentAlerts.equalHighs, 'Equal Highs', 'Equal highs detected')
alertcondition(currentAlerts.equalLows, 'Equal Lows', 'Equal lows detected')
alertcondition(currentAlerts.bullishFairValueGap, 'Bullish FVG', 'Bullish FVG formed')
alertcondition(currentAlerts.bearishFairValueGap, 'Bearish FVG', 'Bearish FVG formed')
//---------------------------------------------------------------------------------------------------------------------}
Phoenix Pattern Scanner v1.3.2 - Multi-Pattern, Score & PresetsAdvanced multi-pattern scanner with intelligent presets and heuristic scoring system.
🎯 KEY FEATURES
- 5 Trading Style Presets: Conservative, Balanced, Aggressive, Swing, Scalp
- 4 Core Patterns: RVOL (unusual volume), Momentum breakout, RSI bounce, Gap & Go
- Heuristic Score (0-100): Visual ranking system for signal quality
- Per-Pattern Anti-Noise: Prevents signal spam with configurable minimum distance
- Relative Strength %: Compare performance vs benchmark (default SPY)
- Squeeze Detection: Identifies low volatility compression (BB inside Keltner)
📊 SMART FILTERS
- Minimum price and average dollar volume gates
- Weekly trend confirmation (optional)
- Separate lookback periods for each pattern
- Configurable RSI length and Gap parameters
⚙️ CUSTOMIZATION
- All parameters adjustable via settings
- Toggle individual components on/off
- Clean info panel with real-time metrics
- Color-coded score visualization
📍 BEST USED ON
- Daily timeframe (primary design)
- Liquid stocks above $5
- As a screening tool alongside your analysis
⚠️ IMPORTANT NOTES
- Educational/informational tool only
- NOT financial advice or trade signals
- Heuristic score is diagnostic, not predictive
- Past pattern behavior ≠ future results
💡 QUICK START
1. Select a preset matching your style
2. Adjust filters for your market
3. Set alerts for patterns you want to track
4. Use score as relative ranking, not absolute signal
Version 1.3.2 - Stable release
Open source - Free to use and modify
Feedback and improvements welcome
Multi-Timeframe Candle Color Dashboard (Closed Bars Only) V.2Pine Script
// This description should be added to the script's information section on TradingView.
//
// === คู่มือการใช้งาน: Multi-Timeframe Candle Color Dashboard ===
//
// **ภาพรวม:**
// อินดิเคเตอร์นี้แสดงสีของแท่งเทียนจากหลายไทม์เฟรม (M1, M5, M15, M30, H1, H4, D1) บนหน้าจอเดียว
// เพื่อช่วยให้คุณเห็นภาพรวมของแนวโน้มในแต่ละช่วงเวลาได้อย่างรวดเร็ว
//
// - **🟢 สีเขียว:** แสดงว่าแท่งเทียนเป็นขาขึ้น (Bullish) ตามจำนวนแท่งที่กำหนด
// - **🔴 สีแดง:** แสดงว่าแท่งเทียนเป็นขาลง (Bearish) ตามจำนวนแท่งที่กำหนด
// - **⚪ สีเทา:** แสดงว่ายังไม่มีทิศทางที่ชัดเจน
//
// **วิธีการใช้งาน:**
// 1. **การดูสัญญาณ:** ใช้ Dashboard เพื่อยืนยันว่าหลายไทม์เฟรมมีแนวโน้มไปในทิศทางเดียวกัน
// - **ตัวอย่าง:** หากคุณกำลังดูชาร์ต M5 แล้วพบว่า M15, M30 และ H1 เป็นสีเขียวทั้งหมด
// แสดงว่ามีแนวโน้มขาขึ้นที่แข็งแกร่งในภาพรวม ซึ่งอาจเป็นจังหวะที่ดีสำหรับการเข้าซื้อ
// 2. **การตั้งค่า:** คุณสามารถปรับแต่งการแสดงผลได้ในเมนู "Settings"
// - **Global Settings:** เลือกเปิด/ปิดการแสดงผลของแต่ละไทม์เฟรมที่คุณต้องการ
// - **Dashboard Style:** เลือกว่าจะให้ Dashboard แสดงผลเป็นแนวตั้ง (Vertical) หรือแนวนอน (Horizontal)
// - **Color Settings:** ปรับสีสำหรับแนวโน้มขาขึ้น (Bullish) และขาลง (Bearish) ได้ตามใจชอบ
//
// **การตั้งค่าการแจ้งเตือน (Alert):**
// อินดิเคเตอร์นี้รองรับการแจ้งเตือนเมื่อทุกไทม์เฟรมที่คุณเปิดใช้งานเป็นสีเขียวทั้งหมด
// 1. ไปที่เมนู "Alert" (รูปกระดิ่ง) ที่ด้านบนของ TradingView
// 2. ตั้งค่า "Condition" เป็นชื่ออินดิเคเตอร์นี้: `Multi-Timeframe Candle Color Dashboard`
// 3. ตั้งค่า "Condition" เป็น `Bullish Alert`
// 4. ตั้งค่า "Frequency" เป็น `Once Per Bar Close`
//
// === User Manual: Multi-Timeframe Candle Color Dashboard ===
//
// **Overview:**
// This indicator displays the candle color from multiple timeframes (M1, M5, M15, M30, H1, H4, D1) on a single screen,
// helping you to quickly see the trend direction across different time periods.
//
// - **🟢 Green:** Indicates that candles are bullish for the specified number of lookback bars.
// - **🔴 Red:** Indicates that candles are bearish for the specified number of lookback bars.
// - **⚪ Gray:** Indicates a neutral or undefined trend.
//
// **How to Use:**
// 1. **Signal Confirmation:** Use the dashboard to confirm that multiple timeframes are moving in the same direction.
// - **Example:** If you are on an M5 chart and see that the M15, M30, and H1 timeframes are all green,
// it suggests a strong overall bullish momentum, which could be a good entry signal.
// 2. **Settings:** You can customize the display in the "Settings" menu.
// - **Global Settings:** Select which timeframes you want to show or hide.
// - **Dashboard Style:** Choose between a vertical or horizontal layout for the dashboard.
// - **Color Settings:** Adjust the colors for bullish and bearish trends to your preference.
//
// **Setting up an Alert:**
// This indicator supports an alert when all enabled timeframes turn completely green.
// 1. Go to the "Alert" menu (bell icon) at the top of TradingView.
// 2. Set the "Condition" to the name of this indicator: `Multi-Timeframe Candle Color Dashboard`.
// 3. Set the "Condition" to `Bullish Alert`.
// 4. Set the "Frequency" to `Once Per Bar Close`.
ET 7:00-9:30 AM High/Low (Customizable Trendlines)This indicator automatically identifies and plots the high and low prices of the 7:00 AM to 9:30 AM Eastern Time trading session. It draws a single horizontal trend line for both the high and low, starting from the exact candlestick where the price was made and extending to the end of the session.
Features:
Precise Plotting: Plots a single, clean trend line for both the session high and low. The line begins precisely on the candlestick where the high or low was reached and extends horizontally to the end of the session.
Customizable Time: The indicator is set to plot the 7:00 AM to 9:30 AM ET session by default but can be easily adjusted by the user in the settings. The time zone is set to UTC-4 to correctly account for Eastern Daylight Time.
Style and Color Customization: Users can change the line style to solid, dotted, or dashed, and choose their preferred colors and width for both the high and low lines.
Price Labels: A toggleable option to display price labels at the end of each line, making it easy to see the exact high and low values at a glance.
影武者Ⅲ (safe fixed)minnkofusuki kaizou torendline jidou
Minkowski space is a real vector space equipped with a non-degenerate symmetric bilinear form. It is named after the German mathematician Hermann Minkowski. The framework was used by Albert Einstein in formulating the theory of special relativity. In this specific setting, since it represents spacetime that combines space and time, it is also referred to as Minkowski spacetime in the context of physics.
Ultimate ICT Pro — Strategy (v6 CLEAN, indicator)The Ultimate ICT Pro — Strategy is a comprehensive trading solution that combines advanced ICT (Inner Circle Trader) concepts with robust trend, volume, and volatility filters. This strategy automatically identifies key market structures such as Break of Structure (BOS), Change of Character (CHOCH), Fair Value Gaps (FVG), and Order Blocks, providing clear entry and exit signals based on multiple confluences. With customizable risk management, regime filtering using ADX and EMAs, and optional funding/volume constraints, Ultimate ICT Pro empowers traders to capture high-probability moves in trending markets while minimizing risk. Designed for both backtesting and live trading, it is suitable for all experience levels looking to leverage smart money concepts with automation and clarity.
Classic RSI/MACD Overlay (Normalized)i tried to put macd and rsi on price chart, i am sure it will help traders in many ways to visualize exactly what is going to happen next moment.
Stock FundamentalsOverview
A comprehensive fundamental analysis tool for TradingView that displays key financial metrics from company financial statements in an easy-to-understand visual format.
Key Features
- Revenue & Earnings Analysis: Track company sales, gross profit, EBITDA, operating expenses, and free cash flow
- EPS & Dividend Metrics: Monitor earnings per share, dividend payments, and payout ratios
- Debt and Equity Structure: Analyze total debt, equity levels, and cash positions
- Profitability Ratios: Evaluate return on equity (ROE), return on assets (ROA), and return on invested capital (ROIC)
- Visual Color Coding: Each metric has a distinct color for easy identification
- Interactive Legend: Comprehensive reference table showing all acronyms and their corresponding colors
How to Use
1. Select Output Type:
- Per Share: Values normalized per share
- % of mcap: Values as percentage of market capitalization
- Actual: Raw financial values
2. Choose Period:
- FQ: Fiscal Quarter data
- FY: Fiscal Year data
3. Toggle Metric Groups:
- Use the input options to show/hide different categories:
- Revenue & Earnings
- EPS & DPS
- Debt metrics
- Return ratios
4. Read the Chart:
- Each colored line represents a different financial metric
- Hover over data points to see exact values
- Use the legend (top-right corner) to identify each metric
5. Interpret the Data:
- Look for consistent upward trends in revenue and earnings
- Monitor debt levels relative to equity and cash positions
- Compare profitability ratios (ROE, ROIC, ROA) over time
- The orange horizontal line indicates the 20% ROE target (excellent performance)
Color Guide
- Purple: Revenue
- Blue: Gross Profit, EPS, Total Equity, ROE
- Aqua: EBITDA
- Orange: Operating Expenses, DPS
- Lime: Free Cash Flow, Cash & Equivalents
- Teal: EPS Estimate, ROIC
- Red: Dividend Payout Ratio, Total Debt
- Green: R&D to Revenue Ratio
Tips
- Compare multiple quarters to identify trends
- Watch for improving profit margins over time
- Monitor cash flow generation relative to earnings
- Use the 20% ROE line as a benchmark for exceptional performance
- Combine with technical analysis for comprehensive investment decisions
Data Source: Company fundamental data from financial statements
TRI - Multi-Timeframe BIASTRI - MULTI-TIMEFRAME BIAS INDICATOR
DESCRIPTION:
Advanced multi-timeframe bias indicator that analyzes market sentiment across
5 different timeframes (15m, 1h, 4h, 1d, 1w) using adaptive technical analysis.
Provides clear directional bias signals to help determine market momentum.
KEY FEATURES:
ADAPTIVE PARAMETERS: Uses different EMA lengths and weights for each timeframe
EMA TREND ANALYSIS: Fast/slow EMA crossovers with slope analysis for momentum
RSI MOMENTUM: Adaptive overbought/oversold levels based on timeframe
ADX STRENGTH: Directional movement confirmation with DI+/DI- analysis
COMPOSITE SCORING: Weighted combination of trend, momentum, and strength
TIMEFRAME ANALYSIS:
15m: EMA9/21 + High momentum weight (45%) - Ultra-responsive for scalping
1h: EMA21/50 + Medium momentum weight (35%) - Balanced for day trading
4h: EMA50/200 + Lower momentum weight (25%) - Swing trading focus
1d: EMA50/200 + Trend focused (55%) - Position trading signals
1w: EMA50/200 + Maximum trend weight (60%) - Long-term bias
BIAS SIGNALS:
STRONG BULLISH/BEARISH: Score ≥ 0.5 - Very strong directional momentum
BULLISH/BEARISH: Score ≥ 0.25 - Clear directional signals
WEAK BULLISH/BEARISH: Score ≥ 0.1 - Mild directional bias
NEUTRAL: Score < 0.1 - No clear directional preference
ALERTS:
Major Bullish/Bearish: When 4H and 1D timeframes align
High confidence signals for strategic decision making
USAGE:
Higher timeframes (1d, 1w) show primary market direction
Lower timeframes (15m, 1h) provide entry timing
Look for alignment across multiple timeframes for stronger signals
Use confidence levels to assess signal reliability
TECHNICAL COMPONENTS:
Exponential Moving Averages (EMA) for responsive trend detection
Relative Strength Index (RSI) for momentum analysis
Average Directional Index (ADX) with DI+/DI- for trend strength
Volume ratio confirmation for signal validation
Adaptive thresholds optimized for each timeframe's characteristics
Thần Tiên / Hạ Phàm (MTF)🔔 Thần Tiên / Hạ Phàm (MTF) Indicator – modified & optimized for real trading practice.
✅ For educational and reference purposes only – not financial advice.
📩 To get the optimized settings & detailed trading strategy, contact me on Telegram: @NDucnhan79
Volume Weighted Average AZ++Volume Weighted Average original script plus:
* anchor from a specific date and time in the past
* anchor from a specific numbers of bars back
Consecutive Candles Box with MidpointHelps to identify consecutive candle closes for potential ranges.
CyberFX EMA21 Strategy (Pine v5)This is a simple indicator that can be used for a simple strategy. It follows the logic of the price always move back to the media, in that case an EMA(21). This give us an opportunity to achieve a better R/R. One important thing here is this indicator works better on trend markets. When the market is in consolidation mode it will show many signals so we need to pay attention and be patient. This indicator works better in 4H timeframes but it can used with other TFs.
The idea behind is:
for a bullish move when the price moves back to the EMA(21) we check the distance between the low value and the EMA(21) value. The best is when the price low crosses the EMA(21) from above. I am considering a 8 pips distance from the price low to the ema as a signal. Then I will wait for the new candle to move above the EMA(21) for a long entry. I also consider at least 50 pips for SL.
for a bearish move the idea is the same but we consider the price high crossing the EMA(21) and the new candle moving below the EMA.
I hope this can be useful and please leave your comment nad critics(but only the constructive one).
Have a safe trade
Risk controlRisk control.
The indicator displays lines at a distance of % from the current price specified in the parameters. This risk is taken as 100% of the volume. Additionally, the max/min of the visible part of the chart is determined. The distance from the current price to the min/max is calculated in % and the ratio of the risk specified in the parameters to the risk to the min/max is displayed in 10% increments. The indicator is calculated based on the visible part of the chart on the screen. The direction of visualization depends on the visible part of the chart: if the opening price of the first candle is > the current price, visualization is from the minimum, otherwise from the maximum.
Required parameters: risk in %.
Visualization: line offset to the left/right, line color and thickness. Additional: table of 3 cells (background, font size and color).