Skip to content

Latest commit

 

History

History
222 lines (130 loc) · 8.11 KB

四均线趋势快速跳空策略Quad-MA-Trend-Scalper-Strategy.md

File metadata and controls

222 lines (130 loc) · 8.11 KB

Name

四均线趋势快速跳空策略Quad-MA-Trend-Scalper-Strategy

Author

ChaoZhang

Strategy Description

IMG

[trans]

概述

四均线趋势快速跳空策略(Quad MA Trend Scalper)是一个利用4条不同周期的移动平均线产生买入和卖出信号的趋势跟踪策略。它适用于更小的时间框架如10分钟到30分钟进行击败市场的操作。

策略原理

该策略同时使用两组移动平均线。第一组是快速移动平均线,包括length1周期的MA1和length2周期的MA2,它们的交叉产生买入和卖出信号。第二组是长线移动平均线,包括longlength1周期的MA3和longlength2周期的MA4,它们用于判断长线趋势方向。

只有当快速移动平均线MA1和MA2发生黄金交叉时,才会开仓做多。此时还需要判断长线移动平均线MA3是否在MA4之上,如果是,则说明目前处于长线上涨趋势中,这时做多信号才是有效的。

做多头寻机后,当快速移动平均线MA1下穿MA3时,表示短线趋势反转,此时平仓止损。

做空信号生成逻辑与做多信号symmetric相反,这里不再赘述。

通过这样的设计,策略能够有效跟踪趋势方向,避免在震荡行情中被套住。同时利用长短线配合,能够在高概率盈利的机会开仓,并设置止损以控制风险。

优势分析

该策略主要有以下优势:

  1. 利用多组移动平均线进行判断,使交易信号更加可靠。避免在震荡行情中被套住。

  2. 采用长线判断大趋势,短线进行入场的思路,可以有效跟踪趋势方向。

  3. 设置短线止损平仓点,可以快速止损,控制单笔损失。

  4. 适合高杠杆交易,收益率较高。

风险分析

该策略也存在一些风险:

  1. 长短线发生背离时可能造成错误交易。这时需要提前识别信号,及时止损。

  2. 移动平均线策略对参数调优敏感,如果参数选择不当,可能导致交易频率过高或信号迟滞。需要多次测试找到最佳参数组合。

  3. 利用高杠杆进行交易要控制好资金使用率,避免爆仓风险。

优化方向

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

  1. 增加波动率指标,评估市场波动率大小,在低波动时段开仓,避开高波动的瞬时点。

  2. 增加成交量指标,在高成交量突破点开仓。避开成交量收缩的假突破。

  3. 优化移动平均线参数,找到最佳参数组合。配合步进优化寻找全局最优参数。

  4. 在多时间框架上观测信号特征,设计多时间框架交易规则,利用更大时间框架确认信号。

总结

四均线趋势快速跳空策略,是一种典型的跟踪趋势策略。它利用两组不同周期均线进行判断,在大趋势方向打开仓位,而后利用短均线快速止盈止损。策略思路清晰, EASY控制风险,适合高频交易。存在一定概率上的错误信号风险,需要通过参数优化和规则优化进行改进,使盈利机会最大化。

||

Overview

The Quad MA Trend Scalper strategy is a trend following strategy that uses 4 moving averages of different periods to generate buy and sell signals. It works best on smaller timeframes from 10mins to 30mins for scalping to beat the market.

Strategy Logic

The strategy uses two groups of moving averages. The first group consists of the fast moving averages - Length1 period MA1 and Length2 period MA2, the crossover between which generates trading signals. The second group consists of the long moving averages - Longlength1 period MA3 and Longlength2 period MA4, which determines the long term trend direction.

Long positions are opened only when the fast MAs (MA1 and MA2) have a golden crossover AND the long MAs (MA3 and MA4) suggest an upward trend (MA3 above MA4).

The long position will be closed when the fast MA1 crosses below the slow MA3, which suggests a short term trend reversal.

The logic for shorts is symmetric and omitted here.

This design allows the strategy to effectively track the trend direction and avoid being whipsawed in range-bound markets. Also, the combination of long and short term MAs helps identify high-probability profit opportunities to enter trades, with stop loss in place to control risks.

Advantage Analysis

The main advantages of this strategy are:

  1. Using multiple MAs improves signal reliability and avoids whipsaws.

  2. The long-term to short-term timeframe analysis facilitates effective trend following.

  3. The short-term stop loss helps limit single trade loss.

  4. Suitable for high leverage trading with good profitability.

Risk Analysis

There are also some risks:

  1. Divergence between long and short MAs may cause bad trades. These need to be identified in advance for early exit.

  2. The strategy is sensitive to parameter tuning. Improper parameters may lead to over-trading or signal delays. Multiple optimization is required to find the optimum.

  3. With high leverage, capital usage needs to controlled to avoid margin calls.

Optimization Directions

Some ways to optimize the strategy:

  1. Add volatility indicators to assess volatility level for improved timing.

  2. Add volume indicators to trade breakouts with authentic high volume.

  3. Optimize MA lengths through iterative testing to find global optimum.

  4. Examine signals across timeframes for improved signal confirmation.

Conclusion

The Quad MA Trend Scalper is a typical trend following strategy. It uses two groups of MAs to determine trend direction and enter positions along the major trend. Profits are captured quickly using the fast MAs. The logic is simple and risk is easy to control, making it suitable for high frequency trading. There can be some false signals which need to be improved through parameter and logic optimization to maximize profitability.

[/trans]

Strategy Arguments

Argument Default Description
v_input_1 false Exponential MA
v_input_2 true Long Exponential MA
v_input_3_close 0 Source: close
v_input_4 13 MA Fast
v_input_5 21 MA Slow
v_input_6 54 Long MA 1
v_input_7 84 Long MA 2

Source (PineScript)

/*backtest
start: 2023-11-21 00:00:00
end: 2023-12-10 10:00:00
period: 1h
basePeriod: 15m
exchanges: [{"eid":"Futures_Binance","currency":"BTC_USDT"}]
*/

//@version=3
strategy(title="Quad MA Trend Scalper Backtest", shorttitle="QMA BACKTEST", overlay=true, pyramiding = 100)

//
//INPUTS
//

price = close
exponential = input(false, title="Exponential MA")
longexponential = input(true, title="Long Exponential MA")
src = input(close, title="Source")

length1 = input(13, title="MA Fast")
length2 = input(21, title="MA Slow")

longlength1 = input(54, title="Long MA 1")
longlength2 = input(84, title="Long MA 2")

//
//MAs
//

ma1 = exponential ? ema(src, length1) : sma(src, length1)
ma2 = exponential ? ema(src, length2) : sma(src, length2)
ma3 = longexponential ? ema(src, longlength1) : sma(src, longlength1)
ma4 = longexponential ? ema(src, longlength2) : sma(src, longlength1)

plot(ma1, color = black, linewidth = 2)
plot(ma2, color = red, linewidth = 2)
plot(ma3, color = blue, linewidth = 2)
plot(ma4, color = green, linewidth = 5)

long1 = crossover(ma1, ma2) and ma3 > ma4
long2 = crossover(ma1, ma2) and ma3 < ma4
short1 = crossunder(ma1, ma2) and ma3 < ma4
short2 = crossunder(ma1, ma2) and ma3 > ma4

//plotshape(long1, style=shape.triangleup, location=location.belowbar, color=green, size=size.tiny)
//plotshape(long2, style=shape.triangleup, location=location.belowbar, color=red, size=size.tiny)
//plotshape(short1, style=shape.triangledown, location=location.abovebar, color=green, size=size.tiny)
//plotshape(short2, style=shape.triangledown, location=location.abovebar, color=red, size=size.tiny)

//
//STRATEGY
//

//LONG
if (crossover(ma1, ma2) and ma1>ma4)
    strategy.entry("Long", strategy.long, comment="Long")
    
strategy.close("Long", when = crossunder(ma1, ma3))

//SHORT

if (crossunder(ma1, ma2) and ma1<ma4)
    strategy.entry("Short", strategy.short, comment="Short")

strategy.close("Short", when = crossover(ma1, ma3))


Detail

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

Last Modified

2023-12-22 14:25:04