Skip to content

Latest commit

 

History

History
170 lines (108 loc) · 7.26 KB

黄金快速突破EMA交易策略Gold-Fast-Breakthrough-EMA-Trading-Strategy.md

File metadata and controls

170 lines (108 loc) · 7.26 KB

Name

黄金快速突破EMA交易策略Gold-Fast-Breakthrough-EMA-Trading-Strategy

Author

ChaoZhang

Strategy Description

IMG [trans]

概述

黄金快速突破EMA交易策略(Gold Fast Breakthrough EMA Trading Strategy)是一个基于EMA指标的黄金scalping策略。该策略利用快速EMA和慢速EMA的交叉进行交易信号判断,结合ATR指标设定止损止盈点,实现黄金scalping交易。

策略原理

该策略主要依靠快速9日EMA和慢速21日EMA的交叉以及价格与EMA的关系判断入场。具体逻辑是,当快速EMA上穿慢速EMA并且收盘价高于慢速EMA时,做多;当快速EMA下穿慢速EMA并且收盘价低于慢速EMA时,做空。

此外,该策略还使用ATR指标计算最近2日的平均波动范围。 entry之后,止损点设在最近lowest(atrLength)减去atr乘以atrMultiplier;止盈点设在最近highest(atrLength)加上atr乘以atrMultiplier。这就是基于ATR指标的波动 trailing stop机制。

优势分析

这是一个相对简单的黄金scalping策略,有以下几个优势:

  1. 使用EMA交叉判断,可以捕捉较明确的趋势;
  2. 结合价格与EMA关系判断,过滤假突破信号,提高准确率;
  3. 基于ATR指标的trailing stop,可以根据市场波动情况动态调整止损止盈,有利锁定盈利。

风险分析

该策略也存在一些风险:

  1. 作为一个scalping策略,它对交易资金规模和杠杆要求较高,否则单笔利润有限;
  2. EMA交叉策略对价格震荡市容易产生错误信号;
  3. ATR指标设定的止损止盈距离可能过大或过小,需要优化。

针对上述风险,可以考虑适当缩减头寸规模,结合其他指标过滤信号,或者测试不同的参数以优化止损止盈的设置。

优化方向

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

  1. 增加其他指标判断,例如MACD、布林带等,形成多重过滤,提高信号质量;
  2. 增加基于波动率的头寸规模调整机制,比如当波动加大时适当缩小头寸;
  3. 对ATR波动范围参数进行优化,找到最优参数组合。

总结

黄金快速突破EMA交易策略是一个简单实用的黄金scalping策略。它利用EMA交叉判断趋势,并基于ATR指标进行止损止盈,可以有效锁定小利润。该策略可以通过多重指标过滤、头寸规模调整、参数优化等方式进行改进,使其更适应市场环境。

||

Overview

The Gold Fast Breakthrough EMA Trading Strategy is a gold scalping strategy based on the EMA indicator. This strategy uses the crossover of the fast EMA and slow EMA to generate trading signals, combined with ATR indicators to set stop loss and take profit points to implement gold scalping trading.

Strategy Principle

This strategy mainly relies on the crossover of the 9-day fast EMA and 21-day slow EMA, as well as the relationship between price and EMA to determine entry. Specifically, when the fast EMA crosses above the slow EMA and the close price is higher than the slow EMA, go long; when the fast EMA crosses below the slow EMA and the close price is lower than the slow EMA, go short.

In addition, this strategy also uses the ATR indicator to calculate the average range of fluctuations in the most recent 2 days. After entry, the stop loss point is set at the lowest (atrLength) minus atr multiplied by atrMultiplier; the take profit point is set at the highest (atrLength) plus atr multiplied by atrMultiplier. This is a volatility trailing stop mechanism based on the ATR indicator.

Advantage Analysis

This is a relatively simple gold scalping strategy with the following advantages:

  1. Using EMA crossover to judge, it can capture clearer trends;
  2. Combined with the relationship between price and EMA to filter false breakout signals and improve accuracy;
  3. The trailing stop based on the ATR indicator can dynamically adjust the stop loss and take profit according to market volatility, which is conducive to locking in profits.

Risk Analysis

This strategy also has some risks:

  1. As a scalping strategy, it has higher requirements for trading capital size and leverage, otherwise the single profit is limited;
  2. EMA crossover strategies are prone to wrong signals in choppy markets;
  3. The distance of stop loss and take profit set by the ATR indicator may be too large or too small and needs to be optimized.

In response to the above risks, we can consider appropriately reducing the position size, combining with other indicators to filter signals, or testing different parameters to optimize the setting of stop loss and take profit.

Optimization Directions

This strategy can also be optimized in the following directions:

  1. Add other indicators to judge, such as MACD, Bollinger Bands, etc. to form multiple filters and improve signal quality;
  2. Add a position sizing adjustment mechanism based on volatility. For example, appropriately reduce the position size when volatility increases;
  3. Optimize the parameters of the ATR volatility range to find the optimal parameter combination.

Summary

The Gold Fast Breakthrough EMA Trading Strategy is a simple and practical gold scalping strategy. It uses EMA crossover to determine the trend and sets stop loss and take profit based on the ATR indicator, which can effectively lock in small profits. This strategy can be improved through multiple indicator filtering, position sizing adjustment, parameter optimization, etc., making it more adaptable to market conditions.

[/trans]

Strategy Arguments

Argument Default Description
v_input_1 9 Fast EMA Length
v_input_2 21 Slow EMA Length
v_input_3 2 ATR Length
v_input_4 2 ATR Multiplier
v_input_5 0.7 Profit Target
v_input_6 0.001 Commission

Source (PineScript)

/*backtest
start: 2023-12-18 00:00:00
end: 2024-01-17 00:00:00
period: 1h
basePeriod: 15m
exchanges: [{"eid":"Futures_Binance","currency":"BTC_USDT"}]
*/

//@version=4
strategy("XAUUSD Trading Strategy", shorttitle="XAUUSD Strategy", overlay=true)

// Inputs
fastLength = input(9, title="Fast EMA Length")
slowLength = input(21, title="Slow EMA Length")
atrLength = input(2, title="ATR Length")
atrMultiplier = input(2, title="ATR Multiplier")
profitTarget = input(0.7, title="Profit Target") * 100 // in percentage
commission = input(0.001, title="Commission") // 0.1% per trade

// Calculations
fastEMA = ema(close, fastLength)
slowEMA = ema(close, slowLength)
atr = atr(atrLength)

// Entry rules
longCondition = crossover(fastEMA, slowEMA) and close > slowEMA
if (longCondition)
    strategy.entry("Long", strategy.long)

shortCondition = crossunder(fastEMA, slowEMA) and close < slowEMA
if (shortCondition)
    strategy.entry("Short", strategy.short)

// Stop loss and take profit
longStop = lowest(atrLength) - atr * atrMultiplier
longTakeProfit = highest(atrLength) + atr * atrMultiplier

shortStop = highest(atrLength) + atr * atrMultiplier
shortTakeProfit = lowest(atrLength) - atr * atrMultiplier

strategy.exit("Exit Long", "Long", stop=longStop, limit=longTakeProfit)
strategy.exit("Exit Short", "Short", stop=shortStop, limit=shortTakeProfit)

// Plot EMAs
plot(fastEMA, title="Fast EMA", color=color.blue)
plot(slowEMA, title="Slow EMA", color=color.red)

Detail

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

Last Modified

2024-01-18 11:37:10