多时间周期动态信号组合的ICT智能结构突破策略

RSI MACD EMA BOS FVG HTF LTF ICT
创建日期: 2025-01-06 14:09:05 最后修改: 2025-01-06 14:09:05
复制: 0 点击次数: 184
avatar of ChaoZhang ChaoZhang
1
关注
1259
关注者

多时间周期动态信号组合的ICT智能结构突破策略

概述

该策略是一个结合了多重技术指标和ICT(机构交易概念)的综合性交易系统。它在不同时间周期上整合了传统技术分析指标(RSI、随机指标、MACD、EMA)与现代ICT交易理念(公允价值缺口、结构突破、高时间周期偏向性分析),并通过严格的交易时段过滤实现精准的市场准入控制。

策略原理

策略运作基于五个核心组件的协同: 1. 高时间周期偏向性分析:使用200均线判断更高时间周期的市场趋势方向 2. 交易时段过滤:限定在特定的”击杀区域”(07:00-10:00)内进行交易 3. 公允价值缺口(FVG)识别:通过三根K线模式识别市场结构性缺口 4. 结构突破(BOS)判定:基于关键价位的突破确认方向性变更 5. 低时间周期指标确认:利用RSI、随机指标、MACD和200均线的多重验证

策略优势

  1. 多维度信号整合:通过组合多个独立的技术指标和ICT概念,提高信号的可靠性
  2. 时间周期协同:高低时间周期的配合增强了信号的稳定性
  3. 结构性机会捕捉:通过FVG和BOS的识别,专注于高概率的结构性交易机会
  4. 风险控制完善:包含止损止盈机制,资金管理规范
  5. 交易时间优化:通过时段过滤降低了非交易时段的干扰

策略风险

  1. 信号滞后性:多重指标的综合可能导致入场时机延迟
  2. 震荡市场表现:在横盘市场中可能产生频繁的假信号
  3. 参数敏感性:多个指标参数的设置需要充分的历史数据验证
  4. 执行风险:复杂的条件组合可能在实盘中错过部分交易机会
  5. 市场环境依赖:策略在不同市场环境下的表现可能存在较大差异

策略优化方向

  1. 动态参数调整:根据市场波动率自适应调整各指标参数
  2. 市场环境分类:增加市场环境识别模块,针对不同市场状态采用不同的参数组合
  3. 信号权重优化:引入机器学习方法,优化各个指标的权重分配
  4. 时间周期扩展:增加更多时间周期的分析,提高信号的可靠性
  5. 风险控制增强:引入动态止损机制,优化资金管理策略

总结

该策略通过整合传统技术分析与现代ICT理念,构建了一个全面的交易系统。其优势在于多维度的信号确认和严格的风险控制,但也面临参数优化和市场适应性的挑战。通过持续优化和完善,策略有望在不同市场环境下保持稳定的表现。

策略源码
/*backtest
start: 2024-01-06 00:00:00
end: 2025-01-04 08:00:00
period: 2d
basePeriod: 2d
exchanges: [{"eid":"Futures_Binance","currency":"BTC_USDT"}]
*/

// -----------------------------------------------------
// Multi-Signal Conservative Strategy (Pine Script v5)
// + More ICT Concepts (HTF Bias, FVG, Killzone, BOS)
// -----------------------------------------------------
//
// Combines:
// - RSI, Stochastic, MACD, 200 EMA (lower TF)
// - Higher Timeframe (HTF) bias check via 200 EMA
// - Kill Zone time filter
// - Fair Value Gap (FVG) detection (simplified 3-candle approach)
// - Break of Structure (BOS) using pivot highs/lows
// - Only trade markers on chart (no extra indicator plots).
//
// Use on lower timeframes: 1m to 15m
// Always backtest thoroughly and manage risk properly.
//
// -----------------------------------------------------
//@version=5
strategy(title="Multi-Signal + ICT Concepts (HTF/FVG/Killzone/BOS)", shorttitle="ICTStrategyExample",overlay=true, pyramiding=0, initial_capital=10000, default_qty_type=strategy.percent_of_equity, default_qty_value=100)

// -----------------------------------------------------
// User Inputs
// -----------------------------------------------------
/////////////// Lower TF Inputs ///////////////
emaLength       = input.int(200,   "LTF EMA Length",           group="Lower TF")
rsiLength       = input.int(14,    "RSI Length",               group="Lower TF")
rsiUpper        = input.int(60,    "RSI Overbought Thresh",    group="Lower TF", minval=50, maxval=80)
rsiLower        = input.int(40,    "RSI Oversold Thresh",      group="Lower TF", minval=20, maxval=50)
stochLengthK    = input.int(14,    "Stoch K Length",           group="Lower TF")
stochLengthD    = input.int(3,     "Stoch D Smoothing",        group="Lower TF")
stochSmooth     = input.int(3,     "Stoch Smoothing",          group="Lower TF")
macdFast        = input.int(12,    "MACD Fast Length",         group="Lower TF")
macdSlow        = input.int(26,    "MACD Slow Length",         group="Lower TF")
macdSignal      = input.int(9,     "MACD Signal Length",       group="Lower TF")

/////////////// ICT Concepts Inputs ///////////////
htfTimeframe    = input.timeframe("60", "HTF for Bias (e.g. 60, 240)", group="ICT Concepts")
htfEmaLen       = input.int(200,  "HTF EMA Length",                   group="ICT Concepts")
sessionInput    = input("0700-1000:1234567", "Kill Zone Window", group="ICT Concepts")
fvgLookbackBars = input.int(2,    "FVG Lookback Bars (3-candle check)",  group="ICT Concepts", minval=1, maxval=10)

/////////////// Risk Management ///////////////
stopLossPerc    = input.float(0.5, "Stop-Loss %",  step=0.1, group="Risk")
takeProfitPerc  = input.float(1.0, "Take-Profit %", step=0.1, group="Risk")

// -----------------------------------------------------
// 1) Higher Timeframe Bias
// -----------------------------------------------------
//
// We'll request the HTF close, then compute the HTF EMA on that data
// to decide if it's bullish or bearish overall.

htfClose       = request.security(syminfo.tickerid, htfTimeframe, close)
htfEma         = request.security(syminfo.tickerid, htfTimeframe, ta.ema(close, htfEmaLen))
isBullHTF      = htfClose > htfEma
isBearHTF      = htfClose < htfEma

// -----------------------------------------------------
// 2) Kill Zone / Session Filter
// -----------------------------------------------------
//
// We'll only consider trades if the current bar is within
// the user-defined session time (e.g., 07:00 to 10:00 local or exchange time).

isInKillZone = time(timeframe.period, sessionInput) != 0

// -----------------------------------------------------
// 3) Fair Value Gap (FVG) Detection (Simplified)
//
// For a "Bullish FVG" among bars [2], [1], [0]:
//     high[2] < low[0] => there's a gap that bar [1] didn't fill
// For a "Bearish FVG":
//     low[2] > high[0] => there's a gap that bar [1] didn't fill
//
// Real ICT usage might check partial fill, candle bodies vs wicks, etc.
// This is just a minimal example for demonstration.

fvgBarsAgo = fvgLookbackBars // default = 2
bullFVG = high[fvgBarsAgo] < low  // e.g. high[2] < low[0]
bearFVG = low[fvgBarsAgo]  > high // e.g. low[2]  > high[0]

// -----------------------------------------------------
// 4) Break of Structure (BOS)
// -----------------------------------------------------
// Using pivot detection from previous example:

swingLen = 2  // pivot detection length (bars on each side)
// Identify a pivot high at bar [1]
swingHigh = high[1] > high[2] and high[1] > high[0]
// Identify a pivot low at bar [1]
swingLow  = low[1]  < low[2]  and low[1]  < low[0]

// Track the most recent pivot high & low
var float lastPivotHigh = na
var float lastPivotLow  = na

if swingHigh
    lastPivotHigh := high[1]

if swingLow
    lastPivotLow := low[1]

bosUp   = not na(lastPivotHigh) and (close > lastPivotHigh)
bosDown = not na(lastPivotLow)  and (close < lastPivotLow)

// -----------------------------------------------------
// 5) Lower TF Indicator Calculations
// -----------------------------------------------------
ema200      = ta.ema(close, emaLength)  // 200 EMA on LTF
rsiValue    = ta.rsi(close, rsiLength)
kValue      = ta.stoch(high, low, close, stochLengthK)
dValue      = ta.sma(kValue, stochLengthD)
stochSignal = ta.sma(dValue, stochSmooth)
[macdLine, signalLine, histLine] = ta.macd(close, macdFast, macdSlow, macdSignal)

// LTF trend filter
isBullTrend = close > ema200
isBearTrend = close < ema200

// -----------------------------------------------------
// Combine All Conditions
// -----------------------------------------------------
//
// We'll require that all filters line up for a long or short:
//  - HTF bias
//  - kill zone
//  - bullish/bearish FVG
//  - BOS up/down
//  - RSI, Stoch, MACD alignment
//  - Price above/below LTF 200 EMA

longCondition = isInKillZone                     // must be in session
 and isBullHTF                                   // HTF bias bullish
 and bullFVG                                     // bullish FVG
 and bosUp                                       // BOS up
 and (rsiValue > rsiUpper)                       // RSI > threshold
 and (kValue > dValue)                           // stoch K above D
 and (macdLine > signalLine)                     // MACD bullish
 and isBullTrend                                 // above LTF 200 EMA

shortCondition = isInKillZone                    // must be in session
 and isBearHTF                                   // HTF bias bearish
 and bearFVG                                     // bearish FVG
 and bosDown                                     // BOS down
 and (rsiValue < rsiLower)                       // RSI < threshold
 and (kValue < dValue)                           // stoch K below D
 and (macdLine < signalLine)                     // MACD bearish
 and isBearTrend                                 // below LTF 200 EMA

// -----------------------------------------------------
// Strategy Entries
// -----------------------------------------------------
if longCondition
    strategy.entry("Long Entry", strategy.long)

if shortCondition
    strategy.entry("Short Entry", strategy.short)

// -----------------------------------------------------
// Risk Management (Stop-Loss & Take-Profit)
// -----------------------------------------------------
if strategy.position_size > 0
    // Long position exit
    strategy.exit("Long Exit", stop  = strategy.position_avg_price * (1.0 - stopLossPerc/100.0), limit = strategy.position_avg_price * (1.0 + takeProfitPerc/100.0))

if strategy.position_size < 0
    // Short position exit
    strategy.exit("Short Exit",  stop  = strategy.position_avg_price * (1.0 + stopLossPerc/100.0), limit = strategy.position_avg_price * (1.0 - takeProfitPerc/100.0))

// -----------------------------------------------------
// Hide All Indicator Plots
// (We only show trade markers for entry & exit)
// -----------------------------------------------------
// Comment out or remove any plot() calls so chart stays clean.
//
// Example (commented out):
// plot(ema200, title="EMA 200", color=color.new(color.yellow, 0), linewidth=2)
// plot(rsiValue, title="RSI", color=color.new(color.blue, 0))
// plot(macdLine, title="MACD", color=color.new(color.teal, 0))
// plot(signalLine, title="Signal", color=color.new(color.purple, 0))
相关推荐