SMC Minimal Setup//@version=5
indicator("SMC Minimal Setup", overlay=true)
// === INPUTS ===
swingLeft = input.int(5, "Swing Left")
swingRight = input.int(5, "Swing Right")
structureLookback = input.int(20, "Structure Lookback")
// === MARKET STRUCTURE ===
var string structure = "neutral"
if high > ta.highest(high , structureLookback)
structure := "bullish"
if low < ta.lowest(low , structureLookback)
structure := "bearish"
// === SWING LEVELS ===
relevantHigh = ta.pivothigh(high, swingLeft, swingRight)
relevantLow = ta.pivotlow(low, swingLeft, swingRight)
// === LIQUIDITY SWEEPS ===
sweepHigh = not na(relevantHigh) and high > relevantHigh and close < relevantHigh
sweepLow = not na(relevantLow) and low < relevantLow and close > relevantLow
// === DISPLACEMENT CANDLES ===
bodySize = math.abs(close - open)
candleRange = high - low
avgRange = ta.sma(candleRange, 10)
displacementUp = close > open and bodySize > candleRange*0.6 and candleRange > avgRange
displacementDown = open > close and bodySize > candleRange*0.6 and candleRange > avgRange
// === SETUP ===
bullishSetup = sweepLow and displacementUp
bearishSetup = sweepHigh and displacementDown
plotshape(bullishSetup, style=shape.triangleup, location=location.belowbar, color=color.green, size=size.small)
plotshape(bearishSetup, style=shape.triangledown, location=location.abovebar, color=color.red, size=size.small)
// === FVG ===
bullishFVG = low > high
bearishFVG = high < low
if bullishFVG
box.new(left=bar_index-2, right=bar_index, top=low , bottom=high , bgcolor=color.new(color.green,85))
if bearishFVG
box.new(left=bar_index-2, right=bar_index, top=high , bottom=low , bgcolor=color.new(color.red,85))
// === BACKGROUND ===
bgcolor(structure=="bullish" ? color.new(color.green,80) : structure=="bearish" ? color.new(color.red,80) : na)
Candlestick analysis
Displacement + Liquidity Levels//@version=5
indicator("Displacement + Liquidity Levels", overlay=true, max_lines_count=500)
// INPUTS
swingLeft = input.int(5, "Swing Left")
swingRight = input.int(5, "Swing Right")
rangeLen = input.int(10, "Range Lookback")
// SWINGS
relevantHigh = ta.pivothigh(high, swingLeft, swingRight)
relevantLow = ta.pivotlow(low, swingLeft, swingRight)
// ARRAYS
var line highLines = array.new_line()
var line lowLines = array.new_line()
// LIQUIDITY SWEEPS
sweepHigh = not na(relevantHigh) and high > relevantHigh and close < relevantHigh
sweepLow = not na(relevantLow) and low < relevantLow and close > relevantLow
// DISPLACEMENT
bodySize = math.abs(close - open)
candleRange = high - low
avgRange = ta.sma(candleRange, rangeLen)
displacementUp = close > open and bodySize > candleRange*0.6 and candleRange > avgRange
displacementDown = open > close and bodySize > candleRange*0.6 and candleRange > avgRange
// SIGNALS
bullishSignal = sweepLow and displacementUp
bearishSignal = sweepHigh and displacementDown
plotshape(bullishSignal, style=shape.triangleup, location=location.belowbar, color=color.green, size=size.large, text="LONG")
plotshape(bearishSignal, style=shape.triangledown, location=location.abovebar, color=color.red, size=size.large, text="SHORT")
// NEUE LINIEN
if not na(relevantHigh)
l = line.new(bar_index, relevantHigh, bar_index + 500, relevantHigh, extend=extend.right, color=color.red, width=2)
array.push(highLines, l)
if not na(relevantLow)
l = line.new(bar_index, relevantLow, bar_index + 500, relevantLow, extend=extend.right, color=color.green, width=2)
array.push(lowLines, l)
// LINIEN LÖSCHEN, WENN GETOUCHT
for i = array.size(highLines)-1 to 0 by -1
l = array.get(highLines, i)
if high >= line.get_price(l, bar_index)
line.delete(l)
array.remove(highLines, i)
for i = array.size(lowLines)-1 to 0 by -1
l = array.get(lowLines, i)
if low <= line.get_price(l, bar_index)
line.delete(l)
array.remove(lowLines, i)
// High/Low-Relevanz sofort
liqHigh = ta.highest(high, 3)
liqLow = ta.lowest(low, 3)
if high == liqHigh
line.new(bar_index, high, bar_index + 500, high, extend=extend.right, color=color.red, width=2)
if low == liqLow
line.new(bar_index, low, bar_index + 500, low, extend=extend.right, color=color.green, width=2)
Liquidity & SMT Detector//@version=5
indicator("Liquidity & SMT Detector", overlay=true, max_lines_count=500, max_labels_count=500)
// ============================================
// INPUT SETTINGS
// ============================================
// Group 1: Liquidity Detection
swing_length = input.int(10, "Swing Length", minval=3, maxval=50, group="Liquidity Detection")
max_lines = input.int(20, "Max Lines Displayed", minval=5, maxval=100, group="Liquidity Detection")
line_color_high = input.color(color.red, "High Line Color", group="Liquidity Detection")
line_color_low = input.color(color.green, "Low Line Color", group="Liquidity Detection")
line_width = input.int(2, "Line Width", minval=1, maxval=5, group="Liquidity Detection")
show_labels = input.bool(true, "Show H/L Labels", group="Liquidity Detection")
// Group 2: Displacement Detection
enable_displacement = input.bool(true, "Enable Displacement Detection", group="Displacement")
displacement_multiplier = input.float(2.0, "Size Multiplier", minval=1.5, maxval=5.0, step=0.1, group="Displacement")
displacement_period = input.int(20, "Average Period", minval=10, maxval=50, group="Displacement")
displacement_color_bull = input.color(color.new(color.aqua, 70), "Bullish Color", group="Displacement")
displacement_color_bear = input.color(color.new(color.orange, 70), "Bearish Color", group="Displacement")
show_displacement_label = input.bool(true, "Show Labels", group="Displacement")
// Group 3: SMT Detection
enable_smt = input.bool(true, "Enable SMT Detection", group="SMT Divergence")
nq_symbol = input.string("NQ1!", "Nasdaq Symbol", group="SMT Divergence")
es_symbol = input.string("ES1!", "S&P500 Symbol", group="SMT Divergence")
smt_lookback = input.int(20, "Lookback Period", minval=5, maxval=100, group="SMT Divergence")
smt_line_color = input.color(color.yellow, "SMT Line Color", group="SMT Divergence")
smt_text_color = input.color(color.yellow, "SMT Text Color", group="SMT Divergence")
// ============================================
// ARRAYS FOR LINE/LABEL MANAGEMENT
// ============================================
var line high_lines = array.new_line()
var line low_lines = array.new_line()
var label high_labels = array.new_label()
var label low_labels = array.new_label()
var float high_levels = array.new_float()
var float low_levels = array.new_float()
// ============================================
// FUNCTION: DETECT SWING HIGHS
// ============================================
isSwingHigh(len) =>
highestBar = ta.highestbars(high, len * 2 + 1)
highestBar == -len
// ============================================
// FUNCTION: DETECT SWING LOWS
// ============================================
isSwingLow(len) =>
lowestBar = ta.lowestbars(low, len * 2 + 1)
lowestBar == -len
// ============================================
// SWING HIGH DETECTION & LINE DRAWING
// ============================================
if isSwingHigh(swing_length)
swing_high = high
new_line = line.new(bar_index - swing_length, swing_high, bar_index, swing_high, color=line_color_high, width=line_width, style=line.style_dashed)
array.push(high_lines, new_line)
array.push(high_levels, swing_high)
if show_labels
new_label = label.new(bar_index - swing_length, swing_high, "H", color=color.new(line_color_high, 80), textcolor=line_color_high, style=label.style_label_down, size=size.small)
array.push(high_labels, new_label)
// Limit number of lines
if array.size(high_lines) > max_lines
line.delete(array.shift(high_lines))
array.shift(high_levels)
if show_labels and array.size(high_labels) > 0
label.delete(array.shift(high_labels))
// ============================================
// SWING LOW DETECTION & LINE DRAWING
// ============================================
if isSwingLow(swing_length)
swing_low = low
new_line = line.new(bar_index - swing_length, swing_low, bar_index, swing_low, color=line_color_low, width=line_width, style=line.style_dashed)
array.push(low_lines, new_line)
array.push(low_levels, swing_low)
if show_labels
new_label = label.new(bar_index - swing_length, swing_low, "L", color=color.new(line_color_low, 80), textcolor=line_color_low, style=label.style_label_up, size=size.small)
array.push(low_labels, new_label)
// Limit number of lines
if array.size(low_lines) > max_lines
line.delete(array.shift(low_lines))
array.shift(low_levels)
if show_labels and array.size(low_labels) > 0
label.delete(array.shift(low_labels))
// ============================================
// UPDATE EXISTING LINES & CHECK FOR SWEEPS
// ============================================
if array.size(high_lines) > 0
for i = array.size(high_lines) - 1 to 0
current_line = array.get(high_lines, i)
current_level = array.get(high_levels, i)
if close > current_level
line.delete(current_line)
array.remove(high_lines, i)
array.remove(high_levels, i)
if show_labels and i < array.size(high_labels)
label.delete(array.get(high_labels, i))
array.remove(high_labels, i)
else
line.set_x2(current_line, bar_index)
if array.size(low_lines) > 0
for i = array.size(low_lines) - 1 to 0
current_line = array.get(low_lines, i)
current_level = array.get(low_levels, i)
if close < current_level
line.delete(current_line)
array.remove(low_lines, i)
array.remove(low_levels, i)
if show_labels and i < array.size(low_labels)
label.delete(array.get(low_labels, i))
array.remove(low_labels, i)
else
line.set_x2(current_line, bar_index)
// ============================================
// DISPLACEMENT CANDLE DETECTION
// ============================================
body_size = math.abs(close - open)
avg_body = ta.sma(math.abs(close - open), displacement_period)
is_displacement = enable_displacement and body_size > (avg_body * displacement_multiplier)
is_bullish = close > open
bgcolor(is_displacement ? (is_bullish ? displacement_color_bull : displacement_color_bear) : na)
if is_displacement and show_displacement_label
label.new(bar_index, is_bullish ? high : low, "D", color=color.new(is_bullish ? color.aqua : color.orange, 50), textcolor=is_bullish ? color.aqua : color.orange, style=is_bullish ? label.style_label_up : label.style_label_down, size=size.tiny)
// ============================================
// SMT DIVERGENCE DETECTION
// ============================================
current_symbol = syminfo.ticker
comparison_symbol = str.contains(current_symbol, "NQ") ? es_symbol : nq_symbol
comparison_high = request.security(comparison_symbol, timeframe.period, high, lookahead=barmerge.lookahead_off)
comparison_low = request.security(comparison_symbol, timeframe.period, low, lookahead=barmerge.lookahead_off)
var float prev_current_low = na
var float prev_comparison_low = na
var int prev_swing_bar = na
current_is_swing_low = isSwingLow(swing_length)
comparison_is_swing_low = ta.lowestbars(comparison_low, swing_length * 2 + 1) == -swing_length
if enable_smt and current_is_swing_low
current_swing_low = low
comparison_swing_low = comparison_low
if not na(prev_current_low) and not na(prev_comparison_low)
current_lower = current_swing_low < prev_current_low
comparison_lower = comparison_swing_low < prev_comparison_low
is_smt = (current_lower and not comparison_lower) or (not current_lower and comparison_lower)
if is_smt
smt_line = line.new(prev_swing_bar, prev_current_low, bar_index - swing_length, current_swing_low, color=smt_line_color, width=2, style=line.style_solid)
mid_bar = math.round((prev_swing_bar + bar_index - swing_length) / 2)
mid_price = (prev_current_low + current_swing_low) / 2
label.new(mid_bar, mid_price, "SMT", color=color.new(smt_line_color, 80), textcolor=smt_text_color, style=label.style_label_center, size=size.normal)
prev_current_low := current_swing_low
prev_comparison_low := comparison_swing_low
prev_swing_bar := bar_index - swing_length
// ============================================
// ALERTS
// ============================================
alertcondition(array.size(high_lines) < array.size(high_lines) , title="Liquidity Sweep High", message="High liquidity swept at {{close}}")
alertcondition(array.size(low_lines) < array.size(low_lines) , title="Liquidity Sweep Low", message="Low liquidity swept at {{close}}")
alertcondition(is_displacement, title="Displacement Candle", message="Displacement candle detected at {{close}}")
VLATMIR LOOTINWell THB i have never coded before this is my first crack at td9. TBH this was first a trend and Candle but we adding stay around have fun > thank you thomas < AKA ASIAN FRANK<
OBV with Divergence (SMA Smoother)Title: OBV Divergence with SMA Smoothing
Description:
This indicator is a powerful tool designed to identify regular (reversal) and hidden (continuation) On-Balance Volume (OBV) divergences against price action. It uses a modified OBV calculation (an OBV Oscillator) and integrates pivot analysis to automatically highlight potential turning points or trend continuations directly on your chart.
Key Features
Advanced Divergence Detection: Automatically detects and labels four types of divergences:
Regular Bullish/Bearish: Signals potential trend reversals.
Regular Bullish: Price makes a Lower Low (LL) but the OBV Oscillator makes a Higher Low (HL).
Regular Bearish: Price makes a Higher High (HH) but the OBV Oscillator makes a Lower High (LH).
Hidden Bullish/Bearish: Signals potential trend continuations.
Hidden Bullish: Price makes a Higher Low (HL) but the OBV Oscillator makes a Lower Low (LL).
Hidden Bearish: Price makes a Lower High (LH) but the OBV Oscillator makes a Higher High (HH).
OBV Oscillator: Instead of plotting the raw OBV, this script uses the difference between the OBV and its Exponential Moving Average (EMA). This technique centers the indicator around zero, making it easier to visualize volume momentum shifts and clearly identify peaks and troughs for divergence analysis.
Optional SMA Smoothing Line (New Feature): An added Simple Moving Average (SMA) line can be toggled on to further smooth the OBV Oscillator. Traders can use this line for crossover signals or to confirm the underlying trend of the volume momentum, reducing whipsaws.
Customizable Lookback: The indicator allows you to define the lookback periods (Pivot Lookback Left/Right) for price and oscillator pivots, giving you precise control over sensitivity. The Max/Min of Lookback Range helps filter out divergences that are too close or too far apart.
ASTER Key Levels & Alerts (Improved)TradingView Script Description
Title: ASTER Key Levels & Alerts (Improved)
Description:
Enhance your trading strategy with the "ASTER Key Levels & Alerts" indicator, designed for precision and decision-making on the Aster chart (e.g., ASTS). This Pine Script v6 tool overlays customizable key levels and zones to identify optimal entry, exit, and stop-loss points, complete with real-time alerts.Key Features:
Customizable Levels: Adjust add zones (Light & Main), breakout, stop, and take-profit (TP1-TP3
SuperBulls - Heiken Ashi StrategyA streamlined, trade-ready strategy from the SuperBulls universe that turns noisy charts into clear decisions. It combines a smoothed price view, adaptive momentum gating, and a dynamic support/resistance overlay so you can spot high-probability turns without overthinking every candle. Entries and exits are signalled visually and designed to work with simple position sizing — perfect for discretionary traders and systematic setups alike.
Why traders like it
Clean visual signals reduce analysis paralysis and speed up decision-making.
Built-in momentum filter helps avoid chop and chase only the stronger moves.
Dynamic S/R zones provide objective areas for targets and stop placement.
Works with simple risk rules — position sizing and pyramiding kept conservative by default.
Who it’s for
Traders who want a reliable, low-friction strategy to trade intraday or swing setups without rebuilding indicators from scratch. Minimal tuning required; plug in your size and let the SuperBulls logic do the heavy lifting.
Use it, don’t overfit it, and try not to blame the indicator when you ignore risk management.
KANNADI MOHANRAJA SCALPINGEach 3minute time frame up direction movement background color goes to green
Loss Alarm (multi-TF)Loss Alarm (multi-TF)
This script triggers an alert once the price candel body stays fully under a chosen line for a predefined period of time.
Select your own ticker, timeframe, and price level.
The alert is triggered only once per session.
A line is plotted on the chart with a label showing the selected timeframe, so you know which alert is active.
⚠️ Note: you must manually create a separate TradingView alert using the condition provided by the script.
Gain Alarm (multi-TF )369
Gain Alarm (multi-TF)
This script triggers an alert once the price candel body stays fully above a chosen line for a predefined period of time.
Select your own ticker, timeframe, and price level.
The alert is triggered only once per session.
A line is plotted on the chart with a label showing the selected timeframe, so you know which alert is active.
⚠️ Note: you must manually create a separate TradingView alert using the condition provided by the script.
Renko ATR Trend + SMA Indicator by YCGH Capital🧭 Overview
The Renko ATR Trend + SMA Indicator is a trend-following tool designed for chart trading.
It combines Renko-style price movement logic (based on ATR) with a Simple Moving Average (SMA) filter to identify sustained bullish or bearish phases on any timeframe.
It plots a color-coded trend line directly on the price chart — green for bullish trends, red for bearish — and maintains a single active state (no repeated buy/sell signals) until the opposite condition appears.
⚙️ How It Works
1️⃣ Renko ATR Engine
Instead of using fixed box sizes like classic Renko charts, this indicator builds synthetic Renko movement based on ATR (Average True Range) of a chosen timeframe.
It pulls OHLC data from your selected Renko Source Timeframe (for example, 60-minute candles).
It calculates an ATR brick size — representing the minimum price move needed for a new Renko brick.
When price moves by at least one ATR in the opposite direction, it flips the trend.
This filters out small fluctuations and captures the underlying directional bias.
2️⃣ SMA Filter
A Simple Moving Average (SMA) acts as a trend confirmation filter.
Only when Renko direction aligns with the price relative to the SMA, a trend signal activates.
BUY → Renko uptrend + price above SMA
SELL → Renko downtrend + price below SMA
3️⃣ Stateful Signal Logic
Unlike typical indicators that spam multiple buy/sell shapes:
This version holds one persistent signal (Buy or Sell)
The state continues until an opposite signal is confirmed
No “continuation” arrows — clean and minimal trend visualization
🎨 Visuals
Element Meaning
🟩 Green Renko Line Active Bullish Trend
🟥 Red Renko Line Active Bearish Trend
⚪ Gray Line Neutral / Waiting phase
🟡 Yellow Line SMA (trend filter)
📍 Label (Buy Active / Sell Active) Displays the current market bias
🔧 Inputs
Input Description
Renko Source Timeframe The timeframe from which Renko data is calculated (e.g., 60 = 1h candles).
ATR Period Determines brick size sensitivity (lower = more responsive, higher = smoother).
SMA Length Moving Average length used as a directional filter.
💡 How Traders Use It
Trend Confirmation:
Use green/red Renko line to stay aligned with the dominant market move.
Entry Timing:
Enter trades when a new Renko direction is confirmed along with SMA alignment.
Exit or Reverse:
Exit long when a red line (Sell Active) appears, and vice versa.
Combine with Price Action:
Add support/resistance or volume analysis for confirmation.
Cruce TEMA SMMA con Alarma a 12 Barras LLUCes un cruce de TEMA SMMA, luego del cruce contar 12 barras controladas por otros
Bullish/Bearish Engulfing Candle ScannerFinds instances on any time frame of bullish or bearish engulfing candles, those with some increased average volume showing green arrows to highlight, otherwise red.
Gap Finder v6Detects unfilled price gaps with clean lines and labels with percentage size of the gap. Lines extend 16 bars and labels extend 14 bars past last bar.
Smart Money Concepts URUGUAYSmart money concept, Bos , choch , liquidiciones con niveles marcados con lineas perfecto
SOL 15分钟MACD全自动策略//@version=5
strategy("30分钟高胜率MACD+RSI全自动策略", overlay=true, shorttitle="HighWin-30min Auto",
initial_capital=10000, // 初始资金
default_qty_type=strategy.cash, // 按资金比例开仓
default_qty_value=2000, // 单次开仓金额(可调整)
commission_type=strategy.commission.percent,
commission_value=0.1, // 匹配欧易0.1%默认手续费
margin_long=100, margin_short=100, // 现货交易无杠杆
pyramiding=0, // 禁止加仓,控制风险
close_entries_rule=strategy.close_entries_rule.all,
calc_on_every_tick=false, // 关闭逐Tick计算,避免报错
title_color=#1E90FF, line_color=#FF6347)
// ———— 1. 核心参数设置(高胜率优化版,可微调) ————
// MACD参数(30分钟周期适配,比默认更稳定)
macd_fast = input.int(12, title="MACD快线周期", minval=1)
macd_slow = input.int(26, title="MACD慢线周期", minval=1)
macd_signal = input.int(9, title="MACD信号线周期", minval=1)
// RSI参数(过滤超买超卖,避免追涨杀跌)
rsi_length = input.int(14, title="RSI周期", minval=1)
rsi_long_thresh = input.int(40, title="多头RSI阈值(低于该值可开多)", minval=10, maxval=50)
rsi_short_thresh = input.int(60, title="空头RSI阈值(高于该值可开空)", minval=50, maxval=90)
// 成交量参数(验证资金动能)
vol_multiplier = input.float(1.5, title="成交量放大倍数", step=0.1, minval=1.0)
// ATR止损与止盈参数(科学风控)
atr_length = input.int(14, title="ATR周期(衡量波动)", minval=1)
atr_sl_multi = input.float(2.0, title="止损ATR倍数(2倍更安全)", step=0.1, minval=1.0)
risk_reward = input.float(2.0, title="风险回报比(1:2,赚2倍于亏)", step=0.1, minval=1.5)
// 信号过滤(避免连续交易)
signal_gap = input.int(4, title="多空信号最小间隔K线数", minval=2)
// ———— 2. 指标计算(三重验证,降低假信号) ————
// 2.1 MACD计算(多空趋势核心)
= ta.macd(close, macd_fast, macd_slow, macd_signal)
// 多头趋势:MACD在零轴上+红柱放大;空头趋势:MACD在零轴下+绿柱放大
macd_long_trend = macd_line > 0 and hist_line > hist_line
macd_short_trend = macd_line < 0 and hist_line < hist_line
// 2.2 RSI计算(过滤超买超卖)
rsi_value = ta.rsi(close, rsi_length)
rsi_long_condition = rsi_value < rsi_long_thresh // 未超买,有上涨空间
rsi_short_condition = rsi_value > rsi_short_thresh // 未超卖,有下跌空间
// 2.3 成交量计算(验证资金动能)
vol_condition = volume >= volume * vol_multiplier and volume > 0 // 成交量比前根放大50%+
vol_long = vol_condition and close > open // 放量上涨,多头资金进场
vol_short = vol_condition and close < open // 放量下跌,空头资金进场
// 2.4 ATR计算(动态止损基础)
atr_value = ta.atr(atr_length)
atr_value := nz(atr_value, ta.sma(ta.tr, atr_length)) // 空值兜底,避免报错
// ———— 3. 多空信号生成(三重条件共振,高胜率核心) ————
// 3.1 多头信号(4个条件同时满足)
var int last_long_bar = 0
long_condition = ta.crossover(macd_line, signal_line) // MACD金叉
and macd_long_trend // 多头趋势
and rsi_long_condition // RSI未超买
and vol_long // 放量上涨
and (bar_index - last_long_bar) >= signal_gap // 间隔过滤
final_long = long_condition
// 3.2 空头信号(4个条件同时满足)
var int last_short_bar = 0
short_condition = ta.crossunder(macd_line, signal_line) // MACD死叉
and macd_short_trend // 空头趋势
and rsi_short_condition // RSI未超卖
and vol_short // 放量下跌
and (bar_index - last_short_bar) >= signal_gap // 间隔过滤
final_short = short_condition
// ———— 4. 动态止盈止损计算(适配30分钟波动,不被洗盘) ————
// 4.1 记录开仓关键数据
var float long_entry = na // 多头入场价
var float short_entry = na // 空头入场价
var float long_entry_low = na // 多头开仓K线低点
var float short_entry_high = na // 空头开仓K线高点
var float entry_atr = na // 开仓时ATR值
// 多头开仓数据记录
if final_long
long_entry := close
long_entry_low := low
entry_atr := atr_value
last_long_bar := bar_index // 更新最后多头信号K线
// 空头开仓数据记录
if final_short
short_entry := close
short_entry_high := high
entry_atr := atr_value
last_short_bar := bar_index // 更新最后空头信号K线
// 4.2 多头止盈止损(双逻辑防护)
long_sl = math.max(long_entry - (entry_atr * atr_sl_multi), long_entry_low * 0.997) // 0.3%缓冲防插针
long_loss = long_entry - long_sl // 止损幅度
long_tp = long_entry + (long_loss * risk_reward) // 1:2风险回报比止盈
// 额外绑定中期压力:前10根K线高点(30分钟周期趋势更稳,周期稍长)
long_resistance = ta.highest(high, 10)
long_tp = math.min(long_tp, long_resistance * 1.003) // 0.3%缓冲防踏空
// 4.3 空头止盈止损(对称逻辑)
short_sl = math.min(short_entry + (entry_atr * atr_sl_multi), short_entry_high * 1.003)
short_loss = short_sl - short_entry
short_tp = short_entry - (short_loss * risk_reward)
// 额外绑定中期支撑:前10根K线低点
short_support = ta.lowest(low, 10)
short_tp = math.max(short_tp, short_support * 0.997)
// ———— 5. 全自动交易执行(严格仓位控制,避免冲突) ————
// 多头开仓:无仓位时执行(避免多空对冲)
if final_long and strategy.position_size == 0
strategy.entry("Long-Position", strategy.long)
strategy.exit("Long-Exit", "Long-Position", stop=long_sl, limit=long_tp) // 自动挂止盈止损
// 空头开仓:无仓位时执行
if final_short and strategy.position_size == 0
strategy.entry("Short-Position", strategy.short)
strategy.exit("Short-Exit", "Short-Position", stop=short_sl, limit=short_tp)
// ———— 6. 可视化与预警(清晰监控,欧易同步提醒) ————
// 6.1 多空信号标记(直观区分)
plotshape(final_long, title="多头信号", location=location.belowbar,
color=color.new(color.green, 0), style=shape.labelup,
text="多", textcolor=color.white, size=size.small)
plotshape(final_short, title="空头信号", location=location.abovebar,
color=color.new(color.red, 0), style=shape.labeldown,
text="空", textcolor=color.white, size=size.small)
// 6.2 止盈止损线(开仓后自动显示,红色止损、绿色止盈)
plot(strategy.position_size > 0 ? long_sl : na, title="多头止损",
color=color.red, linewidth=2, style=plot.style_linebr)
plot(strategy.position_size > 0 ? long_tp : na, title="多头止盈",
color=color.green, linewidth=2, style=plot.style_linebr)
plot(strategy.position_size < 0 ? short_sl : na, title="空头止损",
color=color.red, linewidth=2, style=plot.style_linebr)
plot(strategy.position_size < 0 ? short_tp : na, title="空头止盈",
color=color.green, linewidth=2, style=plot.style_linebr)
// 6.3 副图指标(辅助验证趋势)
// MACD副图
plot(macd_line, title="MACD线", color=color.blue, linewidth=1)
plot(signal_line, title="MACD信号线", color=color.orange, linewidth=1)
barcolor(hist_line > 0 ? color.new(color.green, 60) : color.new(color.red, 60), title="MACD柱")
hline(0, "MACD零轴线", color=color.gray, linestyle=hline.style_dashed)
// RSI副图(显示超买超卖区间)
plot(rsi_value, title="RSI", color=color.purple, linewidth=1, display=display.data_window)
hline(rsi_long_thresh, "多头RSI阈值", color=color.green, linestyle=hline.style_dotted)
hline(rsi_short_thresh, "空头RSI阈值", color=color.red, linestyle=hline.style_dotted)
hline(30, "超卖线", color=color.gray, linestyle=hline.style_dashed)
hline(70, "超买线", color=color.gray, linestyle=hline.style_dashed)
// 6.4 关键预警(欧易同步通知,无需盯盘)
alertCondition(final_long, title="多头开仓提醒",
message="30分钟触发高胜率多头信号,入场价:" + str.tostring(long_entry) + ",止损:" + str.tostring(long_sl))
alertCondition(final_short, title="空头开仓提醒",
message="30分钟触发高胜率空头信号,入场价:" + str.tostring(short_entry) + ",止损:" + str.tostring(short_sl))
alertCondition(strategy.position_size > 0 and close <= long_sl, title="多头止损提醒",
message="多头触及止损位:" + str.tostring(long_sl) + ",已自动平仓")
alertCondition(strategy.position_size > 0 and close >= long_tp, title="多头止盈提醒",
message="多头触及止盈位:" + str.tostring(long_tp) + ",已自动平仓")
alertCondition(strategy.position_size < 0 and close >= short_sl, title="空头止损提醒",
message="空头触及止损位:" + str.tostring(short_sl) + ",已自动平仓")
alertCondition(strategy.position_size < 0 and close <= short_tp, title="空头止盈提醒",
message="空头触及止盈位:" + str.tostring(short_tp) + ",已自动平仓")
Confluence AutoEntry (1m/5m/15m) for Alertatron//@version=5
indicator("Confluence AutoEntry (1m/5m/15m) for Alertatron", overlay=true, max_lines_count=500, max_labels_count=500)
// =========================
// 参数
// =========================
tf1 = input.timeframe("1", "周期-1")
tf2 = input.timeframe("5", "周期-2")
tf3 = input.timeframe("15", "周期-3")
ema1 = input.int(10, "EMA1")
ema2 = input.int(30, "EMA2")
ema3 = input.int(60, "EMA3")
rLen = input.int(14, "RSI 长度")
thr1 = input.int(60, "阈值-周期1 (0~100)", minval=0, maxval=100)
thr2 = input.int(60, "阈值-周期2 (0~100)", minval=0, maxval=100)
thr3 = input.int(60, "阈值-周期3 (0~100)", minval=0, maxval=100)
// 下单资金(USDT)
usdtPerTrade = input.float(500, "每次下单金额(USDT)", step=5)
// 下单类型(市价/限价)
orderType = input.string("market", "下单类型", options= , tooltip="market=市价;limit=限价(使用 entry 作为限价)")
// 两步延续触发
useTwoStep = input.bool(true, "启用两步延续触发", tooltip="收盘仅“武装”,下一根或后续“延续突破”才真正发单;关闭=收盘即发一次信号")
bufferPct = input.float(0.08, "延续触发缓冲(%)", step=0.01, tooltip="突破需要超过武装价的百分比")
armBars = input.int(1, "武装有效bar数", minval=1, tooltip="超时未触发则自动取消武装")
// 可选:在 JSON 中附带 token
attachToken = input.bool(false, "在 JSON 中附带 token 字段")
longToken = input.string("", "多头 token(可留空)")
shortToken = input.string("", "空头 token(可留空)")
// 图形显示
showShapes = input.bool(true, "图表显示三角/武装/触发标记")
showTriggerLabel = input.bool(true, "触发时显示【入场/TP/SL/Qty】标签")
// 「平衡」展示用 TP/SL 百分比(仅用于标签展示,不发到 Alertatron)
tpPct = input.float(2.0, "展示用:TP百分比(%)")
slPct = input.float(1.0, "展示用:SL百分比(%)")
// =========================
// 工具函数
// =========================
f_score(tf) =>
_c = request.security(syminfo.tickerid, tf, close, barmerge.gaps_off, barmerge.lookahead_off)
_e1 = request.security(syminfo.tickerid, tf, ta.ema(close, ema1), barmerge.gaps_off, barmerge.lookahead_off)
_e2 = request.security(syminfo.tickerid, tf, ta.ema(close, ema2), barmerge.gaps_off, barmerge.lookahead_off)
_e3 = request.security(syminfo.tickerid, tf, ta.ema(close, ema3), barmerge.gaps_off, barmerge.lookahead_off)
_r = request.security(syminfo.tickerid, tf, ta.rsi(close, rLen), barmerge.gaps_off, barmerge.lookahead_off)
_m = request.security(syminfo.tickerid, tf, ta.sma(ta.change(close), 5), barmerge.gaps_off, barmerge.lookahead_off)
_ok1 = _c > _e1 ? 1 : 0
_ok2 = _e1 >= _e2 ? 1 : 0
_ok3 = _e2 >= _e3 ? 1 : 0
_ok4 = _r > 50 ? 1 : 0
_ok5 = _m >= 0 ? 1 : 0
(_ok1 + _ok2 + _ok3 + _ok4 + _ok5) / 5.0 * 100.0
// 价格按最小跳动取整
tickRound(x) =>
syminfo.mintick > 0 ? math.round(x / syminfo.mintick) * syminfo.mintick : x
// 数字 -> 价格串
sPrice(x) =>
str.tostring(x, format.mintick)
// 小数点四舍五入(用于数量展示)
roundN(x, n) =>
_f = math.pow(10.0, n)
math.round(x * _f) / _f
sQty(x) =>
str.tostring(roundN(x, 6))
// 去掉交易所前缀和 .P 后缀,得到 BASEQUOTE(如 ETHUSDC)
cleanSymbol() =>
_s = syminfo.ticker
_arr = str.split(_s, ":")
_last = array.get(_arr, array.size(_arr) - 1)
str.replace_all(_last, ".P", "")
// =========================
// 多周期评分 -> 一致方向
// =========================
score1 = f_score(tf1)
score2 = f_score(tf2)
score3 = f_score(tf3)
dir1 = score1 >= thr1 ? 1 : -1
dir2 = score2 >= thr2 ? 1 : -1
dir3 = score3 >= thr3 ? 1 : -1
conf_long = dir1 == 1 and dir2 == 1 and dir3 == 1
conf_short = dir1 == -1 and dir2 == -1 and dir3 == -1
// =========================
// 两步法:收盘“武装” + 下一根/后续“延续触发”
// =========================
var bool armLong = false
var float armLongPx = na
var int armLongUntil = na
var bool armShort = false
var float armShortPx = na
var int armShortUntil = na
if barstate.isconfirmed
if conf_long
armLong := true
armLongPx := close
armLongUntil := bar_index + armBars
if conf_short
armShort := true
armShortPx := close
armShortUntil := bar_index + armBars
longTrigPrice = armLong ? armLongPx * (1 + bufferPct/100.0) : na
shortTrigPrice = armShort ? armShortPx * (1 - bufferPct/100.0) : na
triggerLong = useTwoStep ? (armLong and high >= longTrigPrice) : (barstate.isconfirmed and conf_long)
triggerShort = useTwoStep ? (armShort and low <= shortTrigPrice) : (barstate.isconfirmed and conf_short)
// 触发后立刻卸载武装;超时未触发亦卸载
if triggerLong
armLong := false
if triggerShort
armShort := false
if bar_index > armLongUntil
armLong := false
if bar_index > armShortUntil
armShort := false
// =========================
// 发单用价位(在触发时会被使用)
// =========================
float entryL = tickRound(useTwoStep ? longTrigPrice : close)
float entryS = tickRound(useTwoStep ? shortTrigPrice : close)
float tpL = tickRound(entryL * (1 + tpPct/100.0))
float slL = tickRound(entryL * (1 - slPct/100.0))
float tpS = tickRound(entryS * (1 - tpPct/100.0))
float slS = tickRound(entryS * (1 + slPct/100.0))
// —— 展示标签直接使用上面算好的 entryL/entryS/tpL/slL/tpS/slS
if showTriggerLabel and barstate.isconfirmed
if triggerLong
_txt = "LONG Entry: " + sPrice(entryL) + " TP: " + sPrice(tpL) + " SL: " + sPrice(slL) + " EstQty: " + sQty(usdtPerTrade/entryL)
label.new(bar_index, low, text=_txt, style=label.style_label_up, textcolor=color.white, color=color.new(color.lime, 0))
if triggerShort
_txt = "SHORT Entry: " + sPrice(entryS) + " TP: " + sPrice(tpS) + " SL: " + sPrice(slS) + " EstQty: " + sQty(usdtPerTrade/entryS)
label.new(bar_index, high, text=_txt, style=label.style_label_down, textcolor=color.white, color=color.new(color.red, 0))
// ============ 构造 JSON(按方向用不同 signal 名,所有数值写入) ============
buildMsg(_side, _entry, _tp, _sl) =>
_sig = _side == "buy" ? "open_long" : "open_short"
_token = attachToken ? ',"token":"' + (_side == "buy" ? longToken : shortToken) + '"' : ""
_msg = '{"signal":"' + _sig + '"'
_msg := _msg + ',"side":"' + _side + '"'
_msg := _msg + ',"symbol":"' + cleanSymbol() + '"'
_msg := _msg + ',"order_type":"market"'
_msg := _msg + ',"usdt_per_trade":' + str.tostring(usdtPerTrade)
_msg := _msg + ',"entry":' + sPrice(_entry)
_msg := _msg + ',"tp":' + sPrice(_tp)
_msg := _msg + ',"sl":' + sPrice(_sl)
_msg := _msg + _token + "}"
_msg
msgLong = buildMsg("buy", entryL, tpL, slL)
msgShort = buildMsg("sell", entryS, tpS, slS)
// =========================
// 报警 & 发单(在 TradingView 里选择 Any alert() function call;Webhook 填机器人 URL;Message 留空)
// =========================
alertcondition(triggerLong, title="多仓开仓(…)", message="LONG")
alertcondition(triggerShort, title="空仓开仓(…)", message="SHORT")
if barstate.isconfirmed
if triggerLong
alert(message = msgLong, freq = alert.freq_once_per_bar_close)
if triggerShort
alert(message = msgShort, freq = alert.freq_once_per_bar_close)
// =========================
// 可视化:形态+触发线
// =========================
plotshape(showShapes and conf_long and barstate.isconfirmed, title="收盘-多武装", style=shape.triangleup, color=color.new(color.green, 0), size=size.tiny, text="ARM L", location=location.belowbar)
plotshape(showShapes and conf_short and barstate.isconfirmed, title="收盘-空武装", style=shape.triangledown, color=color.new(color.red, 0), size=size.tiny, text="ARM S", location=location.abovebar)
plotshape(showShapes and triggerLong, title="触发-开多", style=shape.labelup, color=color.new(color.lime, 0), text="▶ LONG", location=location.belowbar, size=size.tiny)
plotshape(showShapes and triggerShort, title="触发-开空", style=shape.labeldown, color=color.new(color.maroon,0), text="▶ SHORT", location=location.abovebar, size=size.tiny)
plot(useTwoStep and armLong ? armLongPx : na, "武装价-L", color=color.new(color.green, 70), style=plot.style_circles, linewidth=1)
plot(useTwoStep and armShort ? armShortPx : na, "武装价-S", color=color.new(color.red, 70), style=plot.style_circles, linewidth=1)
plot(useTwoStep ? longTrigPrice : na, "触发线-L", color=color.new(color.lime, 0), style=plot.style_linebr, linewidth=1)
plot(useTwoStep ? shortTrigPrice : na, "触发线-S", color=color.new(color.maroon, 0), style=plot.style_linebr, linewidth=1)
// =========================
// 可视化:触发时弹出【入场/TP/SL/Qty】标签(仅展示用)
// =========================
if showTriggerLabel and barstate.isconfirmed
if triggerLong
_qtyL = usdtPerTrade > 0 and entryL > 0 ? (usdtPerTrade / entryL) : na
_txtL = "LONG Entry: " + sPrice(entryL) + " TP: " + sPrice(tpL) + " SL: " + sPrice(slL) + " EstQty: " + sQty(_qtyL)
label.new(bar_index, low, text=_txtL, style=label.style_label_up, textcolor=color.white, color=color.new(color.lime, 0))
if triggerShort
_qtyS = usdtPerTrade > 0 and entryS > 0 ? (usdtPerTrade / entryS) : na
_txtS = "SHORT Entry: " + sPrice(entryS) + " TP: " + sPrice(tpS) + " SL: " + sPrice(slS) + " EstQty: " + sQty(_qtyS)
label.new(bar_index, high, text=_txtS, style=label.style_label_down, textcolor=color.white, color=color.new(color.red, 0))
FVG Donchian Channel strategy30min FVG + Donchian Channel strategy
buy sell by 30min fvg
and stoploss , take profit by Donchian Channel
Run the strategy on the 1min timeframe!
Bullish & Bearish Reversal Pattern with Sequential Bars20 Bollinger Bands and custom Stochasti_MTM Setup
Both long and short reversal signals.
Triple EMA (5, 8, 13) + Confirmed Alerts with SoundThis indicator uses three Exponential Moving Averages (EMA 5, 8, and 13) to generate buy and sell signals when the EMAs are properly aligned and not touching. Signals are confirmed on candle close and can trigger customizable sound alerts directly from the TradingView alert panel.
3C FractalsIts based on Williams Fractals indicator, but instead of using 5 candles to mark the fractals, it uses only 3.
Smart Money Concept: FVG Block Filter Smart Money Concept: FVG Block Filter (FVG Block Range vs N Range) with Candle Highlighter
Summary:
Smart Money Concept (SMC): An advanced indicator designed to visualize and filter Fair Value Gaps (FVG) blocks based on their size (Range) compared to the preceding N Range candle movement. It also includes a customizable Candle Highlighter function that marks the specific candle responsible for creating the FVG. The indicator allows full color customization for both blocks and the highlighter, and features clean, label-free charts by default.
Key Features:
FVG Block Detection: Automatically identifies and groups sequential FVG imbalances to form consolidated FVG blocks.
FVG Block Filtering (N Range): Filters blocks based on a user-defined rule, comparing the block's size (Range) to the range of the preceding N candles (e.g., requiring the FVG block to be larger than the range of the previous 6 candles).
Customizable Candle Highlighter: Marks the central candle (B) within the FVG structure (A-B-C) to highlight the source of the price imbalance. Highlighter colors are fully adjustable via inputs.
Visualization Control: Labels are turned OFF by default to keep the chart clean but can be easily enabled via the indicator settings.
Full Color Customization: Allows independent customization of Bullish and Bearish FVG Block colors, Block Transparency, and Bullish/Bearish Highlighter colors.
Keywords:
Smart Money Concept, SMC, Fair Value Gap, FVG, Imbalance, Block Filter, Candle Highlighter, Range.






















