Skip to content

Latest commit

 

History

History
172 lines (131 loc) · 8.13 KB

File metadata and controls

172 lines (131 loc) · 8.13 KB

Name

ADX趋势突破动量交易策略-ADX-Trend-Breakout-Momentum-Trading-Strategy

Author

ChaoZhang

Strategy Description

IMG

[trans]

概述

这是一个基于平均趋向指标(ADX)和价格突破的量化交易策略。该策略主要通过监控ADX指标数值来判断市场趋势强度,并结合价格突破信号来捕捉市场动量。策略设定在特定交易时段内运行,并通过止损和每日交易次数限制来实现风险管理。

策略原理

策略的核心逻辑包含以下几个关键要素:

  1. ADX指标监控:使用ADX指标来评估市场趋势强度,当ADX值低于17.5时表明市场可能即将形成新趋势。
  2. 价格突破判断:策略会跟踪过去34个周期的最高收盘价,当当前价格突破该阻力位时触发交易信号。
  3. 交易时段管理:策略仅在指定的交易时段(0730-1430)内运行,以避免低流动性时段的风险。
  4. 风险控制机制:
    • 设置固定美元止损来限制单笔交易损失
    • 限制每个交易时段最多3笔交易
    • 交易时段结束时自动平仓所有持仓

策略优势

  1. 趋势捕捉能力:通过ADX指标和价格突破相结合,能够有效识别市场趋势初期阶段。
  2. 风险管理完善:包含多层次风险控制措施,如固定止损、交易次数限制和自动收盘机制。
  3. 自动化程度高:策略逻辑清晰,完全实现自动化交易,无需人工干预。
  4. 适应性强:可根据不同市场情况调整参数,如止损金额、回溯周期等。

策略风险

  1. 假突破风险:在震荡市场中可能出现false breakout导致连续止损。
  2. 参数依赖性:策略效果严重依赖于ADX阈值和回溯周期的设置。
  3. 时段限制:仅在特定时段交易可能错过其他时段的机会。
  4. 止损设置:固定美元止损可能在不同波动率环境下不够灵活。

策略优化方向

  1. 动态止损:建议将固定美元止损改为基于ATR的动态止损,以适应不同的市场波动环境。
  2. 市场环境过滤:增加波动率过滤器,在高波动率环境下调整或暂停交易。
  3. 入场优化:可以考虑增加成交量确认,提高突破信号的可靠性。
  4. 动态参数调整:实现ADX阈值和回溯周期的自适应调整机制。

总结

这是一个结构完整、逻辑清晰的趋势跟踪策略。通过将ADX指标与价格突破相结合,在有效的风险管理框架下捕捉市场趋势机会。虽然存在一些优化空间,但策略的基础框架稳健,适合作为量化交易系统的基础组件。建议交易者在实盘之前进行充分的回测和参数优化,并结合市场具体情况进行针对性改进。

||

Overview

This is a quantitative trading strategy based on the Average Directional Index (ADX) and price breakouts. The strategy primarily monitors ADX indicator values to assess market trend strength and combines price breakout signals to capture market momentum. The strategy operates within specific trading sessions and implements risk management through stop-loss and daily trade limits.

Strategy Principles

The core logic includes the following key elements:

  1. ADX Monitoring: Uses the ADX indicator to evaluate trend strength, with ADX values below 17.5 indicating potential new trend formation.
  2. Price Breakout Detection: Tracks the highest closing price over the past 34 periods, triggering trade signals when current price breaks above this resistance.
  3. Session Management: Operates only during specified trading hours (0730-1430) to avoid low liquidity periods.
  4. Risk Control Mechanisms:
    • Fixed dollar stop-loss to limit single trade losses
    • Maximum of 3 trades per session limit
    • Automatic position closure at session end

Strategy Advantages

  1. Trend Capture Capability: Effectively identifies early trend stages through ADX indicator and price breakout combination.
  2. Comprehensive Risk Management: Multiple risk control measures including fixed stop-loss, trade limits, and auto-close mechanism.
  3. High Automation: Clear strategy logic enables fully automated trading without manual intervention.
  4. Strong Adaptability: Parameters can be adjusted for different market conditions.

Strategy Risks

  1. False Breakout Risk: May experience consecutive stops in ranging markets.
  2. Parameter Dependency: Strategy effectiveness heavily relies on ADX threshold and lookback period settings.
  3. Time Restrictions: Trading only during specific sessions may miss opportunities.
  4. Stop-Loss Configuration: Fixed dollar stops may lack flexibility in different volatility environments.

Optimization Directions

  1. Dynamic Stop-Loss: Recommend implementing ATR-based dynamic stops for different market volatility conditions.
  2. Market Environment Filter: Add volatility filters to adjust or pause trading in high volatility environments.
  3. Entry Optimization: Consider adding volume confirmation to improve breakout signal reliability.
  4. Dynamic Parameter Adjustment: Implement adaptive adjustment mechanisms for ADX thresholds and lookback periods.

Summary

This is a well-structured trend-following strategy with clear logic. It captures market trends by combining ADX indicators with price breakouts under an effective risk management framework. While there is room for optimization, the strategy's foundation is robust and suitable as a basic component of a quantitative trading system. Traders are advised to conduct thorough backtesting and parameter optimization before live trading, and make specific improvements based on market conditions. [/trans]

Source (PineScript)

/*backtest
start: 2019-12-23 08:00:00
end: 2024-11-27 00:00:00
period: 1d
basePeriod: 1d
exchanges: [{"eid":"Futures_Binance","currency":"BTC_USDT"}]
*/

// This Pine Script™ code is subject to the terms of the Mozilla Public License 2.0 at https://mozilla.org/MPL/2.0/
// © HuntGatherTrade
// ========================
// NQ 30 minute, ES 30 minute

//@version=5
strategy("ADX Breakout", overlay=false, initial_capital=25000, default_qty_value=1)

// ===============================
// Input parameters
// ===============================
stopLoss = input(1000.0, title="Stop Loss ($)", group="Exits")
session = input("0730-1430:1234567", group="Trade Session")
highestLB = input(34, title="Highest lookback window", group="Indicator values")

// ===============================
// Trade Session Handling
// ===============================
t = time(timeframe.period, session)

// Reset numTrades at the start of each session
var int numTrades = 0
is_new_session = ta.change(time("D")) != 0
if is_new_session
    numTrades := 0

// ===============================
// Entry Conditions
// ===============================
[plusDI, minusDI, adxValue] = ta.dmi(50, 14)
entryCondition = (close >= ta.highest(close, highestLB)[1]) and (adxValue < 17.5) and (strategy.position_size == 0) and (numTrades < 3) and not na(t)

// ===============================
// 7. Execute Entry
// ===============================
var float stopPricePlot = na

if entryCondition
    entryPrice = close + syminfo.mintick
    strategy.entry("Long Entry", strategy.long, stop=entryPrice)
    //stopPrice = strategy.position_avg_price - (stopLoss / syminfo.pointvalue)
    //strategy.exit("Stop Loss", "Long Entry", stop=stopPrice)
    numTrades += 1

if (strategy.position_size > 0) and (strategy.position_size[1] == 0)
    stopPoints = stopLoss / syminfo.pointvalue
    stopPrice = strategy.position_avg_price - stopPoints
    stopPrice := math.round(stopPrice / syminfo.mintick) * syminfo.mintick
    strategy.exit("Stop Loss", from_entry="Long Entry", stop=stopPrice)


if ta.change(strategy.opentrades) == 1
    float entryPrice = strategy.opentrades.entry_price(0)
    stopPricePlot := entryPrice - (stopLoss / syminfo.pointvalue)

if ta.change(strategy.closedtrades) == 1
    stopPricePlot   := na

plot(stopPricePlot, "Stop-loss level", color.red, 1, plot.style_linebr)

// ===============================
// Exit at End of Session
// ===============================
if na(t) and strategy.position_size != 0
    strategy.close_all(comment="End of Day Exit")

Detail

https://www.fmz.com/strategy/473247

Last Modified

2024-11-28 15:44:59