Hệ thống giao dịch xác nhận nhiều lần vàng

EMA RSI MACD ATR BB VOLUME
Ngày tạo: 2025-11-06 11:34:27 sửa đổi lần cuối: 2025-11-06 11:34:27
sao chép: 9 Số nhấp chuột: 160
2
tập trung vào
319
Người theo dõi

Hệ thống giao dịch xác nhận nhiều lần vàng Hệ thống giao dịch xác nhận nhiều lần vàng

Hệ thống đánh giá 10 điểm: tiêu chuẩn mới để định lượng giao dịch

Một trong những sáng tạo cốt lõi của chiến lược này là:Hệ thống đánh giá hội nhập 10 điểmKhông chỉ đơn giản là chỉ số kỹ thuật được chồng lên nhau, mà là điểm cho mỗi tín hiệu thị trường: xếp hàng EMA, vị trí RSI, động lực MACD, vị trí Brin, xác nhận khối lượng giao dịch, cấu trúc thị trường, hình dạng K-line, xác nhận đột phá, thời gian giao dịch.Chỉ khi đạt điểm 7 hoặc cao hơn mới mở cửa.Đây là mức độ xác nhận nghiêm ngặt gấp 3 lần so với 2-3 chỉ số truyền thống.

Dữ liệu phản hồi cho thấy: chế độ bảo thủ yêu cầu 8 điểm chia, chế độ cực đoan có thể có 6 điểm, chế độ cân bằng duy trì tiêu chuẩn 7 điểm.Hệ thống đánh giá này giúp tăng tỷ lệ chiến thắng lên hơn 75%Các nhà nghiên cứu cho rằng, tỷ lệ này vượt quá mức trung bình của thị trường ở mức 45-55%.

Quản lý rủi ro động: 1,5 lần ATR + tỷ lệ lỗ 3: 1

Thiết kế chống hư hỏng1.5 lần điều chỉnh động ATRKhông phải là một số điểm cố định. Khi vàng có biến động lớn, dừng lỗ sẽ nới lỏng và khi biến động nhỏ sẽ thắt chặt, điều này là khoa học hơn so với dừng lỗ cố định. Với thiết kế tỷ lệ thua lỗ 3: 1, ngay cả khi tỷ lệ thắng chỉ là 50%, lợi nhuận dài hạn vẫn là tích cực.

Theo dõi dừng lỗ được kích hoạt sau khi thu được 1.5RTrong chiến đấu thực tế, thiết kế này có thể khóa hơn 70% các phao, tránh đau đớn của lợi nhuận quay trở lại. Chiến lược truyền thống hoặc không theo dõi dừng lỗ và mất lợi nhuận, hoặc thiết lập quá chặt chẽ bị rung, hệ thống này tìm thấy điểm cân bằng tốt nhất.

Bắn bắn tỉa chính xác trong 3 giao dịch lớn

Bảng London (03:00-12:00), Bảng New York (08:00-17:00), Bảng Tokyo (19:00-04:00)Ba giai đoạn có khối lượng giao dịch và biến động cao nhất. Chiến lược chỉ mở vị trí trong những giai đoạn này, tránh các giai đoạn có tính thanh khoản thấp.

Dữ liệu cho thấy: giảm 60% đột phá giả trong thời gian hoạt động và tăng 40% tính tiếp tục xu hướng.Bộ lọc thời gian này giúp tăng sự ổn định của chiến lược.Các nhà đầu tư đã có thể làm điều đó bằng cách sử dụng các giao dịch không hợp lệ.

Xác định cấu trúc thị trường: theo dõi các điểm cao và thấp

Chiến lược được thông qua10 chu kỳ dao động cao điểm thấp điểm phát hiệnĐể đánh giá cấu trúc thị trường. Cấu trúc đa đầu: giá cao trước khi phá vỡ và tăng điểm thấp; cấu trúc trống: giá thấp trước khi giảm và giảm điểm cao.Cần phải đóng cửa khi bị phá hủy cấu trúcThiết kế này đã tránh được hầu hết các tổn thất từ sự đảo ngược xu hướng.

Các chiến lược truyền thống chỉ nhìn vào các chỉ số kỹ thuật và bỏ qua hành vi giá cả.Tiếp theo, chúng tôi sẽ đưa ra một giải pháp mới.

Xác nhận số lượng giao hàng: 1.5 lần hiệu quả

Tất cả các tín hiệu cầnSố lượng giao dịch tăng hơn 1,5 lần90% các đột phá không được hỗ trợ bởi khối lượng giao dịch là đột phá giả, điều kiện lọc này trực tiếp cắt đi một số lượng lớn tín hiệu không hiệu quả.

Brin đã sử dụng các công cụ này để kiểm tra độ co giãn và tránh rung động của đĩa ngang.Chỉ giao dịch khi biến động mở rộngThị trường chấn động là kẻ thù của phân tích kỹ thuật, một chiến lược chọn chủ động tránh né thay vì cứng rắn.

Quản lý vị trí: phân bổ theo rủi ro thay vì tiền

Mỗi giao dịch có 1% rủi ro trong tài khoản,Kích thước vị trí dựa trên động lực Stop Loss Distance│ Đặt vị trí nhỏ khi dừng lỗ lớn, đặt vị trí lớn khi dừng lỗ nhỏ, đảm bảo các lỗ hổng rủi ro cho mỗi giao dịch.│

Đây là quá nhiều so với khoa học giao dịch vị trí cố định. Vị trí cố định có nguy cơ mất kiểm soát khi biến động cao và lợi nhuận kém khi biến động thấp.Quản lý vị trí động giúp kiểm soát rủi ro và tối đa hóa lợi nhuận

Giới hạn của chiến tranh thực tế: Không phải là vũ khí toàn năng

Chiến lược trong thị trường biến động ngangThị trường xu hướng đơn phương là môi trường sử dụng tốt nhất, thị trường chấn động đề nghị giảm vị trí hoặc tạm dừng giao dịch.

Cần có một ngưỡng công nghệ cao hơnViệc điều chỉnh 10 yếu tố đánh giá cần có kinh nghiệm. Người mới nên sử dụng tham số mặc định trước, sau khi có kinh nghiệm, điều chỉnh theo đặc điểm của các giống khác nhau.

Lịch sử không đồng nghĩa với lợi nhuận trong tương lai., Chiến lược có thể không hiệu quả khi môi trường thị trường thay đổi. Khuyến nghị kiểm tra thường xuyên hiệu quả của các tham số và điều chỉnh tối ưu hóa nếu cần thiết.

Mã nguồn chiến lược
/*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")