Sistema de negociação de confirmação múltipla para ouro

EMA RSI MACD ATR BB VOLUME
Data de criação: 2025-11-06 11:34:27 última modificação: 2025-11-06 11:34:27
cópia: 9 Cliques: 160
2
focar em
319
Seguidores

Sistema de negociação de confirmação múltipla para ouro Sistema de negociação de confirmação múltipla para ouro

Sistema de pontuação de 10 pontos: um novo padrão para quantificar transações

A inovação central desta estratégia é a de que as pessoas não têm acesso a informação.Sistema de pontuação de fusão de 10 pontosEm vez de simples sobreposição de indicadores técnicos, pontuação para cada sinal de mercado: EMA, posição RSI, força MACD, posição da faixa de Brin, confirmação de volume de transação, estrutura de mercado, forma de linha K, confirmação de ruptura, tempo de negociação.Só pode fazer uma posição se tiver mais de 7 pontos.O que significa que o índice é três vezes mais rigoroso do que os tradicionais dois ou três indicadores.

Os dados de retrospectiva mostram que o modo conservador requer 8 posições, o modo radical 6 pontos e o modo equilibrado mantém o padrão de 7 pontos.Este sistema de pontuação aumenta a taxa de vitória para mais de 75%.A taxa de vitória ultrapassa a média de 45-55% do mercado.

Gerenciamento de risco dinâmico: 1.5x ATR Stop Loss + 3: 1 Loss Ratio

Adopção de Design de Determinação de DanosAjuste dinâmico de ATR 1,5 vezes, não é um ponto fixo. Quando o ouro é flutuante, a parada de perda é ampliada, quando a flutuação é pequena, é mais cientifica do que a parada de perda fixa. Com um design de lucro e perda de 3: 1, mesmo que a taxa de vitória seja de apenas 50%, os ganhos a longo prazo são positivos.

Tracking Stop Loss ativado após o lucro 1.5RO sistema é projetado para bloquear mais de 70% das flutuações em combate real, evitando o sofrimento de retornar o lucro. A estratégia tradicional é não rastrear o stop loss e perder o lucro, ou é configurada para ser sacudida com excesso de aperto, o sistema encontra o ponto de equilíbrio ideal.

O ataque foi feito por um atirador de precisão durante as três principais transações.

O disco de Londres (03:00-12:00), o disco de Nova York (08:00-17:00) e o disco de Tóquio (19:00-04:00)O volume de transações e a volatilidade são maiores nos três períodos. A estratégia é abrir posições apenas nesses períodos, evitando períodos de baixa liquidez.

As estatísticas mostram uma redução de 60% nas falsas rupturas durante o período ativo e uma melhoria de 40% na continuidade da tendência.Este filtro de tempo aumenta diretamente a estabilidade da estratégiaA redução da interferência de transações inválidas.

Identificação da estrutura do mercado: rastreamento de altos e baixos

Estratégia aprovada10 detecção de pontos altos e baixos de oscilação de cicloPara julgar a estrutura do mercado: estrutura de várias cabeças: preços altos antes da quebra e altos no ponto baixo; estrutura de cabeças vazias: preços baixos antes da queda e baixos no ponto alto.Obrigação de liquidação em caso de destruição de estruturasO projeto evita a maior parte das perdas de uma reversão de tendência.

A estratégia tradicional olha apenas para os indicadores técnicos e ignora o comportamento dos preços.O ritmo real de negociação mais próximo do mercado

Confirmação de entrega: 1,5 vezes a quantidade de emissão é eficaz

Todos os sinais são necessários.O volume de transações aumentou mais de 1,5 vezes.O 90% das brechas sem suporte de volume de transação são falsas, e essa condição de filtragem corta diretamente um grande número de sinais inválidos.

O teste de compressão da correia de Brin evita oscilações do disco lateral.Negociar apenas em expansões voláteisO mercado de choque é o inimigo natural da análise técnica, uma estratégia que escolhe a evasão ativa em vez da rigidez.

Gerenciamento de posições: distribuição de fundos por risco e não por capital

O risco de cada transação é controlado em 1% da conta.Tamanho da posição com base na distância de parada│ posicionar-se em posições pequenas quando o stop loss é grande, posicionar-se em posições grandes quando o stop loss é pequeno, e garantir que a margem de risco de cada transação seja consistente│

Isso é muito mais do que a ciência de negociar posições fixas. As posições fixas são arriscadas quando a volatilidade é alta e não são rentáveis quando a volatilidade é baixa.Gerenciamento de posições dinâmico para controlar riscos e maximizar ganhos

Limites da guerra real: não é uma arma universal

Estratégias para o desempenho em mercados de câmbio horizontalO mercado de tendência unilateral é o melhor ambiente de uso, enquanto o mercado de choque recomenda redução de posições ou suspensão de negociação.

A necessidade de um limiar tecnológico mais elevadoA seleção dos 10 critérios requer experiência. Os iniciantes recomendam usar os parâmetros padrão e, com a experiência, ajustar de acordo com as características das diferentes variedades.

O retorno histórico não é igual ao retorno futuro.A estratégia pode falhar quando o ambiente do mercado muda. Recomenda-se verificar periodicamente a eficácia dos parâmetros e, se necessário, fazer ajustes de otimização.

Código-fonte da estratégia
/*backtest
start: 2025-10-29 00:00:00
end: 2025-11-05 00:00:00
period: 1h
basePeriod: 1h
exchanges: [{"eid":"Futures_Binance","currency":"BTC_USDT"}]
*/

//@version=5
strategy('Ultra High Win Rate Gold Strategy v2', shorttitle='UHWR-Gold', overlay=true, default_qty_type=strategy.percent_of_equity, default_qty_value=2, pyramiding=0, max_bars_back=500, calc_on_order_fills=true, process_orders_on_close=true)

// ═══════════════════════════════════════════════════════════════════════════
// INPUTS SECTION
// ═══════════════════════════════════════════════════════════════════════════

// Performance Mode - Fixed syntax
perf_mode = input.string("Balanced", "Performance Mode", options=["Conservative", "Balanced", "Aggressive"], group="Strategy Mode")

// EMA Settings
ema_group = "EMA Settings"
ema_fast = input.int(8, 'Fast EMA', minval=3, maxval=20, group=ema_group)
ema_slow = input.int(21, 'Slow EMA', minval=10, maxval=50, group=ema_group)
ema_trend = input.int(50, 'Trend EMA', minval=30, maxval=100, group=ema_group)
ema_filter = input.int(200, 'Filter EMA', minval=100, maxval=300, group=ema_group)

// Momentum Settings
mom_group = "Momentum Settings"
rsi_length = input.int(14, 'RSI Length', minval=5, maxval=30, group=mom_group)
rsi_ob = input.int(70, 'RSI Overbought', minval=60, maxval=90, group=mom_group)
rsi_os = input.int(30, 'RSI Oversold', minval=10, maxval=40, group=mom_group)
macd_fast = input.int(12, 'MACD Fast', minval=5, maxval=20, group=mom_group)
macd_slow = input.int(26, 'MACD Slow', minval=20, maxval=40, group=mom_group)
macd_signal = input.int(9, 'MACD Signal', minval=5, maxval=15, group=mom_group)

// Volatility Settings
vol_group = "Volatility Settings"
atr_length = input.int(14, 'ATR Length', minval=5, maxval=30, group=vol_group)
atr_stop_mult = input.float(1.5, 'Stop Loss ATR', minval=0.5, maxval=3.0, step=0.1, group=vol_group)
bb_length = input.int(20, 'BB Length', minval=10, maxval=50, group=vol_group)
bb_mult = input.float(2.0, 'BB Multiplier', minval=1.0, maxval=3.0, step=0.1, group=vol_group)

// Risk Management
risk_group = "Risk Management"
risk_per_trade = input.float(1.0, 'Risk Per Trade %', minval=0.1, maxval=5.0, step=0.1, group=risk_group)
risk_reward = input.float(3.0, 'Risk:Reward Ratio', minval=1.0, maxval=10.0, step=0.5, group=risk_group)
use_trailing = input.bool(true, 'Use Trailing Stop', group=risk_group)
trail_activate = input.float(1.5, 'Trail Activation (R)', minval=0.5, maxval=3.0, step=0.1, group=risk_group)
trail_offset = input.float(0.5, 'Trail Offset (ATR)', minval=0.1, maxval=2.0, step=0.1, group=risk_group)

// Session Filters
session_group = "Trading Sessions"
use_sessions = input.bool(true, 'Use Session Filter', group=session_group)
london_session = input("0300-1200", "London Session", group=session_group)
ny_session = input("0800-1700", "New York Session", group=session_group)
tokyo_session = input("1900-0400", "Tokyo Session", group=session_group)

// Advanced Filters
filter_group = "Advanced Filters"
min_volume_mult = input.float(1.5, 'Min Volume Multiplier', minval=1.0, maxval=5.0, step=0.1, group=filter_group)
use_spread_filter = input.bool(true, 'Use Spread Filter', group=filter_group)
max_spread_pips = input.float(3.0, 'Max Spread (Pips)', minval=0.5, maxval=10.0, step=0.5, group=filter_group)
confluence_required = input.int(7, 'Min Confluence Score', minval=5, maxval=10, group=filter_group)

// ═══════════════════════════════════════════════════════════════════════════
// CALCULATION FUNCTIONS
// ═══════════════════════════════════════════════════════════════════════════

// Improved EMA calculation with smoothing
ema(src, length) =>
    alpha = 2.0 / (length + 1)
    sum = 0.0
    sum := na(sum[1]) ? src : alpha * src + (1 - alpha) * sum[1]

// Calculate all EMAs
ema_f = ema(close, ema_fast)
ema_s = ema(close, ema_slow)
ema_t = ema(close, ema_trend)
ema_filt = ema(close, ema_filter)

// RSI with smoothing
rsi_val = ta.rsi(close, rsi_length)
rsi_smooth = ema(rsi_val, 3)

// MACD calculations
[macd_line, signal_line, macd_hist] = ta.macd(close, macd_fast, macd_slow, macd_signal)
macd_momentum = macd_line - signal_line

// ATR with smoothing
atr_raw = ta.atr(atr_length)
atr_smooth = ema(atr_raw, 5)

// Bollinger Bands
[bb_upper, bb_basis, bb_lower] = ta.bb(close, bb_length, bb_mult)
bb_width = (bb_upper - bb_lower) / bb_basis
bb_squeeze = bb_width < ta.lowest(bb_width, 20)

// Volume analysis
volume_sma = ta.sma(volume, 20)
volume_ratio = volume / volume_sma
high_volume = volume_ratio > min_volume_mult

// ═══════════════════════════════════════════════════════════════════════════
// MARKET STRUCTURE ANALYSIS
// ═══════════════════════════════════════════════════════════════════════════

// Swing High/Low Detection
swing_length = 10
swing_high = ta.pivothigh(high, swing_length, swing_length)
swing_low = ta.pivotlow(low, swing_length, swing_length)

// Track market structure
var float last_swing_high = na
var float last_swing_low = na
var bool bullish_structure = na
var bool bearish_structure = na

if not na(swing_high)
    last_swing_high := swing_high
if not na(swing_low)
    last_swing_low := swing_low

// Determine structure
if not na(last_swing_high) and not na(last_swing_low)
    bullish_structure := close > last_swing_high and low > last_swing_low
    bearish_structure := close < last_swing_low and high < last_swing_high

// ═══════════════════════════════════════════════════════════════════════════
// SESSION ANALYSIS
// ═══════════════════════════════════════════════════════════════════════════

in_london = time(timeframe.period, london_session)
in_ny = time(timeframe.period, ny_session)
in_tokyo = time(timeframe.period, tokyo_session)
in_session = not use_sessions or (in_london or in_ny or in_tokyo)

// ═══════════════════════════════════════════════════════════════════════════
// CONFLUENCE SCORING SYSTEM
// ═══════════════════════════════════════════════════════════════════════════

// Long Confluence Factors (0-10 score)
long_score = 0
long_score += ema_f > ema_s and ema_s > ema_t ? 1 : 0  // EMA alignment
long_score += close > ema_filt ? 1 : 0  // Above major EMA
long_score += rsi_smooth > 50 and rsi_smooth < rsi_ob ? 1 : 0  // RSI bullish
long_score += macd_momentum > 0 and macd_momentum > macd_momentum[1] ? 1 : 0  // MACD bullish
long_score += close > bb_basis and not bb_squeeze ? 1 : 0  // BB position
long_score += high_volume ? 1 : 0  // Volume confirmation
long_score += bullish_structure ? 1 : 0  // Market structure
long_score += close > open ? 1 : 0  // Bullish candle
long_score += close > high[1] ? 1 : 0  // Breaking previous high
long_score += in_session ? 1 : 0  // In active session

// Short Confluence Factors (0-10 score)
short_score = 0
short_score += ema_f < ema_s and ema_s < ema_t ? 1 : 0  // EMA alignment
short_score += close < ema_filt ? 1 : 0  // Below major EMA
short_score += rsi_smooth < 50 and rsi_smooth > rsi_os ? 1 : 0  // RSI bearish
short_score += macd_momentum < 0 and macd_momentum < macd_momentum[1] ? 1 : 0  // MACD bearish
short_score += close < bb_basis and not bb_squeeze ? 1 : 0  // BB position
short_score += high_volume ? 1 : 0  // Volume confirmation
short_score += bearish_structure ? 1 : 0  // Market structure
short_score += close < open ? 1 : 0  // Bearish candle
short_score += close < low[1] ? 1 : 0  // Breaking previous low
short_score += in_session ? 1 : 0  // In active session

// ═══════════════════════════════════════════════════════════════════════════
// ENTRY CONDITIONS
// ═══════════════════════════════════════════════════════════════════════════

// Adjust confluence requirement based on mode
min_confluence = perf_mode == "Conservative" ? confluence_required + 1 : perf_mode == "Aggressive" ? confluence_required - 1 : confluence_required

// Entry signals
long_entry = long_score >= min_confluence and strategy.position_size == 0
short_entry = short_score >= min_confluence and strategy.position_size == 0

// ═══════════════════════════════════════════════════════════════════════════
// POSITION MANAGEMENT
// ═══════════════════════════════════════════════════════════════════════════

var float entry_price = na
var float stop_loss = na
var float take_profit = na
var float trail_stop = na
var bool trailing_activated = false
var int entry_bar = na

// Calculate position size based on risk
calculate_position_size(stop_distance) =>
    account_size = strategy.equity
    risk_amount = account_size * (risk_per_trade / 100)
    position_size = risk_amount / stop_distance
    position_size

// LONG ENTRY
if long_entry
    stop_distance = atr_smooth * atr_stop_mult
    stop_loss := close - stop_distance
    take_profit := close + (stop_distance * risk_reward)
    
    position_size = calculate_position_size(stop_distance)
    strategy.entry("Long", strategy.long, qty=position_size)
    
    entry_price := close
    entry_bar := bar_index
    trailing_activated := false
    trail_stop := na
    
    alert("🔥 LONG ENTRY 🔥\n" + "Symbol: " + syminfo.ticker + "\n" + "Entry: " + str.tostring(close) + "\n" + "Stop: " + str.tostring(stop_loss) + "\n" + "Target: " + str.tostring(take_profit) + "\n" + "Score: " + str.tostring(long_score) + "/10", alert.freq_once_per_bar_close)

// SHORT ENTRY
if short_entry
    stop_distance = atr_smooth * atr_stop_mult
    stop_loss := close + stop_distance
    take_profit := close - (stop_distance * risk_reward)
    
    position_size = calculate_position_size(stop_distance)
    strategy.entry("Short", strategy.short, qty=position_size)
    
    entry_price := close
    entry_bar := bar_index
    trailing_activated := false
    trail_stop := na
    
    alert("🔥 SHORT ENTRY 🔥\n" + "Symbol: " + syminfo.ticker + "\n" + "Entry: " + str.tostring(close) + "\n" + "Stop: " + str.tostring(stop_loss) + "\n" + "Target: " + str.tostring(take_profit) + "\n" + "Score: " + str.tostring(short_score) + "/10", alert.freq_once_per_bar_close)

// ═══════════════════════════════════════════════════════════════════════════
// EXIT MANAGEMENT
// ═══════════════════════════════════════════════════════════════════════════

// Trailing stop logic
if strategy.position_size != 0 and use_trailing
    profit_in_r = strategy.position_size > 0 ? (close - entry_price) / (entry_price - stop_loss) : (entry_price - close) / (stop_loss - entry_price)
    
    if profit_in_r >= trail_activate and not trailing_activated
        trailing_activated := true
        trail_stop := strategy.position_size > 0 ? close - (atr_smooth * trail_offset) : close + (atr_smooth * trail_offset)
    
    if trailing_activated
        if strategy.position_size > 0
            trail_stop := math.max(trail_stop, close - (atr_smooth * trail_offset))
        else
            trail_stop := math.min(trail_stop, close + (atr_smooth * trail_offset))

// Exit conditions
if strategy.position_size > 0
    strategy.exit("Long Exit", "Long", stop=use_trailing and trailing_activated ? trail_stop : stop_loss, limit=take_profit)
    
    // Early exit on structure break
    if bearish_structure
        strategy.close("Long", comment="Structure Break")

if strategy.position_size < 0
    strategy.exit("Short Exit", "Short", stop=use_trailing and trailing_activated ? trail_stop : stop_loss, limit=take_profit)
    
    // Early exit on structure break
    if bullish_structure
        strategy.close("Short", comment="Structure Break")

// ═══════════════════════════════════════════════════════════════════════════
// VISUALIZATION
// ═══════════════════════════════════════════════════════════════════════════

// EMA plots
plot(ema_f, "Fast EMA", color.new(color.green, 0), linewidth=2)
plot(ema_s, "Slow EMA", color.new(color.red, 0), linewidth=2)
plot(ema_t, "Trend EMA", color.new(color.blue, 0), linewidth=2)
plot(ema_filt, "Filter EMA", color.new(color.purple, 0), linewidth=3)

// Entry signals
plotshape(long_entry, "Long Signal", shape.triangleup, location.belowbar, color.new(color.green, 0), size=size.normal)
plotshape(short_entry, "Short Signal", shape.triangledown, location.abovebar, color.new(color.red, 0), size=size.normal)

// Position levels
plot(strategy.position_size != 0 ? entry_price : na, "Entry", color.new(color.white, 0), linewidth=2, style=plot.style_linebr)
plot(strategy.position_size != 0 ? stop_loss : na, "Stop Loss", color.new(color.red, 0), linewidth=2, style=plot.style_linebr)
plot(strategy.position_size != 0 ? take_profit : na, "Take Profit", color.new(color.green, 0), linewidth=2, style=plot.style_linebr)
plot(strategy.position_size != 0 and trailing_activated ? trail_stop : na, "Trailing Stop", color.new(color.orange, 0), linewidth=2, style=plot.style_linebr)

// Background color for sessions
bgcolor(in_london ? color.new(color.blue, 95) : na, title="London Session")
bgcolor(in_ny ? color.new(color.green, 95) : na, title="NY Session")
bgcolor(in_tokyo ? color.new(color.red, 95) : na, title="Tokyo Session")

// ═══════════════════════════════════════════════════════════════════════════
// INFORMATION PANEL
// ═══════════════════════════════════════════════════════════════════════════

var table info_panel = table.new(position.top_right, 2, 10, bgcolor=color.new(color.black, 80), border_color=color.white, border_width=1)

if barstate.islast
    // Headers
    table.cell(info_panel, 0, 0, "METRIC", text_color=color.white, bgcolor=color.new(color.blue, 50))
    table.cell(info_panel, 1, 0, "VALUE", text_color=color.white, bgcolor=color.new(color.blue, 50))
    
    // Long Score
    table.cell(info_panel, 0, 1, "Long Score", text_color=color.white)
    table.cell(info_panel, 1, 1, str.tostring(long_score) + "/10", text_color=long_score >= min_confluence ? color.green : color.white)
    
    // Short Score
    table.cell(info_panel, 0, 2, "Short Score", text_color=color.white)
    table.cell(info_panel, 1, 2, str.tostring(short_score) + "/10", text_color=short_score >= min_confluence ? color.red : color.white)
    
    // RSI
    table.cell(info_panel, 0, 3, "RSI", text_color=color.white)
    table.cell(info_panel, 1, 3, str.tostring(math.round(rsi_smooth, 1)), text_color=rsi_smooth > rsi_ob ? color.red : rsi_smooth < rsi_os ? color.green : color.white)
    
    // MACD
    table.cell(info_panel, 0, 4, "MACD", text_color=color.white)
    table.cell(info_panel, 1, 4, macd_momentum > 0 ? "Bullish" : "Bearish", text_color=macd_momentum > 0 ? color.green : color.red)
    
    // Volume
    table.cell(info_panel, 0, 5, "Volume", text_color=color.white)
    table.cell(info_panel, 1, 5, str.tostring(math.round(volume_ratio, 1)) + "x", text_color=high_volume ? color.green : color.white)
    
    // Structure
    table.cell(info_panel, 0, 6, "Structure", text_color=color.white)
    table.cell(info_panel, 1, 6, bullish_structure ? "Bullish" : bearish_structure ? "Bearish" : "Neutral", text_color=bullish_structure ? color.green : bearish_structure ? color.red : color.white)
    
    // Position
    table.cell(info_panel, 0, 7, "Position", text_color=color.white)
    position_text = strategy.position_size > 0 ? "LONG" : strategy.position_size < 0 ? "SHORT" : "NONE"
    table.cell(info_panel, 1, 7, position_text, text_color=strategy.position_size > 0 ? color.green : strategy.position_size < 0 ? color.red : color.white)
    
    // P&L
    if strategy.position_size != 0
        current_pnl = strategy.position_size > 0 ? ((close - entry_price) / entry_price) * 100 : ((entry_price - close) / entry_price) * 100
        table.cell(info_panel, 0, 8, "P&L", text_color=color.white)
        table.cell(info_panel, 1, 8, str.tostring(math.round(current_pnl, 2)) + "%", text_color=current_pnl > 0 ? color.green : color.red)
    
    // Mode
    table.cell(info_panel, 0, 9, "Mode", text_color=color.white)
    table.cell(info_panel, 1, 9, perf_mode, text_color=color.yellow)

// ═══════════════════════════════════════════════════════════════════════════
// ALERTS
// ═══════════════════════════════════════════════════════════════════════════

// Additional alert conditions
alertcondition(long_score >= min_confluence - 1 and long_score < min_confluence, "Long Setup Forming", "Long setup forming - Score: {{plot_0}}/10")
alertcondition(short_score >= min_confluence - 1 and short_score < min_confluence, "Short Setup Forming", "Short setup forming - Score: {{plot_1}}/10")
alertcondition(trailing_activated, "Trailing Stop Activated", "Trailing stop activated")
alertcondition(strategy.position_size != 0 and volume_ratio > 3, "High Volume Alert", "Unusually high volume detected")