多维度趋势共振策略

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个指标齐上阵!

你知道吗?这个策略就像是给你的交易配了一个超级智能的AI助手!它同时监控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")


相关推荐