B-Xtrender MTF Companion (custom colors + zero)B-Xtrender MTF Companion (Custom Colors + Zero)
This indicator is a multi-timeframe companion tool for the B-Xtrender system, designed to track momentum shifts across your current chart timeframe and up to two higher timeframes — all in one panel.
Key Features:
Multi-Timeframe Momentum: Plots histogram + signal line for current TF, HTF-1, and HTF-2, with independent color/offset settings for easy visual stacking.
Custom Styling: Full color and width control for bullish/bearish histograms, signal lines, and the zero line.
Smoothing Options: Choose between EMA or T3 smoothing for cleaner signals.
Momentum Flip Alerts: Built-in alert conditions for bullish or bearish flips on each timeframe.
Zero Line Control: Toggle, recolor, and restyle the zero reference line.
How It Works:
The B-Xtrender MTF Companion calculates the difference between two EMAs, applies RSI normalization, and then plots it as a centered oscillator. The signal line slope and histogram color indicate momentum direction, while higher-timeframe signals help confirm trend strength and avoid false entries.
Best Use:
Pair with price action or your primary B-Xtrender setup for trend confirmation.
Monitor higher timeframe momentum while trading intraday.
Combine alert flips with your entry rules for more timely trade triggers.
Exponential Moving Average (EMA)
Clean Multi-Indicator Alignment System
Overview
A sophisticated multi-indicator alignment system designed for 24/7 trading across all markets, with pure signal-based exits and no time restrictions. Perfect for futures, forex, and crypto markets that operate around the clock.
Key Features
🎯 Multi-Indicator Confluence System
EMA Cross Strategy: Fast EMA (5) and Slow EMA (10) for precise trend direction
VWAP Integration: Institution-level price positioning analysis
RSI Momentum: 7-period RSI for momentum confirmation and reversal detection
MACD Signals: Optimized 8/17/5 configuration for scalping responsiveness
Volume Confirmation: Customizable volume multiplier (default 1.6x) for signal validation
🚀 Advanced Entry Logic
Initial Full Alignment: Requires all 5 indicators + volume confirmation
Smart Continuation Entries: EMA9 pullback entries when trend momentum remains intact
Flexible Time Controls: Optional session filtering or 24/7 operation
🎪 Pure Signal-Based Exits
No Forced Closes: Positions exit only on technical signal reversals
Dual Exit Conditions: EMA9 breakdown + RSI flip OR MACD cross + EMA20 breakdown
Trend Following: Allows profitable trends to run their full course
Perfect for Swing Scalping: Ideal for multi-session position holding
📊 Visual Interface
Real-Time Status Dashboard: Live alignment monitoring for all indicators
Color-Coded Candles: Instant visual confirmation of entry/exit signals
Clean Chart Display: Toggle-able EMAs and VWAP with professional styling
Signal Differentiation: Clear labels for entries, X-crosses for exits
🔔 Alert System
Entry Notifications: Separate alerts for buy/sell signals
Exit Warnings: Technical breakdown alerts for position management
Mobile Ready: Push notifications to TradingView mobile app
Market Applications
Perfect For:
Gold Futures (GC): 24-hour precious metals trading
NASDAQ Futures (NQ): High-volatility index scalping
Forex Markets: Currency pairs with continuous operation
Crypto Trading: 24/7 cryptocurrency momentum plays
Energy Futures: Oil, gas, and commodity swing trades
Optimal Timeframes:
1-5 Minutes: Ultra-fast scalping during high volatility
5-15 Minutes: Balanced approach for most markets
15-30 Minutes: Swing scalping for trend following
🧠 Smart Position Management
Tracks implied position direction
Prevents conflicting signals
Allows trend continuation entries
State-aware exit logic
⚡ Scalping Optimized
Fast-reacting indicators with shorter periods
Volume-based confirmation reduces false signals
Clean entry/exit visualization
Minimal lag for time-sensitive trades
Configuration Options
All parameters fully customizable:
EMA Lengths: Adjustable from 1-30 periods
RSI Period: 1-14 range for different market conditions
MACD Settings: Fast (1-15), Slow (1-30), Signal (1-10)
Volume Confirmation: 0.5-5.0x multiplier range
Visual Preferences: Colors, displays, and table options
Risk Management Features
Clear visual exit signals prevent emotion-based decisions
Volume confirmation reduces false breakouts
Multi-indicator confluence improves signal quality
Optional time filtering for session-specific strategies
Best Use Cases
Futures Scalping: NQ, ES, GC during active sessions
Forex Swing Trading: Major pairs during overlap periods
Crypto Momentum: Bitcoin, Ethereum trend following
24/7 Automated Systems: Algorithmic trading implementation
Multi-Market Scanning: Portfolio-wide signal monitoring
Multi-EMAMulti-EMA Indicator
This script plots five commonly used Exponential Moving Averages (EMAs) on your chart for trend identification and trade timing.
Included EMAs & Colors:
EMA 8 — Red
EMA 20 — Orange
EMA 50 — Yellow
EMA 100 — Cyan
EMA 200 — Blue
How to use:
Shorter EMAs (8 & 20) help identify short-term momentum and potential entry/exit points.
Mid-range EMA (50) gives a broader view of intermediate trends.
Longer EMAs (100 & 200) are used to confirm long-term trend direction and key support/resistance zones.
Crossovers between EMAs can signal potential trend changes.
Price trading above most EMAs often signals bullish conditions, while trading below suggests bearish momentum.
Designed to work on any timeframe or market.
IB with Range PercentageThis Pine Script indicator for TradingView combines several powerful technical analysis tools to give traders a comprehensive view of market action:
Inside Bar Detection: Identifies the classic inside bar candlestick pattern.
Moving Averages: Provides multiple moving averages to help determine trend and potential support/resistance levels.
Information Table: Displays key market data in a concise table format.
1. Inside Bar Detection and Range
The indicator marks inside bars on the chart. An inside bar is a candlestick where its entire range (high and low) falls within the range of the preceding candlestick (often called the "mother bar"). This pattern often signifies market consolidation or indecision.
Customizable Marking: Users can choose the shape and color used to mark the inside bars, such as triangles, squares, or circles.
Range Percentage: A label shows the range of the inside bar as a percentage of the previous bar's low, providing a quantitative measure of its size.
Time Restriction: A setting allows displaying inside bars only for a specified number of past days, focusing analysis on recent price action.
Customizable Label Size: Users can choose the size of the range percentage label for optimal visibility.
2. Moving Averages for Trend Analysis
The indicator can plot up to four moving averages (MAs) on the chart. Moving averages smooth out price data to help identify trends and potential support and resistance levels.
User-Selectable MA Type: For each MA, traders can choose between Simple Moving Average (SMA) or Exponential Moving Average (EMA).
Customizable Length: Users can specify the length (number of periods) for each MA, such as 20, 50, 100, or 200.
Customizable Color: Each MA's line color can be chosen to suit personal preferences.
Trend Identification: When the price is above an MA, it suggests an uptrend, while prices below suggest a downtrend. The slope of the MA also indicates trend momentum.
3. Information Table for Key Data
A customizable information table is displayed on the chart, providing a quick overview of important market data.
Average Daily Range (ADR) Percentage: Shows the average daily range of the asset as a percentage, reflecting its historical volatility.
Distance from EMAs: Displays how far the current price is from the 10, 20, and 50 period Exponential Moving Averages. A positive percentage indicates the price is above the MA, while a negative percentage means it's below.
Customizable Table Elements: Users can choose the table's background color, text color, and text size for optimal readability.
How to Use This Indicator:
This indicator can be a valuable tool for traders using technical analysis:
Inside Bar Breakouts: Inside bars often precede breakouts. Traders can use the inside bar markings and range percentage to identify potential breakout opportunities.
Confirmation of Trends: Moving averages help confirm the direction of the trend, enabling traders to align their inside bar strategies with the prevailing market direction.
Support and Resistance: Moving averages can act as dynamic support and resistance levels. Traders can look for inside bars forming near these levels as potential entry or exit points.
Volatility and Range Analysis: The ADR percentage helps assess the normal daily range of an asset, which can be useful for setting realistic price targets and managing risk.
Risk Management: The distance from EMAs can alert traders to potential overextended moves, providing information for setting stop-loss or take-profit levels.
By combining these elements, this indicator provides a layered approach to market analysis, allowing traders to identify potential trading opportunities and manage risk effectively based on both candlestick patterns and trend-following indicators. Remember that no indicator guarantees success, and it's essential to use this tool in conjunction with other analysis techniques and proper risk management practices.
EMA21 Cross with 3-Bar Confirmation//@version=5
indicator("EMA21 Cross with 3-Bar Confirmation", overlay=true)
// Calculate 21-period EMA
ema21 = ta.ema(close, 21)
plot(ema21, "EMA21", color=color.blue, linewidth=2)
// Buy Conditions
crossover = ta.crossover(close, ema21)
threeBarsAfterCross = crossover
// Conditions for the 3 bars after crossover:
// 1. At least one red candle (close < open)
// 2. No candle closes below EMA21
// 3. No candle crosses below EMA21
hasRedCandle = (close < open ) or (close < open ) or (close < open)
allAboveEMA = (close > ema21 ) and (close > ema21 ) and (close > ema21)
noCrossDown = not (ta.crossunder(close , ema21 ) or ta.crossunder(close , ema21 ) or ta.crossunder(close, ema21))
buySignal = threeBarsAfterCross and hasRedCandle and allAboveEMA and noCrossDown
// Sell Conditions (opposite logic)
crossunder = ta.crossunder(close, ema21)
threeBarsAfterUnder = crossunder
// Conditions for the 3 bars after crossunder:
// 1. At least one green candle (close > open)
// 2. No candle closes above EMA21
// 3. No candle crosses above EMA21
hasGreenCandle = (close > open ) or (close > open ) or (close > open)
allBelowEMA = (close < ema21 ) and (close < ema21 ) and (close < ema21)
noCrossUp = not (ta.crossover(close , ema21 ) or ta.crossover(close , ema21 ) or ta.crossover(close, ema21))
sellSignal = threeBarsAfterUnder and hasGreenCandle and allBelowEMA and noCrossUp
// Plot Signals
plotshape(buySignal, title="Buy Signal", text="BUY", location=location.belowbar, color=color.green, size=size.small)
plotshape(sellSignal, title="Sell Signal", text="SELL", location=location.abovebar, color=color.red, size=size.small)
// Optional: Plot arrows on chart
plotarrow(buySignal ? 1 : na, title="Buy Arrow", colorup=color.green, maxheight=60)
plotarrow(sellSignal ? -1 : na, title="Sell Arrow", colordown=color.red, maxheight=60)
EMA72 com Difusor - Cor Dinâmica e Espessuras Ajustadas17 EMA
72 EMA (with diffuser included, green signals buy, red signals sell)
72 EMA on the weekly chart
𝙷✪𝚕𝚍𝚎𝚖 [Enhanced MULTI MA Dashboard v7.2]
𝙷✪𝚕𝚍𝚎𝚖 — Enhanced MULTI MA Dashboard v7.2
What it does
A complete moving-average control center that overlays up to seven MAs (5/8/13/20/50/100/200), draws dynamic MA clouds between consecutive pairs, tags crossover events (optional), and shows a compact on-chart dashboard with each MA’s current value and slope-based trend (Up/Down/Flat). It also detects Trendless and High-Volatility regimes to help you adapt your strategy.
Key Features
7 Configurable Moving Averages
Turn each MA on/off individually (5, 8, 13, 20, 50, 100, 200).
Choose type per MA: SMA, EMA, WMA, HMA, VWMA.
Set lengths freely and color each line.
Works on any symbol and timeframe; source selectable (close/open/high/low, etc.).
☁︎ MA Clouds (optional)
Shaded cloud between each consecutive pair (5–8, 8–13, 13–20, 20–50, 50–100, 100–200).
Cloud auto-colors toward the currently dominant MA (above/below) with adjustable transparency.
Quick visual read of short- vs long-side control and compression/expansion.
⚠️ Market Regime Detection
Trendless: measures how tightly short MAs (5, 8, 13) are clustered using std-dev % of their values; user-set threshold.
High Volatility: flags when ATR(Length) > ATR SMA × Multiplier.
Optional background tint and chart labels when regimes flip.
Dashboard cell shows Trending / Trendless / High Volatility with color coding.
➕ Crossover Signal Labels (fully granular)
Toggle labels for any pair you care about (e.g., 5/8, 8/20, 50/200, etc.).
Separate styles/colors for Cross Up and Cross Down; adjustable label size.
Great for momentum shifts, golden/death cross style monitoring, or timing add/reduce decisions.
(Note: these are visual labels; no alertconditions are defined.)
📊 On-Chart MA Dashboard
Compact, movable table (Top/Bottom/Middle, Left/Right/Center).
Columns: MA name, current value, trend direction (derived from MA slope).
Customizable text size, header text, colors, background, optional alternating row colors, and border styling.
Auto-adds a Market row when regime detection is enabled.
How to Use
1 Pick your data source (close by default) and switch on the MAs you care about.
2 Choose MA types and lengths to match your system (e.g., EMA for reactivity, SMA for smoothing).
3 Enable MA Clouds to see compression/expansion and dominance at a glance.
4 Set regime thresholds:
Lower Trendless Threshold → stricter definition of chop.
Raise ATR Multiplier → fewer, “truer” high-volatility flags.
5 Activate specific crossovers that fit your playbook (e.g., 5/20 for short-term momentum, 50/200 for cycle turns).
6 Position and style the dashboard so it stays readable on your layout.
Signal & Reading Guide
Trend column (Up/Down/Flat) reflects the slope of each MA (today vs previous bar).
Cloud flips (color dominance changes) often precede or confirm crossover labels.
Trendless suggests range conditions; consider mean-reversion tools or stand aside.
High Volatility calls for wider stops or volatility-aware sizing; breakouts can travel farther.
Disclaimer
This tool is for education and visualization. It does not constitute financial advice and is not a buy/sell system by itself. Always validate signals within your broader risk-managed plan.
EMA Triad Vanguard Pro [By TraderMan]📌 EMA Triad Vanguard Pro — Advanced Trend & Position Management System
📖 Introduction
EMA Triad Vanguard Pro is an advanced indicator that utilizes three different EMAs (Exponential Moving Averages) to analyze the direction, strength, and reliability of market trends.
It goes beyond a single timeframe, performing trend analysis across 8 different timeframes simultaneously and automatically tracking TP/SL management.
This makes it a powerful reference tool for both short-term traders and medium-to-long-term swing traders.
⚙ How It Works
EMAs:
EMA 21 → Responds quickly to short-term price changes.
EMA 50 → Shows medium-term price direction.
EMA 200 → Determines the long-term market trend.
Trend Direction Logic:
📈 Long Signal: EMA 21 crosses above EMA 200 and EMA 21 > EMA 50.
📉 Short Signal: EMA 21 crosses below EMA 200 and EMA 21 < EMA 50.
Trend Strength Calculation:
Calculates the percentage distance between EMAs.
Strength levels: Very Weak → Weak → Strong → Very Strong.
Multi-Timeframe Analysis:
Analyzes trend direction for: 5min, 15min, 30min, 1H, 4H, Daily, Weekly, and Monthly charts.
Generates an overall market bias from combined results.
Automatic Position Management:
When a position is opened, TP1, TP2, TP3, and SL levels are calculated automatically.
As price reaches these levels, chart labels appear (TP1★, TP2★, TP3★, SL!).
📊 How to Use
1️⃣ Long (Buy) Setup
EMA 21 must cross above EMA 200 ✅
EMA 21 must be above EMA 50 ✅
Overall market bias should be “Bullish” ✅
Entry Price: closing price of the signal candle.
TP levels: calculated based on upward % targets.
SL: a set % below the entry price.
2️⃣ Short (Sell) Setup
EMA 21 must cross below EMA 200 ✅
EMA 21 must be below EMA 50 ✅
Overall market bias should be “Bearish” ✅
Entry Price: closing price of the signal candle.
TP levels: calculated based on downward % targets.
SL: a set % above the entry price.
💡 Pro Tips
Multi-timeframe alignment significantly increases the signal reliability.
If trend strength is “Very Strong”, chances of hitting TP targets are higher.
Weak trends may cause false signals → confirm with extra indicators (RSI, MACD, Volume).
TP levels are ideal for partial take-profits → lock in gains and reduce risk.
📌 Advantages
✅ Displays both trend direction and trend strength at a glance.
✅ Multi-timeframe approach avoids tunnel vision from a single chart.
✅ Automatic TP/SL calculation eliminates manual measuring.
✅ Labeled signal alerts make tracking positions easy and visual.
⚠ Important Notes
No indicator is 100% accurate — sudden news events or manipulations may cause false signals.
Use it together with other technical and fundamental analysis methods.
Signal reliability may decrease in low liquidity markets.
🎯 In summary:
EMA Triad Vanguard Pro combines trend tracking, position management, and multi-timeframe analysis in a single package, helping professional traders reduce workload and make more strategic trades.
EMA Cross 5/21 with Accurate Break Triangles & Clean Prev OHLCEMA Cross 5/21 with Structure Break & OHLC Levels
Purpose
This strategy combines EMA crossovers with market structure breakouts for more reliable trade signals.
It enhances trade context by plotting Previous Day and Previous Week key levels (Open, High, Low, Close), which are widely used for intraday decision-making.
Core Components
1. EMA Trend Filter
Uses a fast EMA (5) and a slow EMA (21).
Bullish bias: EMA 5 crosses above EMA 21.
Bearish bias: EMA 5 crosses below EMA 21.
EMA cross serves as the initial momentum shift signal.
2. Market Structure Break Confirmation
After an EMA cross, the script looks for a structure break within 3 candles:
Bullish Break: Price closes above the most recent swing high.
Bearish Break: Price closes below the most recent swing low.
Swing points are determined using a 3-bar lookback on each side.
This confirmation filters out false EMA crosses that occur during consolidation.
3. Entry Signal Visualization
Green triangle below the bar = Bullish structure break within 3 bars after bullish EMA cross.
Red triangle above the bar = Bearish structure break within 3 bars after bearish EMA cross.
These markers appear only when both EMA direction and structure break agree.
4. Key Market Levels (Support/Resistance)
The script automatically draws straight horizontal reference lines for:
Previous Day OHLC:
PDO – Previous Day Open (Blue)
PDC – Previous Day Close (Yellow)
PDH – Previous Day High (Red)
PDL – Previous Day Low (Green)
Previous Week OHLC (lighter shades):
PWO – Previous Week Open (Light Blue)
PWC – Previous Week Close (Light Yellow)
PWH – Previous Week High (Light Red)
PWL – Previous Week Low (Light Green)
These levels help traders identify:
Potential support/resistance zones.
High-probability breakout or reversal points.
Institutional liquidity levels.
Trading Logic
Wait for EMA cross to set bias (bullish or bearish).
Within 3 bars, check for a break of the last swing high/low in the direction of bias.
Plot signal (green triangle up for bullish, red triangle down for bearish).
Use PD/PW levels as confluence zones for entry, stop placement, or target setting.
Advantages
Filters out many false signals from simple EMA cross strategies.
Adds market structure awareness.
Automatically integrates important daily/weekly reference levels.
Signals are visually intuitive for faster decision-making.
Best Use Cases
Intraday trading: Using PD/PW levels for scalping or day trades.
Swing trading: Waiting for higher timeframe EMA cross + structure break confirmation.
Breakout trading: Combining PDH/PDL or PWH/PWL breaks with EMA confirmation.
Trend Filter (Higher Timeframe EMA)English (EN)
This indicator overlays the higher timeframe (default: 1H) EMA trend onto your current chart to serve as a directional filter for trading decisions.
- Fetches and plots EMA20 / EMA50 / EMA200 from a higher timeframe (user-configurable)
- Identifies LONG trend when EMA20 > EMA50 > EMA200, SHORT trend when EMA20 < EMA50 < EMA200
- Changes background color based on trend direction (Green = Long, Red = Short)
- Can trigger alerts when a new trend direction is detected
1. Apply this script to lower timeframes such as 5m or 15m charts to see the higher timeframe trend.
2. When the background is green, consider long setups; when red, consider short setups.
3. Use this as a filter in conjunction with your main entry signals, not as a standalone strategy.
- Default higher timeframe is 1 hour, but you can change it in the settings.
- This script does not provide financial advice. Use at your own risk.
日本語(JP)
このインジケーターは、現在のチャートに上位足(デフォルト:1時間足)のEMAトレンドを重ねて表示し、売買方向のフィルターとして利用できます。
【機能】
- 上位足(設定可能)のEMA20 / EMA50 / EMA200 を取得して表示
- EMA20 > EMA50 > EMA200 でロングトレンド、EMA20 < EMA50 < EMA200 でショートトレンド判定
- トレンド方向に応じて背景色を変化(緑=ロング、赤=ショート)
- トレンド発生時にアラートを送信可能
【使い方】
1. 5分足や15分足など短期足に適用し、背景色で上位足の流れを確認します。
2. 背景が緑の時は買い目線、赤の時は売り目線で短期エントリーを検討します。
3. 単独での売買判断ではなく、他のテクニカル指標と併用してご利用ください。
【注意】
- デフォルトは1時間足で計算していますが、設定から変更可能です。
- 本スクリプトは投資助言を行うものではありません。ご利用は自己責任でお願いします。
Reversal Strategy (RSI & Volume & Automantic support resistance)// This Pine Script® code is subject to the terms of the Mozilla Public License 2.0 at mozilla.org
// © RoseZero
//@version=6
indicator('Chien luoc dao chieu manh(RSI + Volume + Ho tro auto)', overlay = true)
//===Tham so nguoi dung===
rsiOversold = input.int(30, 'Nguong RSI qua ban')
rsiOverbought = input.int(70, 'Nguong RSI qua mua')
rsiLow = input.int(35, 'Nguong qua ban')
rsiHigh = input.int(55, 'Nguong qua mua')
volMultiplier = input.float(1.5, 'nguong khoi luong tang (so voi TB)')
mult = input.float(1.5, 'Nguong nhan do lon nen', step = 0.1)
supportLength = input.int(20, 'Do dai vung ho tro')
resistLength = input.int(20, 'Do dai vung khang cu')
length = input.int(20, 'So nen trung binh')
volume_threshold = input.float(1.2, title = 'Nguong volume dao chieu')
fastEMA = input.int(21, title = 'EMA nhanh')
slowEMA = input.int(55, title = 'EMA cham')
depth = input.int(3, title = 'Pivot Depth')
rsiLen = input.int(14, title = 'RSI Length')
//==============================================================================
// === Dấu hiệu Cạn Cung ===
lowVolMultiplier = input.float(0.5, title = 'Ngưỡng khối lượng thấp (Cạn cung)')
lowRangeMultiplier = input.float(0.7, title = 'Ngưỡng biên độ giá thấp (Cạn cung)')
avgVolCC = ta.sma(volume, 20)
avgRangeCC = ta.sma(high - low, 20)
isLowVolume = volume < avgVolCC * lowVolMultiplier
isNarrowRange = (high - low) < avgRangeCC * lowRangeMultiplier
isSideways = math.abs(close - close ) < avgRangeCC * 0.3
supplyDryUp = isLowVolume and isNarrowRange and isSideways
// === Dấu hiệu Cạn Cầu ===
lowVolMultiplier2 = input.float(0.5, title = 'Ngưỡng khối lượng thấp (Cạn cầu)')
lowRangeMultiplier2 = input.float(0.7, title = 'Ngưỡng biên độ giá thấp (Cạn cầu)')
avgVolCD = ta.sma(volume, 20)
avgRangeCD = ta.sma(high - low, 20)
isLowVolumeCD = volume < avgVolCD * lowVolMultiplier2
isNarrowRangeCD = (high - low) < avgRangeCD * lowRangeMultiplier2
isWeakDemand = close <= close or close - close < avgRangeCD * 0.2
demandDryUp = isLowVolumeCD and isNarrowRangeCD and isWeakDemand
//=====================================================================================
ema34 = ta.ema(close, 34)
ema89 = ta.ema(close, 89)
volAvg = ta.sma(volume, 20)
plot(ema34, color = color.green, title = 'EMA 34')
plot(ema89, color = color.orange, title = 'EMA 89')
emaUp = ta.crossover(ema34, ema89)
emaDow = ta.crossunder(ema34, ema89)
alertcondition(emaUp, title = 'EMA34 cat len tren EMA89', message = 'EMA34 cat len tren EMA89 xu huong gia di len')
alertcondition(emaDow, title = 'EMA34 cat xuong duoi EMA89', message = 'EMA34 cat xuong duoi EMA*9 xu huong gia di xuong')
// dieu kien pha len ema va nguoc lai============================================================================================================
breakoutEma = close < ema34 and close < ema89 and close > ema34 and close > ema89
breakdownEma = close > ema34 and close > ema89 and close < ema34 and close < ema89
//dieu kien test lai EMA sau break
retestUpEma = breakoutEma and close < ema34 * 1.02 and close > ema89 * 0.98
retestDownEma = breakdownEma and close > ema34 * 0.98 and close < ema89 * 1.02
//canh bao gia test lai cum ema
alertcondition(retestUpEma, title = 'Canh bao test lai EMA gia tang', message = 'Gia dang test lai cum EMA khi gia tang')
alertcondition(retestDownEma, title = 'Canh bao test lai EMA gia giam', message = 'Gia dang test lai cum EMA khi gia giam')
//Tinh toan co bao Pivot
pivotHigh = ta.pivothigh(high, depth, depth)
pivotLow = ta.pivotlow(low, depth, depth)
ema = ta.ema(close, fastEMA)
ma = ta.sma(close, slowEMA)
rsii = ta.rsi(close, rsiLen)
//Volume Breakout check
volStrong = volume > ta.sma(volume, 20) * volume_threshold
//Mo hinh nen : Pinbar, Engulfing, Doji
isPinBar = math.abs(close - open) / math.abs(high - low) < 0.2
isBullEngulfing = close > open and open < close and close > open
isBearishEngulfing = close < open and open > close and close < open
isDoji = math.abs(close - open) / math.abs(high - low) < 0.1
//Dao chieu tang manh va giam manh
candlePattern = isPinBar or isBullEngulfing or isDoji
candlePattern2 = isPinBar or isBearishEngulfing or isDoji
priceCondition = close > ema and close > ma and rsii < 30 and volStrong
priceCondition2 = close < ema and close < ma and rsii > 70 and volStrong
bullishSignal = not na(pivotLow) and candlePattern and priceCondition and volStrong
if bullishSignal
alert('Dao chieu tang manh: Xuat hien nen dao chieu Tang(PInBar, BullishEngulf, Doji)', alert.freq_once_per_bar_close)
bearishSignal = not na(pivotHigh) and candlePattern2 and priceCondition2 and volStrong
if bearishSignal
alert('Dao chieu giam manh: Xuat hien nen dao chieu Giam(PinBar, BearishEngul, Doji)', alert.freq_once_per_bar_close)
//EMA & Trend
emaFast = ta.ema(close, fastEMA)
emaSlow = ta.ema(close, slowEMA)
plot(emaFast, title = 'EMA nhanh', color = color.blue)
plot(emaSlow, 'EMA cham', color = color.purple)
//===Ho tro tu dong===
supportZone = ta.lowest(low, supportLength)
resistZone = ta.highest(high, resistLength)
nearSupport = math.abs(low - supportZone) < syminfo.mintick * 100
nearResistance = math.abs(high - resistZone) < syminfo.mintick * 100
plot(supportZone, 'Ho tro', color = color.gray)
plot(resistZone, 'Khang cu', color = color.orange)
//===Mo hinh nen dao chieu tang & giam===
//Bullish: Hammer, Engulfing, piercing
body = math.abs(close - open)
avgbody = ta.sma(body, length)
upperWick = high - math.max(open, close)
lowerWick = math.min(open, close) - low
isHammerUp = lowerWick > 2 * body and upperWick < body and close > open
//engulfingUp = close < open and close > open and close > open and open < close
piercingUp = close > open and open < close and close > (open + close ) / 2
bullishCandle = isHammerUp or isBullEngulfing or piercingUp
//Bearish: Inverted Hammer, Bearish Engulfing, Dark cloud Cover
isHammerDow = upperWick > 2 * body and lowerWick < body and close < open
//engulfingDow = close > open and close < open and close < open and open > close
darkCloud = close < open and open > close and close < (open + close ) / 2
bearishCandle = isHammerDow or isBearishEngulfing or darkCloud
//========================================================================
//===Chi bao RSI & Volume===
rsi = ta.rsi(close, 14)
oversold = rsi < rsiOversold
overbought = rsi > rsiOverbought
avgVol = ta.sma(volume, 20)
volumeSpike = volume > avgVol * volMultiplier
rsiLL = rsi < rsiLow
rsiHH = rsi > rsiHigh
// nen rut chan 50%
fibo50=high/2+low/2
Pinbarbullish=close>fibo50 and open>fibo50 and volumeSpike and rsiLL // and close ta.ema(close,89)
plotshape(Pinbarbullish, style = shape.labelup, location = location.belowbar, color = color.green, text = 'L', textcolor = color.white, size = size.tiny)
plotshape(Pinbarbearish, style = shape.labeldown, location = location.abovebar, color = color.red, text = 'S', textcolor = color.white, size = size.tiny)
if Pinbarbullish
alert('Pin Bar dao chieu tang', alert.freq_once_per_bar_close)
if Pinbarbearish
alert('Pin Bar dao chieu giam', alert.freq_once_per_bar_close)
//===dieu kien tin hieu===
buySignal = bullishCandle and oversold and volumeSpike and nearSupport
sellSignal = bearishCandle and overbought and volumeSpike and nearResistance
//Canh bao nag cao
if buySignal
alert('Tin hieu MUA manh:Nen dao chieu tai vung ho tro kem RSI thap & Volume lon(LONG)', alert.freq_once_per_bar_close)
if sellSignal
alert('Tin hieu BAN manh:Nen dao chieu tai vung khang cu kem RSI cao & Volume lon(SHORT)', alert.freq_once_per_bar_close)
//===Hien canh bao===
alertcondition(buySignal, title = 'Tin hieu MUA', message = 'Nen dao chieu TANG tai vung ho tro(RSI thap + Volume lon)')
alertcondition(sellSignal, title = 'Tin hieu BAN', message = 'Nen dao chieu GIAM tai vung ho(RSI cao + Volume lon)')
plotshape(buySignal, style = shape.triangleup, location = location.belowbar, color = color.green, text = 'Long', textcolor = color.white)
plotshape(sellSignal, style = shape.triangledown, location = location.abovebar, color = color.red, text = 'Short', textcolor = color.white)
//Pin Bar ket hop volume lon & RSI qua mua / qua ban
isStrongBullPin = close > open and high - close > 2 * (close - open) and volume > volAvg * volMultiplier and rsi < rsiOversold
isStrongBearPin = open > close and close - low > 2 * (open - close) and volume > volAvg * volMultiplier and rsi > rsiOverbought
plotshape(isStrongBullPin, title = 'Canh bao Pinbar MUA manh', location = location.belowbar, color = color.green, style = shape.labelup, text = "Pb Mua", textcolor = color.white)
plotshape(isStrongBearPin, title = 'Canh bao Pinbar BAN manh', location = location.abovebar, color = color.red, style = shape.labeldown, text = 'Pb Ban', textcolor = color.white)
alertcondition(isStrongBullPin, title = 'Canh bao PinBar MUA manh', message = 'Phat hien PinBar MUA manh(vol cao + RSI qua ban)')
alertcondition(isStrongBearPin, title = 'Canh bao PInBar BAN manh', message = 'Phat hien PinBar BAN manh(vol cao+ RSI qua mua)')
if isStrongBullPin
alert('Pin Bar tin hieu mua:Phat hien PinBar MUA manh(vol cao + RSI qua ban)', alert.freq_once_per_bar_close)
if isStrongBearPin
alert('Pin Bar tin hieu ban:Phat hien PinBar BAN manh(vol cao+ RSI qua mua)', alert.freq_once_per_bar_close)
//================================================================
bool pv2_sv = input.bool (true, title='Plot 2nd order pivots')
bool msb_sv = input.bool (true, title='Plot MSB lines')
bool box_sv = input.bool (true, title='Plot Orderblocks')
bool m_sv = input.bool (true, title='Plot Breakerblocks')
bool range_sv = input.bool (true, title='Plot Range')
bool range_eq_sv = input.bool (true, title='Plot Range 0.5 Line')
bool range_q_sv = input.bool (true, title='Plot Range 0.25 and 0.75 Lines')
bool log_sv = input.bool (true, title='Use Log Scale')
bool msb_a_sv = input.bool (true, title='Alert MSB')
bool ob_a_sv = input.bool (true, title='Alert Orderblock test')
bool bb_a_sv = input.bool (true, title='Alert Breakerblock test')
bool r_a_sv = input.bool (true, title='Alert New Range')
bool rt_a_sv = input.bool (true, title='Alert Range test')
color u_s = input.color (color.new(color.red,90), title='Untested Supply Color')
color t_s = input.color (color.new(color.red,70), title='Tested Supply Color')
color u_d = input.color (color.new(color.green,90), title='Untested Demand Color')
color t_d = input.color (color.new(color.green,70), title='Tested Demand Color')
color u_b = input.color ( color.new(color.blue,90), title='Untested Breaker Color')
color t_b = input.color (color.new(color.blue, 70), title='Tested Breaker Color')
var float pvh1_price = array.new_float (30, na) // high
var int pvh1_time = array.new_int (30, na)
var float pvl1_price = array.new_float (30, na) // low
var int pvl1_time = array.new_int (30, na)
var float pvh2_price = array.new_float (10, na) // higher high
var int pvh2_time = array.new_int (10, na)
var float pvl2_price = array.new_float (10, na) // lower low
var int pvl2_time = array.new_int (10, na)
var float htcmrll_price = na // high that created most recent ll
var int htcmrll_time = na
var float ltcmrhh_price = na // low that created most recent hh
var int ltcmrhh_time = na
var box long_boxes = array.new_box() // orderblocks
var box short_boxes = array.new_box()
var box m_long_boxes = array.new_box() // breakerblocks
var box m_short_boxes = array.new_box()
var line bull_bos_lines = array.new_line() // MSB lines
var line bear_bos_lines = array.new_line()
var line range_h_lines = array.new_line() // Range lines
var line range_25_lines = array.new_line()
var line range_m_lines = array.new_line()
var line range_75_lines = array.new_line()
var line range_l_lines = array.new_line()
var label la_ph2 = array.new_label() // 2nd order pivots
var label la_pl2 = array.new_label()
var float temp_pv_0 = na
var float temp_pv_1 = na
var float temp_pv_2 = na
var int temp_time = na
var float last_range_h = na
var float last_range_l = na
var line range_m = na
var line range_25 = na
var line range_75 = na
var float box_top = na
var float box_bottom = na
var int h_a_time = 0
var int l_a_time = 0
var int mh_a_time = 0
var int ml_a_time = 0
var int rh_a_time = 0
var int rl_a_time = 0
bool pvh = high < high and high > high
bool pvl = low > low and low < low
int pv1_time = bar_index
float pv1_high = high
float pv1_low = low
bool new_ph_2nd = false
bool new_pl_2nd = false
string alert = na
if barstate.isconfirmed
if pvh
array.pop(pvh1_price)
array.pop(pvh1_time)
array.unshift(pvh1_price, pv1_high)
array.unshift(pvh1_time, pv1_time)
if array.size(pvh1_price) > 2
temp_pv_0 := array.get(pvh1_price, 0)
temp_pv_1 := array.get(pvh1_price, 1)
temp_pv_2 := array.get(pvh1_price, 2)
if temp_pv_0 < temp_pv_1 and temp_pv_1 > temp_pv_2
array.pop(pvh2_price)
array.pop(pvh2_time)
array.unshift(pvh2_price, temp_pv_1)
array.unshift(pvh2_time, array.get(pvh1_time, 1))
new_ph_2nd := true
if temp_pv_1 > array.get(pvh2_price, 1)
for i = 0 to array.size(pvl2_time) - 1 by 1
temp_ltcmrhh_time = array.get(pvl2_time, i)
if temp_ltcmrhh_time < array.get(pvh2_time, 0)
ltcmrhh_price := array.get(pvl2_price, i)
ltcmrhh_time := temp_ltcmrhh_time
break
if temp_pv_0 < ltcmrhh_price
if msb_sv
array.push(bear_bos_lines, line.new(x1=ltcmrhh_time, y1=ltcmrhh_price, x2=bar_index, y2=ltcmrhh_price, color=color.rgb(11, 238, 18), width=3))
box_top := array.get(pvh2_price, 0)
box_bottom := math.max(low , low )
array.push(short_boxes, box.new(left=array.get(pvh2_time, 0), top=box_top, right=bar_index, bottom=box_bottom, bgcolor= box_sv ? u_s : na ,border_color=na, extend=extend.right))
if msb_a_sv
alert := alert + 'Bearish MSB @ ' + str.tostring(ltcmrhh_price) + ' ' + 'New Supply Zone : '+ str.tostring(box_top) + ' - ' + str.tostring(box_bottom) + ' '
ltcmrhh_price := na
if pvl
array.pop(pvl1_price)
array.pop(pvl1_time)
array.unshift(pvl1_price, pv1_low)
array.unshift(pvl1_time, pv1_time)
if array.size(pvl1_price) > 2
temp_pv_0 := array.get(pvl1_price, 0)
temp_pv_1 := array.get(pvl1_price, 1)
temp_pv_2 := array.get(pvl1_price, 2)
if temp_pv_0 > temp_pv_1 and temp_pv_1 < temp_pv_2
array.pop(pvl2_price)
array.pop(pvl2_time)
array.unshift(pvl2_price, temp_pv_1)
array.unshift(pvl2_time, array.get(pvl1_time, 1))
new_pl_2nd := true
if temp_pv_1 < array.get(pvl2_price, 1)
for i = 0 to array.size(pvh2_time) - 1 by 1
temp_htcmrll_time = array.get(pvh2_time, i)
if temp_htcmrll_time < array.get(pvl2_time, 0)
htcmrll_price := array.get(pvh2_price, i)
htcmrll_time := temp_htcmrll_time
break
if temp_pv_0 > htcmrll_price
if msb_sv
array.push(bull_bos_lines, line.new(x1=htcmrll_time, y1=htcmrll_price, x2=bar_index, y2=htcmrll_price, color=color.rgb(236, 5, 5), width=3))
box_top := math.min(high , high )
box_bottom := array.get(pvl2_price, 0)
array.push(long_boxes, box.new(left=array.get(pvl2_time, 0), top=box_top, right=bar_index, bottom=box_bottom, bgcolor= box_sv ? u_d : na, border_color=na, extend=extend.right))
if msb_a_sv
alert := alert + 'Bullish MSB @ ' + str.tostring(htcmrll_price) + ' ' + 'New Demand Zone : '+ str.tostring(box_bottom) + ' - ' + str.tostring(box_top) + ' '
htcmrll_price := na
if array.size(short_boxes) > 0
for i = array.size(short_boxes) - 1 to 0 by 1
tbox = array.get(short_boxes, i)
top = box.get_top(tbox)
bottom = box.get_bottom(tbox)
ago = box.get_left(tbox)
if array.get(pvh1_price, 0) > bottom
if box_sv
box.set_bgcolor(tbox, t_s)
if ob_a_sv and close < bottom
if array.get(pvh1_time, 0) != h_a_time
h_a_time := array.get(pvh1_time, 0)
alert := alert + 'Supply Zone Test @ ' + str.tostring(array.get(pvh1_price, 0)) + ' (age = ' + str.tostring(bar_index-ago) + ' bars) '
if array.get(pvl1_price, 0) > top
if m_sv
box.set_bgcolor(tbox, u_b)
array.push(m_long_boxes, tbox)
else
box.delete(tbox)
array.remove(short_boxes, i)
if msb_sv
line.delete(array.get(bear_bos_lines, i))
array.remove(bear_bos_lines, i)
if array.size(long_boxes) > 0
for i = array.size(long_boxes) - 1 to 0 by 1
lbox = array.get(long_boxes, i)
top = box.get_top(lbox)
bottom = box.get_bottom(lbox)
ago = box.get_left(lbox)
if array.get(pvl1_price, 0) < top
if box_sv
box.set_bgcolor(lbox, t_d)
if ob_a_sv and close > top
if array.get(pvl1_time, 0) != l_a_time
l_a_time := array.get(pvl1_time, 0)
alert := alert + 'Demand Zone Test @ ' + str.tostring(array.get(pvl1_price, 0)) + ' (age = ' + str.tostring(bar_index-ago) + ' bars) '
if array.get(pvh1_price, 0) < bottom
if m_sv
box.set_bgcolor(lbox, u_b)
array.push(m_short_boxes, lbox)
else
box.delete(lbox)
array.remove(long_boxes, i)
if msb_sv
line.delete(array.get(bull_bos_lines, i))
array.remove(bull_bos_lines, i)
if array.size(m_short_boxes) > 0
for i = array.size(m_short_boxes) - 1 to 0 by 1
tbox = array.get(m_short_boxes, i)
top = box.get_top(tbox)
bottom = box.get_bottom(tbox)
ago = box.get_left(tbox)
if array.get(pvh1_price, 0) > bottom
box.set_bgcolor(tbox, t_b)
if bb_a_sv and close < bottom
if array.get(pvh1_time, 0) != mh_a_time
mh_a_time := array.get(pvh1_time, 0)
alert := alert + 'Breakerblock Test Up @ ' + str.tostring(array.get(pvh1_price, 0)) + ' (age = ' + str.tostring(bar_index-ago) + ' bars) '
if array.get(pvl1_price, 0) > top
box.delete(tbox)
array.remove(m_short_boxes, i)
if array.size(m_long_boxes) > 0
for i = array.size(m_long_boxes) - 1 to 0 by 1
lbox = array.get(m_long_boxes, i)
top = box.get_top(lbox)
bottom = box.get_bottom(lbox)
ago = box.get_left(lbox)
if array.get(pvl1_price, 0) < top
box.set_bgcolor(lbox, t_b)
if bb_a_sv and close > top
if array.get(pvl1_time, 0) != ml_a_time
ml_a_time := array.get(pvl1_time, 0)
alert := alert + 'Breakerblock Test Down @ ' + str.tostring(array.get(pvl1_price, 0)) + ' (age = ' + str.tostring(bar_index-ago) + ' bars) '
if array.get(pvh1_price, 0) < bottom
box.delete(lbox)
array.remove(m_long_boxes, i)
if range_sv and (new_ph_2nd or new_pl_2nd) and (array.get(pvh2_price, 0) < array.get(pvh2_price, 1) and array.get(pvl2_price, 0) > array.get(pvl2_price, 1) and array.get(pvh2_price, 0) > array.get(pvl2_price, 1) and array.get(pvl2_price, 0) < array.get(pvh2_price, 1)) and (array.get(pvl2_price, 1) > nz(last_range_h) or na(last_range_l)? true : (array.get(pvh2_price, 1) < last_range_l))
temp_time := math.min(array.get(pvh2_time, 1), array.get(pvl2_time, 1))
last_range_h := array.get(pvh2_price, 1)
last_range_l := array.get(pvl2_price, 1)
temp_pv_0 := log_sv ? math.exp((math.log(last_range_h) + math.log(last_range_l))/2) : (last_range_h + last_range_l)/2
temp_pv_1 := log_sv ? math.exp((math.log(last_range_h) + math.log(temp_pv_0))/2) : (last_range_h + temp_pv_0)/2
temp_pv_2 := log_sv ? math.exp((math.log(last_range_l) + math.log(temp_pv_0))/2) : (last_range_l + temp_pv_0)/2
array.push(range_h_lines, line.new(x1=temp_time, y1=last_range_h, x2=bar_index, y2=last_range_h, color= color.white, width=2, extend=extend.right))
array.push(range_l_lines, line.new(x1=temp_time, y1=last_range_l, x2=bar_index, y2=last_range_l, color= color.white, width=2, extend=extend.right))
if range_eq_sv
array.push(range_m_lines, line.new(x1=temp_time, y1=temp_pv_0, x2=bar_index, y2=temp_pv_0, color= color.rgb(246, 6, 6), width=2, extend=extend.right))
if range_q_sv
array.push(range_25_lines, line.new(x1=temp_time, y1=temp_pv_1, x2=bar_index, y2=temp_pv_1, style=line.style_dashed, color=color.rgb(1, 54, 249), width=2, extend=extend.right))
array.push(range_75_lines, line.new(x1=temp_time, y1=temp_pv_2, x2=bar_index, y2=temp_pv_2, style=line.style_dashed, color=color.rgb(1, 54, 249), width=2, extend=extend.right))
if r_a_sv
alert := alert + 'New Range : ' + str.tostring(last_range_h) + ' - ' + str.tostring(last_range_l) + '. Mean = ' + str.tostring(temp_pv_0) + ' '
if array.size(range_h_lines) > 0
for i = array.size(range_h_lines) - 1 to 0 by 1
range_h = array.get(range_h_lines, i)
top = line.get_y1(range_h)
range_l = array.get(range_l_lines, i)
bottom = line.get_y1(range_l)
temp_time := line.get_x1(range_h)
if array.get(pvh1_price, 0) > top
if rt_a_sv and close < top
if array.get(pvh1_time, 0) != rh_a_time
rh_a_time := array.get(pvh1_time, 0)
alert := alert + 'Range High Test @ ' + str.tostring(array.get(pvh1_price, 0)) + ' '
if array.get(pvl1_price, 0) < bottom
if rt_a_sv and close > bottom
if array.get(pvl1_time, 0) != rl_a_time
rl_a_time := array.get(pvl1_time, 0)
alert := alert + 'Range Low Test @ ' + str.tostring(array.get(pvl1_price, 0)) + ' '
if range_eq_sv
range_m := array.get(range_m_lines, i)
if range_q_sv
range_25 := array.get(range_25_lines, i)
range_75 := array.get(range_75_lines, i)
if array.get(pvh1_price, 0) < bottom or array.get(pvl1_price, 0) > top
line.delete(range_h)
array.remove(range_h_lines, i)
line.delete(range_l)
array.remove(range_l_lines, i)
if range_eq_sv
line.delete(range_m)
array.remove(range_m_lines, i)
if range_q_sv
line.delete(range_25)
array.remove(range_25_lines, i)
line.delete(range_75)
array.remove(range_75_lines, i)
last_range_h := na
last_range_l := na
if pv2_sv
if new_ph_2nd
array.push(la_ph2, label.new(x = array.get(pvh2_time, 0), y = array.get(pvh2_price, 0), xloc = xloc.bar_index, style = label.style_label_down, color = #770000FF, size = size.tiny))
if new_pl_2nd
array.push(la_pl2, label.new(x = array.get(pvl2_time, 0), y = array.get(pvl2_price, 0), xloc = xloc.bar_index, style = label.style_label_up, color = #007700FF, size = size.tiny))
alert := not na(alert) ? (alert + 'Current price = ' + str.tostring(close) + ' ') : na
exec = not na(alert) ? true : false
//if exec==true
//alert(alert, alert.freq_once_per_bar_close)
//xac dinh dieu kien khoi luong lon
// mau cay nen mua
buyCandle = close > open and volumeSpike ? color.rgb(4, 128, 8) : na
// mau cay nen ban
sellCandle = close < open and volumeSpike ? color.rgb(147, 23, 230) : na
// ve nen tuy chinh
plotcandle(open, high, low, close, color = buyCandle, title = "Buy Candle")
plotcandle(open, high, low, close, color = sellCandle, title = "Sell Candle")
//plot(close)
//=== Lọc pin bar intraday ===
isIntraday = timeframe.multiplier >= 15 and timeframe.multiplier <= 60 // M15 đến H1
//isPinBar = math.abs(close - open) / math.abs(high - low) < 0.2
volSpike = volume > ta.sma(volume, 20) * 1.5
//rsi = ta.rsi(close, 14)
rsiExtreme = rsi < 30 or rsi > 70
//nearSupport = math.abs(low - ta.lowest(low, 20)) < syminfo.mintick * 100
//nearResistance = math.abs(high - ta.highest(high, 20)) < syminfo.mintick * 100
validBullPin = isPinBar and close > open and high - close > 2 * (close - open) and volSpike and rsi < 30 and nearSupport and isIntraday
validBearPin = isPinBar and open > close and close - low > 2 * (open - close) and volSpike and rsi > 70 and nearResistance and isIntraday
plotshape(validBullPin, location = location.belowbar, style = shape.labelup, color = color.green, text = "PB M15-H1")
plotshape(validBearPin, location = location.abovebar, style = shape.labeldown, color = color.red, text = "PB M15-H1")
alertcondition(validBullPin, title = "Pin Bar MUA intraday", message = "Phát hiện Pin Bar MUA mạnh (M15-H1)")
if validBullPin
alert("Pin bar MUA intraday : Phát hiện Pin Bar MUA mạnh (M15-H1)", alert.freq_once_per_bar_close)
alertcondition(validBearPin, title = "Pin Bar BÁN intraday", message = "Phát hiện Pin Bar BÁN mạnh (M15-H1)")
if validBearPin
alert("Pin bar BAN Intrday : Phát hiện Pin Bar BÁN mạnh (M15-H1)", alert.freq_once_per_bar_close)
//=======- Dùng H1 để xác định xu hướng, M15 để vào lệnh.
//Nếu pin bar xuất hiện ở H1, bạn có thể chờ xác nhận phá đỉnh/đáy ở M15 để vào lệnh.
//Kết hợp thêm EMA hoặc vùng cung cầu để tăng độ tin cậy
//====================================
trendUp = ema34 > ema89
trendDow = ema34 < ema89
//tin hieu vao lenh
enterLong = validBullPin and close > high and trendUp
enterShort = validBearPin and close < low and trendDow
plotshape(enterLong, location = location.belowbar, style = shape.triangleup, color = color.lime, text = "Long", textcolor = color.white)
plotshape(enterShort, location = location.abovebar, style = shape.triangledown, color = color.fuchsia, text = "Short", textcolor = color.white)
if enterLong
alert("Vao lenh Long: Pin Bar + Pha dinh + EMA xac nhan", alert.freq_once_per_bar_close)
if enterShort
alert("Vao lenh Short: Pin Bar + Pha day + EMA xac nhan", alert.freq_once_per_bar_close)
//==================================================================================
// === Hiển thị tín hiệu Cạn cung ===
//plotshape(supplyDryUp, title = 'Cạn cung', location = location.belowbar, color = color.yellow, style = shape.circle, size = size.small)
alertcondition(supplyDryUp, title = 'Cảnh báo cạn cung', message = 'Phát hiện dấu hiệu cạn cung: khối lượng thấp + giá đi ngang + biên độ hẹp')
// === Kết hợp với tín hiệu mua/bán để tăng độ tin cậy ===
buySignalCC = buySignal and supplyDryUp
sellSignalCC = sellSignal and supplyDryUp
plotshape(buySignalCC, title = 'Mua + Cạn cung', location = location.belowbar, color = color.lime, style = shape.triangleup, text = 'Long CC', textcolor = color.white)
plotshape(sellSignalCC, title = 'Bán + Cạn cung', location = location.abovebar, color = color.fuchsia, style = shape.triangledown, text = 'Short CC', textcolor = color.white)
alertcondition(buySignalCC, title = 'Mua mạnh + Cạn cung', message = 'Tín hiệu MUA mạnh kết hợp dấu hiệu cạn cung')
alertcondition(sellSignalCC, title = 'Bán mạnh + Cạn cung', message = 'Tín hiệu BÁN mạnh kết hợp dấu hiệu cạn cung')
if buySignalCC
alert('Mua mạnh + Cạn cung : Tín hiệu MUA mạnh kết hợp dấu hiệu cạn cung', alert.freq_once_per_bar_close)
if sellSignalCC
alert('Bán mạnh + Cạn cung : Tín hiệu BÁN mạnh kết hợp dấu hiệu cạn cung', alert.freq_once_per_bar_close)
// === Hiển thị tín hiệu Cạn cầu ===
//plotshape(demandDryUp, title = 'Cạn cầu', location = location.abovebar, color = color.orange, style = shape.circle, size = size.small)
alertcondition(demandDryUp, title = 'Cảnh báo cạn cầu', message = 'Phát hiện dấu hiệu cạn cầu: khối lượng thấp + giá không tăng + biên độ hẹp')
// === Kết hợp với tín hiệu bán để tăng độ tin cậy ===
sellSignalCD = sellSignal and demandDryUp
plotshape(sellSignalCD, title = 'Bán + Cạn cầu', location = location.abovebar, color = color.red, style = shape.triangledown, text = 'Short CCầu', textcolor = color.white)
alertcondition(sellSignalCD, title = 'Bán mạnh + Cạn cầu', message = 'Tín hiệu BÁN mạnh kết hợp dấu hiệu cạn cầu')
if sellSignalCD
alert('Bán mạnh + Cạn cầu : Tín hiệu BÁN mạnh kết hợp dấu hiệu cạn cầu', alert.freq_once_per_bar_close)
//====================================================
VHX EMA 135/315📈 EMA 135/315 Cross Strategy – Your Trend Compass with Smart Confirmations
🔍 Core Idea
The EMA 135/315 Cross strategy is a trend-following system.
It tracks two moving averages:
EMA 135 → the “fast” line that reacts to short-term price moves
EMA 315 → the “slow” line that reacts to the bigger trend
When the fast EMA crosses above the slow EMA → market momentum is turning up → BUY signal 🟢
When the fast EMA crosses below the slow EMA → momentum is turning down → SELL signal 🔴
This gives you a clear entry trigger — no guessing, no overcomplication.
✨ On Your Chart
BUY/SELL Arrows
🟢 Green arrow = bullish cross → trend turning up
🔴 Red arrow = bearish cross → trend turning down
Trend Info Panel (Top Left)
Current Trend: BUY / SELL / Neutral
Last Cross: how many bars ago it happened
EMA Gap in %: measures the strength of the trend
Status: “Approaching” if EMAs are getting close → possible cross soon
Automatic TP/SL Levels
📈 TP line (+2% from entry)
📉 SL line (–0.5% from entry)
Saves time — you instantly see your target and protection
EMA Distance Meter
Big % gap = strong trend momentum 🚀
Small % gap = weak or sideways market ⚠️
Real-Time Alerts
You get notified when a cross happens, even if you’re away from the screen
🧠 The Logic Behind It
The EMA 135 reacts faster → it reflects short-term momentum
The EMA 315 moves slower → it reflects the main trend
When the fast EMA overtakes the slow EMA: short-term strength now aligns with the long-term trend → higher probability of a sustained move
The gap % tells you how strong the alignment is — large gap = cleaner moves, small gap = market in transition
“Approaching” status warns that the EMAs are converging, which often happens before a reversal
📊 Boosting the Strategy with Volume Analysis
The EMA cross is a strong trigger, but volume confirms the quality of the move:
High Volume + Cross → more reliable signal, as strong market participation is pushing the trend
Low Volume + Cross → caution, the move might be weak or a false breakout
💡 Tip:
Check the volume histogram or a volume-based indicator (e.g., Volume Profile, OBV).
On a BUY signal: volume should spike above the recent average.
On a SELL signal: watch for strong selling volume bars.
📍 Adding Support & Resistance for Precision
Support and resistance levels help filter out bad trades and optimize entries:
Best BUY setups:
EMA 135 crosses above EMA 315 near a known support zone
Bonus if volume confirms the move
Avoid buying directly into a strong resistance
Best SELL setups:
EMA 135 crosses below EMA 315 near a known resistance zone
Bonus if selling volume is strong
Avoid selling directly into a major support
💡 Use tools like horizontal lines, previous highs/lows, and Volume Profile nodes to spot these zones.
📈 Best Usage Practices
Timeframes
Lower timeframes (1m–5m) → more signals, but more noise → best for scalping with extra filters
Always Combine With Confirmation
EMA Cross = Trigger
Volume spike = Confirmation
S/R zone in your favor = High-probability setup
Manage Risk
Start with the built-in TP/SL
Adjust SL if volatility is higher than usual
Consider trailing stop once price moves in your favor
Avoid Sideways Markets
If EMA gap % is very small and crosses happen often → stand aside until a clear direction forms
Use Alerts
Set alerts for BUY & SELL crosses so you never miss a setup
In short:
This isn’t just an EMA cross indicator — it’s a trend system with built-in risk management, strength measurement, and pre-trade preparation. Combine it with volume confirmation and smart use of support/resistance, and you turn a simple signal into a high-probability trading edge.
EMA 9, 20, 50Exponential Moving Averages of 9, 20, and 50. Used to gauge buy and sell opportunities in trending markets.
EMA Pullback Entry SignalsEMA Pullback Entry Signals is a tool designed to help traders identify trend continuation opportunities by detecting price pullbacks toward a slow EMA (Exponential Moving Average) during trending conditions.
This indicator combines moving average crossovers, price interaction with EMAs, and optional filtering to improve the timing and quality of trend entries.
Core Features:
Golden Cross / Death Cross Detection
Golden Cross: Fast EMA crossing above Slow EMA
Death Cross: Fast EMA crossing below Slow EMA
Optional X-shaped markers for crossover visualization
Pullback Signal on Slow EMA
Green triangle: Price crosses up through the slow EMA during a bullish trend
Red triangle: Price crosses down through the slow EMA during a bearish trend
Designed to capture continuation entries after a trend pullback
Optional Fast EMA Signals
Green arrow: Price crosses above fast EMA in a bull trend
Red arrow: Price crosses below fast EMA in a bear trend
Helps confirm minor retracements or short-term momentum shifts
Sideways Market Filter
Suppresses signals when the fast and slow EMAs are too close
Prevents entries during low-trend or choppy price action
Cooldown Timer
Enforces a minimum bar interval between signals to reduce overtrading
Helps avoid multiple entries from clustered signals
Custom Alerts
Alerts available for all signal types
Include ticker and timeframe in each alert message
Configurable Settings:
Fast and slow EMA lengths1
Toggle individual signal types (pullbacks, fast EMA crosses, crossovers)
Enable/disable cooldown logic and set bar duration
Sideways market detection sensitivity (EMA proximity threshold)
Primary Use Case
This script is most useful for trend-following traders seeking to enter pullbacks after a trend is established. When the price retraces to the slow EMA and then resumes in the trend direction, it can offer high-quality continuation setups. Works well across timeframes and markets.
The Phantom Indicator for beginnersThe Phantom Indicator is an original software script written in Pine Script for use on the TradingView charting platform. It is designed as a real-time algorithmic trading and technical analysis toolkit that integrates multiple market signals into a unified framework. The work is a compilation of open-source trading concepts, modified and combined in a novel and proprietary manner, resulting in a unique educational tool.
Key features include:
Dynamic background shading based on price relation to the 200-period Exponential Moving Average (EMA)
Multi-timeframe Hull Moving Averages rendered as ribbons to show directional bias
A custom Fair Value Gap (FVG) detection algorithm
ATR-based trailing stop logic, inspired by UT Bot
Visual markers for candlestick rejection patterns, labeled “J. Wick” (bullish) and “Black Widow” (bearish)
Real-time structural pivot recognition, identifying Higher Highs, Lower Lows, and Break of Structure (BOS)
Interactive label alerts, trend-based visuals, and adaptive ribbon overlays
This indicator is intended to train beginner traders to:
Recognize candlestick reversal patterns
Understand trend creation and breakage
Learn to identify market direction using real-time, rule-based logic
Mutanabby_AI | Ultimate Algo | Remastered+Overview
The Mutanabby_AI Ultimate Algo Remastered+ represents a sophisticated trend-following system that combines Supertrend analysis with multiple moving average confirmations. This comprehensive indicator is designed specifically for identifying high-probability trend continuation and reversal opportunities across various market conditions.
Core Algorithm Components
**Supertrend Foundation**: The primary signal generation relies on a customizable Supertrend indicator with adjustable sensitivity (1-20 range). This adaptive trend-following tool uses Average True Range calculations to establish dynamic support and resistance levels that respond to market volatility.
**SMA Confirmation Matrix**: Multiple Simple Moving Averages (SMA 4, 5, 9, 13) provide layered confirmation for signal strength. The algorithm distinguishes between regular signals and "Strong" signals based on SMA 4 vs SMA 5 relationship, offering traders different conviction levels for position sizing.
**Trend Ribbon Visualization**: SMA 21 and SMA 34 create a visual trend ribbon that changes color based on their relationship. Green ribbon indicates bullish momentum while red signals bearish conditions, providing immediate visual trend context.
**RSI-Based Candle Coloring**: Advanced 61-tier RSI system colors candles with gradient precision from deep red (RSI ≤20) through purple transitions to bright green (RSI ≥79). This visual enhancement helps traders instantly assess momentum strength and overbought/oversold conditions.
Signal Generation Logic
**Buy Signal Criteria**:
- Price crosses above Supertrend line
- Close price must be above SMA 9 (trend confirmation)
- Signal strength determined by SMA 4 vs SMA 5 relationship
- "Strong Buy" when SMA 4 ≥ SMA 5
- Regular "Buy" when SMA 4 < SMA 5
**Sell Signal Criteria**:
- Price crosses below Supertrend line
- Close price must be below SMA 9 (trend confirmation)
- Signal strength based on SMA relationship
- "Strong Sell" when SMA 4 ≤ SMA 5
- Regular "Sell" when SMA 4 > SMA 5
Advanced Risk Management System
**Automated TP/SL Calculation**: The indicator automatically calculates stop loss and take profit levels using ATR-based measurements. Risk percentage and ATR length are fully customizable, allowing traders to adapt to different market conditions and personal risk tolerance.
**Multiple Take Profit Targets**:
- 1:1 Risk-Reward ratio for conservative profit taking
- 2:1 Risk-Reward for balanced trade management
- 3:1 Risk-Reward for maximum profit potential
**Visual Risk Display**: All risk management levels appear as both labels and optional trend lines on the chart. Customizable line styles (solid, dashed, dotted) and positioning ensure clear visualization without chart clutter.
**Dynamic Level Updates**: Risk levels automatically recalculate with each new signal, maintaining current market relevance throughout position lifecycles.
Visual Enhancement Features
**Customizable Display Options**: Toggle trend ribbon, TP/SL levels, and risk lines independently. Decimal precision adjustments (1-8 decimal places) accommodate different instrument price formats and personal preferences.
**Professional Label System**: Clean, informative labels show entry points, stop losses, and take profit targets with precise price levels. Labels automatically position themselves for optimal chart readability.
**Color-Coded Momentum**: The gradient RSI candle coloring system provides instant visual feedback on momentum strength, helping traders assess market energy and potential reversal zones.
Implementation Strategy
**Timeframe Optimization**: The algorithm performs effectively across multiple timeframes, with higher timeframes (4H, Daily) providing more reliable signals for swing trading. Lower timeframes work well for day trading with appropriate risk adjustments.
**Sensitivity Adjustment**: Lower sensitivity values (1-5) generate fewer but higher-quality signals, ideal for conservative approaches. Higher sensitivity (15-20) increases signal frequency for active trading styles.
**Risk Management Integration**: Use the automated risk calculations as baseline parameters, adjusting risk percentage based on account size and market conditions. The 1:1, 2:1, 3:1 targets enable systematic profit-taking strategies.
Market Application
**Trend Following Excellence**: Primary strength lies in capturing significant trend movements through the Supertrend foundation with SMA confirmation. The dual-layer approach reduces false signals common in single-indicator systems.
**Momentum Assessment**: RSI-based candle coloring provides immediate momentum context, helping traders assess signal strength and potential continuation probability.
**Range Detection**: The trend ribbon helps identify ranging conditions when SMA 21 and SMA 34 converge, alerting traders to potential breakout opportunities.
Performance Optimization
**Signal Quality**: The requirement for both Supertrend crossover AND SMA 9 confirmation significantly improves signal reliability compared to basic trend-following approaches.
**Visual Clarity**: The comprehensive visual system enables rapid market assessment without complex calculations, ideal for traders managing multiple instruments.
**Adaptability**: Extensive customization options allow fine-tuning for specific markets, trading styles, and risk preferences while maintaining the core algorithm integrity.
## Non-Repainting Design
**Educational Note**: This indicator uses standard TradingView functions (Supertrend, SMA, RSI) with normal behavior patterns. Real-time updates on current candles are expected and standard across all technical indicators. Historical signals on closed candles remain fixed and unchanged, ensuring reliable backtesting and analysis.
**Signal Confirmation**: Final signals are confirmed only when candles close, following standard technical analysis principles. The algorithm provides clear distinction between developing signals and confirmed entries.
Technical Specifications
**Supertrend Parameters**: Default sensitivity of 4 with ATR length of 11 provides balanced signal generation. Sensitivity range from 1-20 allows adaptation to different market volatilities and trading preferences.
**Moving Average Configuration**: SMA periods of 8, 9, and 13 create multi-layered trend confirmation, while SMA 21 and 34 form the visual trend ribbon for broader market context.
**Risk Management**: ATR-based calculations with customizable risk percentage ensure dynamic adaptation to market volatility while maintaining consistent risk exposure principles.
Recommended Settings
**Conservative Approach**: Sensitivity 4-5, RSI length 14, higher timeframes (4H, Daily) for swing trading with maximum signal reliability.
**Active Trading**: Sensitivity 6-8, RSI length 8-10, intermediate timeframes (1H) for balanced signal frequency and quality.
**Scalping Setup**: Sensitivity 10-15, RSI length 5-8, lower timeframes (15-30min) with enhanced risk management protocols.
## Conclusion
The Mutanabby_AI Ultimate Algo Remastered+ combines proven trend-following principles with modern visual enhancements and comprehensive risk management. The algorithm's strength lies in its multi-layered confirmation approach and automated risk calculations, providing both novice and experienced traders with clear signals and systematic trade management.
Success with this system requires understanding the relationship between signal strength indicators and adapting sensitivity settings to match current market conditions. The comprehensive visual feedback system enables rapid decision-making while the automated risk management ensures consistent trade parameters.
Practice with different sensitivity settings and timeframes to optimize performance for your specific trading style and risk tolerance. The algorithm's systematic approach provides an excellent framework for disciplined trend-following strategies across various market environments.
D1 Momentum Trigger (with filter D1 + Slope Filter)Multi‐timeframe indicator that identifies trend and entry points with daily confirmation and volatility filters:
Daily Trend Filter
Verifies that 4-, 6-, and 8-period momentum are all above (long) or below (short) their EMA(3) on the D1 chart, ensuring signals align with the higher-timeframe trend.
Entry Signals (Current Timeframe)
Momentum 4/6/8 > (or <) EMA(3) of the 8-period momentum
Price in the lower (long) or upper (short) 20% of the Bollinger Bands (20,2)
Positive (long) or negative (short) 50-EMA slope above a customizable threshold
Visual Overlays
Triangles for long/short entries
Dots to show active daily confirmation
Adjustable Settings
DifferenceThreshold: EMA50 slope sensitivity
BB% thresholds to define acceptable volatility
Ideal for traders seeking a systematic multi-timeframe approach with trend confirmation and volatility control.
GOOD TRADING!
VSTrade 3EMA📊 EMA Triple Power – spot the trend before the crowd does
This indicator combines three powerful exponential moving averages — EMA 100, 150, and 200 — to help you identify the true direction and strength of the market trend.
🔹 High-precision trend filter: The triple EMA structure cuts through noise and highlights only high-probability setups.
🔹 Perfect for all timeframes: Whether you're scalping or swing trading, this tool adjusts to your strategy.
🔹 Clear market visualization: Instantly spot bullish or bearish phases at a glance.
🔹 Trusted by professionals: Already used by experienced traders to enhance their edge in volatile markets.
👉 Add EMA Triple Power to your chart and start trading with the trend – not against it.
–––––––––––––––
📊 EMA Triple Power – найдите тренд, пока другие сомневаются
Этот индикатор использует три ключевые скользящие средние — EMA 100, 150 и 200, — чтобы точно определить силу и направление тренда.
🔹 Мощная фильтрация тренда: Тройная структура EMA устраняет рыночный шум и помогает вам входить только в высоковероятные сделки.
🔹 Идеален для всех таймфреймов: От скальпинга до свинг-трейдинга – индикатор адаптируется под ваш стиль торговли.
🔹 Простота визуализации: Четкое разделение бычьих и медвежьих фаз рынка, понятное с первого взгляда.
🔹 Используется профессионалами: Этот инструмент уже стал частью стратегии опытных трейдеров по всему миру.
👉 Добавьте EMA Triple Power на свой график и торгуйте в сторону настоящего тренда.
TrendGradient [By TraderMan]TrendGradient Indicator: What It Does, How It Works, and How to Use It 📊✨
The **TrendGradient ** indicator is a Pine Script tool designed for the TradingView platform, assisting traders in trend analysis, generating buy/sell signals, and determining target price (TP) and stop-loss (SL) levels. In this guide, I’ll explain in detail what the indicator does, how it operates, how to use it, and strategies for opening positions. Get ready to dive into this colorful and powerful tool! 🚀
🌟 **What Is TrendGradient and What Does It Do?**
TrendGradient is an indicator that analyzes price movements to identify trend direction and strength while generating actionable buy and sell signals. Here are its core functions:
1. **Trend Tracking**: Uses 38-period and 62-period Exponential Moving Averages (EMAs) to determine the trend direction (bullish or bearish).
2. **Buy/Sell Signals**: Generates signals based on EMA crossovers and crossunders.
3. **Target and Stop Levels**: Calculates entry, take-profit (TP1, TP2, TP3), and stop-loss (SL) levels using the Average True Range (ATR).
4. **Volatility and Trend Analysis**: Visualizes volatility levels (low, medium, high) and trend strength (strong/weak) via ATR and EMA.
5. **Visual Clarity**: Provides a user-friendly interface with colored lines, labels, tables, and shapes.
This indicator is ideal for trend-following traders and can be used for both short-term (scalping/day trading) and long-term strategies. 📈
---
### 🛠️ **How Does TrendGradient Work?**
Let’s break down the indicator’s mechanics step by step:
#### 1. **EMA-Based Trend Analysis** 📉
- **EMA 38 and EMA 62**: The indicator uses 38-period and 62-period Exponential Moving Averages to smooth price data and identify trend direction.
- **EMA 38 > EMA 62**: Bullish trend (uptrend) 📈
- **EMA 38 < EMA 62**: Bearish trend (downtrend) 📉
- EMA crossovers trigger buy/sell signals:
- **Crossover (EMA 38 crosses above EMA 62)**: Buy signal (BUY).
- **Crossunder (EMA 38 crosses below EMA 62)**: Sell signal (SELL).
- The EMAs focus on the last 20 days of data to display recent trends only.
#### 2. **ATR-Based Levels** ⚖️
- **ATR (Average True Range)**: Measures price volatility and is used to calculate entry, TP, and SL levels.
- **Entry Price**: For buys, the closing price plus an ATR multiplier; for sells, the closing price minus an ATR multiplier.
- **Take-Profit Levels (TP1, TP2, TP3)**: Calculated by adding/subtracting ATR multiples (default: 2.0, 4.0, 6.0) to/from the entry price.
- **Stop-Loss (SL)**: Set at a distance from the entry price using an ATR multiplier (default: 2.0 + additional SL).
- These levels are visualized on the chart with colored lines (yellow: entry, green: TP1, teal: TP2, blue: TP3, red: SL) and labels.
#### 3. **Signal and Status Visualization** 🖼️
- **Lines and Labels**: Buy/sell signals are marked with green "BUY" and red "SELL" labels on the chart.
- **Table**: A table in the top-right corner summarizes signal status, entry/TP/SL levels, trend strength, volatility, and trend direction.
- **Color Coding**:
- Green: Bullish trend, buy signal, or TP achievements.
- Red: Bearish trend, sell signal, or SL triggered.
- Yellow, teal, blue: Entry and TP levels.
- **Bar Coloring**: Bars are colored green (bullish) or red (bearish) based on EMA alignment.
#### 4. **TP/SL Monitoring** ✅❌
- The indicator checks if the price hits TP or SL levels and displays labels like "✔️ TP Achieved" or "❌ SL Stopped Out."
- When a TP or SL is hit, the position status updates (e.g., "In Progress ⏳", "Successful ✅", or "Failed ❌").
#### 5. **Volatility and Trend Strength** 📊
- **Volatility (ATR)**: Classified as "Low" (red), "Medium" (orange), or "High" (green) based on the ATR’s position within its 50-bar range.
- **Trend Strength**: If EMA 38 > EMA 62, the trend is "Strong" (green); otherwise, it’s "Weak" (red).
---
### 📋 **How to Use TrendGradient?**
Follow these steps to effectively use TrendGradient:
#### 1. **Add the Indicator to TradingView** 🖥️
- In TradingView, search for "TrendGradient " in the **Indicators** menu and add it to your chart.
- Use default settings or customize parameters like ATR period, multipliers, and display duration (default: 20 days) in the **Settings** menu.
#### 2. **Identify Signals** 🔍
- **Buy Signal (BUY)**: Appears when a green "BUY" label is displayed and EMA 38 crosses above EMA 62.
- **Sell Signal (SELL)**: Appears when a red "SELL" label is displayed and EMA 38 crosses below EMA 62.
- Check the top-right table for signal status ("BUY", "SELL", or "-") and position levels (Entry, TP1, TP2, TP3, SL).
#### 3. **Opening a Position** 🚪
- **Long Position (Buy)**:
1. When a "BUY" signal appears, check the entry price (yellow line).
2. Open a position at or near the entry price.
3. Set TP1, TP2, TP3 (green, teal, blue lines) and SL (red line) as targets/stops.
- **Short Position (Sell)**:
1. When a "SELL" signal appears, check the entry price.
2. Open a position at or near the entry price.
3. Use TP and SL levels as targets/stops.
- **Note**: ATR-based levels adjust dynamically to market volatility, ensuring adaptability.
#### 4. **Position Management** 🛡️
- **Take-Profit (TP)**: Realize profits when the price hits TP1, TP2, or TP3. For example, close part of the position at TP1 and hold the rest for TP2/TP3.
- **Stop-Loss (SL)**: Close the position if the price hits the SL level ("❌ SL Stopped Out" appears).
- **Partial Closes**: Use multiple TP levels to scale out of positions incrementally.
#### 5. **Trend and Volatility Analysis** 📊
- **Trend Direction and Strength**: The table shows whether the trend is "Up" or "Down" and its strength ("Strong" or "Weak"). Strong trends may warrant more aggressive positions.
- **Volatility**: ATR-based volatility indicators help gauge market conditions. High volatility (green) suggests larger price moves, while low volatility (red) indicates calmer markets.
#### 6. **Risk Management** ⚠️
- Always use the SL level and assess the risk/reward ratio (e.g., 2:1 for TP1, 4:1 for TP2).
- In low volatility (red), consider smaller positions; in high volatility (green), expect larger moves.
---
### 🛠️ **Example Position Opening Scenario**
**Scenario: Long Position**
- **Situation**: EMA 38 crosses above EMA 62, and a green "BUY" label appears.
- **Entry Price**: 100 (yellow line).
- **TP Levels**: TP1: 104, TP2: 108, TP3: 112.
- **SL Level**: 96.
- **Strategy**:
1. Open a long position at 100.
2. Close 50% of the position at TP1 (104), hold the rest for TP2 (108) or TP3 (112).
3. Exit fully if the price hits SL (96).
- **Table Status**: "Signal: BUY", "Position Status: In Progress ⏳", "Trend Strength: Strong", "Volatility: High".
**Scenario: Short Position**
- **Situation**: EMA 38 crosses below EMA 62, and a red "SELL" label appears.
- **Entry Price**: 100.
- **TP Levels**: TP1: 96, TP2: 92, TP3: 88.
- **SL Level**: 104.
- **Strategy**: Manage the position similarly, scaling out at TP levels.
---
### 💡 **Tips and Suggestions**
1. **Timeframe**: The indicator works across timeframes (1H, 4H, daily). Short-term traders can use 1H-4H, while long-term traders may prefer daily charts.
2. **Combine with Other Indicators**: Use RSI, MACD, or support/resistance levels to confirm signals.
3. **Backtesting**: Test the strategy on historical data to evaluate performance.
4. **Customization**: Adjust ATR multipliers or EMA periods to suit your market or strategy.
5. **Discipline**: Stick to signals and avoid emotional decisions.
---
### 🎨 **Visual Features**
- **Colored Lines and Labels**: Entry, TP, and SL levels are displayed with colored lines (yellow, green, teal, blue, red) for clarity.
- **Table**: The top-right table summarizes all key information (signal, levels, trend, volatility).
- **Bar Coloring**: Green bars for bullish trends and red bars for bearish trends make trend direction easy to spot.
- **Emojis**: Position status is enhanced with emojis like ⏳ (in progress), ✅ (successful), and ❌ (failed) for visual appeal.
---
### ⚠️ **Warnings and Limitations**
- **Market Conditions**: The indicator performs best in trending markets; it may produce false signals in ranging markets.
- **Risk Management**: Always use proper risk/reward ratios and risk only a small portion of your capital.
- **Lag**: EMAs are lagging indicators, so signals may be delayed in fast-moving markets.
- **Customization Needs**: Default settings may not suit all markets; test and optimize as needed.
---
### 🌟 **Conclusion**
TrendGradient is a user-friendly, visually appealing indicator for trend tracking and automated level calculation. It generates signals via EMA crossovers, calculates dynamic TP/SL levels with ATR, and presents all information clearly through tables, lines, and labels. By using this tool with discipline, you can make more informed and successful trading decisions! 🚀
If you have further questions or need help customizing the indicator, feel free to ask! 💬 Good luck and happy trading! 🍀
EMA ZONE MASTER [By TraderMan]🟢 EMA Zone Master Indicator Explanation 🚀
🌟 What is the EMA Zone Master?
The EMA Zone Master is a powerful TradingView Pine Script indicator designed to help traders identify trends, entry points, and manage trades with precision. It leverages a 200-period EMA (Exponential Moving Average) to create a dynamic zone for spotting bullish 📈 and bearish 📉 trends. The indicator provides clear buy/sell signals, take-profit (TP) levels, and stop-loss (SL) levels, making it ideal for both novice and experienced traders! 💪
🔍 How Does It Work?
The indicator uses the 200-period EMA as its core, surrounded by a zone defined by a percentage offset (default 0.3%). Here's how it operates:
Trend Detection 🧠:
The price's position relative to the EMA zone determines the trend:
Above the zone (with tolerance and minimum distance) signals a bullish trend (BUY 📈).
Below the zone signals a bearish trend (SELL 📉).
A neutral trend occurs when the price is within the zone or lacks momentum.
A trend is confirmed after a set number of bars (default 3) to filter out noise. 🔎
Trade Signals 🚦:
Buy Signal: Triggered when the price breaks above the EMA zone with confirmation.
Sell Signal: Triggered when the price breaks below the EMA zone with confirmation.
Signals are visualized with labels ("BUY" or "SELL") on the chart for clarity. ✅
Position Management 🎯:
Entry Price: Set at the closing price when a signal is triggered.
Take-Profit Levels: Three TP levels (TP1, TP2, TP3) are calculated based on a Risk/Reward Ratio (default 0.7).
Stop-Loss: Calculated using the ATR (Average True Range) with a multiplier (default 6.0) for volatility-based protection. 🛡️
Lines and labels for entry, TP, and SL are drawn on the chart for easy tracking.
Trend Strength 💪:
The indicator calculates trend strength (0-100%) and categorizes it as Very Strong, Strong, Moderate, Weak, or Very Weak. This helps gauge the reliability of the trend. 🌡
Analysis Comment 📝:
A dynamic comment provides professional insights based on trend strength, guiding traders on whether to act or wait. 🧑💼
Visuals & Alerts 🔔:
The EMA, zone boundaries, and candlestick colors change based on the trend (green for bullish, red for bearish, gray for neutral).
A table in the top-right corner summarizes key data: trend direction, strength, entry price, TP/SL levels, and success rate.
Alerts are generated with detailed trade information when a new signal appears.
🛠 How to Use It?
Setup on TradingView ⚙️:
Add the EMA Zone Master to your chart via the TradingView Pine Script editor.
Customize settings like EMA Length (default 200), Zone Width (0.3%), ATR Period (50), and Risk/Reward Ratio (0.7) to suit your trading style. 🛠
Interpreting Signals 📊:
Buy Signal (AL): Look for a "BUY" label and green candlesticks when the price breaks above the EMA zone. 📈
Sell Signal (SAT): Look for a "SELL" label and red candlesticks when the price breaks below the EMA zone. 📉
Check the table for trend strength and analysis comments to confirm the signal's reliability.
Opening a Position 💸:
Long Position: Enter a buy trade when a "BUY" signal appears. Set your take-profit at TP1, TP2, or TP3 and stop-loss at the SL level shown on the chart.
Short Position: Enter a sell trade when a "SELL" signal appears. Use the TP and SL levels provided.
The indicator automatically plots these levels as lines and labels for easy reference. 🎯
Managing Trades 🕒:
Monitor the trade's progress via the table and labels.
The indicator tracks if TP1, TP2, or TP3 is hit or if the trade stops out, updating the Last Result in the table (e.g., "✅ TP1 SUCCESS" or "❌ STOPPED OUT").
Use the Success Rate (displayed in the table) to gauge historical performance (75% for BUY, 65% for SELL, 50% for NEUTRAL).
Using Alerts 🔔:
Set up alerts in TradingView to receive notifications when a buy or sell signal is triggered.
The alert message includes the trend, strength, entry price, TP/SL levels, success rate, and analysis comment for quick decision-making.
📈 How to Open a Position?
Wait for a Signal: Ensure a "BUY" or "SELL" label appears, and the trend strength is at least Moderate (40%+) for higher confidence. ✅
Check the Table: Review the trend direction, strength, and analysis comment to confirm the trade setup. 📊
Enter the Trade:
For a Buy: Enter at the entry price shown, set TP1/TP2/TP3 and SL as indicated by the lines/labels.
For a Sell: Same process, but for a short position.
Monitor: Watch for TP or SL hits. The indicator will update the table with the result (e.g., "✅ TP3 SUCCESS"). 🕒
Risk Management: Always adhere to the stop-loss level to limit losses, and consider partial profit-taking at TP1 or TP2 for safer trading. 🛡️
🎉 Why Use EMA Zone Master?
Clear Signals: Easy-to-read buy/sell signals with visual cues. 🚦
Automated Levels: Pre-calculated TP and SL levels save time and reduce errors. 🧮
Trend Strength Insight: Helps avoid weak trends and focus on high-probability setups. 💪
Professional Analysis: Dynamic comments guide your trading decisions. 🧑💼
Customizable: Adjust settings to match your trading style or market conditions. ⚙️
Alert System: Stay informed with detailed alerts for timely action. 🔔
⚠️ Tips for Success
Confirm with Other Tools: Use additional indicators (e.g., RSI, MACD) to validate signals. 🔍
Test First: Backtest the indicator on your preferred market/timeframe to understand its performance. 📉
Risk Management: Always use proper position sizing and respect stop-loss levels. 🛑
Higher Timeframes: The indicator works best on higher timeframes (e.g.,15MİN, 1H, 4H, Daily) for stronger signals. ⏰
Happy trading with EMA Zone Master! 🚀 Let it guide you to smarter, more confident trades. 💰 Feel free to tweak settings and share your results! 😊
TrendSync TP Engine [By TraderMan]📘 TrendSync TP Engine – Overview & User Guide
TrendSync TP Engine is a trend-following indicator that automatically detects trend direction based on how long the price stays above or below a defined EMA (Exponential Moving Average). Once a trend is confirmed, it plots entry, take-profit (TP), and stop-loss (SL) levels directly on the chart.
Its purpose is to offer a clear roadmap for manual traders and act as a “TP engine” in trend-based trading.
🔧 How It Works
Trend Detection:
If the price closes consistently above or below the EMA for a minimum number of bars, a LONG or SHORT trend is triggered.
EMA-Based Trade Plan:
When a new trend is detected, the script automatically plots:
Entry level
TP1, TP2, TP3
SL level
based on dynamic ATR offsets.
TP / SL Labels:
As the price hits TP or SL targets, real-time labels appear on the chart showing trade progress.
Built-in Alert System:
Alerts are triggered when:
A new position opens
TP1, TP2, TP3 levels are reached
Stop loss is hit
🚀 How to Use
Add to Chart:
Apply the indicator to your chart on any timeframe (1H, 4H, 1D, etc.).
Configure Settings:
Adjust parameters like:
EMA length
Minimum trend duration
TP/SL distances (in ATR multiples)
to fit your strategy.
Follow the Plan:
Once a trend begins, you'll see:
Blue line for entry
Green dashed lines for TP1/TP2/TP3
Red dashed line for SL
Let the engine guide your trades.
🎯 Who Is It For?
Trend-following traders
Manual traders who want structured trade plans
Users who prefer automated visual signals & alerts
Developers looking to build strategy logic on top
✅ Key Features
Automatic levels: Entry, TP1-3, SL lines
Alert-ready: Real-time push/email/webhook notifications
Clear visuals: All levels labeled with real-time status
Flexible & modular: Can be extended into a full strategy
Disclaimer: This tool is for educational and informational purposes only. It does not constitute financial advice. Use at your own discretion with proper risk management.
EMA Plot with Colorshis indicator displays six Exponential Moving Averages (EMAs) with distinct colors to help traders analyze short-, medium-, and long-term market trends at a glance.
📈 Included EMAs:
EMA 20 – Blue (Short-term trend)
EMA 40 – Green (Short/Medium-term trend)
EMA 55 – Orange (Medium-term trend)
EMA 81 – Red (Medium/Long-term trend)
EMA 100 – Purple (Long-term trend)
EMA 200 – Gray (Major trend indicator)
These EMAs can be used to:
Identify dynamic support and resistance
Spot trend direction and strength
Observe crossover signals for potential entries/exits
Simple and effective for all trading styles — intraday, swing, or long-term.