Skip to content

Latest commit

 

History

History
230 lines (165 loc) · 10.4 KB

双项式动量突破反转策略Binomial-Momentum-Breakout-Reversal-Strategy.md

File metadata and controls

230 lines (165 loc) · 10.4 KB

Name

双项式动量突破反转策略Binomial-Momentum-Breakout-Reversal-Strategy

Author

ChaoZhang

Strategy Description

IMG [trans]

概述

双项式动量突破反转策略通过结合斯托克指标和公牛指标,实现双重信号过滤,在市场反转点进行反转交易,追捧超跌超升。

策略原理

该策略由两部分组成:

  1. 123反转策略

    使用乌尔夫·詹森在他的书《我如何在期货市场上将资金翻三番》中提出的反转策略。当收盘价连续2天高于前一日收盘价,而9日慢速K线斯托克指标低于50时做多;当收盘价连续2天低于前一日收盘价,而9日快速K线斯托克指标高于50时做空。

  2. 公牛指标

    使用瓦迪姆·吉梅尔法布在他的书《公牛熊平衡指标》中提出的动量指标。它通过计算当前K线与前一K线的关系,判断多空力量,并给出做多做空信号。

该策略将上述两种单一信号策略结合,当两者信号一致时发出交易信号,以双重过滤减少假信号。

优势分析

该策略结合反转策略和跟踪策略的优点,能够在市场出现反转信号时及时捕捉,同时通过双信号过滤减少假信号,避免追高杀跌。具体优势如下:

  1. 使用123形态判断市场反转点,能够识别超卖超买点位。
  2. 双重信号过滤机制,避免单一指标产生的假信号,提高信号质量。
  3. 采用反转交易方式,追捧市场反转带来的趋势机会。
  4. 参数优化空间大,可以通过调整指标参数适应不同市场环境。

风险分析

该策略也存在一定风险,主要来源如下:

  1. 反转失败风险。识别反转信号具有一定难度,反转信号发出后价格继续原趋势运行的概率也很大。
  2. 双重过滤信号不一致时无法交易的机会损失。
  3. 参数不当造成反转信号识别不准确。
  4. 该策略更适合中长线交易,短线交易效果并不是很好。

对策如下:

  1. 采用止损策略控制单笔损失。
  2. 优化参数,不同品种可以选择不同参数组合。
  3. 结合其他指标作为辅助判断。

优化方向

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

  1. 测试不同参数对策略效果的影响,寻找最优参数组合。例如调整斯托克指标的周期参数、KDJ指标的平滑参数等。
  2. 增加止损策略,以控制单笔损失。可以结合ATR指标设定止损位。
  3. 结合其他指标进行信号校验。例如MACD,KD,RSI等指标产生信号时再考虑发出交易信号。
  4. 使用机器学习算法对参数进行优化,实现参数的动态调整。

总结

双项式动量突破反转策略通过斯托克指标和公牛指标的结合,实现双重信号过滤和反转交易。它能抓住市场反转机会,避免单一信号产生的噪音,是一种稳定而有效的量化策略。该策略可以通过参数优化、止损策略、信号校验等方式进行改进,适应更多不同品种和市场环境,具有很大的优化空间和应用前景。

||

Overview

The Binomial Momentum Breakout Reversal Strategy combines the Stochastic indicator and Bull Power indicator to implement dual signal filtering and reversal trading at market turning points to chase oversold and overbought situations.

Strategy Logic

The strategy consists of two parts:

  1. 123 Reversal Strategy

    It uses the reversal strategy proposed by Ulf Jensen in his book "How I Tripled My Money in the Futures Market". It goes long when the close price is higher than the previous close for 2 consecutive days and the 9-day slow stochastic is below 50; it goes short when the close price is lower than the previous close for 2 consecutive days and the 9-day fast stochastic is above 50.

  2. Bull Power Indicator

    It uses the momentum indicator proposed by Vadim Gimelfarb in his book "Bull and Bear Balance Indicator". It judges the bullish/bearish power by calculating the relationship between the current K-line and previous K-line, and generates trading signals.

The strategy combines the above two single signal strategies. It generates trading signals only when the signals of two strategies are consistent to implement dual signal filtering.

Advantage Analysis

The strategy combines the advantages of reversal strategies and tracking strategies. It can capture reversal signals timely when the market shows signs of reversal, while reducing false signals through dual signal filtering to avoid chasing highs and selling lows. The main advantages are:

  1. Using the 123 pattern to determine market turning points and identify oversold and overbought situations.
  2. The dual signal filtering mechanism avoids false signals generated by single indicators and improves the quality of trading signals.
  3. Reversal trading to seize the trend opportunities brought by market reversals.
  4. Large parameter optimization space to adapt to different market environments by adjusting indicator parameters.

Risk Analysis

The strategy also has some risks:

  1. Reversal failure risk. Identifying reversal signals has some difficulty. The probability of prices continuing the original trend after giving reversal signals is also very high.
  2. Opportunity loss when inconsistent signals between two indicators.
  3. Inaccurate identification of reversal signals due to inappropriate parameters.
  4. The strategy is more suitable for medium- and long-term trading. The effect of short-term trading is not very good.

The counter measures:

  1. Adopt stop loss strategies to control single loss.
  2. Optimize parameters. Different combinations can be selected for different varieties.
  3. Combine other indicators as auxiliary judgment.

Optimization Directions

The strategy can be further optimized in the following aspects:

  1. Test the impact of different parameters on strategy performance to find the optimal parameter combination. For example, adjust the cycle parameters of the Stochastic indicator, the smoothing parameters of the KDJ indicator, etc.
  2. Increase stop loss strategies to control single losses. Can set stop loss points combined with the ATR indicator.
  3. Combine other indicators for signal verification. For example, MACD, KD, RSI and other indicators can be considered when generating trading signals.
  4. Use machine learning algorithms to optimize parameters and achieve dynamic adjustment of parameters.

Summary

The Binomial Momentum Breakout Reversal Strategy combines the Stochastic indicator and Bull Power indicator to achieve dual signal filtering and reversal trading. It can seize market reversal opportunities and avoid noise generated by single signals. It is a stable and effective quantitative strategy. The strategy can be improved through parameter optimization, stop loss strategies, signal verification, etc., making it suitable for more varieties and market environments. It has great potential for optimization and application.

[/trans]

Strategy Arguments

Argument Default Description
v_input_1 14 Length
v_input_2 true KSmoothing
v_input_3 3 DLength
v_input_4 50 Level
v_input_5 15 SellLevel
v_input_6 3 BuyLevel
v_input_7 false Trade reverse

Source (PineScript)

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

//@version=4
////////////////////////////////////////////////////////////
//  Copyright by HPotter v1.0 05/07/2019
// This is combo strategies for get a cumulative signal. 
//
// First strategy
// This System was created from the Book "How I Tripled My Money In The 
// Futures Market" by Ulf Jensen, Page 183. This is reverse type of strategies.
// The strategy buys at market, if close price is higher than the previous close 
// during 2 days and the meaning of 9-days Stochastic Slow Oscillator is lower than 50. 
// The strategy sells at market, if close price is lower than the previous close price 
// during 2 days and the meaning of 9-days Stochastic Fast Oscillator is higher than 50.
//
// Second strategy
//  Bull Power Indicator
//  To get more information please see "Bull And Bear Balance Indicator" 
//  by Vadim Gimelfarb. 
//
// WARNING:
// - For purpose educate only
// - This script to change bars colors.
////////////////////////////////////////////////////////////
Reversal123(Length, KSmoothing, DLength, Level) =>
    vFast = sma(stoch(close, high, low, Length), KSmoothing) 
    vSlow = sma(vFast, DLength)
    pos = 0.0
    pos := iff(close[2] < close[1] and close > close[1] and vFast < vSlow and vFast > Level, 1,
	         iff(close[2] > close[1] and close < close[1] and vFast > vSlow and vFast < Level, -1, nz(pos[1], 0))) 
	pos

BullPower(SellLevel, BuyLevel) =>
    pos = 0
    value = iff (close < open ,  
             iff (close[1] < open ,  max(high - close[1], close - low), max(high - open, close - low)),
              iff (close > open, 
               iff(close[1] > open,  high - low, max(open - close[1], high - low)), 
                 iff(high - close > close - low, 
                  iff (close[1] < open, max(high - close[1], close - low), high - open), 
                   iff (high - close < close - low, 
                     iff(close[1] > open,  high - low, max(open - close, high - low)), 
                      iff (close[1] > open, max(high - open, close - low),
                       iff(close[1] < open, max(open - close, high - low), high - low))))))
    pos := iff(value > SellLevel, -1,
	         iff(value <= BuyLevel, 1, nz(pos[1], 0)))
    pos

strategy(title="Combo Backtest 123 Reversal & Bull Power", shorttitle="Combo", overlay = true)
Length = input(14, minval=1)
KSmoothing = input(1, minval=1)
DLength = input(3, minval=1)
Level = input(50, minval=1)
//-------------------------
SellLevel = input(15, step=1)
BuyLevel = input(3, step=1)
reverse = input(false, title="Trade reverse")
posReversal123 = Reversal123(Length, KSmoothing, DLength, Level)
posBullPower = BullPower(SellLevel, BuyLevel)
pos = iff(posReversal123 == 1 and posBullPower == 1 , 1,
	   iff(posReversal123 == -1 and posBullPower == -1, -1, 0)) 
possig = iff(reverse and pos == 1, -1,
          iff(reverse and pos == -1, 1, pos))	   
if (possig == 1) 
    strategy.entry("Long", strategy.long)
if (possig == -1)
    strategy.entry("Short", strategy.short)	 
if (possig == 0) 
    strategy.close_all()
barcolor(possig == -1 ? #b50404: possig == 1 ? #079605 : #0536b3 )

Detail

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

Last Modified

2024-02-28 17:20:02