VolumeTimeVolumeTime BY ADELALMZYAD
Analysis of Japanese Candlesticks and Price Action with Trading Volume
A technical approach combining candlestick patterns and price behavior with volume data to identify real market strength and institutional activity.
Indicators and strategies
Opposing Candle V2🟩 OC (Opposing Candle) Multi–Timeframe Framework
🔍 Overview
The OC Indicator automatically detects and displays Opposing Candles (OCs) across up to three timeframes.
An Opposing Candle is a candle that fully engulfs the previous one, signaling a potential shift in control — either a trend continuation or a trend reversal.
This multi–timeframe framework gives traders a structured way to visualize displacement, pullbacks, and momentum shifts between timeframes.
⚙️ How It Works
Each OC is drawn as a box showing:
High & Low → The candle’s full range
Open Line (black) → Key control level
Midline (white) → Candle equilibrium
Optional labels for timeframe and session
You can enable up to 3 timeframes (e.g., 30m / 1H / 4H) and adjust how many OCs to display for each.
📈 Trading Framework
🔹 Continuation Setup (Trend Following)
1. 4H Bias → Bullish or Bearish
Identify clear trend structure (HH/HL = bullish, LH/LL = bearish).
Confirm strong displacement and visible gaps between OCs — signs of momentum and healthy trend continuation.
2. 1H Confirmation OC
OC forms in the direction of the 4H bias, confirming control.
3. 30min Pullback OC
Opposite–colored OC appears → represents the pullback.
4. Entry Trigger
A yellow candle closes beyond the 30min OC open line, confirming the end of the pullback.
→ Enter in trend direction.
🎯 Targets
Target 1: Next 1H OC high or low (in trend direction)
Target 2: Next 4H OC high or low
🛑 Stop: Beyond the 30min OC’s opposite wick
🔹 Reversal Setup (Trend Shift)
1. 4H Structure → Extended or Losing Momentum
When there are no higher–timeframe gaps and no displacement, momentum weakens — often a sign of potential reversal.
2. Opposing OC Forms on HTF
A strong engulfing OC appears against the previous trend at a key structural level.
3. Lower–Timeframe Alignment
1H and 30min OCs begin forming in the new direction, confirming control shift.
4. Entry Trigger
Break of the lower–timeframe OC open line signals the reversal confirmation.
🟢 Example: Bullish Reversal
4H downtrend shows compression (no displacement)
4H bullish OC forms at support
30min breaks above a bearish OC’s open line → Go long
🔴 Example: Bearish Reversal
4H uptrend stalls at resistance
4H bearish OC forms
30min breaks below a bullish OC’s open line → Go short
🎯 Targets
Target 1: Nearest opposing 1H OC high/low
Target 2: Major 4H structural high/low
🛑 Stop: Beyond the reversal OC wick
🧠 Key Concepts
Displacement = Strength. Strong, impulsive moves with clear gaps between OCs show continuation.
Compression = Weakness. Overlapping candles and no HTF displacement often hint at reversal.
OC = Control Candle. The open line is the “line in the sand” — when price breaks it, control flips.
Multi–TF Confluence = Precision. 4H → 1H → 30m gives you structure → confirmation → entry accuracy.
🎨 Features
✅ Multi–Timeframe OC detection (default: 30m / 1H / 4H)
✅ Bullish & Bearish boxes with open and midlines
✅ Break candles highlighted yellow
✅ Optional labels (timeframe + session)
✅ Session filters (Asia, London, NYAM, NYPM)
✅ Fully customizable visuals and extension lengths
INFOPANEL_PUBLICThis contains key details of an asset such as:
- market cap
- ave volume
- ave $ volume
- etc.
This will help you assess the asset easily with the information displayed
EMA Dual Clouds
EMA Clouds - Enhanced Version
Description
This indicator provides a sophisticated dual-cloud exponential moving average system with extensive customization options and intelligent crossover detection. Building upon the classic EMA cloud concept, this enhanced version offers complete control over two independent cloud pairs (fast and slow), each with adjustable EMA periods, individual line toggles, custom colors, and automated crossover signals with dynamic labels. Unlike basic EMA overlays, this tool creates visual zones between moving average pairs that change color based on trend direction, making it easy to identify bullish and bearish conditions at a glance while providing flexibility to adapt to any trading style or timeframe.
Advanced Feature: By setting the same EMA period for Cloud 1's second EMA and Cloud 2's first EMA, you can create a unified three-EMA cloud system (e.g., 8/21/50), where both clouds share a middle EMA, creating layered zones that provide graduated trend strength visualization.
How It Works
The indicator calculates four exponential moving averages and creates two distinct "clouds" by filling the space between EMA pairs. Each cloud serves a different purpose:
Cloud 1 (Fast Cloud) - Default 8/21 EMAs:
Uses shorter-period EMAs for quick trend identification
Changes color when the fast EMA crosses the slow EMA
Ideal for entry signals and short-term trend confirmation
Bullish when fast EMA > slow EMA (default: lime cloud)
Bearish when fast EMA < slow EMA (default: teal cloud)
Cloud 2 (Slow Cloud) - Default 34/50 EMAs:
Uses longer-period EMAs for overall trend direction
Provides broader market context and trend confirmation
Better for filtering false signals and identifying major trends
Bullish when fast EMA > slow EMA (default: aqua cloud)
Bearish when fast EMA < slow EMA (default: blue cloud)
Three-EMA Cloud Configuration:
You can configure the indicator to create a three-level EMA system by setting EMA 2 and EMA 3 to the same period. For example:
EMA 1: 8
EMA 2: 21
EMA 3: 21 (same as EMA 2)
EMA 4: 50
This creates:
Cloud 1: Between 8 and 21 (short-term trend)
Cloud 2: Between 21 and 50 (medium-term trend)
Both clouds share the middle EMA (21), creating a layered visual effect that shows:
Innermost cloud (8-21): Immediate price action relative to short-term trend
Outer cloud (21-50): Broader trend context
When both clouds are the same color = strong trend
When clouds are different colors = transitional phase
Crossover Signal System:
When the fast EMA crosses above or below the slow EMA within each cloud pair, the indicator:
Plots a triangle marker (up for bullish, down for bearish)
Displays a label showing the EMA periods used (e.g., "8/21")
Triggers an alert condition (if configured)
Uses percentage-based vertical offset to position labels away from price action
Original Features & Methodology
What Makes This Script Unique:
Dual independent cloud systems that can be toggled, customized, and analyzed separately
Flexible three-EMA configuration by sharing a middle EMA between both clouds
Individual control over each of the four EMA lines (show/hide each independently)
Separate color customization for bullish and bearish states of each cloud
Smart label system with percentage-based vertical offset that adapts to any price scale
Independent signal toggles for each cloud (control crossover signals separately)
Complete color palette control for both cloud fills and crossover signal labels
Dynamic alert messages that include the actual EMA periods being monitored
Technical Implementation:
EMAs calculated using Pine Script's built-in ta.ema() function for accuracy
Cloud fills use the fill() function with conditional coloring based on EMA relationship
Crossover detection uses ta.crossover() and ta.crossunder() for precise signal timing
Label positioning uses percentage-based offset from high/low for consistent placement across instruments
All settings organized into logical groups for intuitive navigation
No repainting - all signals confirmed on bar close
EMA Cloud Interpretation:
The thickness of each cloud represents the "strength" of the trend:
Thick clouds = EMAs are far apart = strong trending conditions
Thin clouds = EMAs are close together = weak trend or potential reversal
Cloud color change = Trend direction shift = potential entry/exit point
Key Features
🔹 Dual Cloud System: Two independent EMA cloud pairs for multi-timeframe analysis
🔹 Three-EMA Mode: Share middle EMA between clouds for layered visualization
🔹 Complete Customization: Adjust all four EMA periods to match your trading strategy
🔹 Individual EMA Toggles: Show/hide each of the four EMA lines independently
🔹 Custom Line Colors: Define unique colors for each EMA line
🔹 Cloud Color Control: Separate bullish and bearish colors for each cloud
🔹 Line Width Settings: Adjust EMA line thickness for each cloud pair
🔹 Crossover Signals: Triangle markers at all EMA crossover points
🔹 Smart Signal Labels: Display EMA periods with adjustable vertical offset
🔹 Independent Signal Control: Toggle crossover signals for each cloud separately
🔹 Full Label Customization: Control size, colors, and text colors for bullish/bearish labels
🔹 Built-in Alerts: Alert conditions for all four crossover types
🔹 Organized Settings: All inputs grouped logically for easy configuration
Input Parameters Explained
Cloud 1 (Fast) Settings
Show Cloud 1: Toggle the fast cloud fill on/off
EMA 1 Length: Period for first EMA (default: 8)
EMA 2 Length: Period for second EMA (default: 21) - Set equal to EMA 3 for three-EMA mode
Show EMA Lines: Individual toggles for each line
EMA Colors: Custom color for each line
Line Width: Thickness from 1-5 pixels (default: 2)
Bullish Cloud Color: Fill color when EMA 1 > EMA 2 (default: lime with 60% transparency)
Bearish Cloud Color: Fill color when EMA 1 < EMA 2 (default: teal with 60% transparency)
Cloud 2 (Slow) Settings
Show Cloud 2: Toggle the slow cloud fill on/off
EMA 3 Length: Period for third EMA (default: 34) - Set equal to EMA 2 for three-EMA mode
EMA 4 Length: Period for fourth EMA (default: 50)
Show EMA Lines: Individual toggles for each line
EMA Colors: Custom color for each line
Line Width: Thickness from 1-5 pixels (default: 2)
Bullish Cloud Color: Fill color when EMA 3 > EMA 4 (default: aqua with 60% transparency)
Bearish Cloud Color: Fill color when EMA 3 < EMA 4 (default: blue with 60% transparency)
Crossover Signal Settings
Show Crossover Signals: Master toggle for all crossover markers
Show Cloud 1 Crossover Signals: Toggle fast cloud signals
Show Cloud 2 Crossover Signals: Toggle slow cloud signals
Cloud 1 Signal Label Settings
Show Cloud 1 Labels: Display period labels on Cloud 1 crossovers
Cloud 1 Label Size: Choose from Tiny to Huge
Cloud 1 Label Vertical Offset: Distance from price bars as percentage (0.15% default)
Bullish Label Color: Background color for bullish crossover labels (default: green)
Bullish Text Color: Text color for bullish labels (default: white)
Bearish Label Color: Background color for bearish crossover labels (default: red)
Bearish Text Color: Text color for bearish labels (default: white)
Cloud 2 Signal Label Settings
Show Cloud 2 Labels: Display period labels on Cloud 2 crossovers
Cloud 2 Label Size: Choose from Tiny to Huge
Cloud 2 Label Vertical Offset: Distance from price bars as percentage (0.15% default)
Bullish Label Color: Background color for bullish crossover labels (default: lime)
Bullish Text Color: Text color for bullish labels (default: white)
Bearish Label Color: Background color for bearish crossover labels (default: maroon)
Bearish Text Color: Text color for bearish labels (default: white)
How to Use This Indicator
Basic Setup:
Add the indicator to your chart - both clouds will appear with default settings
Cloud 1 (8/21) shows fast trend changes in lime/teal
Cloud 2 (34/50) shows broader trend in aqua/blue
Triangle markers appear when EMAs cross
Three-EMA Cloud Setup:
Set EMA 2 Length to your middle period (e.g., 21)
Set EMA 3 Length to the same value (e.g., 21)
Now you have: EMA 1 (8) - Cloud 1 - EMA 2/3 (21) - Cloud 2 - EMA 4 (50)
This creates layered zones: inner cloud for short-term, outer cloud for medium-term
Optionally hide EMA 2 or EMA 3 line to show only one shared middle line
Reading the Clouds:
Both clouds same color = Strong trend confirmation (both timeframes aligned)
Clouds opposite colors = Mixed signals or potential reversal zone
Cloud 1 changes first = Early warning of potential trend change
Cloud 2 confirms = Stronger trend change signal
Thick clouds = Strong trending market
Thin clouds = Weak trend, be cautious with entries
Three-EMA Cloud Reading:
Both clouds same color = Price is on correct side of all EMAs (strongest signal)
Inner cloud changes = Short-term trend shift
Outer cloud still intact = Major trend still valid
Both clouds change = Complete trend reversal
Layered visual = Easy to see how far price is from each EMA level
Trading Strategies:
Scalping/Day Trading (Fast Signals):
Use Cloud 1 (8/21) for primary signals
Enter when Cloud 1 changes color
Use Cloud 2 as trend filter (only trade in direction of Cloud 2)
Exit when Cloud 1 changes back or price hits target
Swing Trading (Confirmed Signals):
Wait for both clouds to align (same color)
Enter when Cloud 2 changes color with Cloud 1 confirmation
Hold until Cloud 2 changes back
Use Cloud 1 for position management and partial exits
Trend Following:
Only trade when both clouds are same color
Enter on Cloud 1 crossovers in direction of Cloud 2
Exit only when Cloud 2 changes color
Ignore Cloud 1 signals against Cloud 2 trend
Three-EMA Strategy:
Configure as 8/21/50 (set EMA 2 and EMA 3 both to 21)
Strong entries: Both clouds same color (price beyond all EMAs)
Early exits: Inner cloud changes (take profits)
Stop loss: Outer cloud changes (trend reversal)
Re-entry: Wait for both clouds to realign
Custom Configurations:
Standard Two-Cloud:
Aggressive: 5/13 and 21/34 for faster signals
Balanced: 8/21 and 34/50 (default)
Conservative: 13/34 and 50/100 for stronger confirmation
Ichimoku style: 9/26 and 26/52 for similar methodology
Three-EMA Configurations:
Fast: Set EMAs to 5, 13, 13, 34 (5/13/34 system)
Standard: Set EMAs to 8, 21, 21, 50 (8/21/50 system)
Slow: Set EMAs to 13, 34, 34, 100 (13/34/100 system)
Fibonacci: Set EMAs to 8, 21, 21, 89 (Fibonacci sequence)
Classic: Set EMAs to 10, 20, 20, 50 (round numbers)
Customization Tips:
Hide EMA lines to see only clouds for cleaner charts
In three-EMA mode, hide either EMA 2 or EMA 3 to show only one middle line
Adjust cloud transparency (60% default) if colors are too intense
Use different colors to distinguish multiple chart windows
Increase label offset if labels overlap with price action
Turn off Cloud 1 signals in ranging markets to reduce noise
Use larger label sizes on multi-monitor setups
In three-EMA mode, use contrasting colors for inner and outer clouds
Alert Configuration:
Set up alerts for:
Cloud 1 Bullish Cross - Fast trend up signal
Cloud 1 Bearish Cross - Fast trend down signal
Cloud 2 Bullish Cross - Major trend up confirmation
Cloud 2 Bearish Cross - Major trend down confirmation
Use Cases
Intraday Trading:
Quick trend identification with Cloud 1
Major trend filter with Cloud 2
Clear visual entry/exit zones
Label offset prevents chart clutter on busy timeframes
Three-EMA mode shows graduated support/resistance zones
Swing Trading:
Multi-timeframe trend analysis on single chart
Both clouds must align for high-probability setups
Cloud thickness indicates trend strength
Position management using Cloud 1 signals
Three-EMA setup provides clear profit-taking levels
Trend Following:
Clear visual representation of trend direction
Cloud color = trade direction
Thick clouds = add to positions
Thin clouds = prepare for exit
Three-EMA layers show trend progression
Market Analysis:
Quick assessment of market conditions
Multiple timeframes visible simultaneously
Color-coded for instant interpretation
Works on all asset classes
Three-EMA configuration shows price relationship to multiple timeframe EMAs
Technical Details
Uses standard EMA calculation: ta.ema(source, length)
Crossover detection with no lag: ta.crossover() and ta.crossunder()
Percentage-based label offset works across all price scales
All calculations confirmed on bar close (no repainting)
Compatible with all timeframes and instruments
Efficient code with minimal computation overhead
Works on stocks, forex, crypto, futures, and indices
Three-EMA mode achieved by setting EMA 2 and EMA 3 to same value
Best Practices
Start with default settings and adjust based on your instrument's volatility
Use shorter periods for faster markets, longer for slower markets
Try three-EMA configuration (8/21/50) for clearer trend visualization
Consider higher timeframe clouds as filters for lower timeframe entries
Don't ignore Cloud 2 signals - they're often more reliable
Combine with volume analysis for stronger confirmation
Watch for cloud thickness changes as early warning signals
Use cloud color alignment for highest-probability setups
Adjust transparency if clouds obscure price action
Test different EMA combinations to find what works for your strategy
Set alerts for both clouds to catch all opportunities
In three-EMA mode, treat inner cloud as entry zone and outer cloud as trend filter
This indicator transforms the traditional EMA crossover system into a visual, intuitive tool that makes trend identification effortless while providing the flexibility to adapt to any trading style or market condition. The optional three-EMA configuration adds another dimension of trend analysis by creating layered zones that show price position relative to multiple timeframe perspectives simultaneously.
Connect With Me
📧 Email: contact@savvytraderpro.com
📊 Website: savvytraderpro.com
🐦 X (Twitter): @savvytraderpro
💬 Follow for more indicators, trading strategies, and market insights!
⚠️ Disclaimer:
This script is provided for educational and informational purposes only. It is not financial advice and should not be considered a recommendation to buy, sell, or hold any financial instrument. Trading involves significant risk of loss and is not suitable for every investor. Users should perform their own due diligence and consult with a licensed financial advisor before making any trading decisions. The author does not guarantee any profits or results from using this script, and assumes no liability for any losses incurred. Use this script at your own risk.
AG Pro Trading Suite V572🏆 AG Pro Trading Suite V572
This is the definitive, all-in-one trading ecosystem.
The AG Pro Trading Suite is the result of years of development, designed to be the central nervous system for your trading operation. It moves beyond static indicators to provide a living, adaptive decision-support framework. It is designed for the serious trader who demands professional-grade tools and seeks to manage the entire trading process—from macro analysis to portfolio management—within a single, unified interface.
This is not just an indicator; it is your new command center.
The Core Philosophy: Adaptive Intelligence
The fundamental problem with most trading tools is their static nature. A setting that works in a bull market fails spectacularly in a range. The AG Pro Suite is built to solve this.
At its heart is the 🧠 Dynamic Alpha Engine (AI). This is not a simple "signal." It is a learning-capable system that actively monitors its own performance.
Real-Time Back-Evaluation: The script constantly analyzes the historical success rate and Risk/Reward (R:R) of its most recent signals.
Dynamic Weighting: Based on this performance data, the AI dynamically re-calibrates the weighting of all core components (RSI, MACD, SMC, OBV, etc.).
Market Adaptability: If the market starts favoring momentum, the AI will intelligently increase the weight of trend-following components. If the market turns choppy, it learns to trust mean-reversion signals more. This is true, adaptive intelligence, happening live on your chart.
Unmatched, Integrated Modules
The AG Pro Suite is a collection of powerful, interconnected modules that work in harmony.
1. The 🔄 'Smart Swap' Portfolio Analyzer
Move beyond single-asset analysis and start managing your capital. This professional-grade module provides insights previously reserved for prop desks.
Portfolio Input: Manually enter your current portfolio holdings (e.g., 1.5 BTC, 20 ETH, 5000 SOL).
Background Scanning: The script scans a "Reserve Coin" list (fully customizable by you) in the background, analyzing their relative performance and AI trend scores.
Actionable Suggestions: If it finds an underperforming asset in your portfolio with a weak AI score, and simultaneously finds a "reserve" coin with powerful momentum and a high score, it will provide a clear, actionable "Smart Swap" suggestion. This is active capital management, built directly into your chart.
2. The 🏛️ Automated SMC & Charting Suite
Stop drawing boxes all day. The suite automates the most critical elements of Smart Money Concepts, keeping your charts clean and your analysis sharp.
Market Structure Breaks (BOS): Automatically detects and plots valid Breaks of Structure to confirm the prevailing trend direction.
Liquidity Sweeps (💰): Instantly identifies and marks high/low liquidity sweeps with a '💰' icon, highlighting potential stop-hunts and high-probability reversal zones.
Fair Value Gaps (FVG): Finds and plots bullish/bearish imbalances (FVGs) in real-time, showing you the "magnets" that price may be drawn to.
3. The ⚙️ Dual-Profile System
A black box is useless. The AG Pro Suite adapts to both the asset and you.
Coin Profiles: Instantly select the asset's volatility class (e.g., "1: Stable (BTC, ETH)," "2: Fast L1 (SOL, AVAX)," or "3: Volatile (FET, BONK)"). This tunes the script's base-level sensitivity.
Risk Profiles: Select your trading style (e.g., "1: Düşük (Trader/Scalp)," "2: Orta (Swing)," or "3: Yüksek (Agresif/Trend)").
When you change your profile, the entire script logic—from AI sensitivity to SL/TP calculations—instantly adjusts.
The Unified Dashboard: Your Command Center
Clarity is profit. All this intelligence is synthesized into one clean, actionable dashboard.
It provides a final AI Score (0-100) and, more importantly, a Signal Quality Index (SQI), which measures the conviction of a signal.
The dashboard culminates in the 💡 A-Z Action Plan. This section synthesizes all data into a complete, actionable trade idea, providing:
Trade Bias: A clear "Strong Bullish," "Bearish," or "Risky (No-Trade)" rating.
Calculated Levels: Key Support and Resistance levels pulled from multiple timeframes.
Long Plan: A complete plan with 3 Take Profit targets and a calculated Stop Loss level.
Short Plan: A complete plan with 3 Take Profit targets and a calculated Stop Loss level.
Position Sizing: Automatically calculates the exact position size (in units of the asset) for both long and short plans, based on your selected Risk Profile.
Performance & Reliability
Performance 'Turbo Mode': A tool this powerful could be slow. We engineered "Turbo Mode," which intelligently disables all background calculations for dashboard elements you have hidden. This ensures a fast, fluid, and non-lagging chart experience.
Non-Repainting Logic: This script is built for professional use. All primary signals, alerts, dashboard scores, and strategy logic are non-repainting. They fire on confirmed bar closes to provide stable, reliable, and backtestable data.
How to Use
Configure: Select your Coin Profile and Risk Profile.
Analyze: Review the Dashboard. Check the Final Score, the Signal Quality (SQI), and the HTF confirmation row.
Execute: If the signal is high-quality (e.g., Score > 80, SQI > 85), review the Action Plan. Use its calculated TP, SL, and Position Size to build your trade with full confidence.
Disclaimer: This is an advanced decision-support tool, not a financial advisory service. It is designed to provide institutional-grade data and analysis for informational and educational purposes. All trading involves substantial risk. Past performance, whether in backtests or real-time, is not indicative of future results. You, and you alone, are solely responsible for all trading decisions you make.
OHLC Tool Multiple TFThis indicator displays Open, High, Low, and Close (OHLC) levels from multiple timeframes directly on your chart. It allows full customization of line styles, colors, and widths for each OHLC component — not only for the base timeframe, but also for higher timeframes like Daily, Weekly, and Monthly.
Key Features:
- 🔹 Per-TF Styling: Customize color, style, and thickness for each OHLC line (O/H/L/C) independently across base, daily, weekly, and monthly timeframes.
- 🔹 Inheritance Toggle: Optionally inherit base timeframe styles for higher timeframes to maintain visual consistency.
- 🔹 Dynamic Labels: Each OHLC line is labeled with its type and price, rounded to your preferred decimal precision.
- 🔹 Precision Control: Set custom decimal formatting for each timeframe to match asset volatility (e.g. 2 decimals for BTC, 3+ for altcoins).
- 🔹 Length Multipliers: Extend line visibility with adjustable multipliers per timeframe.
- 🔹 Toggle Visibility: Enable or disable OHLC lines for Daily, Weekly, and Monthly timeframes independently.
How to Use:
- Select your base timeframe (e.g. 3G, 15m, 1h) and configure its OHLC line styles under Line Display Settings.
- Enable Daily / Weekly / Monthly OHLC under General Settings > Higher TFs.
- Customize each higher timeframe’s OHLC styles under their respective sections (Daily Line Display, Weekly Line Display, etc.).
- Use the inherit toggle to apply base styles to higher timeframes automatically.
- Tune line length multipliers to extend visibility across your chart.
Ideal For:
- Traders who want to track multi-timeframe OHLC levels with visual clarity.
- Analysts who prefer symbolic, rhythmic, or color-coded chart annotations.
- Anyone seeking a clean, customizable OHLC overlay with precision control.
TLP Swing Chart V2// This source code is subject to the terms of the Mozilla Public License 2.0 at mozilla.org
// Sửa đổi trên code gốc của © meomeo105
// © meomeo105
//@version=5
indicator('TLP Swing Chart V2', shorttitle='TLP Swing V2', overlay=true, max_lines_count=500)
//-----Input-------
customTF = input.timeframe(defval="",title = "Show Other TimeFrame")
showTLP = input.bool(false, 'Show TLP', inline = "TLP1")
colorTLP = input.color(color.aqua, '', inline = "TLP1")
showSTLP = input.bool(true, 'Show TLP Swing', inline = "Swing1")
colorSTLP = input.color(color.aqua, '', inline = "Swing1")
showLabel = input.bool(true, 'Show Label TimeFrame')
lineSTLP = input.string(title="",options= ,defval="(─)", inline = "Swing1")
lineStyleSTLP = lineSTLP == "(┈)" ? line.style_dotted : lineSTLP == "(╌)" ? line.style_dashed : line.style_solid
//IOSB
IOSB = "TLPInOutSideBarSetting"
ISB = input(true,group =IOSB, title="showISB")
colorISB = input.color(color.rgb(250, 171, 0), inline = "ISB")
OSB = input(true,group =IOSB, title="showOSB")
colorOSB = input.color(color.rgb(56, 219, 255), inline = "OSB")
ZoneColor = input(defval = color.new(color.orange, 90),group =IOSB, title = "Background Color")
BorderColor = input(defval = color.new(color.orange, 100),group =IOSB, title = "Border Color")
/////////////////
var aCZ = array.new_float(0)
float highest = high
float lowest = low
if (array.size(aCZ) > 0)
highest := array.get(aCZ, 0)
lowest := array.get(aCZ, 1)
insideBarCondtion = low >= lowest and low <= highest and high >= lowest and high <= highest
if ( insideBarCondtion == true )
array.push(aCZ, high )
array.push(aCZ, low )
if( array.size(aCZ) >= 2 and insideBarCondtion == false )
float maxCZ = array.max(aCZ)
float minCZ = array.min(aCZ)
box.new(bar_index - (array.size(aCZ) / 2) - 1, maxCZ, bar_index - 1, minCZ, bgcolor = ZoneColor, border_color = BorderColor)
array.clear(aCZ)
//////////////////////////Global//////////////////////////
var arrayLineTemp = array.new_line()
// Funtion
f_resInMinutes() =>
_resInMinutes = timeframe.multiplier * (
timeframe.isseconds ? 1. / 60. :
timeframe.isminutes ? 1. :
timeframe.isdaily ? 1440. :
timeframe.isweekly ? 10080. :
timeframe.ismonthly ? 43800. : na)
// Converts a resolution expressed in minutes into a string usable by "security()"
f_resFromMinutes(_minutes) =>
_minutes < 1 ? str.tostring(math.round(_minutes*60)) + "S" :
_minutes < 60 ? str.tostring(math.round(_minutes)) + "m" :
_minutes < 1440 ? str.tostring(math.round(_minutes/60)) + "H" :
_minutes < 10080 ? str.tostring(math.round(math.min(_minutes / 1440, 7))) + "D" :
_minutes < 43800 ? str.tostring(math.round(math.min(_minutes / 10080, 4))) + "W" :
str.tostring(math.round(math.min(_minutes / 43800, 12))) + "M"
f_tfRes(_res,_exp) =>
request.security(syminfo.tickerid,_res,_exp,lookahead=barmerge.lookahead_on)
var label labelError = label.new(bar_index, high, text = "", color = #00000000, textcolor = color.white,textalign = text.align_left)
sendError(_mmessage) =>
label.set_xy(labelError, bar_index + 3, close )
label.set_text(labelError, _mmessage)
var arrayLineChoCh = array.new_line()
var label labelTF = label.new(time, close, text = "",color = color.new(showSTLP ? colorSTLP : colorTLP,95), textcolor = showSTLP ? colorSTLP : colorTLP,xloc = xloc.bar_time, textalign = text.align_left)
//////////////////////////TLP//////////////////////////
var arrayXTLP = array.new_int(5,time)
var arrayYTLP = array.new_float(5,close)
var arrayLineTLP = array.new_line()
int drawLineTLP = 0
_high = high
_low = low
_close = close
_open = open
if(customTF != timeframe.period)
_high := f_tfRes(customTF,high)
_low := f_tfRes(customTF,low)
_close := f_tfRes(customTF,close)
_open := f_tfRes(customTF,open)
highPrev = _high
lowPrev = _low
// drawLineTLP => 2:Tiếp tục 1:Đảo chiều; // Outsidebar 2:Tiếp tục 3:Tiếp tục và Đảo chiều 4 : Đảo chiều 2 lần
drawLineTLP := 0
if(_high > highPrev and _low > lowPrev )
if(array.get(arrayYTLP,0) > array.get(arrayYTLP,1))
if(_high <= high)
array.set(arrayXTLP, 0, time)
array.set(arrayYTLP, 0, _high )
drawLineTLP := 2
else
array.unshift(arrayXTLP,time)
array.unshift(arrayYTLP,_high )
drawLineTLP := 1
else if(_high < highPrev and _low < lowPrev )
if(array.get(arrayYTLP,0) > array.get(arrayYTLP,1))
array.unshift(arrayXTLP,time)
array.unshift(arrayYTLP,_low )
drawLineTLP := 1
else
if(_low >= low)
array.set(arrayXTLP, 0, time)
array.set(arrayYTLP, 0, _low )
drawLineTLP := 2
else if(_high >= highPrev and _low < lowPrev or _high > highPrev and _low <= lowPrev )
if(array.get(arrayYTLP,0) > array.get(arrayYTLP,1))
if(_high >= array.get(arrayYTLP,0) and array.get(arrayYTLP,1) < _low )
if(_high <= high)
array.set(arrayXTLP, 0, time)
array.set(arrayYTLP, 0, _high )
drawLineTLP := 2
else if(_high >= array.get(arrayYTLP,0) and array.get(arrayYTLP,1) > _low )
if(_close < _open)
if(_high <= high)
array.set(arrayXTLP, 0, time)
array.set(arrayYTLP, 0, _high )
array.unshift(arrayXTLP,time)
array.unshift(arrayYTLP,_low )
drawLineTLP := 3
else
array.unshift(arrayXTLP,time)
array.unshift(arrayYTLP,_low )
array.unshift(arrayXTLP,time)
array.unshift(arrayYTLP,_high )
drawLineTLP := 4
else if(array.get(arrayYTLP,0) < array.get(arrayYTLP,1))
if(_low <= array.get(arrayYTLP,0) and _high < array.get(arrayYTLP,1))
if(_low >= low)
array.set(arrayXTLP, 0, time)
array.set(arrayYTLP, 0, _low )
drawLineTLP := 2
else if(_low <= array.get(arrayYTLP,0) and _high > array.get(arrayYTLP,1))
if(_close > _open)
if(_low >= low)
array.set(arrayXTLP, 0, time)
array.set(arrayYTLP, 0, _low )
array.unshift(arrayXTLP,time)
array.unshift(arrayYTLP,_high )
drawLineTLP := 3
else
array.unshift(arrayXTLP,time)
array.unshift(arrayYTLP,_high )
array.unshift(arrayXTLP,time)
array.unshift(arrayYTLP,_low )
drawLineTLP := 4
else if((_high <= highPrev and _low >= lowPrev ))
highPrev := highPrev
lowPrev := lowPrev
if(f_resInMinutes() < f_tfRes(customTF,f_resInMinutes()) and drawLineTLP == 0)
if(array.get(arrayYTLP,0) > array.get(arrayYTLP,1))
if(array.get(arrayYTLP,0) <= high)
array.set(arrayXTLP, 0, time)
drawLineTLP := 2
else
if(array.get(arrayYTLP,0) >= low)
array.set(arrayXTLP, 0, time)
drawLineTLP := 2
if((showSTLP or showTLP) and f_resInMinutes() <= f_tfRes(customTF,f_resInMinutes()))
if(drawLineTLP == 2)
if(array.size(arrayLineTLP) >0)
line.set_xy2(array.get(arrayLineTLP,0),array.get(arrayXTLP,0),array.get(arrayYTLP,0))
else
array.unshift(arrayLineTLP,line.new(array.get(arrayXTLP,1),array.get(arrayYTLP,1),array.get(arrayXTLP,0),array.get(arrayYTLP,0), color = colorTLP,xloc = xloc.bar_time, style = lineStyleSTLP))
else if(drawLineTLP == 1)
array.unshift(arrayLineTLP,line.new(array.get(arrayXTLP,1),array.get(arrayYTLP,1),array.get(arrayXTLP,0),array.get(arrayYTLP,0), color = colorTLP,xloc = xloc.bar_time, style = lineStyleSTLP))
else if(drawLineTLP == 3)
if(array.size(arrayLineTLP) >0)
line.set_xy2(array.get(arrayLineTLP,0),array.get(arrayXTLP,1),array.get(arrayYTLP,1))
else
array.unshift(arrayLineTLP,line.new(array.get(arrayXTLP,2),array.get(arrayYTLP,2),array.get(arrayXTLP,1),array.get(arrayYTLP,1), color = colorTLP,xloc = xloc.bar_time, style = lineStyleSTLP))
array.unshift(arrayLineTLP,line.new(array.get(arrayXTLP,1),array.get(arrayYTLP,1),array.get(arrayXTLP,0),array.get(arrayYTLP,0), color = colorTLP,xloc = xloc.bar_time, style = lineStyleSTLP))
else if(drawLineTLP == 4)
array.unshift(arrayLineTLP,line.new(array.get(arrayXTLP,2),array.get(arrayYTLP,2),array.get(arrayXTLP,1),array.get(arrayYTLP,1), color = colorTLP,xloc = xloc.bar_time, style = lineStyleSTLP))
array.unshift(arrayLineTLP,line.new(array.get(arrayXTLP,1),array.get(arrayYTLP,1),array.get(arrayXTLP,0),array.get(arrayYTLP,0), color = colorTLP,xloc = xloc.bar_time, style = lineStyleSTLP))
//////////////////////////Swing TLP//////////////////////////
var arrayXSTLP = array.new_int(5,time)
var arrayYSTLP = array.new_float(5,close)
var arrayLineSTLP = array.new_line()
int drawLineSTLP = 0
int drawLineSTLP1 = 0
if(showSTLP)
if(math.max(array.get(arrayYSTLP,0),array.get(arrayYSTLP,1)) < math.min(array.get(arrayYTLP,0),array.get(arrayYTLP,1)) or math.min(array.get(arrayYSTLP,0),array.get(arrayYSTLP,1)) > math.max(array.get(arrayYTLP,0),array.get(arrayYTLP,1)))
//Khởi tạo bắt đầu
drawLineSTLP1 := 5
array.set(arrayXSTLP, 0, array.get(arrayXTLP,1))
array.set(arrayYSTLP, 0, array.get(arrayYTLP,1))
array.unshift(arrayXSTLP,array.get(arrayXTLP,0))
array.unshift(arrayYSTLP,array.get(arrayYTLP,0))
// drawLineSTLP kiểm tra điểm 1 => 13:Tiếp tục có sóng hồi // 12|19(reDraw):Tiếp tục không có sóng hồi // 14:Đảo chiều
if(array.get(arrayXTLP,0) == array.get(arrayXTLP,1))
if(array.get(arrayXSTLP,0) >= array.get(arrayXTLP,2) and array.get(arrayYSTLP,0) != array.get(arrayYTLP,1) and ((array.get(arrayYTLP,1) > array.get(arrayYTLP,2) and array.get(arrayYSTLP,0) > array.get(arrayYSTLP,1)) or (array.get(arrayYTLP,1) < array.get(arrayYTLP,2) and array.get(arrayYSTLP,0) < array.get(arrayYSTLP,1))))
drawLineSTLP1 := 12
array.set(arrayXSTLP, 0, array.get(arrayXTLP,1))
array.set(arrayYSTLP, 0, array.get(arrayYTLP,1))
else if(array.get(arrayXSTLP,0) <= array.get(arrayXTLP,2))
if((array.get(arrayYSTLP,0) > array.get(arrayYSTLP,1) and array.get(arrayYTLP,1) < array.get(arrayYSTLP,1)) or (array.get(arrayYSTLP,0) < array.get(arrayYSTLP,1) and array.get(arrayYTLP,1) > array.get(arrayYSTLP,1)))
drawLineSTLP1 := 14
array.unshift(arrayXSTLP,array.get(arrayXTLP,1))
array.unshift(arrayYSTLP,array.get(arrayYTLP,1))
else if((array.get(arrayYSTLP,0) > array.get(arrayYSTLP,1) and array.get(arrayYTLP,1) > array.get(arrayYSTLP,0)) or (array.get(arrayYSTLP,0) < array.get(arrayYSTLP,1) and array.get(arrayYTLP,1) < array.get(arrayYSTLP,0)))
drawLineSTLP1 := 13
_max = math.min(array.get(arrayYSTLP,0),array.get(arrayYSTLP,1))
_min = math.max(array.get(arrayYSTLP,0),array.get(arrayYSTLP,1))
_max_idx = 0
_min_idx = 0
for i = 2 to array.size(arrayXTLP)
if(array.get(arrayXSTLP,0) >= array.get(arrayXTLP,i))
break
if(_min > array.get(arrayYTLP,i))
_min := array.get(arrayYTLP,i)
_min_idx := array.get(arrayXTLP,i)
if(_max < array.get(arrayYTLP,i))
_max := array.get(arrayYTLP,i)
_max_idx := array.get(arrayXTLP,i)
if(array.get(arrayYSTLP,0) > array.get(arrayYSTLP,1))
array.unshift(arrayXSTLP,_min_idx)
array.unshift(arrayYSTLP,_min)
else if(array.get(arrayYSTLP,0) < array.get(arrayYSTLP,1))
array.unshift(arrayXSTLP,_max_idx)
array.unshift(arrayYSTLP,_max)
array.unshift(arrayXSTLP,array.get(arrayXTLP,1))
array.unshift(arrayYSTLP,array.get(arrayYTLP,1))
if(f_resInMinutes() < f_tfRes(customTF,f_resInMinutes()))
if(array.get(arrayYSTLP,0) == array.get(arrayYTLP,1) and array.get(arrayXSTLP,0) != array.get(arrayXTLP,1))
array.set(arrayXSTLP, 0, array.get(arrayXTLP,1))
drawLineSTLP1 := 19
if(f_resInMinutes() <= f_tfRes(customTF,f_resInMinutes()))
if(drawLineSTLP1 == 12 or drawLineSTLP1 == 19)
if(array.size(arrayLineSTLP) >0)
line.set_xy2(array.get(arrayLineSTLP,0),array.get(arrayXSTLP,0),array.get(arrayYSTLP,0))
else
array.unshift(arrayLineSTLP,line.new(array.get(arrayXSTLP,1),array.get(arrayYSTLP,1),array.get(arrayXSTLP,0),array.get(arrayYSTLP,0), color = colorSTLP,xloc = xloc.bar_time))
else if(drawLineSTLP1 == 14)
array.unshift(arrayLineSTLP,line.new(array.get(arrayXSTLP,1),array.get(arrayYSTLP,1),array.get(arrayXSTLP,0),array.get(arrayYSTLP,0), color = colorSTLP,xloc = xloc.bar_time))
else if(drawLineSTLP1 == 13)
array.unshift(arrayLineSTLP,line.new(array.get(arrayXSTLP,2),array.get(arrayYSTLP,2),array.get(arrayXSTLP,1),array.get(arrayYSTLP,1), color = colorSTLP,xloc = xloc.bar_time))
array.unshift(arrayLineSTLP,line.new(array.get(arrayXSTLP,1),array.get(arrayYSTLP,1),array.get(arrayXSTLP,0),array.get(arrayYSTLP,0), color = colorSTLP,xloc = xloc.bar_time))
else if(drawLineSTLP1 == 15)
if(array.size(arrayLineSTLP) >0)
line.set_xy2(array.get(arrayLineSTLP,0),array.get(arrayXSTLP,1),array.get(arrayYSTLP,1))
else
array.unshift(arrayLineSTLP,line.new(array.get(arrayXSTLP,2),array.get(arrayYSTLP,2),array.get(arrayXSTLP,1),array.get(arrayYSTLP,1), color = colorSTLP,xloc = xloc.bar_time))
array.unshift(arrayLineSTLP,line.new(array.get(arrayXSTLP,1),array.get(arrayYSTLP,1),array.get(arrayXSTLP,0),array.get(arrayYSTLP,0), color = colorSTLP,xloc = xloc.bar_time))
// drawLineSTLP kiểm tra điểm 0 => 3:Tiếp tục có sóng hồi // 2|9(reDraw):Tiếp tục không có sóng hồi // 4:Đảo chiều
if(array.get(arrayXSTLP,0) >= array.get(arrayXTLP,1) and array.get(arrayYSTLP,0) != array.get(arrayYTLP,0) and ((array.get(arrayYTLP,0) > array.get(arrayYTLP,1) and array.get(arrayYSTLP,0) > array.get(arrayYSTLP,1)) or (array.get(arrayYTLP,0) < array.get(arrayYTLP,1) and array.get(arrayYSTLP,0) < array.get(arrayYSTLP,1))))
drawLineSTLP := 2
array.set(arrayXSTLP, 0, array.get(arrayXTLP,0))
array.set(arrayYSTLP, 0, array.get(arrayYTLP,0))
else if(array.get(arrayXSTLP,0) <= array.get(arrayXTLP,1))
if((array.get(arrayYSTLP,0) > array.get(arrayYSTLP,1) and array.get(arrayYTLP,0) < array.get(arrayYSTLP,1)) or (array.get(arrayYSTLP,0) < array.get(arrayYSTLP,1) and array.get(arrayYTLP,0) > array.get(arrayYSTLP,1)))
drawLineSTLP := 4
array.unshift(arrayXSTLP,array.get(arrayXTLP,0))
array.unshift(arrayYSTLP,array.get(arrayYTLP,0))
else if((array.get(arrayYSTLP,0) > array.get(arrayYSTLP,1) and array.get(arrayYTLP,0) > array.get(arrayYSTLP,0)) or (array.get(arrayYSTLP,0) < array.get(arrayYSTLP,1) and array.get(arrayYTLP,0) < array.get(arrayYSTLP,0)))
drawLineSTLP := 3
_max = math.min(array.get(arrayYSTLP,0),array.get(arrayYSTLP,1))
_min = math.max(array.get(arrayYSTLP,0),array.get(arrayYSTLP,1))
_max_idx = 0
_min_idx = 0
for i = 1 to array.size(arrayXTLP)
if(array.get(arrayXSTLP,0) >= array.get(arrayXTLP,i))
break
if(_min > array.get(arrayYTLP,i))
_min := array.get(arrayYTLP,i)
_min_idx := array.get(arrayXTLP,i)
if(_max < array.get(arrayYTLP,i))
_max := array.get(arrayYTLP,i)
_max_idx := array.get(arrayXTLP,i)
if(array.get(arrayYSTLP,0) > array.get(arrayYSTLP,1))
array.unshift(arrayXSTLP,_min_idx)
array.unshift(arrayYSTLP,_min)
else if(array.get(arrayYSTLP,0) < array.get(arrayYSTLP,1))
array.unshift(arrayXSTLP,_max_idx)
array.unshift(arrayYSTLP,_max)
array.unshift(arrayXSTLP,array.get(arrayXTLP,0))
array.unshift(arrayYSTLP,array.get(arrayYTLP,0))
if(f_resInMinutes() < f_tfRes(customTF,f_resInMinutes()))
if(array.get(arrayYSTLP,0) == array.get(arrayYTLP,0) and array.get(arrayXSTLP,0) != array.get(arrayXTLP,0))
array.set(arrayXSTLP, 0, array.get(arrayXTLP,0))
drawLineSTLP := 9
if(f_resInMinutes() <= f_tfRes(customTF,f_resInMinutes()))
if(drawLineSTLP == 2 or drawLineSTLP == 9)
if(array.size(arrayLineSTLP) >0)
line.set_xy2(array.get(arrayLineSTLP,0),array.get(arrayXSTLP,0),array.get(arrayYSTLP,0))
else
array.unshift(arrayLineSTLP,line.new(array.get(arrayXSTLP,1),array.get(arrayYSTLP,1),array.get(arrayXSTLP,0),array.get(arrayYSTLP,0), color = colorSTLP,xloc = xloc.bar_time))
else if(drawLineSTLP == 4)
array.unshift(arrayLineSTLP,line.new(array.get(arrayXSTLP,1),array.get(arrayYSTLP,1),array.get(arrayXSTLP,0),array.get(arrayYSTLP,0), color = colorSTLP,xloc = xloc.bar_time))
else if(drawLineSTLP == 3)
array.unshift(arrayLineSTLP,line.new(array.get(arrayXSTLP,2),array.get(arrayYSTLP,2),array.get(arrayXSTLP,1),array.get(arrayYSTLP,1), color = colorSTLP,xloc = xloc.bar_time))
array.unshift(arrayLineSTLP,line.new(array.get(arrayXSTLP,1),array.get(arrayYSTLP,1),array.get(arrayXSTLP,0),array.get(arrayYSTLP,0), color = colorSTLP,xloc = xloc.bar_time))
else if(drawLineSTLP == 5)
if(array.size(arrayLineSTLP) >0)
line.set_xy2(array.get(arrayLineSTLP,0),array.get(arrayXSTLP,1),array.get(arrayYSTLP,1))
else
array.unshift(arrayLineSTLP,line.new(array.get(arrayXSTLP,2),array.get(arrayYSTLP,2),array.get(arrayXSTLP,1),array.get(arrayYSTLP,1), color = colorSTLP,xloc = xloc.bar_time))
array.unshift(arrayLineSTLP,line.new(array.get(arrayXSTLP,1),array.get(arrayYSTLP,1),array.get(arrayXSTLP,0),array.get(arrayYSTLP,0), color = colorSTLP,xloc = xloc.bar_time))
///////////////////////Other//////////////////////////////////
if(f_resInMinutes() <= f_tfRes(customTF,f_resInMinutes()))
if(showSTLP)
if(showLabel and (barstate.islast or barstate.islastconfirmedhistory))
texLabel = f_resInMinutes() == f_tfRes(customTF,f_resInMinutes()) ? f_resFromMinutes(f_resInMinutes()) : f_resFromMinutes(f_tfRes(customTF,f_resInMinutes()))
label.set_xy(labelTF,array.get(arrayXSTLP,0),array.get(arrayYSTLP,0))
label.set_text(labelTF,texLabel)
label.set_style(labelTF,array.get(arrayYSTLP,0) < array.get(arrayYSTLP,1) ? label.style_label_upper_right : label.style_label_lower_right)
if(not showTLP)
arrayLineTemp := array.copy(arrayLineTLP)
for itemArray in arrayLineTemp
if(line.get_x1(itemArray) < array.get(arrayXSTLP,0))
line.delete(itemArray)
array.remove(arrayLineTLP,array.indexof(arrayLineTLP, itemArray))
//Inside Bars - Outside Bars
insideBar() => ISB and high <= high and low >= low ? 1 : 0
outsideBar() => OSB and (high > high and low < low ) ? 1 : 0
//Inside and Outside Bars
barcolor(insideBar() ? color.new(colorISB,0) : na )
barcolor(outsideBar() ? color.new(colorOSB,0) : na )
Last Price Line
# Last Price Line with Enhanced Features
## Description
This indicator provides a highly customizable horizontal price line that tracks the current market price with advanced visualization options and real-time price change tracking. Unlike the basic price line built into most charting platforms, this tool offers extensive customization including dynamic color changes based on price movement, detailed price change statistics, adjustable line extensions, and flexible label positioning. The indicator is designed to give traders instant visual reference of the current price level with optional momentum context through color-coded labels showing gains or losses from the previous bar.
## How It Works
The indicator continuously monitors the closing price of the most recent bar and draws a horizontal line at that exact level. The line extends both left and right by user-defined amounts, with an option to infinitely extend the line to the right. When price change display is enabled, the indicator calculates the difference between the current price and the previous close, presenting this information both in absolute points and percentage terms directly on the price label.
**Core Calculation:**
- Current Price = Close of most recent bar
- Price Change = Current Price - Previous Close
- Percent Change = (Price Change / Previous Close) × 100
**Dynamic Color Logic:**
When "Color by Change Direction" is enabled, the label automatically changes color based on price movement:
- **Up Color** (default: green) when current price > previous close
- **Down Color** (default: red) when current price < previous close
- **Neutral Color** (default: gray) when price is unchanged
This provides instant visual feedback on intrabar momentum without needing to look at price values.
## Original Features & Methodology
**What Makes This Script Unique:**
- Combines a customizable price reference line with real-time price change statistics
- Implements percentage-based label offset system that works consistently across all price scales
- Features tri-state color system (up/down/neutral) with user-definable colors for each state
- Includes independent left and right extension controls for precise visual placement
- Offers multiple decimal place precision options (0-8 decimals) for any asset class
- Provides optional circular marker plot that can be toggled independently from the main line
**Technical Implementation:**
- Uses `barstate.islast` to ensure line updates only on the most recent bar for performance
- Implements proper object deletion to prevent memory buildup over time
- Employs `line.style_label_left` and `line.style_label_right` for intelligent label positioning
- Supports infinite right extension via `extend.right` or fixed extension via `extend.none`
- Line transparency and marker transparency controlled independently
## Key Features
🔹 **Fully Customizable Line**: Control color, width, style (solid/dashed/dotted), and transparency
🔹 **Flexible Extension**: Separate left and right extension controls with optional infinite right extension
🔹 **Smart Price Labels**: Display current price with customizable size, position, and decimal precision
🔹 **Price Change Display**: Optional display of price change from previous bar in points and/or percentage
🔹 **Dynamic Color Coding**: Label automatically changes color based on up/down/neutral movement
🔹 **Custom Color Palette**: Define your own colors for bullish, bearish, and neutral conditions
🔹 **Precision Control**: Set decimal places from 0 to 8 for any asset (stocks, forex, crypto, futures)
🔹 **Optional Price Marker**: Toggle circular plot marker independently from main line
🔹 **Performance Optimized**: Efficient code that only updates on the most recent bar
## Input Parameters Explained
**Line Settings**
- **Line Color**: Base color for the horizontal price line (default: yellow)
- **Line Width**: Thickness from 1-5 pixels (default: 2)
- **Line Style**: Choose Solid, Dashed, or Dotted appearance
- **Line Transparency**: 0-100% transparency control (0 = opaque, 100 = invisible)
**Extension Settings**
- **Left Extension**: How many bars to extend the line to the left (default: 50)
- **Right Extension**: How many bars to extend the line to the right (default: 10)
- **Extend Line Right**: Toggle infinite right extension (overrides right extension bars when enabled)
**Label Settings**
- **Show Price Label**: Toggle the price label on/off
- **Label Position**: Place label on Left or Right side of chart
- **Label Size**: Choose from Tiny, Small, Normal, Large, or Huge
- **Label Text Color**: Color of the text inside the label (default: white)
- **Price Decimals**: Number of decimal places to display (0-8)
**Price Change Settings**
- **Show Price Change**: Display change from previous bar
- **Show Percent Change**: Include percentage change in label
- **Color by Change Direction**: Enable dynamic color coding based on movement
- **Up Color**: Label color when price is higher (default: green)
- **Down Color**: Label color when price is lower (default: red)
- **Neutral Color**: Label color when price is unchanged (default: gray)
**Display Settings**
- **Show Current Price Marker**: Toggle the circular plot marker
- **Marker Transparency**: Control transparency of the marker line (default: 90%)
## How to Use This Indicator
**Basic Setup:**
1. Add the indicator to your chart - a yellow horizontal line will appear at the current price
2. The line extends 50 bars to the left and 10 bars to the right by default
3. A label on the right shows the current price with 2 decimal places
**Customizing Appearance:**
1. Adjust line color, width, and style to match your chart theme
2. Modify left/right extensions to fit your chart display preferences
3. Change label position to Left if it interferes with right-side indicators
4. Increase/decrease label size based on your screen resolution and preferences
**Enabling Price Change Display:**
1. Check "Show Price Change" to see movement from previous bar
2. Label will show: Current Price, Point Change, and Percent Change
3. Enable "Color by Change Direction" for instant visual momentum feedback
4. Customize up/down/neutral colors to match your trading style
**Precision Settings:**
- **Stocks**: Use 2 decimal places
- **Forex majors**: Use 4-5 decimal places
- **Crypto**: Use 2-4 decimal places depending on asset value
- **Futures**: Use 2 decimal places (0 for index futures)
- **Commodities**: Vary by instrument (0-4 typical)
**Pro Tips:**
- Use high transparency (60-80%) for subtle price reference
- Disable the circular marker if you only want the main line
- Enable infinite right extension to see price level projection into the future
- Use different colors for different timeframes on multi-chart layouts
## Use Cases
**Day Trading:**
- Quick visual reference for entry price and current price relationship
- Color-coded momentum feedback shows if you're gaining or losing on the bar
- Precise decimal control for instruments with specific tick sizes
**Swing Trading:**
- Track daily close levels across multiple days
- Monitor percentage gains/losses from previous session close
- Clear visual separation between current price and reference levels
**Position Monitoring:**
- Instant visual of current P&L when combined with entry indicators
- Clean price display without cluttering the chart
- Customizable to match any chart color scheme
**Multi-Monitor Setups:**
- Consistent price reference across different timeframe charts
- Large label sizes for viewing from a distance
- High-contrast colors for quick recognition
## Technical Details
- Updates only on `barstate.islast` for optimal performance
- Proper line and label deletion prevents memory buildup
- Works on all timeframes and asset classes
- No repainting - all values based on confirmed bar data
- Label position calculated using `bar_index` for accurate placement
- Supports both fixed and infinite line extension modes
## Best Practices
- Use contrasting line colors that stand out against your chart background
- Set appropriate decimal places for your asset to avoid clutter
- Enable price change display for active trading, disable for clean charts
- Use transparency when layering multiple indicators
- Position labels to avoid overlap with other chart elements
- Customize colors to distinguish between different chart windows
- Test different label sizes to find what works best for your screen
This indicator serves as an essential price reference tool that combines simplicity with powerful customization options, making it suitable for traders of all experience levels and trading styles.
---
## Connect With Me
📧 **Email**: contact@savvytraderpro.com
📊 **Website**: (savvytraderpro.com)
🐦 **X (Twitter)**: (twitter.com)
💬 Follow for more indicators, trading strategies, and market insights!
---
**⚠️ Disclaimer:**
This script is provided for educational and informational purposes only. It is not financial advice and should not be considered a recommendation to buy, sell, or hold any financial instrument. Trading involves significant risk of loss and is not suitable for every investor. Users should perform their own due diligence and consult with a licensed financial advisor before making any trading decisions. The author does not guarantee any profits or results from using this script, and assumes no liability for any losses incurred. Use this script at your own risk.
GTI BGTI: RSI Suite (Standard • Stochastic • Smoothed)
A three-layer momentum and trend toolkit that combines Standard RSI, Stochastic RSI, and a Smoothed/“Macro” RSI to help you read intraday swings, trend transitions, and high-probability reversal/continuation spots.
All in one pane with intuitive coloring and optional divergence markers and alerts.
Why this works
* Stochastic RSI (K/D) visualizes fast momentum swings and timing.
* Standard RSI moves more gradually, helping confirm trend transitions that may span several Stochastic cycles.
* Smoothed RSI (Average → Macro) adds a second-pass filter and slope persistence to reveal the macro direction while suppressing noise.
Used together, Stochastic guides entries/exits around local highs/lows, while the RSI layers improve confidence when a small swing is likely part of a larger turn.
What you’ll see
* Standard RSI (yellow; pink above Bull line, aqua below Bear line).
* Stochastic RSI (K/D) with contextual colors:
* Greens when RSI is weak/oversold (bearish conditions → watch for bullish reversals/continuations).
* Reds when RSI is strong/overbought (bullish conditions → watch for bearish reversals/continuations).
* Smoothed (Macro) RSI with trend color:
* Red when macro is ascending (bullish),
* Aqua when macro is descending (bearish).
* Divergences (optional markers):
* Bearish: RSI Lower High + Price Higher High (red ⬇).
* Bullish: RSI Higher Low + Price Lower Low (green ⬆).
* No repaint: pivots confirm after the chosen right-bars window.
How to use it
* Bullish Reversal
* Macro RSI is reversing at a higher low after price has been in a overall downtrend
* Stochastic RSI is switching from green to red in an overall downtrend
* Bullish Oversold
* Macro RSI is reversing from a significantly low level after price has a short but strong dip during an overall uptrend
* Stochastic RSI is switching from green to red in an overall uptrend
* Bullish Continuation
* Macro RSI is ascending with a strong slope or forming a higher low above the 50 line
* Stochastic RSI is reaching a bottom but still painted red
* Bearish Reversal
* Macro RSI is reversing at a lower high after price has been in a overall uptrend
* Stochastic RSI is switching from red to green in an overall uptrend
* Bearish Overbought
* Macro RSI is reversing from a significantly high level after price has a short but strong jump during an overall downtrend
* Stochastic RSI is switching from red to green in an overall downtrend
* Bearish Continuation
* Macro RSI is descending with a strong slope or forming a lower high below the 50 line
* Stochastic RSI is reaching a top but still painted green
* Divergences: Use as signals of exhaustion—best when aligned with Macro RSI color/slope and key levels (e.g., Bull/Bear lines, 50 midline).
*** IMPORTANT ***
* Stack confluence, don’t single-signal trade. Look for:
* 1) Macro RSI color & slope (red = ascending/bullish, aqua = descending/bearish)
* 2) Standard RSI location (above/below Bull/Bear lines or 50)
* 3) Stoch flip + direction
* 4) Price structure (HH/HL vs LH/LL)
* 5) Divergence type (regular vs hidden) at meaningful levels
* Trade with the macro
* Prioritize longs when Macro RSI is red or just flipped up
* Prioritize shorts when Macro RSI is aqua or just flipped down
* Counter-trend setups = smaller size and faster management.
* Location > signal
* The same crossover/divergence is higher quality near Bull (~60)/Bear(~40) or extremes than in the mid-range chop around 50.
* Early vs confirmed
* Use the early pivot heads-up for anticipation, but scale in only after the confirmed pivot (right-bars complete). If early signal fails to confirm, stand down.
* Define invalidation upfront
* For divergence entries, place stops beyond the pivot extreme (LL/HH). If Macro RSI flips against your trade or RSI breaks back through 50 with slope, exit or tighten.
* Multi-timeframe alignment
* Best results come when entry timeframe (e.g., 1H) aligns with higher-TF macro (e.g., 4H/D). If they disagree, treat it as mean-reversion only.
* Avoid common traps
* Skip: isolated Stochastic flips without RSI support, divergences without price HH/LL confirmation, and serial divergences when Macro RSI slope is strong against the idea.
* Parameter guidance
* Start with defaults; then tune: confirmBars 3–7, minSlope 0.05–0.15 RSI pts/bar, pivot left/right tighter for faster but noisier signals, wider for cleaner but fewer.
* Alerts = workflow, not auto-trades
* Use Macro Flip + Divergence alerts as a checklist trigger; enter only when your confluence rules are met and risk is defined.
Key inputs (tweak to your market/timeframe)
* RSI / Stochastic lengths and K/D smoothing.
* Bull / Bear Lines (default 61.1 / 43.6).
* Average RSI Method/Length (SMA/EMA/RMA/WMA) + Macro Smooth Length.
* Trend confirmation: bars of persistence and minimum slope to reduce flip noise.
* Pivot look-back (left/right) for divergence confirmation strictness.
Alerts included
* Macro Flip Up / Down (Smoothed RSI regime change).
* RSI Bullish/Bearish Divergence (confirmed at pivot).
* Stochastic RSI continuation/divergence (optional).
Tips
* Level + Slope matter. High/low RSI level flags conditions; slope confirms impulse/continuation.
* Let Stochastic time the swing; let Macro RSI filter the trend.
* Tighten or loosen pivot windows to trade fewer/cleaner vs. more/faster signals.
Mithsuka-Check-List V2This Is ICT Concept Based Check List Indicator, you Cn Use This For Before Enter a Trade For Confirmation Checking.
Dual DEMA with Slope Coloring
Dual DEMA with Slope Coloring & Signal Labels
Description
This indicator implements a dual moving average system using Double Exponential Moving Averages (DEMA) with an innovative slope-based color-coding mechanism and customizable crossover signal labels. The indicator addresses the common lag problem found in traditional moving averages by applying exponential smoothing twice, while adding a real-time momentum visualization layer through dynamic color changes based on each DEMA's rate of change.
Original Features & Methodology
What Makes This Script Unique:
Combines DEMA calculation with real-time slope analysis to create a visual momentum feedback system
Implements adjustable slope thresholds (measured in ticks per bar) that control color sensitivity independently for each DEMA
Features intelligent signal labels that display the exact period configuration (e.g., "8/21") with percentage-based vertical offset positioning to avoid chart clutter
How DEMA is Calculated:
The Double Exponential Moving Average reduces lag by applying exponential smoothing twice:
First EMA: EMA1 = EMA(Price, Length)
Second EMA: DEMA = EMA(EMA1, Length)
This double smoothing creates a faster-responding average compared to a single EMA while maintaining smoothness.
How Slope Coloring Works:
Each DEMA continuously calculates its slope using this formula:
Slope = (Current DEMA - Previous DEMA) / Tick Size
The slope is then compared against an adjustable threshold (default: 2.0, divided by 10 for scaling):
Green/Lime: Slope exceeds positive threshold (strong uptrend)
Red/Maroon: Slope exceeds negative threshold (strong downtrend)
Yellow/Orange: Slope within threshold range (consolidation/weak trend)
This provides instant visual feedback on momentum strength without requiring additional oscillators.
Signal Label System:
When the fast DEMA crosses the slow DEMA, a label appears showing the period configuration. Labels use percentage-based vertical offset calculated from the high/low of the signal bar, ensuring consistent positioning across different price scales and timeframes.
Key Features
🔹 Independent DEMA Configuration: Each DEMA has separate settings for source, length, displacement, and slope threshold
🔹 Real-Time Momentum Visualization: Color changes instantly reflect trend strength based on tick-normalized slope
🔹 Smart Crossover Labels: Auto-generated labels show periods with adjustable offset (percentage-based for consistency)
🔹 Displacement Option: Forward-shift DEMAs for predictive/leading analysis
🔹 Optional Fill Zone: Visual area between DEMAs shows relationship strength
🔹 Customizable Alerts: Built-in alert conditions for all crossover events
🔹 Multi-Asset Compatible: Slope calculation uses tick size for consistent behavior across instruments
Input Parameters Explained
DEMA 1 Settings (Fast Line)
Price Source: Which price data to use (close, open, high, low, hl2, hlc3, ohlc4)
Length: Number of periods for EMA calculation (default: 8 for responsive signals)
Displace: Shift DEMA forward by X bars (0 = no displacement)
Slope Threshold: Sensitivity control - lower values = more frequent color changes (default: 2.0)
DEMA 2 Settings (Slow Line)
Same parameters as DEMA 1, with default length of 21 for trend confirmation
Signal Controls
Show Crossover Signals: Display triangle markers at crossover points
Fill Between DEMAs: Shade area between lines (green when fast > slow, red when slow > fast)
Signal Label Options
Show Signal Labels: Toggle period labels on crossovers
Label Size: Visual size from Tiny to Huge
Vertical Offset: Distance from price bars as percentage (0.15% = ~15 ticks from bar on typical chart)
Color Settings: Independent colors for bullish and bearish signals
How to Use This Indicator
Setup:
Add indicator to chart - both DEMAs will display with default settings (8 and 21 periods)
Observe color changes - lines change from neutral (yellow/orange) to directional (green/red) as momentum builds
Adjust slope thresholds if colors change too frequently (increase) or too slowly (decrease)
Trading Signals:
Bullish Setup: Fast DEMA (8) crosses above slow DEMA (21) - look for long entries
Bearish Setup: Fast DEMA crosses below slow DEMA - look for short entries
Momentum Confirmation: Both DEMAs showing strong directional colors (green/lime or red/maroon)
Caution Zones: Neutral colors (yellow/orange) indicate weak momentum or consolidation
Recommended Configurations:
Scalping/Intraday: 5/15 or 8/21 periods with slope threshold 1.5-2.5
Swing Trading: 21/50 or 50/100 periods with slope threshold 1.0-2.0
Position Trading: 50/200 periods with slope threshold 0.5-1.5
Alert Setup:
Create alerts for crossover events to catch signals in real-time without constant chart monitoring.
Technical Details
Slope calculation normalizes using syminfo.mintick for consistent behavior across instruments
Label positioning uses percentage-based offset for price-scale independence
Works on all timeframes and asset classes (stocks, forex, crypto, futures, indices)
No repainting - all calculations use confirmed bar data
Best Practices
Use shorter periods for faster markets and longer timeframes
Combine with volume analysis or support/resistance for trade confirmation
Neutral colors often precede breakouts - wait for directional color confirmation
Adjust vertical offset if labels overlap with price action on busy charts
Consider higher slope thresholds in ranging markets to reduce false signals
This indicator serves as a comprehensive trend-following and momentum visualization tool, combining the lag-reduction benefits of DEMA with an intuitive color-coding system that provides at-a-glance market condition assessment.
Connect With Me
📧 Email: contact@savvytraderpro.com
📊 Website: savvytraderpro.com
🐦 X (Twitter): @savvytraderpro
💬 Follow for more indicators, trading strategies, and market insights!
⚠️ Disclaimer:
This script is provided for educational and informational purposes only. It is not financial advice and should not be considered a recommendation to buy, sell, or hold any financial instrument. Trading involves significant risk of loss and is not suitable for every investor. Users should perform their own due diligence and consult with a licensed financial advisor before making any trading decisions. The author does not guarantee any profits or results from using this script, and assumes no liability for any losses incurred. Use this script at your own risk.
Abhay Mani// This work is licensed under a Attribution-NonCommercial-ShareAlike 4.0 International (CC BY-NC-SA 4.0) creativecommons.org
//
//@version=5
indicator("Abhay Mani", shorttitle = "Abhay Mani ", overlay = true, max_lines_count = 500, max_labels_count = 500, max_boxes_count = 500, max_bars_back = 500, max_polylines_count = 100)
//-----------------------------------------------------------------------------{
//Boolean set
//-----------------------------------------------------------------------------{
s_BOS = 0
s_CHoCH = 1
i_BOS = 2
i_CHoCH = 3
i_pp_CHoCH = 4
green_candle = 5
red_candle = 6
s_CHoCHP = 7
i_CHoCHP = 8
boolean =
array.from(
false
, false
, false
, false
, false
, false
, false
, false
, false
)
//-----------------------------------------------------------------------------{
// User inputs
//-----------------------------------------------------------------------------{
show_swing_ms = input.string ("All" , "Swing " , inline = "1", group = "MARKET STRUCTURE" , options = )
show_internal_ms = input.string ("All" , "Internal " , inline = "2", group = "MARKET STRUCTURE" , options = )
internal_r_lookback = input.int (5 , "" , inline = "2", group = "MARKET STRUCTURE" , minval = 2)
swing_r_lookback = input.int (50 , "" , inline = "1", group = "MARKET STRUCTURE" , minval = 2)
ms_mode = input.string ("Manual" , "Market Structure Mode" , inline = "a", group = "MARKET STRUCTURE" , tooltip = " Use selected lenght Use automatic lenght" ,options = )
show_mtf_str = input.bool (true , "MTF Scanner" , inline = "9", group = "MARKET STRUCTURE" , tooltip = "Display Multi-Timeframe Market Structure Trend Directions. Green = Bullish. Red = Bearish")
show_eql = input.bool (false , "Show EQH/EQL" , inline = "6", group = "MARKET STRUCTURE")
plotcandle_bool = input.bool (false , "Plotcandle" , inline = "3", group = "MARKET STRUCTURE" , tooltip = "Displays a cleaner colored candlestick chart in place of the default candles. (requires hiding the current ticker candles)")
barcolor_bool = input.bool (false , "Bar Color" , inline = "4", group = "MARKET STRUCTURE" , tooltip = "Color the candle bodies according to market strucutre trend")
i_ms_up_BOS = input.color (#089981 , "" , inline = "2", group = "MARKET STRUCTURE")
i_ms_dn_BOS = input.color (#f23645 , "" , inline = "2", group = "MARKET STRUCTURE")
s_ms_up_BOS = input.color (#089981 , "" , inline = "1", group = "MARKET STRUCTURE")
s_ms_dn_BOS = input.color (#f23645 , "" , inline = "1", group = "MARKET STRUCTURE")
lvl_daily = input.bool (false , "Day " , inline = "1", group = "HIGHS & LOWS MTF")
lvl_weekly = input.bool (false , "Week " , inline = "2", group = "HIGHS & LOWS MTF")
lvl_monthly = input.bool (false , "Month" , inline = "3", group = "HIGHS & LOWS MTF")
lvl_yearly = input.bool (false , "Year " , inline = "4", group = "HIGHS & LOWS MTF")
css_d = input.color (color.blue , "" , inline = "1", group = "HIGHS & LOWS MTF")
css_w = input.color (color.blue , "" , inline = "2", group = "HIGHS & LOWS MTF")
css_m = input.color (color.blue , "" , inline = "3", group = "HIGHS & LOWS MTF")
css_y = input.color (color.blue , "" , inline = "4", group = "HIGHS & LOWS MTF")
s_d = input.string ('⎯⎯⎯' , '' , inline = '1', group = 'HIGHS & LOWS MTF' , options = )
s_w = input.string ('⎯⎯⎯' , '' , inline = '2', group = 'HIGHS & LOWS MTF' , options = )
s_m = input.string ('⎯⎯⎯' , '' , inline = '3', group = 'HIGHS & LOWS MTF' , options = )
s_y = input.string ('⎯⎯⎯' , '' , inline = '4', group = 'HIGHS & LOWS MTF' , options = )
ob_show = input.bool (true , "Show Last " , inline = "1", group = "VOLUMETRIC ORDER BLOCKS" , tooltip = "Display volumetric order blocks on the chart Ammount of volumetric order blocks to show")
ob_num = input.int (5 , "" , inline = "1", group = "VOLUMETRIC ORDER BLOCKS" , tooltip = "Orderblocks number", minval = 1, maxval = 10)
ob_metrics_show = input.bool (true , "Internal Buy/Sell Activity" , inline = "2", group = "VOLUMETRIC ORDER BLOCKS" , tooltip = "Display volume metrics that have formed the orderblock")
css_metric_up = input.color (color.new(#089981, 50) , " " , inline = "2", group = "VOLUMETRIC ORDER BLOCKS")
css_metric_dn = input.color (color.new(#f23645 , 50) , "" , inline = "2", group = "VOLUMETRIC ORDER BLOCKS")
ob_swings = input.bool (false , "Swing Order Blocks" , inline = "a", group = "VOLUMETRIC ORDER BLOCKS" , tooltip = "Display swing volumetric order blocks")
css_swing_up = input.color (color.new(color.gray , 90) , " " , inline = "a", group = "VOLUMETRIC ORDER BLOCKS")
css_swing_dn = input.color (color.new(color.silver, 90) , "" , inline = "a", group = "VOLUMETRIC ORDER BLOCKS")
ob_filter = input.string ("None" , "Filtering " , inline = "d", group = "VOLUMETRIC ORDER BLOCKS" , tooltip = "Filter out volumetric order blocks by BOS/CHoCH/CHoCH+", options = )
ob_mitigation = input.string ("Absolute" , "Mitigation " , inline = "4", group = "VOLUMETRIC ORDER BLOCKS" , tooltip = "Trigger to remove volumetric order blocks", options = )
ob_pos = input.string ("Precise" , "Positioning " , inline = "k", group = "VOLUMETRIC ORDER BLOCKS" , tooltip = "Position of the Order Block Cover the whole candle Cover half candle Adjust to volatility Same as Accurate but more precise", options = )
use_grayscale = input.bool (false , "Grayscale" , inline = "6", group = "VOLUMETRIC ORDER BLOCKS" , tooltip = "Use gray as basic order blocks color")
use_show_metric = input.bool (true , "Show Metrics" , inline = "7", group = "VOLUMETRIC ORDER BLOCKS" , tooltip = "Show volume associated with the orderblock and his relevance")
use_middle_line = input.bool (true , "Show Middle-Line" , inline = "8", group = "VOLUMETRIC ORDER BLOCKS" , tooltip = "Show mid-line order blocks")
use_overlap = input.bool (true , "Hide Overlap" , inline = "9", group = "VOLUMETRIC ORDER BLOCKS" , tooltip = "Hide overlapping order blocks")
use_overlap_method = input.string ("Previous" , "Overlap Method " , inline = "Z", group = "VOLUMETRIC ORDER BLOCKS" , tooltip = " Preserve the most recent volumetric order blocks Preserve the previous volumetric order blocks", options = )
ob_bull_css = input.color (color.new(#089981 , 90) , "" , inline = "1", group = "VOLUMETRIC ORDER BLOCKS")
ob_bear_css = input.color (color.new(#f23645 , 90) , "" , inline = "1", group = "VOLUMETRIC ORDER BLOCKS")
show_acc_dist_zone = input.bool (false , "" , inline = "1", group = "Accumulation And Distribution")
zone_mode = input.string ("Fast" , "" , inline = "1", group = "Accumulation And Distribution" , tooltip = " Find small zone pattern formation Find bigger zone pattern formation" ,options = )
acc_css = input.color (color.new(#089981 , 60) , "" , inline = "1", group = "Accumulation And Distribution")
dist_css = input.color (color.new(#f23645 , 60) , "" , inline = "1", group = "Accumulation And Distribution")
show_lbl = input.bool (false , "Show swing point" , inline = "1", group = "High and Low" , tooltip = "Display swing point")
show_mtb = input.bool (false , "Show High/Low/Equilibrium" , inline = "2", group = "High and Low" , tooltip = "Display Strong/Weak High And Low and Equilibrium")
toplvl = input.color (color.red , "Premium Zone " , inline = "3", group = "High and Low")
midlvl = input.color (color.gray , "Equilibrium Zone" , inline = "4", group = "High and Low")
btmlvl = input.color (#089981 , "Discount Zone " , inline = "5", group = "High and Low")
fvg_enable = input.bool (false , " " , inline = "1", group = "FAIR VALUE GAP" , tooltip = "Display fair value gap")
what_fvg = input.string ("FVG" , "" , inline = "1", group = "FAIR VALUE GAP" , tooltip = "Display fair value gap", options = )
fvg_num = input.int (5 , "Show Last " , inline = "1a", group = "FAIR VALUE GAP" , tooltip = "Number of fvg to show")
fvg_upcss = input.color (color.new(#089981, 80) , "" , inline = "1", group = "FAIR VALUE GAP")
fvg_dncss = input.color (color.new(color.red , 80) , "" , inline = "1", group = "FAIR VALUE GAP")
fvg_extend = input.int (10 , "Extend FVG" , inline = "2", group = "FAIR VALUE GAP" , tooltip = "Extend the display of the FVG.")
fvg_src = input.string ("Close" , "Mitigation " , inline = "3", group = "FAIR VALUE GAP" , tooltip = " Use the close of the body as trigger Use the extreme point of the body as trigger", options = )
fvg_tf = input.timeframe ("" , "Timeframe " , inline = "4", group = "FAIR VALUE GAP" , tooltip = "Timeframe of the fair value gap")
t = color.t (ob_bull_css)
invcol = color.new (color.white , 100)
//{----------------------------------------------------------------------------------------------------------------------------------------------}
//{----------------------------------------------------------------------------------------------------------------------------------------------}
//{----------------------------------------------------------------------------------------------------------------------------------------------}
//{----------------------------------------------------------------------------------------------------------------------------------------------}
//{ - UDT }
//{----------------------------------------------------------------------------------------------------------------------------------------------}
//{----------------------------------------------------------------------------------------------------------------------------------------------}
//{----------------------------------------------------------------------------------------------------------------------------------------------}
//{----------------------------------------------------------------------------------------------------------------------------------------------}
type bar
float o = open
float c = close
float h = high
float l = low
float v = volume
int n = bar_index
int t = time
type Zphl
line top
line bottom
label top_label
label bottom_label
bool stopcross
bool sbottomcross
bool itopcross
bool ibottomcross
string txtup
string txtdn
float topy
float bottomy
float topx
float bottomx
float tup
float tdn
int tupx
int tdnx
float itopy
float itopx
float ibottomy
float ibottomx
float uV
float dV
type FVG
box box
line ln
bool bull
float top
float btm
int left
int right
type ms
float p
int n
float l
type msDraw
int n
float p
color css
string txt
bool bull
type obC
float top
float btm
int left
float avg
float dV
float cV
int wM
int blVP
int brVP
int dir
float h
float l
int n
type obD
box ob
box eOB
box blB
box brB
line mL
type zone
chart.point points
float p
int c
int t
type hqlzone
box pbx
box ebx
box lbx
label plb
label elb
label lbl
type ehl
float pt
int t
float pb
int b
type pattern
string found = "None"
bool isfound = false
int period = 0
bool bull = false
type alerts
bool chochswing = false
bool chochplusswing = false
bool swingbos = false
bool chochplus = false
bool choch = false
bool bos = false
bool equal = false
bool ob = false
bool swingob = false
bool zone = false
bool fvg = false
bool obtouch = false
//{----------------------------------------------------------------------------------------------------------------------------------------------}
//{----------------------------------------------------------------------------------------------------------------------------------------------}
//{----------------------------------------------------------------------------------------------------------------------------------------------}
//{----------------------------------------------------------------------------------------------------------------------------------------------}
//{ - End }
//{----------------------------------------------------------------------------------------------------------------------------------------------}
//{----------------------------------------------------------------------------------------------------------------------------------------------}
//{----------------------------------------------------------------------------------------------------------------------------------------------}
//{----------------------------------------------------------------------------------------------------------------------------------------------}
//{----------------------------------------------------------------------------------------------------------------------------------------------}
//{----------------------------------------------------------------------------------------------------------------------------------------------}
//{----------------------------------------------------------------------------------------------------------------------------------------------}
//{----------------------------------------------------------------------------------------------------------------------------------------------}
//{ - General Setup }
//{----------------------------------------------------------------------------------------------------------------------------------------------}
//{----------------------------------------------------------------------------------------------------------------------------------------------}
//{----------------------------------------------------------------------------------------------------------------------------------------------}
//{----------------------------------------------------------------------------------------------------------------------------------------------}
bar b = bar.new()
var pattern p = pattern.new()
alerts blalert = alerts.new()
alerts bralert = alerts.new()
if p.isfound
p.period += 1
if p.period == 50
p.period := 0
p.found := "None"
p.isfound := false
p.bull := na
switch
b.c > b.o => boolean.set(green_candle, true)
b.c < b.o => boolean.set(red_candle , true)
f_zscore(src, lookback) =>
(src - ta.sma(src, lookback)) / ta.stdev(src, lookback)
var int iLen = internal_r_lookback
var int sLen = swing_r_lookback
vv = f_zscore(((close - close ) / close ) * 100,iLen)
if ms_mode == "Dynamic"
switch
vv >= 1.5 or vv <= -1.5 => iLen := 10
vv >= 1.6 or vv <= -1.6 => iLen := 9
vv >= 1.7 or vv <= -1.7 => iLen := 8
vv >= 1.8 or vv <= -1.8 => iLen := 7
vv >= 1.9 or vv <= -1.9 => iLen := 6
vv >= 2.0 or vv <= -2.0 => iLen := 5
=> iLen
var msline = array.new(0)
iH = ta.pivothigh(high, iLen, iLen)
sH = ta.pivothigh(high, sLen, sLen)
iL = ta.pivotlow (low , iLen, iLen)
sL = ta.pivotlow (low , sLen, sLen)
//{----------------------------------------------------------------------------------------------------------------------------------------------}
//{----------------------------------------------------------------------------------------------------------------------------------------------}
//{----------------------------------------------------------------------------------------------------------------------------------------------}
//{----------------------------------------------------------------------------------------------------------------------------------------------}
//{ - End }
//{----------------------------------------------------------------------------------------------------------------------------------------------}
//{----------------------------------------------------------------------------------------------------------------------------------------------}
//{----------------------------------------------------------------------------------------------------------------------------------------------}
//{----------------------------------------------------------------------------------------------------------------------------------------------}
//{----------------------------------------------------------------------------------------------------------------------------------------------}
//{----------------------------------------------------------------------------------------------------------------------------------------------}
//{----------------------------------------------------------------------------------------------------------------------------------------------}
//{----------------------------------------------------------------------------------------------------------------------------------------------}
//{ - ARRAYS }
//{----------------------------------------------------------------------------------------------------------------------------------------------}
//{----------------------------------------------------------------------------------------------------------------------------------------------}
//{----------------------------------------------------------------------------------------------------------------------------------------------}
//{----------------------------------------------------------------------------------------------------------------------------------------------}
hl () =>
= request.security(syminfo.tickerid , 'D' , hl() , lookahead = barmerge.lookahead_on)
= request.security(syminfo.tickerid , 'W' , hl() , lookahead = barmerge.lookahead_on)
= request.security(syminfo.tickerid , 'M' , hl() , lookahead = barmerge.lookahead_on)
= request.security(syminfo.tickerid , '12M', hl() , lookahead = barmerge.lookahead_on)
lstyle(style) =>
out = switch style
'⎯⎯⎯' => line.style_solid
'----' => line.style_dashed
'····' => line.style_dotted
mtfphl(h, l ,tf ,css, pdhl_style) =>
var line hl = line.new(
na
, na
, na
, na
, xloc = xloc.bar_time
, color = css
, style = lstyle(pdhl_style)
)
var line ll = line.new(
na
, na
, na
, na
, xloc = xloc.bar_time
, color = css
, style = lstyle(pdhl_style)
)
var label lbl = label.new(
na
, na
, xloc = xloc.bar_time
, text = str.format('P{0}L', tf)
, color = invcol
, textcolor = css
, size = size.small
, style = label.style_label_left
)
var label hlb = label.new(
na
, na
, xloc = xloc.bar_time
, text = str.format('P{0}H', tf)
, color = invcol
, textcolor = css
, size = size.small
, style = label.style_label_left
)
hy = ta.valuewhen(h != h , h , 1)
hx = ta.valuewhen(h == high , time , 1)
ly = ta.valuewhen(l != l , l , 1)
lx = ta.valuewhen(l == low , time , 1)
if barstate.islast
extension = time + (time - time ) * 50
line.set_xy1(hl , hx , hy)
line.set_xy2(hl , extension , hy)
label.set_xy(hlb, extension , hy)
line.set_xy1(ll , lx , ly)
line.set_xy2(ll , extension , ly)
label.set_xy(lbl, extension , ly)
if lvl_daily
mtfphl(pdh , pdl , 'D' , css_d, s_d)
if lvl_weekly
mtfphl(pwh , pwl , 'W' , css_w, s_w)
if lvl_monthly
mtfphl(pmh , pml, 'M' , css_m, s_m)
if lvl_yearly
mtfphl(pyh , pyl , '12M', css_y, s_y)
//{----------------------------------------------------------------------------------------------------------------------------------------------}
//{----------------------------------------------------------------------------------------------------------------------------------------------}
//{----------------------------------------------------------------------------------------------------------------------------------------------}
//{----------------------------------------------------------------------------------------------------------------------------------------------}
//{ - End }
//{----------------------------------------------------------------------------------------------------------------------------------------------}
//{----------------------------------------------------------------------------------------------------------------------------------------------}
//{----------------------------------------------------------------------------------------------------------------------------------------------}
//{----------------------------------------------------------------------------------------------------------------------------------------------}
//{----------------------------------------------------------------------------------------------------------------------------------------------}
//{----------------------------------------------------------------------------------------------------------------------------------------------}
//{----------------------------------------------------------------------------------------------------------------------------------------------}
//{----------------------------------------------------------------------------------------------------------------------------------------------}
//{ - Market Structure }
//{----------------------------------------------------------------------------------------------------------------------------------------------}
//{----------------------------------------------------------------------------------------------------------------------------------------------}
//{----------------------------------------------------------------------------------------------------------------------------------------------}
//{----------------------------------------------------------------------------------------------------------------------------------------------}
method darkcss(color css, float factor, bool bull) =>
blue = color.b(css) * (1 - factor)
red = color.r(css) * (1 - factor)
green = color.g(css) * (1 - factor)
color.rgb(red, green, blue, 0)
method f_line(msDraw d, size, style) =>
var line id = na
var label lbl = na
id := line.new(
d.n
, d.p
, b.n
, d.p
, color = d.css
, width = 1
, style = style
)
if msline.size() >= 250
line.delete(msline.shift())
msline.push(id)
lbl := label.new(
int(math.avg(d.n, b.n))
, d.p
, d.txt
, color = invcol
, textcolor = d.css
, style = d.bull ? label.style_label_down : label.style_label_up
, size = size
, text_font_family = font.family_monospace
)
structure(bool mtf) =>
msDraw drw = na
bool isdrw = false
bool isdrwS = false
var color css = na
var color icss = na
var int itrend = 0
var int trend = 0
bool bull_ob = false
bool bear_ob = false
bool s_bull_ob = false
bool s_bear_ob = false
n = bar_index
var ms up = ms.new(
array.new()
, array.new< int >()
, array.new()
)
var ms dn = ms.new(
array.new()
, array.new< int >()
, array.new()
)
var ms sup = ms.new(
array.new()
, array.new< int >()
, array.new()
)
var ms sdn = ms.new(
array.new()
, array.new< int >()
, array.new()
)
switch show_swing_ms
"All" => boolean.set(s_BOS , true ), boolean.set(s_CHoCH, true ) , boolean.set(s_CHoCHP, true )
"CHoCH" => boolean.set(s_BOS , false), boolean.set(s_CHoCH, true ) , boolean.set(s_CHoCHP, false )
"CHoCH+" => boolean.set(s_BOS , false), boolean.set(s_CHoCH, false) , boolean.set(s_CHoCHP, true )
"BOS" => boolean.set(s_BOS , true ), boolean.set(s_CHoCH, false) , boolean.set(s_CHoCHP, false )
"None" => boolean.set(s_BOS , false), boolean.set(s_CHoCH, false) , boolean.set(s_CHoCHP, false )
=> na
switch show_internal_ms
"All" => boolean.set(i_BOS, true ), boolean.set(i_CHoCH, true ), boolean.set(i_CHoCHP, true )
"CHoCH" => boolean.set(i_BOS, false), boolean.set(i_CHoCH, true ), boolean.set(i_CHoCHP, false)
"CHoCH+" => boolean.set(i_BOS, false), boolean.set(i_CHoCH, false ), boolean.set(i_CHoCHP, true )
"BOS" => boolean.set(i_BOS, true ), boolean.set(i_CHoCH, false ), boolean.set(i_CHoCHP, false)
"None" => boolean.set(i_BOS, false), boolean.set(i_CHoCH, false ), boolean.set(i_CHoCHP, false)
=> na
switch
iH =>
up.p.unshift(b.h )
up.l.unshift(b.h )
up.n.unshift(n )
iL =>
dn.p.unshift(b.l )
dn.l.unshift(b.l )
dn.n.unshift(n )
sL =>
sdn.p.unshift(b.l )
sdn.l.unshift(b.l )
sdn.n.unshift(n )
sH =>
sup.p.unshift(b.h )
sup.l.unshift(b.h )
sup.n.unshift(n )
// INTERNAL BULLISH STRUCTURE
if up.p.size() > 0 and dn.l.size() > 1
if ta.crossover(b.c, up.p.first())
bool CHoCH = na
string txt = na
if itrend < 0
CHoCH := true
switch
not CHoCH =>
txt := "BOS"
css := i_ms_up_BOS
blalert.bos := true
if boolean.get(i_BOS) and mtf == false and na(drw)
isdrw := true
drw := msDraw.new(
up.n.first()
, up.p.first()
, i_ms_up_BOS
, txt
, true
)
CHoCH =>
dn.l.first() > dn.l.get(1) ? blalert.chochplus : blalert.choch
txt := dn.l.first() > dn.l.get(1) ? "CHoCH+" : "CHoCH"
css := i_ms_up_BOS.darkcss(0.25, true)
if (dn.l.first() > dn.l.get(1) ? boolean.get(i_CHoCHP) : boolean.get(i_CHoCH)) and mtf == false and na(drw)
isdrw := true
drw := msDraw.new(
up.n.first()
, up.p.first()
, i_ms_up_BOS.darkcss(0.25, true)
, txt
, true
)
if mtf == false
switch
ob_filter == "None" => bull_ob := true
ob_filter == "BOS" and txt == "BOS" => bull_ob := true
ob_filter == "CHoCH" and txt == "CHoCH" => bull_ob := true
ob_filter == "CHoCH+" and txt == "CHoCH+" => bull_ob := true
itrend := 1
up.n.clear()
up.p.clear()
// INTERNAL BEARISH STRUCTURE
if dn.p.size() > 0 and up.l.size() > 1
if ta.crossunder(b.c, dn.p.first())
bool CHoCH = na
string txt = na
if itrend > 0
CHoCH := true
switch
not CHoCH =>
bralert.bos := true
txt := "BOS"
css := i_ms_dn_BOS
if boolean.get(i_BOS) and mtf == false and na(drw)
isdrw := true
drw := msDraw.new(
dn.n.first()
, dn.p.first()
, i_ms_dn_BOS
, txt
, false
)
CHoCH =>
if up.l.first() < up.l.get(1)
bralert.chochplus := true
else
bralert.choch := true
txt := up.l.first() < up.l.get(1) ? "CHoCH+" : "CHoCH"
css := i_ms_dn_BOS.darkcss(0.25, false)
if (up.l.first() < up.l.get(1) ? boolean.get(i_CHoCHP) : boolean.get(i_CHoCH)) and mtf == false and na(drw)
isdrw := true
drw := msDraw.new(
dn.n.first()
, dn.p.first()
, i_ms_dn_BOS.darkcss(0.25, false)
, txt
, false
)
if mtf == false
switch
ob_filter == "None" => bear_ob := true
ob_filter == "BOS" and txt == "BOS" => bear_ob := true
ob_filter == "CHoCH" and txt == "CHoCH" => bear_ob := true
ob_filter == "CHoCH+" and txt == "CHoCH+" => bear_ob := true
itrend := -1
dn.n.clear()
dn.p.clear()
// SWING BULLISH STRUCTURE
if sup.p.size() > 0 and sdn.l.size() > 1
if ta.crossover(b.c, sup.p.first())
bool CHoCH = na
string txt = na
if trend < 0
CHoCH := true
switch
not CHoCH =>
blalert.swingbos := true
txt := "BOS"
icss := s_ms_up_BOS
if boolean.get(s_BOS) and mtf == false and na(drw)
isdrwS := true
drw := msDraw.new(
sup.n.first()
, sup.p.first()
, s_ms_up_BOS
, txt
, true
)
CHoCH =>
if sdn.l.first() > sdn.l.get(1)
blalert.chochplusswing := true
else
blalert.chochswing := true
txt := sdn.l.first() > sdn.l.get(1) ? "CHoCH+" : "CHoCH"
icss := s_ms_up_BOS.darkcss(0.25, true)
if (sdn.l.first() > sdn.l.get(1) ? boolean.get(s_CHoCHP) : boolean.get(s_CHoCH)) and mtf == false and na(drw)
isdrwS := true
drw := msDraw.new(
sup.n.first()
, sup.p.first()
, s_ms_up_BOS.darkcss(0.25, true)
, txt
, true
)
if mtf == false
switch
ob_filter == "None" => s_bull_ob := true
ob_filter == "BOS" and txt == "BOS" => s_bull_ob := true
ob_filter == "CHoCH" and txt == "CHoCH" => s_bull_ob := true
ob_filter == "CHoCH+" and txt == "CHoCH+" => s_bull_ob := true
trend := 1
sup.n.clear()
sup.p.clear()
// SWING BEARISH STRUCTURE
if sdn.p.size() > 0 and sup.l.size() > 1
if ta.crossunder(b.c, sdn.p.first())
bool CHoCH = na
string txt = na
if trend > 0
CHoCH := true
switch
not CHoCH =>
bralert.swingbos := true
txt := "BOS"
icss := s_ms_dn_BOS
if boolean.get(s_BOS) and mtf == false and na(drw)
isdrwS := true
drw := msDraw.new(
sdn.n.first()
, sdn.p.first()
, s_ms_dn_BOS
, txt
, false
)
CHoCH =>
if sup.l.first() < sup.l.get(1)
bralert.chochplusswing := true
else
bralert.chochswing := true
txt := sup.l.first() < sup.l.get(1) ? "CHoCH+" : "CHoCH"
icss := s_ms_dn_BOS.darkcss(0.25, false)
if (sup.l.first() < sup.l.get(1) ? boolean.get(s_CHoCHP) : boolean.get(s_CHoCH)) and mtf == false and na(drw)
isdrwS := true
drw := msDraw.new(
sdn.n.first()
, sdn.p.first()
, s_ms_dn_BOS.darkcss(0.25, false)
, txt
, false
)
if mtf == false
switch
ob_filter == "None" => s_bear_ob := true
ob_filter == "BOS" and txt == "BOS" => s_bear_ob := true
ob_filter == "CHoCH" and txt == "CHoCH" => s_bear_ob := true
ob_filter == "CHoCH+" and txt == "CHoCH+" => s_bear_ob := true
trend := -1
sdn.n.clear()
sdn.p.clear()
= structure(false)
if isdrw
f_line(drw, size.small, line.style_dashed)
if isdrwS
f_line(drw, size.small, line.style_solid)
= request.security("", "15" , structure(true))
= request.security("", "60" , structure(true))
= request.security("", "240" , structure(true))
= request.security("", "1440" , structure(true))
if show_mtf_str
var tab = table.new(position = position.top_right, columns = 10, rows = 10, bgcolor = na, frame_color = color.rgb(54, 58, 69, 0), frame_width = 1, border_color = color.rgb(54, 58, 69, 100), border_width = 1)
table.cell(tab, 0, 1, text = "15" , text_color = color.silver, text_halign = text.align_center, text_size = size.normal, bgcolor = chart.bg_color, text_font_family = font.family_monospace, width = 2)
table.cell(tab, 0, 2, text = "1H" , text_color = color.silver, text_halign = text.align_center, text_size = size.normal, bgcolor = chart.bg_color, text_font_family = font.family_monospace, width = 2)
table.cell(tab, 0, 3, text = "4H" , text_color = color.silver, text_halign = text.align_center, text_size = size.normal, bgcolor = chart.bg_color, text_font_family = font.family_monospace, width = 2)
table.cell(tab, 0, 4, text = "1D" , text_color = color.silver, text_halign = text.align_center, text_size = size.normal, bgcolor = chart.bg_color, text_font_family = font.family_monospace, width = 2)
table.cell(tab, 1, 1, text = itrend15 == 1 ? "BULLISH" : itrend15 == -1 ? "BEARISH" : na , text_halign = text.align_center, text_size = size.normal, text_color = itrend15 == 1 ? i_ms_up_BOS.darkcss(-0.25, true) : itrend15 == -1 ? i_ms_dn_BOS.darkcss(0.25, false) : color.gray, bgcolor = chart.bg_color, text_font_family = font.family_monospace)
table.cell(tab, 1, 2, text = itrend1H == 1 ? "BULLISH" : itrend1H == -1 ? "BEARISH" : na , text_halign = text.align_center, text_size = size.normal, text_color = itrend1H == 1 ? i_ms_up_BOS.darkcss(-0.25, true) : itrend1H == -1 ? i_ms_dn_BOS.darkcss(0.25, false) : color.gray, bgcolor = chart.bg_color, text_font_family = font.family_monospace)
table.cell(tab, 1, 3, text = itrend4H == 1 ? "BULLISH" : itrend4H == -1 ? "BEARISH" : na , text_halign = text.align_center, text_size = size.normal, text_color = itrend4H == 1 ? i_ms_up_BOS.darkcss(-0.25, true) : itrend4H == -1 ? i_ms_dn_BOS.darkcss(0.25, false) : color.gray, bgcolor = chart.bg_color, text_font_family = font.family_monospace)
table.cell(tab, 1, 4, text = itrend1D == 1 ? "BULLISH" : itrend1D == -1 ? "BEARISH" : na , text_halign = text.align_center, text_size = size.normal, text_color = itrend1D == 1 ? i_ms_up_BOS.darkcss(-0.25, true) : itrend1D == -1 ? i_ms_dn_BOS.darkcss(0.25, false) : color.gray, bgcolor = chart.bg_color, text_font_family = font.family_monospace)
table.cell(tab, 0, 5, text = "Detected Pattern", text_halign = text.align_center, text_size = size.normal, text_color = color.silver, bgcolor = chart.bg_color, text_font_family = font.family_monospace)
table.cell(tab, 0, 6, text = p.found, text_halign = text.align_center, text_size = size.normal, text_color = na(p.bull) ? color.white : p.bull ? i_ms_up_BOS.darkcss(-0.25, true) : p.bull == false ? i_ms_dn_BOS.darkcss(0.25, false) : na, bgcolor = chart.bg_color, text_font_family = font.family_monospace)
table.merge_cells(tab, 0, 5, 1, 5)
table.merge_cells(tab, 0, 6, 1, 6)
//{----------------------------------------------------------------------------------------------------------------------------------------------}
//{----------------------------------------------------------------------------------------------------------------------------------------------}
//{----------------------------------------------------------------------------------------------------------------------------------------------}
//{----------------------------------------------------------------------------------------------------------------------------------------------}
//{ - End }
//{----------------------------------------------------------------------------------------------------------------------------------------------}
//{----------------------------------------------------------------------------------------------------------------------------------------------}
//{----------------------------------------------------------------------------------------------------------------------------------------------}
//{----------------------------------------------------------------------------------------------------------------------------------------------}
//{----------------------------------------------------------------------------------------------------------------------------------------------}
//{----------------------------------------------------------------------------------------------------------------------------------------------}
//{----------------------------------------------------------------------------------------------------------------------------------------------}
//{----------------------------------------------------------------------------------------------------------------------------------------------}
//{ - Strong/Weak High/Low And Equilibrium }
//{----------------------------------------------------------------------------------------------------------------------------------------------}
//{----------------------------------------------------------------------------------------------------------------------------------------------}
//{----------------------------------------------------------------------------------------------------------------------------------------------}
//{----------------------------------------------------------------------------------------------------------------------------------------------}
var phl = Zphl.new(
na
, na
, label.new(na , na , color = invcol , textcolor = i_ms_dn_BOS , style = label.style_label_down , size = size.tiny , text = "")
, label.new(na , na , color = invcol , textcolor = i_ms_up_BOS , style = label.style_label_up , size = size.tiny , text = "")
, true
, true
, true
, true
, ""
, ""
, 0
, 0
, 0
, 0
, high
, low
, 0
, 0
, 0
, 0
, 0
, 0
, na
, na
)
zhl(len)=>
upper = ta.highest(len)
lower = ta.lowest(len)
var float out = 0
out := b.h > upper ? 0 : b.l < lower ? 1 : out
top = out == 0 and out != 0 ? b.h : 0
btm = out == 1 and out != 1 ? b.l : 0
= zhl(sLen)
= zhl(iLen)
upphl(trend) =>
var label lbl = label.new(
na
, na
, color = invcol
, textcolor = toplvl
, style = label.style_label_down
, size = size.small
)
if top
phl.stopcross := true
phl.txtup := top > phl.topy ? "HH" : "HL"
if show_lbl
topl = label.new(
b.n - swing_r_lookback
, top
, phl.txtup
, color = invcol
, textcolor = toplvl
, style = label.style_label_down
, size = size.small
)
line.delete(phl.top )
phl.top := line.new(
b.n - sLen
, top
, b.n
, top
, color = toplvl)
phl.topy := top
phl.topx := b.n - sLen
phl.tup := top
phl.tupx := b.n - sLen
if itop
phl.itopcross := true
phl.itopy := itop
phl.itopx := b.n - iLen
phl.tup := math.max(high, phl.tup)
phl.tupx := phl.tup == high ? b.n : phl.tupx
phl.uV := phl.tup != phl.tup ? b.v : phl.uV
if barstate.islast
line.set_xy1(
phl.top
, phl.tupx
, phl.tup
)
line.set_xy2(
phl.top
, b.n + 50
, phl.tup
)
label.set_x(
lbl
, b.n + 50
)
label.set_y(
lbl
, phl.tup
)
dist = math.abs(phl.uV / (phl.uV + phl.dV)) * 100
label.set_text (lbl, trend < 0
? "Strong High | " + str.tostring(phl.uV, format.volume) + " (" + str.tostring(math.round(dist,0)) + "%)"
: "Weak High | " + str.tostring(phl.uV, format.volume) + " (" + str.tostring(math.round(dist,0)) + "%)")
dnphl(trend) =>
var label lbl = label.new(
na
, na
, color = invcol
, textcolor = btmlvl
, style = label.style_label_up
, size = size.small
)
if btm
phl.sbottomcross := true
phl.txtdn := btm > phl.bottomy ? "LH" : "LL"
if show_lbl
btml = label.new(
b.n - swing_r_lookback
, btm, phl.txtdn
, color = invcol
, textcolor = btmlvl
, style = label.style_label_up
, size = size.small
)
line.delete(phl.bottom )
phl.bottom := line.new(
b.n - sLen
, btm
, b.n
, btm
, color = btmlvl
)
phl.bottomy := btm
phl.bottomx := b.n - sLen
phl.tdn := btm
phl.tdnx := b.n - sLen
if ibtm
phl.ibottomcross := true
phl.ibottomy := ibtm
phl.ibottomx := b.n - iLen
phl.tdn := math.min(low, phl.tdn)
phl.tdnx := phl.tdn == low ? b.n : phl.tdnx
phl.dV := phl.tdn != phl.tdn ? b.v : phl.dV
if barstate.islast
line.set_xy1(
phl.bottom
, phl.tdnx
, phl.tdn
)
line.set_xy2(
phl.bottom
, b.n + 50
, phl.tdn
)
label.set_x(
lbl
, b.n + 50
)
label.set_y(
lbl
, phl.tdn
)
dist = math.abs(phl.dV / (phl.uV + phl.dV)) * 100
label.set_text (lbl, trend > 0
? "Strong Low | " + str.tostring(phl.dV, format.volume) + " (" + str.tostring(math.round(dist,0)) + "%)"
: "Weak Low | " + str.tostring(phl.uV, format.volume) + " (" + str.tostring(math.round(dist,0)) + "%)")
midphl() =>
avg = math.avg(phl.bottom.get_y2(), phl.top.get_y2())
var line l = line.new(
y1 = avg
, y2 = avg
, x1 = b.n - sLen
, x2 = b.n + 50
, color = midlvl
, style = line.style_solid
)
var label lbl = label.new(
x = b.n + 50
, y = avg
, text = "Equilibrium"
, style = label.style_label_left
, color = invcol
, textcolor = midlvl
, size = size.small
)
if barstate.islast
more = (phl.bottom.get_x1() + phl.bottom.get_x2()) > (phl.top.get_x1() + phl.top.get_x2()) ? phl.top.get_x1() : phl.bottom.get_x1()
line.set_xy1(l , more , avg)
line.set_xy2(l , b.n + 50, avg)
label.set_x (lbl , b.n + 50 )
label.set_y (lbl , avg )
dist = math.abs((l.get_y2() - close) / close) * 100
label.set_text (lbl, "Equilibrium (" + str.tostring(math.round(dist,0)) + "%)")
hqlzone() =>
if barstate.islast
var hqlzone dZone = hqlzone.new(
box.new(
na
, na
, na
, na
, bgcolor = color.new(toplvl, 70)
, border_color = na
)
, box.new(
na
, na
, na
, na
, bgcolor = color.new(midlvl, 70)
, border_color = na
)
, box.new(
na
, na
, na
, na
, bgcolor = color.new(btmlvl, 70)
, border_color = na
)
, label.new(na, na, text = "Premium" , color = invcol, textcolor = toplvl, style = label.style_label_down, size = size.small)
, label.new(na, na, text = "Equilibrium", color = invcol, textcolor = midlvl, style = label.style_label_left, size = size.small)
, label.new(na, na, text = "Discount" , color = invcol, textcolor = btmlvl, style = label.style_label_up , size = size.small)
)
dZone.pbx.set_lefttop(int(math.max(phl.topx, phl.bottomx)) , phl.tup)
dZone.pbx.set_rightbottom(b.n + 50 , 0.95 * phl.tup + 0.05 * phl.tdn)
dZone.ebx.set_lefttop(int(math.max(phl.topx, phl.bottomx)), 0.525 * phl.tup + 0.475 * phl.tdn)
dZone.ebx.set_rightbottom(b.n + 50 , 0.525 * phl.tdn + 0.475 * phl.tup)
dZone.lbx.set_lefttop(int(math.max(phl.topx, phl.bottomx)), 0.95 * phl.tdn + 0.05 * phl.tup)
dZone.lbx.set_rightbottom(b.n + 50 , phl.tdn)
dZone.plb.set_xy( int(math.avg(math.max(phl.topx, phl.bottomx), int(b.n + 50))) , phl.tup)
dZone.elb.set_xy( int(b.n + 50) , math.avg(phl.tup, phl.tdn))
dZone.lbl.set_xy( int(math.avg(math.max(phl.topx, phl.bottomx), int(b.n + 50))) , phl.tdn)
if show_mtb
upphl (trend)
dnphl (trend)
hqlzone()
//{----------------------------------------------------------------------------------------------------------------------------------------------}
//{----------------------------------------------------------------------------------------------------------------------------------------------}
//{----------------------------------------------------------------------------------------------------------------------------------------------}
//{----------------------------------------------------------------------------------------------------------------------------------------------}
//{ - End }
//{----------------------------------------------------------------------------------------------------------------------------------------------}
//{----------------------------------------------------------------------------------------------------------------------------------------------}
//{----------------------------------------------------------------------------------------------------------------------------------------------}
//{----------------------------------------------------------------------------------------------------------------------------------------------}
//{----------------------------------------------------------------------------------------------------------------------------------------------}
//{----------------------------------------------------------------------------------------------------------------------------------------------}
//{----------------------------------------------------------------------------------------------------------------------------------------------}
//{----------------------------------------------------------------------------------------------------------------------------------------------}
//{ - Volumetric Order Block }
//{----------------------------------------------------------------------------------------------------------------------------------------------}
//{----------------------------------------------------------------------------------------------------------------------------------------------}
//{----------------------------------------------------------------------------------------------------------------------------------------------}
//{----------------------------------------------------------------------------------------------------------------------------------------------}
method eB(box b, bool ext, color css, bool swing) =>
b.unshift(
box.new(
na
, na
, na
, na
, xloc = xloc.bar_time
, text_font_family = font.family_monospace
, extend = ext ? extend.right : extend.none
, border_color = swing ? color.new(css, 0) : color.new(color.white,100)
, bgcolor = css
, border_width = 1
)
)
method eL(line l, bool ext, bool solid, color css) =>
l.unshift(
line.new(
na
, na
, na
, na
, width = 1
, color = css
, xloc = xloc.bar_time
, extend = ext ? extend.right : extend.none
, style = solid ? line.style_solid : line.style_dashed
)
)
method drawVOB(bool cdn, bool bull, color css, int loc, bool swing) =>
= request.security(
syminfo.tickerid
, ""
,
, lookahead = barmerge.lookahead_off
)
var obC obj = obC.new(
array.new()
, array.new()
, array.new< int >()
, array.new()
, array.new()
, array.new()
, array.new< int >()
, array.new< int >()
, array.new< int >()
, array.new< int >()
, array.new()
, array.new()
, array.new< int >()
)
var obD draw = obD.new(
array.new()
, array.new()
, array.new()
, array.new()
, array.new()
)
if barstate.isfirst
for i = 0 to ob_num - 1
draw.mL .eL(false, false, use_grayscale ? color.new(color.gray, 0) : color.new(css,0))
draw.ob .eB(false, use_grayscale ? color.new(color.gray, 90) : css, swing)
draw.blB.eB(false, css_metric_up , swing)
draw.brB.eB(false, css_metric_dn , swing)
draw.eOB.eB(true , use_grayscale ? color.new(color.gray, 90) : css, swing)
float pos = ob_pos == "Full"
? (bull ? high : low)
: ob_pos == "Middle"
? ohlc4
: ob_pos == "Accurate"
? hl2
: hl2
if cdn
obj.h.clear()
obj.l.clear()
obj.n.clear()
for i = 0 to math.abs((loc - b.n)) - 1
obj.h.push(hH )
obj.l.push(lL )
obj.n.push(b.t )
// obj.h.reverse()
// obj.l.reverse()
int iU = obj.l.indexof(obj.l.min()) + 1
int iD = obj.h.indexof(obj.h.max()) + 1
obj.dir.unshift(
bull
? (b.c > b.o ? 1 : -1)
: (b.c > b.o ? 1 : -1)
)
obj.top.unshift(
bull
? pos
: obj.h.max()
)
obj.btm.unshift(
bull
? obj.l.min()
: pos
)
obj.left.unshift(
bull
? obj.n.get(obj.l.indexof(obj.l.min()))
: obj.n.get(obj.h.indexof(obj.h.max()))
)
obj.avg.unshift(
math.avg(obj.top.first(), obj.btm.first())
)
obj.cV.unshift(
bull
? b.v
: b.v
)
if ob_pos == "Precise"
switch bull
true =>
if obj.avg.get(0) < (b.c < b.o ? b.c : b.o ) and obj.top.get(0) > hlcc4
obj.top.set(0, obj.avg.get(0))
obj.avg.set(0, math.avg(obj.top.first(), obj.btm.first()))
false =>
if obj.avg.get(0) > (b.c < b.o ? b.o : b.c ) and obj.btm.get(0) < hlcc4
obj.btm.set(0, obj.avg.get(0))
obj.avg.set(0, math.avg(obj.top.first(), obj.btm.first()))
obj.blVP.unshift ( 0 )
obj.brVP.unshift ( 0 )
obj.wM .unshift ( 1 )
if use_overlap
int rmP = use_overlap_method == "Recent" ? 1 : 0
if obj.avg.size() > 1
if bull
? obj.btm.first() < obj.top.get(1)
: obj.top.first() > obj.btm.get(1)
obj.wM .remove(rmP)
obj.cV .remove(rmP)
obj.dir .remove(rmP)
obj.top .remove(rmP)
obj.avg .remove(rmP)
obj.btm .remove(rmP)
obj.left .remove(rmP)
obj.blVP .remove(rmP)
obj.brVP .remove(rmP)
if barstate.isconfirmed
for x = 0 to ob_num - 1
tg = switch ob_mitigation
"Middle" => obj.avg
"Absolute" => bull ? obj.btm : obj.top
for in tg
if (bull ? cC < pt : cC > pt)
obj.wM .remove(idx)
obj.cV .remove(idx)
obj.dir .remove(idx)
obj.top .remove(idx)
obj.avg .remove(idx)
obj.btm .remove(idx)
obj.left .remove(idx)
obj.blVP .remove(idx)
obj.brVP .remove(idx)
if barstate.islast
if obj.avg.size() > 0
// Alert
if bull
? ta.crossunder(low , obj.top.get(0))
: ta.crossover (high, obj.btm.get(0))
switch bull
true => blalert.obtouch := true
false => bralert.obtouch := true
float tV = 0
obj.dV.clear()
seq = math.min(ob_num - 1, obj.avg.size() - 1)
for j = 0 to seq
tV += obj.cV.get(j)
if j == seq
for y = 0 to seq
obj.dV.unshift(
math.floor(
(obj.cV.get(y) / tV) * 100)
)
obj.dV.reverse()
for i = 0 to math.min(ob_num - 1, obj.avg.size() - 1)
dmL = draw.mL .get(i)
dOB = draw.ob .get(i)
dblB = draw.blB.get(i)
dbrB = draw.brB.get(i)
deOB = draw.eOB.get(i)
dOB.set_lefttop (obj.left .get(i) , obj.top.get(i))
deOB.set_lefttop (b.t , obj.top.get(i))
dOB.set_rightbottom (b.t , obj.btm.get(i))
deOB.set_rightbottom(b.t + (b.t - b.t ) * 100 , obj.btm.get(i))
if use_middle_line
dmL.set_xy1(obj.left.get(i), obj.avg.get(i))
dmL.set_xy2(b.t , obj.avg.get(i))
if ob_metrics_show
dblB.set_lefttop (obj.left.get(i), obj.top.get(i))
dbrB.set_lefttop (obj.left.get(i), obj.avg.get(i))
dblB.set_rightbottom(obj.left.get(i), obj.avg.get(i))
dbrB.set_rightbottom(obj.left.get(i), obj.btm.get(i))
rpBL = dblB.get_right()
rpBR = dbrB.get_right()
dbrB.set_right(rpBR + (b.t - b.t ) * obj.brVP.get(i))
dblB.set_right(rpBL + (b.t - b.t ) * obj.blVP.get(i))
if use_show_metric
txt = switch
obj.cV.get(i) >= 1000000000 => str.tostring(math.round(obj.cV.get(i) / 1000000000,3)) + "B"
obj.cV.get(i) >= 1000000 => str.tostring(math.round(obj.cV.get(i) / 1000000,3)) + "M"
obj.cV.get(i) >= 1000 => str.tostring(math.round(obj.cV.get(i) / 1000,3)) + "K"
obj.cV.get(i) < 1000 => str.tostring(math.round(obj.cV.get(i)))
deOB.set_text(
str.tostring(
txt + " (" + str.tostring(obj.dV.get(i)) + "%)")
)
deOB.set_text_size (size.auto)
deOB.set_text_halign(text.align_left)
deOB.set_text_color (use_grayscale ? color.silver : color.new(css, 0))
if ob_metrics_show and barstate.isconfirmed
if obj.wM.size() > 0
for i = 0 to obj.avg.size() - 1
switch obj.dir.get(i)
1 =>
switch obj.wM.get(i)
1 => obj.blVP.set(i, obj.blVP.get(i) + 1), obj.wM.set(i, 2)
2 => obj.blVP.set(i, obj.blVP.get(i) + 1), obj.wM.set(i, 3)
3 => obj.brVP.set(i, obj.brVP.get(i) + 1), obj.wM.set(i, 1)
-1 =>
switch obj.wM.get(i)
1 => obj.brVP.set(i, obj.brVP.get(i) + 1), obj.wM.set(i, 2)
2 => obj.brVP.set(i, obj.brVP.get(i) + 1), obj.wM.set(i, 3)
3 => obj.blVP.set(i, obj.blVP.get(i) + 1), obj.wM.set(i, 1)
var hN = array.new(1, b.n)
var lN = array.new(1, b.n)
var hS = array.new(1, b.n)
var lS = array.new(1, b.n)
if iH
hN.pop()
hN.unshift(int(b.n ))
if iL
lN.pop()
lN.unshift(int(b.n ))
if sH
hS.pop()
hS.unshift(int(b.n ))
if sL
lS.pop()
lS.unshift(int(b.n ))
if ob_show
bull_ob.drawVOB(true , ob_bull_css, hN.first(), false)
bear_ob.drawVOB(false, ob_bear_css, lN.first(), false)
if ob_swings
s_bull_ob.drawVOB(true , css_swing_up, hS.first(), true)
s_bear_ob.drawVOB(false, css_swing_dn, lS.first(), true)
if bull_ob
blalert.ob := true
if bear_ob
bralert.ob := true
if s_bull_ob
blalert.swingob := true
if s_bear_ob
blalert.swingob := true
//{----------------------------------------------------------------------------------------------------------------------------------------------}
//{----------------------------------------------------------------------------------------------------------------------------------------------}
//{----------------------------------------------------------------------------------------------------------------------------------------------}
//{----------------------------------------------------------------------------------------------------------------------------------------------}
//{ - End }
//{----------------------------------------------------------------------------------------------------------------------------------------------}
//{----------------------------------------------------------------------------------------------------------------------------------------------}
//{----------------------------------------------------------------------------------------------------------------------------------------------}
//{----------------------------------------------------------------------------------------------------------------------------------------------}
//{----------------------------------------------------------------------------------------------------------------------------------------------}
//{----------------------------------------------------------------------------------------------------------------------------------------------}
//{----------------------------------------------------------------------------------------------------------------------------------------------}
//{----------------------------------------------------------------------------------------------------------------------------------------------}
//{ - FVG | VI | OG }
//{----------------------------------------------------------------------------------------------------------------------------------------------}
//{----------------------------------------------------------------------------------------------------------------------------------------------}
//{----------------------------------------------------------------------------------------------------------------------------------------------}
//{----------------------------------------------------------------------------------------------------------------------------------------------}
ghl() => request.security(syminfo.tickerid, fvg_tf, [high , low , close , open ])
tfG() => request.security(syminfo.tickerid, fvg_tf, )
cG(bool bull) =>
= ghl()
= tfG()
var FVG draw = FVG.new(
array.new()
, array.new()
)
var FVG cords = array.new()
float pup = na
float pdn = na
bool cdn = na
int pos = 2
cc = timeframe.change(fvg_tf)
if barstate.isfirst
for i = 0 to fvg_num - 1
draw.box.unshift(box.new (na, na, na, na, border_color = color.new(color.white, 100), xloc = xloc.bar_time))
draw.ln.unshift (line.new(na, na, na, na, xloc = xloc.bar_time, width = 1, style = line.style_solid))
switch what_fvg
"FVG" =>
pup := bull ? gl : l
pdn := bull ? h : gh
cdn := bull ? gl > h and cc : gh < l and cc
pos := 2
"VI" =>
pup := bull
? (gc > go
? go
: gc)
: (gc > go
? go
: gc )
pdn := bull
? (gc > go
? gc
: go )
: (gc > go
? gc
: go)
cdn := bull
? go > gc and gh > gl and gc > gc and go > go and gh < math.min(gc, go) and cc
: go < gc and gl < gh and gc < gc and go < go and gl > math.max(gc, go) and cc
pos := 1
"OG" =>
pup := bull ? b.l : gl
pdn := bull ? gh : gh
cdn := bull ? gl > gh and cc : gh < gl and cc
pos := 1
Perpetual Swing [HCR]The Perpetual Swing is a fully automated swing-direction indicator designed to help traders visualize long-term trend regimes and smooth out noise in volatile markets.
It combines:
• Hash Adaptive CCI – a dynamically tuned Commodity Channel Index that adapts to volatility conditions.
• Regime-based SMMA – a Smoothed Moving Average model used to define bullish and bearish environments.
The indicator continuously monitors both momentum and structural trend, switching bias automatically between long and short conditions.
It can be used on any asset or timeframe to identify directional bias, trend transitions, and potential swing entries.
How it works:
– When the adaptive CCI confirms bullish strength above the SMMA regime, the indicator signals a long bias.
– When momentum and regime flip bearish, it switches to short bias.
– The system remains continuously engaged to capture multi-cycle swings.
Phoenix Lock — No-Repaint No-Loss SMA+RSI+MACD Bot (+270%)🔥 PHOENIX LOCK — NO-REPAINT NO-LOSS SMA+RSI+MACD BOT (+270%) 🔥
✅ 100% confirmed signals — NO REPAINT (all on closed bar)
✅ 0 losses — built-in No-Loss Exit (covers fees + slippage)
✅ +270% over 2 years (backtest + live OKX Spot)
✅ Works on BTC/USDT, ETH/USDT, SOL/USDT, any spot pair
🎯 PREMIUM FEATURES:
• SMA Crossover (30/40) — clean trend entry
• RSI Filter (>40) — avoids weak moves
• MACD Confirmation — momentum lock
• ATR x3 Take-Profit — dynamic, adaptive
• No-Loss Exit — closes only above breakeven + fees
• Webhook Alerts — auto-trade on OKX, Bybit, Binance
• MagicNumber ready (via alert ID)
📊 SETUP (1 minute):
1. Add to TradingView
2. Enable alerts → Webhook to your broker
3. Run 24/7 — zero monitoring
4. Profit — no drawdown, no stress
💎 WHY BUY?
• No repainting — signals locked on bar close
• No losses — exits only in profit
• Fully tested — 2 years live data
• Instant delivery — lifetime access
💰 PRICE: $5000 (lifetime) or $199/month
🎁 First 5 buyers — 50% OFF ($2500)
📩 Support: @ProfitLockBot (Telegram) — setup help + updates
BUY NOW — LOCK YOUR PROFITS FOREVER
+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
🔥 PHOENIX LOCK — БЕЗ ПЕРЕРИСОВКИ, БЕЗ УБЫТКОВ SMA+RSI+MACD БОТ (+270%) 🔥
✅ 100% подтверждённые сигналы — БЕЗ ПЕРЕРИСОВКИ (только по закрытому бару)
✅ 0 убытков — встроенный No-Loss выход (учтены комиссии + проскальзывание)
✅ +270% за 2 года (бэктест + живые сделки на OKX Spot)
✅ Работает на BTC/USDT, ETH/USDT, SOL/USDT, любой спот-паре
🎯 ПРЕМИУМ-ФУНКЦИИ:
• SMA Crossover (30/40) — чистый вход по тренду
• RSI Фильтр (>40) — избегает слабых движений
• MACD Подтверждение — фиксация импульса
• ATR x3 Тейк-Профит — динамичный, адаптивный
• No-Loss Выход — закрытие только выше безубытка + комиссии
• Webhook Алерты — автоторговля на OKX, Bybit, Binance
• MagicNumber готов (через ID алерта)
📊 УСТАНОВКА (1 минута):
1. Добавь в TradingView
2. Включи алерты → Webhook к брокеру
3. Запусти 24/7 — без контроля
4. Прибыль — без просадки, без стресса
💎 ПОЧЕМУ КУПИТЬ?
• Без перерисовки — сигналы фиксированы на закрытии бара
• Без убытков — выход только в плюс
• Полностью протестировано — 2 года реальных данных
• Мгновенная доставка — пожизненный доступ
💰 ЦЕНА: $5000 (пожизненно) или $199/мес
🎁 Первые 5 покупателей — СКИДКА 50% ($2500)
📩 Поддержка: @ProfitLockBot (Telegram) — помощь с настройкой + обновления
КУПИ СЕЙЧАС — ЗАФИКСИРУЙ ПРИБЫЛЬ НАВСЕГДА
[Leo+] Scepter Algo$ LEO ✞ MONEY MAN® $
100% FREE FOREVER!
⚠️ Disclaimer – Please Read Carefully
Not Investment Advice:
All content shared in this server—including messages, media, discussions, and resources—is intended solely for educational and informational purposes. Nothing provided here constitutes financial, investment, or trading advice.
Personal Responsibility:
You are fully responsible for your own trading and investment decisions. Always conduct your own due diligence and consult with a licensed financial advisor before making financial decisions.
Third-Party Content:
This server is not responsible for any third-party content, links, tools, or resources shared by members. Use of such content is at your own risk.
Educational Purpose:
This is a learning-focused community. All discussions and shared materials are intended to support your personal development—not to replace professional financial guidance.
By joining and participating in this server, you acknowledge and accept that you are solely responsible for any actions or strategies you choose to undertake related to investing or trading.
By continuing to engage with this community, you agree to follow all server rules and accept the terms of service.
Enjoy exploring, testing and mastering these tools, happy trading!
AG Pro Dynamic ChannelsAG Pro Dynamic Channels V2
Discover a new lens through which to view market structure with the AG Pro Dynamic Channels V2. This advanced indicator moves beyond simple trendlines, automatically identifying, classifying, and drawing eight distinct types of support and resistance channels directly on your chart.
Built on a sophisticated pivot-point detection engine, this script intelligently distinguishes between Major and Minor price structures, as well as Internal and External channels. This provides a comprehensive and multi-dimensional map of the market's flow, helping you identify trend continuations, corrections, and potential reversals.
The indicator is complete with a powerful, fully customizable alert system designed to notify you of the two most critical events: channel breakouts and price reactions.
Key Features
Fully Automatic Channels: The script automatically analyzes price action to find pivot highs and lows, using them to construct relevant channels without any manual drawing required.
8-Channel Classification: Gain deep market insight by viewing eight distinct channel types:
Major External (Up/Down)
Major Internal (Up/Down)
Minor External (Up/Down)
Minor Internal (Up/Down)
Advanced Pivot Engine: The core logic classifies pivots into categories like Higher Highs (MHH/mHH), Lower Lows (MLL/mLL), Higher Lows (MHL/mHL), and Lower Highs (MLH/mLH) to determine the precise start and end points for each channel.
Deep Customization: Take full control of your chart's appearance. You can individually toggle the visibility, color, line style (solid, dashed, dotted), and line width for all eight channel types.
Chart Clarity: A "Delete Previous" option is available for each channel type, allowing you to keep your chart clean and focused on only the most current and relevant market structures.
Comprehensive Alert System
Never miss a key price interaction. The AG Pro Dynamic Channels V2 features a robust, built-in alert module.
Dual-Alert Conditions: Get notifications for two distinct events:
Break Alert: Triggers when price confirms a close outside of a channel, signaling a potential breakout.
React Alert: Triggers when price touches or interacts with a channel line before closing back inside, signaling a test or rejection.
16 Unique Alerts: You have full control to enable or disable "Break" and "React" alerts for all 8 channel types individually, giving you 16 unique alert conditions to monitor.
Professional Alert Messages: The embedded alert sender provides detailed messages that include the asset, timeframe, and the specific event, such as "Break Major External Up Channel" or "React Minor Internal Down Channel".
Alert Configuration: Easily set your global Alert Name, Message Frequency (e.g., Once Per Bar, Once Per Bar Close), and Alert Time Zone from the script's settings.
How to Use
Trend Identification: Use the Major External Channels (drawn from MHH and MLL pivots) to identify the primary, long-term trend direction.
Pullback & Entry Zones: Use the Internal Channels (drawn from MHL and MLH pivots) to spot corrections and potential entry zones within an established trend.
Breakout Trading: Set Break Alerts on Major channels to be notified of significant, structure-shifting moves.
Short-Term & Counter-Trend: Utilize the Minor Channels to identify shorter-term price swings and potential reversal points.
RVOL CandlesRvol indicator shows relative volume on each candle and can be adjusted and color change.
Custom Session Background Highlighter (Asia / London / NY)This was something i am used to using with Motivewave, and did not see a good one with TV. You can set any time frame, and change the background color to any color you want. I like to have a lightly different color background for Asia (6pm to 3am),, London, (3am to 9:30 am) and NY (9:30am to 5 pm). You can set your time as you wish, and change the colors as you like. This was created with the help of ChatGPT and seems to be working perfectly fine, but if you encounter any issues copy and paste the code to chatgpt and ask to revise it as needed.
ka66: Symbol InformationThis shows a table of all current (Pine v6) `syminfo.` values.
Please note this is primarily of use to Pine Developers, or the curious trader.
There are a few of these around on TradingView, but many seem to focus on the use case they have. This script just dumps all values, in alphabetical order of properties.
You can use this to inspect the details of the symbol, which in turn, can be fed into various scripts covering tasks such as:
Position Sizing calculation (which requires things like tick, pointvalue, and currency details)
Recommendation engines (which use the recommendation_* properties)
Fundamentals on stocks (which may use share count information, and possibly employee information)
Note that not all table values are populated, as they depend on the instrument being introspected. For example, a share ticker will have some different details to a Forex pair. The `NaN` values (the "Not A Number" special value in programming parlance) are not a bug, they are simply Pine reporting that no value is set for it. I have opted to dump out values as-is as the focus is developers.
My motivation to create it was to write a position sizing tool. Additionally, the output of this script is cleanly formatted, with monospace fonts and conventional alignment for tables/forms with key and values. It also allows customising the table position. Ideally this feature is made part of the default TradingView customisation, but at this time, it is not, and tables don't auto-adjust their positions.
Dante Broadening FormationThis auto-draws an attempt at best fit broadening formation used for trading "The Strat". Looking for reversals around the extremes of price discovery near the higher highs and lower lows can open up to big setup combined with the proper Strat setups, entries, exits, risk management and practice. Always paper trade first and protect your bankroll. Know that this tool isn't perfect, it's just saves some time drawing broadening formations and can help to train what they look like and why they are important. Open to feedback, enjoy!






















