
The Triple Micro-Channel Momentum Probability Multi-Factor Trading Strategy is a price action-based quantitative trading method that identifies micro-channel structures formed by three consecutive price bars and evaluates trading signals through 10 key factors to enhance trading success probability. This strategy is applicable to financial markets across various timeframes, particularly providing objective and systematic entry and exit mechanisms for intraday traders. The strategy combines the advantages of technical pattern recognition and statistical probability, offering traders a complete trading solution through a strict risk control system.
The Triple Micro-Channel Momentum Probability Multi-Factor Trading Strategy operates based on identifying consecutive three-bar unidirectional movement channels. The strategy works through the following steps:
Micro-Channel Identification: The strategy first looks for three consecutive unidirectional bars (all bullish or all bearish), indicating the market may be in a short-term directional trend.
Multi-Factor Scoring System: The quality of the pattern is quantified through 10 key factors:
Probability Scoring: Based on a base win rate (70%) plus factor scoring, the expected win rate for each trading signal is calculated.
Entry Conditions: When the overall score exceeds a preset threshold (50%), the system generates a trading signal.
Risk Management:
Position Management: Contract quantity is dynamically calculated based on account equity and risk percentage per trade (default 1%).
Exit Mechanisms: The strategy employs trailing stops to lock in profits after reaching targets, while also setting fixed stop losses and intraday force-exit times.
Through in-depth code analysis, this strategy demonstrates the following significant advantages:
Objective Quantitative Scoring: The strategy quantitatively evaluates each trading signal through 10 factors, reducing subjective judgment and improving trading consistency and objectivity.
Strong Adaptability: The strategy can be applied to various markets and timeframes as it is based on universally present price patterns rather than specific market characteristics.
Probability-Driven: Based on statistical probability, each trading signal has a clear expected win rate, enabling traders to make data-driven decisions.
Comprehensive Risk Control: Each trade has a clear stop loss position, and risk is limited to a fixed percentage of account equity through dynamic position adjustment.
Diversified Exit Mechanisms: The strategy integrates multiple exit methods, including trailing stops, fixed stops, and intraday force-exits, comprehensively protecting traders’ capital.
Visual Feedback: The strategy provides detailed trading signal markers and factor scores on charts, allowing traders to intuitively understand the quality of each signal.
Precise Time Management: By limiting trading time windows and forcing end-of-day closing, overnight position risks are avoided.
Despite its numerous advantages, the strategy still presents the following potential risks and challenges:
Overfitting Risk: The weights and thresholds of the 10 factors may risk overfitting historical data, potentially leading to poor future performance.
Low Liquidity Market Risk: In less liquid markets, entry and exit prices may experience slippage, affecting actual trading results.
Parameter Sensitivity: Strategy performance is highly sensitive to multiple parameters, including ATR length, win rate threshold, and risk-reward ratio. Improper parameter settings can significantly impact strategy performance.
Market Environment Dependency: The strategy performs best in markets with clear trends and may generate false signals in oscillating or highly volatile markets.
Signal Scarcity: Due to the need to meet multiple strict conditions, the strategy may generate few trading signals during certain periods, affecting overall returns.
Computational Complexity: Multi-factor evaluation increases the computational complexity of the strategy, which may face delay challenges in real-time trading.
Methods to mitigate these risks include:
Based on code analysis, the strategy can be optimized in the following directions:
Factor Weight Optimization: Currently, all factors have the same weight (each affecting 5% of the win rate). Machine learning methods can be used to determine optimal factor weights, improving prediction accuracy. This optimization might assign higher weights to more important factors while reducing the influence of others.
Market Environment Filtering: Add market environment assessment components, such as trend strength or volatility indicators, to trade only under favorable market conditions. This can be implemented by adding indicators like ADX, volatility percentiles, etc., avoiding trading signals in unfavorable market environments.
Time Filter Improvement: The current strategy uses fixed trading time windows. By analyzing strategy performance during different time periods, the trading time range can be optimized. For example, some markets may be more directional during specific periods and more oscillating during others.
Adaptive Parameters: Convert fixed parameters (such as ATR length, risk-reward ratio) into parameters that dynamically adjust based on market conditions. For example, increase the risk-reward ratio in high-volatility markets and decrease it in low-volatility markets.
Multi-Timeframe Confirmation: Introduce higher timeframe confirmation mechanisms, for example, requiring the daily trend to align with the current trading direction. This can significantly improve the strategy’s success rate by avoiding counter-trend trades.
Optimize Exit Mechanisms: The current trailing stop can be improved to dynamic ATR-based trailing stops or structure-based exits based on support and resistance levels. This optimization can better capture trend continuation while exiting promptly when trends end.
Integrate Machine Learning: Utilize machine learning algorithms to predict which signals are more likely to succeed, assigning more precise probability scores to each trading signal. For example, random forests or gradient boosting tree models can be used to classify historical signals, extracting more complex patterns.
The Triple Micro-Channel Momentum Probability Multi-Factor Trading Strategy is a systematic trading approach combining price pattern recognition and multi-factor scoring. By identifying micro-channel structures formed by three consecutive bars and evaluating signal quality through 10 key factors, the strategy provides an objective, quantifiable trading decision framework.
The core advantages of the strategy lie in its objective signal scoring system, strict risk control, and flexible exit mechanisms. By calculating the expected win rate for each signal, traders can make more data-driven decisions rather than relying on subjective feelings. Meanwhile, the strategy’s dynamic position management ensures risk control consistency regardless of account size.
Despite challenges such as parameter sensitivity and market environment dependency, through the proposed optimization directions, particularly factor weight optimization, market environment filtering, and exit mechanism improvements, the strategy’s performance can be further enhanced. Additionally, introducing machine learning techniques represents an important future direction for the strategy, with the potential to discover more complex patterns from historical data.
For quantitative traders, this strategy provides a solid foundation framework that can be customized and extended according to individual risk preferences and trading styles. Ultimately, the success of the strategy depends not only on its technical implementation but also on the trader’s understanding of strategy rules and execution discipline.
/*backtest
start: 2024-05-20 00:00:00
end: 2025-05-18 08:00:00
period: 1d
basePeriod: 1d
exchanges: [{"eid":"Futures_Binance","currency":"ETH_USDC"}]
*/
//@version=5
strategy("Ali 3-Bar MC v6 10 Factor", overlay=true, pyramiding=0)
// === INPUTS ===
showLabels = input.bool(true, title="Show Entry Labels")
rewardMultiple = input.float(1, title="Reward : Risk")
atrLength = input.int(4, title="ATR Length")
var int bullSignalBarIndex = na
var int bearSignalBarIndex = na
// === ATR ===
atr = ta.sma(ta.tr(true), atrLength)
signalTimeout = 1 // 例如3根bar
// === 风险控制参数 ===
riskPerTradePercent = input.float(1, title="每笔风险占比 (%)") // 如 1%
pointValue = input.float(5, title="每点价值,例如 ES 是 $50/pt")
// 10 Factor
//@version=5
baseWinRate = 0.70
tick = syminfo.mintick
tolerance = 0.2 // 用于判断 bar 大小一致的容忍比例
// 获取3根 bar 的关键数据
body(i) => math.abs(close[i] - open[i])
barSize(i) => math.abs(high[i] - low[i])
upperTailRatio(i) => (high[i] - math.max(close[i], open[i])) / barSize(i)
lowerTailRatio(i) => (math.min(close[i], open[i]) - low[i])/barSize(i)
upperTailTolerance = 0.15
lowerTailTolerance = 0.15
bodyTolerance = 0.7
barUniformTolerance = 0.3
win_threshold = 0.5
// 检测 BL MC(3-bar micro channel 向上)
isBLMC = close[2] > open[2] and close[1] > open[1] and close > open
// === 各项因子判断 ===
//f1_uniform = math.max(barSize(2)/barSize(1), barSize(1)/barSize(2)) < 1 + barUniformTolerance and math.max(barSize(1)/barSize(0), barSize(1)/barSize(0)) < 1 + barUniformTolerance
f1_uniform = math.max(barSize(2)/barSize(0) , barSize(0)/barSize(2)) < 1 + barUniformTolerance
f2_mostCOH = ((upperTailRatio(2) < upperTailTolerance? 1:0) + (upperTailRatio(1) < upperTailTolerance? 1:0) + (upperTailRatio(0) < upperTailTolerance? 1:0) )>=2
f3_microGap = low > high[2]
f4_tickGap = open > close[1] or open[1] > close[2]
f5_closesAboveHigh = close > high[1] and close[1] > high[2]
f6_higherLows = low > low[1] and low[1] > low[2]
f7_opensAbovePriorClose = open >= close[1] or open[1] >= close[2]
f8_noLowerTail = ((lowerTailRatio(2) < lowerTailTolerance? 1:0) + (lowerTailRatio(1) < lowerTailTolerance? 1:0) + (lowerTailRatio(0) < lowerTailTolerance? 1:0) )>=1
f9_noDojiOrOpposite =body(2) / barSize(2) > bodyTolerance and body(1) / barSize(1) > bodyTolerance and body(0) / barSize(0) > bodyTolerance
// === 总评分计算 ===
score = 0
score := score - (f1_uniform ? 0 : 1)
score := score - (f2_mostCOH ? 0 : 1)
score := score - (f3_microGap ? 0 : 4)
score := score - (f4_tickGap ? 0 : 1)
score := score - (f5_closesAboveHigh ? 0 : 1)
score := score - (f6_higherLows ? 0 : 1)
score := score - (f7_opensAbovePriorClose ? 0 : 1)
score := score - (f8_noLowerTail ? 0 : 1)
score := score - (f9_noDojiOrOpposite ? 0 : 1)
winProb = baseWinRate + (score * 0.05) // 每个因子加5%,最高 1.20
// === 图上标记 ===
if isBLMC
labelText = str.tostring(winProb * 100, "#.##") + "%\n" + "1️⃣ uniform: " + str.tostring(f1_uniform) + "\n" + "2️⃣ mostCOL: " + str.tostring(f2_mostCOH) + "\n" + "3️⃣ microGap: " + str.tostring(f3_microGap) + "\n" + "4️⃣ tickGap: " + str.tostring(f4_tickGap) + "\n" + "5️⃣ closes<priorLow: " + str.tostring(f5_closesAboveHigh) + "\n" + "6️⃣ lowerHighs: " + str.tostring(f6_higherLows) + "\n" + "7️⃣ opensBelowClose: " + str.tostring(f7_opensAbovePriorClose) + "\n" + "8️⃣ noLowerTail: " + str.tostring(f8_noLowerTail) + "\n" + "9️⃣ noDoji: " + str.tostring(f9_noDojiOrOpposite) ,
label.new( bar_index, low, text=labelText, style=label.style_label_up, color=color.new(color.green, 0), textcolor=color.white, size=size.small )
// === Ali BULL MC ===
isAliBull = isBLMC and winProb>=win_threshold
// === 检测 Bear Micro Channel ===
isBRMC = close[2] < open[2] and close[1] < open[1] and close < open
// === Bear 各项因子 ===
br_f1_uniform = math.max(barSize(2)/barSize(0) , barSize(0)/barSize(2)) < 1 + barUniformTolerance
br_f2_mostCOL = ((lowerTailRatio(2) < lowerTailTolerance ? 1:0) + (lowerTailRatio(1) < lowerTailTolerance ? 1:0) + (lowerTailRatio(0) < lowerTailTolerance ? 1:0)) >= 2
br_f3_microGap = low[2] > high
br_f4_tickGap = open < close[1] or open[1] < close[2]
br_f5_closesBelowLow = close < low[1] and close[1] < low[2]
br_f6_lowerHighs = high < high[1] and high[1] < high[2]
br_f7_opensBelowPriorClose = open < close[1] or open[1] < close[2]
br_f8_noUpperTail = ((upperTailRatio(2) < upperTailTolerance ? 1:0) + (upperTailRatio(1) < upperTailTolerance ? 1:0) + (upperTailRatio(0) < upperTailTolerance ? 1:0)) >= 1
br_f9_noDojiOrOpposite = body(2)/barSize(2) > bodyTolerance and body(1)/barSize(1) > bodyTolerance and body(0)/barSize(0) > bodyTolerance
// === Bear 总评分计算 ===
br_score = 0
br_score := br_score - (br_f1_uniform ? 0 : 1)
br_score := br_score - (br_f2_mostCOL ? 0 : 1)
br_score := br_score - (br_f3_microGap ? 0 : 4)
br_score := br_score - (br_f4_tickGap ? 0 : 1)
br_score := br_score - (br_f5_closesBelowLow ? 0 : 1)
br_score := br_score - (br_f6_lowerHighs ? 0 : 1)
br_score := br_score - (br_f7_opensBelowPriorClose ? 0 : 1)
br_score := br_score - (br_f8_noUpperTail ? 0 : 1)
br_score := br_score - (br_f9_noDojiOrOpposite ? 0 : 1)
br_winProb = baseWinRate + (br_score * 0.05)
// === Bear 图上标记 ===
if isBRMC
labelText = str.tostring(br_winProb * 100, "#.##") + "%\n" + "1️⃣ uniform: " + str.tostring(br_f1_uniform) + "\n" + "2️⃣ mostCOL: " + str.tostring(br_f2_mostCOL) + "\n" + "3️⃣ microGap: " + str.tostring(br_f3_microGap) + "\n" + "4️⃣ tickGap: " + str.tostring(br_f4_tickGap) + "\n" + "5️⃣ closes<priorLow: " + str.tostring(br_f5_closesBelowLow) + "\n" + "6️⃣ lowerHighs: " + str.tostring(br_f6_lowerHighs) + "\n" + "7️⃣ opensBelowClose: " + str.tostring(br_f7_opensBelowPriorClose) + "\n" + "8️⃣ noUpperTail: " + str.tostring(br_f8_noUpperTail) + "\n" + "9️⃣ noDoji: " + str.tostring(br_f9_noDojiOrOpposite) ,
label.new( bar_index, low, text=labelText, style=label.style_label_up, color=color.new(color.red, 0), textcolor=color.white, size=size.small )
// === Ali BEAR MC ===
isAliBear = isBRMC and br_winProb >=win_threshold
// === ENTRY/RISK/TARGET ===
bullEntry = (upperTailRatio(0)<0.1 ? close :high + tick)
bullStop = open[2] - tick
bullRisk = bullEntry - bullStop
bullTarget = bullEntry + bullRisk * rewardMultiple
bearEntry = (lowerTailRatio(0)<0.1? close :low - tick)
bearStop = open[2] + tick
bearRisk = bearStop - bearEntry
bearTarget = bearEntry - bearRisk * rewardMultiple
// === 动态仓位计算(基于账户资金和止损大小) ===
riskAmount = strategy.equity * (riskPerTradePercent / 100)
bullContracts = math.max(math.floor(riskAmount / (bullRisk * pointValue)),1)
bearContracts = math.max(math.floor(riskAmount / (bearRisk * pointValue)),1)
// === STATE ===
var float bullGapCloseLine = na
var float bearGapCloseLine = na
var bool inLong = false
var bool inShort = false
var bool bullStructureExitArmed = false
var bool bearStructureExitArmed = false
var float lastBullOpen = na
var float lastBearOpen = na
var line currentTPLine = na
var line currentSLLine = na
var float fixedBullStop = na
var float fixedBullTarget = na
var float fixedBearStop = na
var float fixedBearTarget = na
canTradeNow = not na(time(timeframe.period, "0930-1545", "America/New_York")) // 只在盘中前6小时交易
// === BULL ENTRY ===
if isAliBull and na(bullSignalBarIndex) and canTradeNow and strategy.position_size == 0
strategy.entry("Ali Long", strategy.long, stop=bullEntry, qty=bullContracts)
strategy.exit("Close Long", from_entry = "Ali Long", stop = bullStop, trail_price = bullTarget, trail_offset = atrLength )
bullSignalBarIndex := bar_index
fixedBullStop := bullStop
fixedBullTarget := bullTarget
// === BEAR ENTRY ===
if isAliBear and na(bearSignalBarIndex) and canTradeNow and strategy.position_size == 0
strategy.entry("Ali Short", strategy.short, stop=bearEntry, qty=bearContracts)
strategy.exit("Close Short", from_entry = "Ali Short", stop = bearStop,trail_price = bearTarget, trail_offset = atrLength)
bearSignalBarIndex := bar_index
fixedBearStop := bearStop
fixedBearTarget := bearTarget
// === RESET ===
if strategy.position_size != 0
bullSignalBarIndex := na
bearSignalBarIndex := na
if not na(bullSignalBarIndex) and (bar_index - bullSignalBarIndex >= signalTimeout) and strategy.opentrades == 0
strategy.cancel("Ali Long")
bullSignalBarIndex := na
fixedBullStop := na
fixedBullTarget := na
if not na(bearSignalBarIndex) and (bar_index - bearSignalBarIndex >= signalTimeout) and strategy.opentrades == 0
strategy.cancel("Ali Short")
bearSignalBarIndex := na
fixedBearStop := na
fixedBearTarget := na
eodTime = timestamp("America/New_York", year, month, dayofmonth, 15, 55)
if time >= eodTime and strategy.position_size != 0
strategy.close_all(comment="EOD Exit")
label.new(bar_index, close, "Exit: EOD", style=label.style_label_down, color=color.gray, textcolor=color.white, size=size.small)
bearSignalBarIndex := na
bullSignalBarIndex:=na
fixedBearStop := na
fixedBearTarget := na
plot(fixedBearTarget, title="Bull TP", color=color.green, style=plot.style_linebr)
plot(fixedBearStop, title="Bull SL", color=color.red, style=plot.style_linebr)