Skip to content

Latest commit

 

History

History
256 lines (154 loc) · 12.1 KB

多时间框架金反转跟踪策略Multi-Timeframe-Gold-Reversal-Tracking-Strategy.md

File metadata and controls

256 lines (154 loc) · 12.1 KB

Name

多时间框架金反转跟踪策略Multi-Timeframe-Gold-Reversal-Tracking-Strategy

Author

ChaoZhang

Strategy Description

IMG [trans]

概述

该策略通过组合使用不同的技术指标和交易方法,实现在金市场中自动识别趋势,发现反转机会,进行高效率的跟踪交易。策略适用于多个时间框架,可以在日内短线和中长线上都获得优异的效果。

策略原理

策略主要基于均线交叉、布林带、支撑阻力位、价格形态等多种技术指标进行交易信号的判断。在判断大趋势时,会组合使用快速移动平均线、慢速移动平均线、RSI和MACD指标等进行多角度的确认,精确捕捉趋势反转。在具体入市时,会通过观察布林带、关键价格位的突破以及诸如锤头形态等价格形态形成的信号进行操作。同时,策略也会利用一定的止损和止盈机制来控制风险。

整个策略流程主要可以分为以下步骤:

  1. 判断大趋势方向:计算快速MA、慢速MA,当快速MA上穿慢速MA时为看涨,下穿时为看跌。同时结合RSI和MACD指标进行确认。

  2. 寻找具体入市点:主要通过观察布林带、关键支撑阻力位的突破以及价格形态信号等入场。

  3. 设置止盈止损:通过ATR指标计算止损幅度,设定合理的止盈位置。

  4. 过滤假突破:部分指标可能出现错误信号,通过组合使用多个指标进行过滤。

优势分析

该策略具有以下几个优势:

  1. 多角度判断:不同指标的组合使用能够从更多维度判断市场,避免单一指标误判的概率。

  2. 适用性强:无论是日内还是中长线交易,该策略都可以获得较好效果。

  3. 灵活多变:策略包含的交易方法丰富多样,可以适应市场的不同阶段。

  4. 风险可控:通过止损和止盈来控制每单的风险敞口,从整体上控制策略的最大回撤。

风险分析

该策略主要存在以下风险:

  1. 指标误判的概率:虽然通过多个指标组合的方式降低了误判概率,但是极端行情下依然存在一定的误判可能。这是技术指标交易难以完全规避的风险。

  2. 反转不确定性:策略判断反转依据的关键点可能不足以成为真正的趋势转折点,无法完美预测未来趋势。这需要通过止损来控制风险。

  3. 假突破风险:突破性事件如表现突然,可能是短期的假突破。这需要通过观察更大级别的时间框架和价格形态进行判断。

  4. 参数优化困难:策略包含多个参数,不同的参数对结果有重要影响,但难以穷举调整找到最优参数。这需要通过平衡多种指标并保持参数稳定来减轻。

优化方向

该策略主要可以从以下几个方向进行优化:

  1. 模型集成:引入机器学习等模型,辅助判断指标信号的权重和市场概率。

  2. 自适应参数优化:通过适当引入一些动态指标或基于价格实体变化的自适应机制来优化参数。

  3. 事件驱动交易:在金市场中引入基于事件、消息面等驱动因素作为交易信号来源。

  4. 模型对冲组合:构建含长短仓位的组合,不同模型之间互相对冲,可以降低市场系统性风险。

总结

总的来说,该金反转跟踪策略整合运用了多种交易方法,在发现趋势反转的同时控制好风险,是一种适合高频交易的有效策略。通过进一步扩充信号源,引入自适应机制与风险管理模型,该策略还具有很大的优化空间,可以望获得更长久更稳定的超额收益。

||

Overview

This strategy combines different technical indicators and trading methods to automatically identify trends, discover reversal opportunities, and conduct efficient tracking trading in the gold market. The strategy is applicable to multiple timeframes and can achieve excellent results in both intraday and mid-to-long term trading.

Strategy Principle

The strategy mainly uses multiple technical indicators like moving average crossover, Bollinger bands, support/resistance levels, price patterns for trading signal judgment. When determining the major trend, it uses a combination of fast moving average, slow moving average, RSI and MACD indicators for multi-angle confirmation to accurately capture trend reversals. For specific market entry, it observes the breakthrough of Bollinger bands, key price levels, and price patterns like hammer to generate trading signals. At the same time, the strategy also utilizes stop loss and take profit mechanisms to control risks.

The main steps of the whole strategy can be divided into:

  1. Judge Trend Direction: Calculate fast MA and slow MA, bullish when fast MA crosses over slow MA, bearish when crossing below. Also use RSI and MACD for confirmation.

  2. Find Specific Entry Points: Mainly enter through observing the breakthrough of Bollinger bands, key support/resistance levels, and price pattern signals.

  3. Set Stop Loss and Take Profit: Use ATR indicator to calculate stop loss range, and set reasonable take profit positions.

  4. Filter False Breakout: Some indicators may generate incorrect signals. Use a combination of multiple indicators to filter.

Advantage Analysis

The advantages of this strategy include:

  1. Multi-angle Judgment: The combination of different indicators can judge the market from more dimensions and avoid the probability of misjudgment by a single indicator.

  2. Strong Applicability: The strategy can achieve good results no matter intraday or mid-to-long term trading.

  3. Flexibility: The strategy contains a variety of trading methods that can adapt to different market stages.

  4. Controllable Risks: Use stop loss and take profit to control the risk exposure of each trade and thus the maximum drawdown of the whole strategy.

Risk Analysis

The main risks of this strategy include:

  1. Misjudgment Probability: Although the probability of misjudgment is reduced through the combination of multiple indicators, there still exists some probability of misjudgment under extreme market conditions. This is a risk hard to completely avoid for technical indicator trading strategies.

  2. Uncertainty of Reversal: The key points for strategy to judge reversals may not be sufficient to become real trend reversal points, unable to perfectly predict future trends. This needs to be addressed by setting proper stop loss.

  3. False Breakout: Breakout events can appear suddenly and may just be short-term false breakouts. Need to judge through observing larger timeframe and price patterns.

  4. Difficult Parameter Optimization: The strategy contains multiple parameters, which have important influence on results but are hard to find the optimum through exhaustive adjustment. This needs to be mitigated by balancing multiple indicators and keeping parameters stable.

Optimization Directions

The main directions for optimizing this strategy include:

  1. Model Ensemble: Introduce machine learning models to assist in determining indicator signal weights and market probabilities.

  2. Adaptive Parameter Optimization: Introduce some dynamic indicators or adaptive mechanisms based on price movement changes to optimize parameters.

  3. Event-driven Trading: Introduce some event-driven factors like news and announcements in the gold market as trading signal sources.

  4. Model Hedged Combination: Construct combinations with both long and short positions, with models hedging against each other, thus reducing systematic market risks.

Conclusion

In conclusion, this gold reversal tracking strategy integrates a variety of trading techniques, controls risks while discovering trend reversals, and is an effective strategy suitable for high-frequency trading. There is still much room for further optimization by expanding signal sources, introducing adaptive mechanisms and risk management models, in order to obtain longer-lasting excess returns in a more stable way.

[/trans]

Strategy Arguments

Argument Default Description
v_input_1 1500 Resistance Level
v_input_2 1400 Support Level
v_input_3 0.618 Fibonacci Level
v_input_4 1.5 ATR Multiplier

Source (PineScript)

/*backtest
start: 2023-12-01 00:00:00
end: 2023-12-31 23:59:59
period: 2h
basePeriod: 15m
exchanges: [{"eid":"Futures_Binance","currency":"BTC_USDT"}]
*/

//@version=5
strategy("PratikMoney_Gold_Swing_v2.0", overlay=true)

// Trend Following
fastMA = ta.sma(close, 50)
slowMA = ta.sma(close, 200)
rsiValue = ta.rsi(close, 14)
[macdLine, signalLine, _] = ta.macd(close, 12, 26, 9)
macdDivergence = macdLine - signalLine
trendUp = ta.crossover(fastMA, slowMA) and rsiValue > 50 and macdLine > 0 and macdDivergence > 0
trendDown = ta.crossunder(fastMA, slowMA) and rsiValue < 50 and macdLine < 0 and macdDivergence < 0

// Breakout Trading
resistanceLevel = input(1500, title="Resistance Level")
supportLevel = input(1400, title="Support Level")

breakoutUp = close > resistanceLevel and close[1] <= resistanceLevel
breakoutDown = close < supportLevel and close[1] >= supportLevel

// Moving Average Crossovers
shortTermMA = ta.sma(close, 9)
longTermMA = ta.sma(close, 21)

maCrossUp = ta.crossover(shortTermMA, longTermMA)
maCrossDown = ta.crossunder(shortTermMA, longTermMA)

// Bollinger Bands
bbUpper = ta.sma(close, 20) + 2 * ta.stdev(close, 20)
bbLower = ta.sma(close, 20) - 2 * ta.stdev(close, 20)

bbBreakoutUp = close > bbUpper and close[1] <= bbUpper
bbBreakoutDown = close < bbLower and close[1] >= bbLower

// Support and Resistance
bounceFromSupport = close < supportLevel and close[1] >= supportLevel
reversalFromResistance = close > resistanceLevel and close[1] <= resistanceLevel

// Fibonacci Retracement
fibonacciLevel = input(0.618, title="Fibonacci Level")

fibRetraceUp = ta.lowest(low, 50) >= ta.highest(high, 50) * (1 - fibonacciLevel)
fibRetraceDown = ta.highest(high, 50) <= ta.lowest(low, 50) * (1 + fibonacciLevel)

// Price Action Trading
pinBar = close < open and low < close[1] and close > open[1]
engulfing = close < open and close[1] > open and close[2] > open[1] and close > open[2]

priceActionLong = pinBar or engulfing and close > open
priceActionShort = pinBar or engulfing and close < open

// Scalping
scalpLong = ta.change(close) > 0.1
scalpShort = ta.change(close) < -0.1

// Volatility Breakout
atrLevel = input(1.5, title="ATR Multiplier")

volatilityBreakoutUp = close > ta.sma(close, 20) + atrLevel * ta.atr(20)
volatilityBreakoutDown = close < ta.sma(close, 20) - atrLevel * ta.atr(20)

// Strategy Execution
strategy.entry("TrendLong", strategy.long, when=trendUp)
strategy.entry("TrendShort", strategy.short, when=trendDown)

strategy.entry("BreakoutLong", strategy.long, when=breakoutUp)
strategy.entry("BreakoutShort", strategy.short, when=breakoutDown)

strategy.entry("VolatilityLong", strategy.long, when=volatilityBreakoutUp)
strategy.entry("VolatilityShort", strategy.short, when=volatilityBreakoutDown)

strategy.entry("PriceActionLong", strategy.long, when=priceActionLong)
strategy.entry("PriceActionShort", strategy.short, when=priceActionShort)

strategy.entry("ScalpLong", strategy.long, when=scalpLong)
strategy.entry("ScalpShort", strategy.short, when=scalpShort)

// Plotting
plot(supportLevel, color=color.green, title="Support Level")
plot(resistanceLevel, color=color.red, title="Resistance Level")

plot(bbUpper, color=color.blue, title="Upper Bollinger Band")
plot(bbLower, color=color.blue, title="Lower Bollinger Band")

// Plotting Price Action Signals
plotshape(series=priceActionLong, title="Price Action Long", color=color.green, style=shape.triangleup, location=location.belowbar)
plotshape(series=priceActionShort, title="Price Action Short", color=color.red, style=shape.triangledown, location=location.abovebar)

// Plotting Scalping Signals
plotshape(series=scalpLong, title="Scalp Long", color=color.green, style=shape.triangleup, location=location.abovebar)
plotshape(series=scalpShort, title="Scalp Short", color=color.red, style=shape.triangledown, location=location.belowbar)

Detail

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

Last Modified

2024-01-31 15:01:39