双動量反転戦略は,反転戦略と動量戦略の優位性を融合させ,両種類の指標の信号を利用して組み合わせ,突破点で反転操作を行い,利益を得るようにする.
この戦略は2つの部分から構成されています.
第”部は”123の逆転戦略”です. その原理は次のとおりです.
閉店価格が前日の閉店価格より2日連続で高く,そして9日間の平均速度のK線が50未満であるとき,多額にする.
閉盤価格が前日の閉盤価格より2日連続で低い場合,そして9日の平均速K線が50以上であるとき,空白する.
第2部は波動量指標である.この指標の計算ステップは以下の通りである.
価格変動の値 xMom = close - close を計算する[1]
価格変化の絶対値 xMomAbs = abs ((close - close) を計算する[1])
価格変化の値にフィルターされ,値下がりフィルターより小さい場合は0と記されます.
価格変化の絶対値にフィルターされ,値下げフィルターより小さい場合は0と記されます.
最後のn日間の波動後の価格変動のnSumを計算する
nAbsSumを計算し,最後のn日間の波動後の価格変化の絶対値の合計を計算する
運動量を計算する:nRes = 100 * nSum / nAbsSum
トップバンドとローバンドの境界と動量値を判断し,取引信号を出力する.
この指標は,小さな波動をフィルタリングして,大きなトレンドの動きだけを抽出します.
最後に,両種類の指標信号が一致するときに取引信号が生成され,多行または空行となる.
この戦略は,二つの異なるタイプの指標の優位性を融合させ,信号の質を向上させる:
123の反転戦略は,反転のトレンドをターニングポイントで捉え,罠にはならないようにする.
波動量指標は大きな波動のみを注意し,ノイズをフィルターして主要なトレンドを捉えます.
この2つの組み合わせは,信号を検証し,誤った取引の確率を低くし,勝率を高めます.
この戦略には以下のリスクがあります.
単一のタイムサイクル分析では,より大きなレベルのトレンドが 見逃されることがあります.
パラメータ設定は,市場の変化に適応できないように,あまりにも固く設定されています.
双重検証は,利益の余地を減らすことのできる機会を逃しているかもしれない.
低品質の取引シグナルも検証され,損失を招く.
この戦略は以下の点で最適化できます.
複数のタイムサイクルで検証を重ねて 騙されないようにする.
適応パラメータを設定し,市場に応じて指標パラメータを調整する.
フィルター値の最適化,信号誤報率の減少
単一損失を抑えるためのストップ・ロース戦略を導入する.
ポジション管理を調整し,資金利用の効率を最適化する.
概して,二動量反転戦略は,反転戦略と波量指標の優位性を組み合わせて,ある程度信号品質と収益効率を向上させることができる.しかし,この戦略には,より大きなレベルの傾向,パラメータの固定,信号誤報などのリスクを無視するなどのいくつかの問題があります.複数の時間枠の検証,自己適応パラメータ,ストップを設定するなどの方法によって,この戦略を最適化し,リスクを軽減し,安定した収益性を向上させることができます.
/*backtest
start: 2023-09-08 00:00:00
end: 2023-10-08 00:00:00
period: 1h
basePeriod: 15m
exchanges: [{"eid":"Futures_Binance","currency":"BTC_USDT"}]
*/
//@version=4
////////////////////////////////////////////////////////////
// Copyright by HPotter v1.0 25/09/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
// This indicator plots a CMO which ignores price changes which are less
// than a threshold value. CMO was developed by Tushar Chande. A scientist,
// an inventor, and a respected trading system developer, Mr. Chande developed
// the CMO to capture what he calls "pure momentum". For more definitive
// information on the CMO and other indicators we recommend the book The New
// Technical Trader by Tushar Chande and Stanley Kroll.
// The CMO is closely related to, yet unique from, other momentum oriented
// indicators such as Relative Strength Index, Stochastic, Rate-of-Change, etc.
// It is most closely related to Welles Wilder`s RSI, yet it differs in several ways:
// - It uses data for both up days and down days in the numerator, thereby directly
// measuring momentum;
// - The calculations are applied on unsmoothed data. Therefore, short-term extreme
// movements in price are not hidden. Once calculated, smoothing can be applied to the
// CMO, if desired;
// - The scale is bounded between +100 and -100, thereby allowing you to clearly see
// changes in net momentum using the 0 level. The bounded scale also allows you to
// conveniently compare values across different securities.
//
// 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
fFilter(xSeriesSum, xSeriesV, Filter) =>
iff(xSeriesV > Filter, xSeriesSum, 0)
CMOfilt(Length,Filter, TopBand, LowBand) =>
pos = 0
xMom = close - close[1]
xMomAbs = abs(close - close[1])
xMomFilter = fFilter(xMom, xMomAbs, Filter)
xMomAbsFilter = fFilter(xMomAbs,xMomAbs, Filter)
nSum = sum(xMomFilter, Length)
nAbsSum = sum(xMomAbsFilter, Length)
nRes = 100 * nSum / nAbsSum
pos := iff(nRes > TopBand, 1,
iff(nRes < LowBand, -1, nz(pos[1], 0)))
pos
strategy(title="Combo Backtest 123 Reversal & CMOfilt", shorttitle="Combo", overlay = true)
Length = input(14, minval=1)
KSmoothing = input(1, minval=1)
DLength = input(3, minval=1)
Level = input(50, minval=1)
//-------------------------
LengthCMO = input(9, minval=1)
Filter = input(3, minval=1)
TopBand = input(70, minval=1)
LowBand = input(-70, maxval=-1)
reverse = input(false, title="Trade reverse")
posReversal123 = Reversal123(Length, KSmoothing, DLength, Level)
posCMOfilt = CMOfilt(LengthCMO,Filter, TopBand, LowBand)
pos = iff(posReversal123 == 1 and posCMOfilt == 1 , 1,
iff(posReversal123 == -1 and posCMOfilt == -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 )