다차원적 트렌드 공명 전략

EMA RSI MACD ATR BB STOCH MFI MTF
생성 날짜: 2025-11-12 17:01:17 마지막으로 수정됨: 2025-11-12 17:01:17
복사: 0 클릭수: 209
avatar of ianzeng123 ianzeng123
2
집중하다
319
수행원

다차원적 트렌드 공명 전략 다차원적 트렌드 공명 전략

젠장, 이건 신세안 전략이냐? 20개의 지표가 맞대결에 나섰어요!

이 전략은 당신의 거래에 초지능 인공지능 보조자를 배치하는 것과 같습니다. 그것은 20개의 다른 시장 신호를 동시에 모니터링하고, 대부분의 지표가 “좋아요”라고 말할 때만 거래 제안을합니다. 마치 집을 사는데 지점, 가격, 주택형, 교통 등이 있어야 모든 부분이 만족할 때만 거래하는 것과 같습니다.

이것은 일반적인 단일 지표 전략이 아니라 “다차원 공명 시스템”입니다. 상상해보세요. 만약 한 명의 친구가 어떤 주식을 잘한다고 말한다면, 당신은 반심할 수도 있지만, 만약 20명의 전문적인 친구들이 모두 잘한다고 말한다면, 당신은 더 확신할 수 있을까요?

코어 무기고의 폭로

트렌드 인식 🗡️

  • 빠른 EMA ((5) vs 느린 EMA ((13): 단기 트렌드 전환을 잡기
  • 트렌드 필터 EMA ((34): 중기 방향 확인
  • 주요 트렌드 EMA ((89)): 큰 방향에 집중하고 작은 변동에 사로잡히지 말라

다중 시간 프레임 분석 ⏰ 이 기능은 정말 멋집니다! 전략은 1시간과 4시간의 트렌드를 동시에 볼 수 있습니다. 마치 여러분이 앞의 도로 상황을 보고 운전하는 것과 마찬가지로 전체적인 경로를 탐색하는 것과 같습니다. “작은 시간 프레임이 상승하고, 큰 시간 프레임이 하락”이라는 곤란한 상황을 피합니다!

지능형 위험 관리 🛡️

  • 동적 포지션 조정: 시장의 변동에 따라 베팅 크기를 자동으로 조정
  • 을 분배하라: 탐욕하지 말고, 행운을 보며 을 가져라.
  • 이동 상쇄: 이익 보호 신전

🔥 20가지 보험 거래 논리

여러 신호를 만드는 것은 다음과 같습니다:

  • 상승 추세: 모든 EMA가 다목적
  • RSI, MACD, 무작위 RSI 모두 가동이 충분합니다.
  • 성량 합동: 체중을 늘리는 것이 진짜 중독입니다.
  • 시장 구조는 건강합니다.
  • 유동성 지원: 핵심 지원이 완료되었습니다.

은 신호는 정반대입니다!

️: 전략은 “블린 벨트 압축 검출”입니다. 시장이 너무 평온할 때 거래를 중단하고, 흔들리는 시장에서 회전하는 것을 피합니다!

수익을 극대화하기 위한 비밀 무기

을 제거하는 전략 📈

  • 첫 번째 정지: 2배의 리스크 수익으로 30%의 포지션을 매각한다
  • 두 번째 하락: 3.5%가 되면 40%를 매각한다.
  • 잔여 포지션: 이동식 상쇄보호로 수익을 다

지능형 상쇄 업그레이드 🎯 이윤의 2.5배가 되면, 정지 손실은 자동으로 비용으로 옮겨져 거래가 최소 손실을 입지 않도록 보장됩니다. 이것은 당신의 이윤에 보험을 구입하는 것과 같습니다!

동적 추적 중지 🏃‍♂️ 이윤이 어느 정도에 도달하면, 스톱로스는 그림자처럼 가격에 따라가며, 이윤을 보호하면서도, 매출을 유지하도록 합니다.

, 왜 이 전략이 바보같았을까?

  1. 전방위기술분석, 재무관리, 위험관리 등이 있습니다.
  2. 스마트 필터20개의 조건부 필터링이 성공률을 크게 높여줍니다.
  3. 매우 적응력이 좋다다중 시간 프레임 분석, 다양한 시장 환경에 적합함
  4. 인간적인 디자인자동화 실행, 감정적 거래를 피하기

이 전략은 경험 많은 거래팀을 코드에 넣은 것과 같습니다. 그들은 24시간 내내 당신을 위해 최고의 거래 기회를 찾고 있습니다.

전략 소스 코드
/*backtest
start: 2024-11-12 00:00:00
end: 2025-11-10 08:00:00
period: 1d
basePeriod: 1d
exchanges: [{"eid":"Futures_Binance","currency":"BTC_USDT"}]
*/

//@version=6
strategy('Amir Mohammad Lor ', shorttitle='MPF', overlay=true, default_qty_type=strategy.percent_of_equity, default_qty_value=15, pyramiding=0, max_bars_back=1000)

// === INPUTS ===
// Core Indicators
ema_fast_len = input.int(5, 'EMA Fast Length', minval=1, group="Core Indicators")
ema_slow_len = input.int(13, 'EMA Slow Length', minval=1, group="Core Indicators")
ema_trend_len = input.int(34, 'EMA Trend Filter', minval=1, group="Core Indicators")
ema_major_len = input.int(89, 'EMA Major Trend', minval=1, group="Core Indicators")
rsi_len = input.int(21, 'RSI Length', minval=1, group="Core Indicators")

// Multi-Timeframe Analysis
use_mtf = input.bool(true, 'Use Multi-Timeframe Analysis', group="Multi-Timeframe")
htf1 = input.timeframe("60", "1H Timeframe", group="Multi-Timeframe")
htf2 = input.timeframe("240", "4H Timeframe", group="Multi-Timeframe")

// Advanced Risk Management
initial_rr = input.float(4.0, 'Initial Risk Reward Ratio', minval=2.0, step=0.5, group="Risk Management")
atr_mult_entry = input.float(0.8, 'ATR Entry Stop Multiplier', minval=0.3, step=0.1, group="Risk Management")
use_dynamic_sizing = input.bool(true, 'Use Dynamic Position Sizing', group="Risk Management")
max_risk_per_trade = input.float(1.5, 'Max Risk Per Trade %', minval=0.5, step=0.1, group="Risk Management")

// Profit Maximization
use_partial_tp = input.bool(true, 'Use Partial Take Profits', group="Profit Management")
tp1_percent = input.float(30.0, 'First TP % of Position', minval=10, maxval=50, step=5, group="Profit Management")
tp1_rr = input.float(2.0, 'First TP R:R Ratio', minval=1.0, step=0.25, group="Profit Management")
tp2_percent = input.float(40.0, 'Second TP % of Position', minval=10, maxval=50, step=5, group="Profit Management")
tp2_rr = input.float(3.5, 'Second TP R:R Ratio', minval=2.0, step=0.25, group="Profit Management")
use_breakeven = input.bool(true, 'Move to Breakeven After TP1', group="Profit Management")
use_profit_trail = input.bool(true, 'Use Profit Trailing', group="Profit Management")
trail_activation = input.float(2.5, 'Trail Activation R:R', minval=1.5, step=0.25, group="Profit Management")
trail_distance = input.float(1.0, 'Trail Distance ATR', minval=0.5, step=0.1, group="Profit Management")

// Market Structure
use_market_structure = input.bool(true, 'Use Market Structure Analysis', group="Market Structure")
swing_length = input.int(20, 'Swing Length', minval=5, group="Market Structure")
use_liquidity_zones = input.bool(true, 'Use Liquidity Zone Detection', group="Market Structure")

// Trend Strength Filters
min_trend_strength = input.float(0.6, 'Minimum Trend Strength', minval=0.3, maxval=1.0, step=0.1, group="Filters")
use_momentum_filter = input.bool(true, 'Use Momentum Confluence', group="Filters")
min_volume_ratio = input.float(1.8, 'Minimum Volume Ratio', minval=1.0, step=0.1, group="Filters")

// Alert Settings
enable_sound_alerts = input.bool(true, 'Enable Sound Alerts', group="Alert Settings")
enable_popup_alerts = input.bool(true, 'Enable Popup Alerts', group="Alert Settings")
enable_email_alerts = input.bool(false, 'Enable Email Alerts', group="Alert Settings")
alert_frequency = input.string("Once Per Bar Close", "Alert Frequency", options=["All", "Once Per Bar", "Once Per Bar Close"], group="Alert Settings")

// === INDICATORS ===
// EMAs
ema_fast = ta.ema(close, ema_fast_len)
ema_slow = ta.ema(close, ema_slow_len)
ema_trend = ta.ema(close, ema_trend_len)
ema_major = ta.ema(close, ema_major_len)

// Crossover calculations
fast_under_slow = ta.crossunder(ema_fast, ema_slow)
fast_over_slow = ta.crossover(ema_fast, ema_slow)

// RSI with divergence detection
rsi = ta.rsi(close, rsi_len)
rsi_ma = ta.sma(rsi, 5)

// ATR for dynamic stops
atr = ta.atr(14)
atr_ma = ta.sma(atr, 14)

// Volume analysis
volume_ma = ta.sma(volume, 20)
volume_ratio = volume / volume_ma

// Market Structure Analysis
swing_high = ta.pivothigh(high, swing_length, swing_length)
swing_low = ta.pivotlow(low, swing_length, swing_length)

var float[] swing_highs = array.new<float>()
var float[] swing_lows = array.new<float>()

if not na(swing_high)
    array.unshift(swing_highs, swing_high)
    if array.size(swing_highs) > 5
        array.pop(swing_highs)

if not na(swing_low)
    array.unshift(swing_lows, swing_low)
    if array.size(swing_lows) > 5
        array.pop(swing_lows)

// Trend strength calculation
trend_strength = math.abs(ema_fast - ema_major) / (ema_major * 0.01)
trend_strength_norm = math.min(trend_strength / 2, 1.0)

// Multi-timeframe trend analysis
htf1_trend = request.security(syminfo.tickerid, htf1, ema_fast > ema_slow and ema_slow > ema_trend, barmerge.gaps_on)
htf1_trend_bear = request.security(syminfo.tickerid, htf1, ema_fast < ema_slow and ema_slow < ema_trend, barmerge.gaps_on)
htf2_trend = request.security(syminfo.tickerid, htf2, ema_fast > ema_trend and close > ema_major, barmerge.gaps_on)
htf2_trend_bear = request.security(syminfo.tickerid, htf2, ema_fast < ema_trend and close < ema_major, barmerge.gaps_on)

// Advanced momentum indicators
macd_line = ta.ema(close, 12) - ta.ema(close, 26)
macd_signal = ta.ema(macd_line, 9)
macd_hist = macd_line - macd_signal

// Bollinger Bands with squeeze detection
bb_length = 20
bb_mult = 2.0
[bb_upper, bb_middle, bb_lower] = ta.bb(close, bb_length, bb_mult)
bb_width = (bb_upper - bb_lower) / bb_middle
bb_squeeze = bb_width < ta.percentile_linear_interpolation(bb_width, 50, 20)

// Stochastic RSI
stoch_rsi = ta.stoch(rsi, rsi, rsi, 14)

// Money Flow Index
mfi = ta.mfi(hlc3, 14)

// Liquidity zones detection
var float liquidity_high = na
var float liquidity_low = na
var int liq_high_touches = 0
var int liq_low_touches = 0

if array.size(swing_highs) >= 2
    recent_high = array.get(swing_highs, 0)
    prev_high = array.get(swing_highs, 1)
    if math.abs(recent_high - prev_high) / recent_high < 0.002
        liquidity_high := recent_high
        liq_high_touches := 2

if array.size(swing_lows) >= 2
    recent_low = array.get(swing_lows, 0)
    prev_low = array.get(swing_lows, 1)
    if math.abs(recent_low - prev_low) / recent_low < 0.002
        liquidity_low := recent_low
        liq_low_touches := 2

// Advanced trend detection
uptrend_structure = array.size(swing_lows) >= 2 ? array.get(swing_lows, 0) > array.get(swing_lows, 1) : false
downtrend_structure = array.size(swing_highs) >= 2 ? array.get(swing_highs, 0) < array.get(swing_highs, 1) : false

// === CONFLUENCE SYSTEM ===
// LONG Setup Confluences (20 factors)
long_c1 = ema_fast > ema_slow and ema_slow > ema_trend and ema_trend > ema_major
long_c2 = close > ema_fast and close > ema_slow
long_c3 = rsi > 50 and rsi < 75 and rsi > rsi[1]
long_c4 = macd_line > macd_signal and macd_hist > macd_hist[1]
long_c5 = volume_ratio > min_volume_ratio
long_c6 = not use_mtf or (htf1_trend and htf2_trend)
long_c7 = trend_strength_norm > min_trend_strength
long_c8 = stoch_rsi > 20 and stoch_rsi < 80
long_c9 = mfi > 40 and mfi < 80 and mfi > mfi[1]
long_c10 = not bb_squeeze
long_c11 = close > bb_middle
long_c12 = not use_market_structure or uptrend_structure
long_c13 = fast_over_slow or (ema_fast > ema_slow and ema_fast[1] <= ema_slow[1])
long_c14 = atr > atr_ma * 0.8
long_c15 = close > high[1] or close > open
long_c16 = not use_liquidity_zones or (not na(liquidity_low) and close > liquidity_low)
long_c17 = ta.change(close, 3) > 0
long_c18 = hl2 > ema_trend
long_c19 = ta.roc(close, 5) > 0
long_c20 = close > ta.highest(close, 3)[1]

long_confluences = (long_c1 ? 1 : 0) + (long_c2 ? 1 : 0) + (long_c3 ? 1 : 0) + 
     (long_c4 ? 1 : 0) + (long_c5 ? 1 : 0) + (long_c6 ? 1 : 0) + 
     (long_c7 ? 1 : 0) + (long_c8 ? 1 : 0) + (long_c9 ? 1 : 0) + 
     (long_c10 ? 1 : 0) + (long_c11 ? 1 : 0) + (long_c12 ? 1 : 0) + 
     (long_c13 ? 1 : 0) + (long_c14 ? 1 : 0) + (long_c15 ? 1 : 0) + 
     (long_c16 ? 1 : 0) + (long_c17 ? 1 : 0) + (long_c18 ? 1 : 0) + 
     (long_c19 ? 1 : 0) + (long_c20 ? 1 : 0)

// SHORT Setup Confluences (20 factors)
short_c1 = ema_fast < ema_slow and ema_slow < ema_trend and ema_trend < ema_major
short_c2 = close < ema_fast and close < ema_slow
short_c3 = rsi < 50 and rsi > 25 and rsi < rsi[1]
short_c4 = macd_line < macd_signal and macd_hist < macd_hist[1]
short_c5 = volume_ratio > min_volume_ratio
short_c6 = not use_mtf or (htf1_trend_bear and htf2_trend_bear)
short_c7 = trend_strength_norm > min_trend_strength
short_c8 = stoch_rsi < 80 and stoch_rsi > 20
short_c9 = mfi < 60 and mfi > 20 and mfi < mfi[1]
short_c10 = not bb_squeeze
short_c11 = close < bb_middle
short_c12 = not use_market_structure or downtrend_structure
short_c13 = fast_under_slow or (ema_fast < ema_slow and ema_fast[1] >= ema_slow[1])
short_c14 = atr > atr_ma * 0.8
short_c15 = close < low[1] or close < open
short_c16 = not use_liquidity_zones or (not na(liquidity_high) and close < liquidity_high)
short_c17 = ta.change(close, 3) < 0
short_c18 = hl2 < ema_trend
short_c19 = ta.roc(close, 5) < 0
short_c20 = close < ta.lowest(close, 3)[1]

short_confluences = (short_c1 ? 1 : 0) + (short_c2 ? 1 : 0) + (short_c3 ? 1 : 0) + 
     (short_c4 ? 1 : 0) + (short_c5 ? 1 : 0) + (short_c6 ? 1 : 0) + 
     (short_c7 ? 1 : 0) + (short_c8 ? 1 : 0) + (short_c9 ? 1 : 0) + 
     (short_c10 ? 1 : 0) + (short_c11 ? 1 : 0) + (short_c12 ? 1 : 0) + 
     (short_c13 ? 1 : 0) + (short_c14 ? 1 : 0) + (short_c15 ? 1 : 0) + 
     (short_c16 ? 1 : 0) + (short_c17 ? 1 : 0) + (short_c18 ? 1 : 0) + 
     (short_c19 ? 1 : 0) + (short_c20 ? 1 : 0)

// High probability entry requirements
min_confluences_required = 14
long_entry = long_confluences >= min_confluences_required
short_entry = short_confluences >= min_confluences_required

// Signal strength classification
long_strength = long_confluences >= 18 ? "ULTRA STRONG" : long_confluences >= 16 ? "VERY STRONG" : long_confluences >= 14 ? "STRONG" : "WEAK"
short_strength = short_confluences >= 18 ? "ULTRA STRONG" : short_confluences >= 16 ? "VERY STRONG" : short_confluences >= 14 ? "STRONG" : "WEAK"

// === DYNAMIC POSITION SIZING ===
confluence_multiplier = long_entry ? 
     (long_confluences - min_confluences_required + 1) * 0.2 : 
     short_entry ? 
     (short_confluences - min_confluences_required + 1) * 0.2 : 
     1.0

volatility_factor = atr / close
normalized_vol = math.min(volatility_factor / 0.02, 2.0)
vol_multiplier = 1.0 / math.max(normalized_vol, 0.5)

dynamic_size = use_dynamic_sizing ? confluence_multiplier * vol_multiplier : 1.0
position_size = math.min(dynamic_size * 15, 25)

// === POSITION MANAGEMENT VARIABLES ===
var float entry_price = na
var float initial_stop = na
var float current_stop = na
var float tp1_price = na
var float tp2_price = na
var float tp3_price = na
var bool tp1_hit = false
var bool tp2_hit = false
var bool breakeven_moved = false
var string position_direction = na
var int bars_in_position = 0
var float max_profit = 0.0
var float trail_trigger_price = na
var float unrealized_pnl = 0.0

// Alert trigger variables
var bool long_entry_triggered = false
var bool short_entry_triggered = false
var bool tp1_alert_sent = false
var bool tp2_alert_sent = false
var bool breakeven_alert_sent = false
var bool trail_alert_sent = false

// === ENTRY LOGIC ===
if long_entry and strategy.position_size == 0
    entry_price := close
    initial_stop := close - (atr * atr_mult_entry)
    current_stop := initial_stop
    tp1_price := close + ((close - initial_stop) * tp1_rr)
    tp2_price := close + ((close - initial_stop) * tp2_rr)
    tp3_price := close + ((close - initial_stop) * initial_rr)
    trail_trigger_price := close + ((close - initial_stop) * trail_activation)
    position_direction := "LONG"
    tp1_hit := false
    tp2_hit := false
    breakeven_moved := false
    bars_in_position := 0
    max_profit := 0.0
    long_entry_triggered := true
    tp1_alert_sent := false
    tp2_alert_sent := false
    breakeven_alert_sent := false
    trail_alert_sent := false
    
    if use_dynamic_sizing
        strategy.entry("LONG", strategy.long, qty=position_size, comment="L:" + str.tostring(long_confluences))
    else
        strategy.entry("LONG", strategy.long, comment="L:" + str.tostring(long_confluences))

if short_entry and strategy.position_size == 0
    entry_price := close
    initial_stop := close + (atr * atr_mult_entry)
    current_stop := initial_stop
    tp1_price := close - ((initial_stop - close) * tp1_rr)
    tp2_price := close - ((initial_stop - close) * tp2_rr)
    tp3_price := close - ((initial_stop - close) * initial_rr)
    trail_trigger_price := close - ((initial_stop - close) * trail_activation)
    position_direction := "SHORT"
    tp1_hit := false
    tp2_hit := false
    breakeven_moved := false
    bars_in_position := 0
    max_profit := 0.0
    short_entry_triggered := true
    tp1_alert_sent := false
    tp2_alert_sent := false
    breakeven_alert_sent := false
    trail_alert_sent := false
    
    if use_dynamic_sizing
        strategy.entry("SHORT", strategy.short, qty=position_size, comment="S:" + str.tostring(short_confluences))
    else
        strategy.entry("SHORT", strategy.short, comment="S:" + str.tostring(short_confluences))

// === POSITION MANAGEMENT ===
if strategy.position_size != 0
    bars_in_position += 1
    
    if position_direction == "LONG"
        current_profit = (close - entry_price) / entry_price
        max_profit := math.max(max_profit, current_profit)
        unrealized_pnl := (close - entry_price) * math.abs(strategy.position_size)
        
        // Partial take profits
        if use_partial_tp and not tp1_hit and close >= tp1_price
            strategy.close("LONG", qty_percent=tp1_percent, comment="TP1")
            tp1_hit := true
            tp1_alert_sent := true
            
        if use_partial_tp and not tp2_hit and close >= tp2_price and tp1_hit
            strategy.close("LONG", qty_percent=tp2_percent, comment="TP2")
            tp2_hit := true
            tp2_alert_sent := true
            
        // Move to breakeven after TP1
        if use_breakeven and tp1_hit and not breakeven_moved and close >= tp1_price
            current_stop := entry_price + (atr * 0.2)
            breakeven_moved := true
            breakeven_alert_sent := true
            
        // Profit trailing
        if use_profit_trail and close >= trail_trigger_price
            trail_stop = close - (atr * trail_distance)
            if trail_stop > current_stop
                current_stop := trail_stop
                trail_alert_sent := true
                
    else if position_direction == "SHORT"
        current_profit = (entry_price - close) / entry_price
        max_profit := math.max(max_profit, current_profit)
        unrealized_pnl := (entry_price - close) * math.abs(strategy.position_size)
        
        // Partial take profits
        if use_partial_tp and not tp1_hit and close <= tp1_price
            strategy.close("SHORT", qty_percent=tp1_percent, comment="TP1")
            tp1_hit := true
            tp1_alert_sent := true
            
        if use_partial_tp and not tp2_hit and close <= tp2_price and tp1_hit
            strategy.close("SHORT", qty_percent=tp2_percent, comment="TP2")
            tp2_hit := true
            tp2_alert_sent := true
            
        // Move to breakeven after TP1
        if use_breakeven and tp1_hit and not breakeven_moved and close <= tp1_price
            current_stop := entry_price - (atr * 0.2)
            breakeven_moved := true
            breakeven_alert_sent := true
            
        // Profit trailing
        if use_profit_trail and close <= trail_trigger_price
            trail_stop = close + (atr * trail_distance)
            if trail_stop < current_stop
                current_stop := trail_stop
                trail_alert_sent := true

// Exit conditions
var bool stop_loss_hit = false
var bool final_tp_hit = false
var bool trend_reversal_exit = false
var bool time_exit = false

// === EXIT LOGIC ===
if strategy.position_size > 0
    if close <= current_stop
        strategy.close_all(comment="SL")
        stop_loss_hit := true
        entry_price := na
        position_direction := na
    else if close >= tp3_price
        strategy.close_all(comment="TP3")
        final_tp_hit := true
        entry_price := na
        position_direction := na
    else if fast_under_slow and breakeven_moved
        strategy.close_all(comment="Trend Rev")
        trend_reversal_exit := true
        entry_price := na
        position_direction := na
    else if bars_in_position >= 100
        strategy.close_all(comment="Time Exit")
        time_exit := true
        entry_price := na
        position_direction := na

if strategy.position_size < 0
    if close >= current_stop
        strategy.close_all(comment="SL")
        stop_loss_hit := true
        entry_price := na
        position_direction := na
    else if close <= tp3_price
        strategy.close_all(comment="TP3")
        final_tp_hit := true
        entry_price := na
        position_direction := na
    else if fast_over_slow and breakeven_moved
        strategy.close_all(comment="Trend Rev")
        trend_reversal_exit := true
        entry_price := na
        position_direction := na
    else if bars_in_position >= 100
        strategy.close_all(comment="Time Exit")
        time_exit := true
        entry_price := na
        position_direction := na

// === PLOTTING ===
// EMAs
plot(ema_fast, color=color.lime, linewidth=2, title="EMA Fast")
plot(ema_slow, color=color.orange, linewidth=2, title="EMA Slow")
plot(ema_trend, color=color.blue, linewidth=2, title="EMA Trend")
plot(ema_major, color=color.purple, linewidth=3, title="EMA Major")

// Enhanced Entry signals with strength indication
plotshape(long_entry and long_confluences >= 18, style=shape.triangleup, location=location.belowbar, 
          color=color.new(color.lime, 0), size=size.large, title="ULTRA STRONG Long")
plotshape(long_entry and long_confluences >= 16 and long_confluences < 18, style=shape.triangleup, location=location.belowbar, 
          color=color.new(color.green, 20), size=size.normal, title="VERY STRONG Long")
plotshape(long_entry and long_confluences >= 14 and long_confluences < 16, style=shape.triangleup, location=location.belowbar, 
          color=color.new(color.green, 40), size=size.small, title="STRONG Long")

plotshape(short_entry and short_confluences >= 18, style=shape.triangledown, location=location.abovebar, 
          color=color.new(color.red, 0), size=size.large, title="ULTRA STRONG Short")
plotshape(short_entry and short_confluences >= 16 and short_confluences < 18, style=shape.triangledown, location=location.abovebar, 
          color=color.new(color.orange, 20), size=size.normal, title="VERY STRONG Short")
plotshape(short_entry and short_confluences >= 14 and short_confluences < 16, style=shape.triangledown, location=location.abovebar, 
          color=color.new(color.orange, 40), size=size.small, title="STRONG Short")

// Support and resistance
plot(liquidity_high, color=color.red, linewidth=2, style=plot.style_stepline, title="Liquidity High")
plot(liquidity_low, color=color.green, linewidth=2, style=plot.style_stepline, title="Liquidity Low")

// Position management levels
plot(strategy.position_size != 0 ? current_stop : na, color=color.red, linewidth=2, style=plot.style_linebr, title="Current Stop")
plot(strategy.position_size != 0 ? tp1_price : na, color=color.green, linewidth=1, style=plot.style_linebr, title="TP1")
plot(strategy.position_size != 0 ? tp2_price : na, color=color.green, linewidth=1, style=plot.style_linebr, title="TP2")
plot(strategy.position_size != 0 ? tp3_price : na, color=color.green, linewidth=2, style=plot.style_linebr, title="TP3")

// Background coloring
bgcolor(strategy.position_size > 0 ? color.new(color.green, 95) : strategy.position_size < 0 ? color.new(color.red, 95) : na, title="Position")