
双管齐の量化逆転追跡戦略は,シンプルな移動平均指標とランダムな指標の組み合わせを使用して,市場の急速な逆転を捕捉し,同時に,見逃した信号による機会コストを減らす高効率で安定したショートライン取引戦略を実現します.
この戦略は2つの部分から構成される:123形状反転部分と自在移動平均部分.123形状反転部分では,前2取引日の閉盘価格関係を計算して反転の機会があるかどうかを判断する.前日閉盘価格が前2日より低くなって,現在の取引日の閉盘価格が前日より高くなって,ランダムなスローラインが50より低くなれば,買入シグナルが生じる.前2日の閉盘価格が前2日より高くなって,現在の取引日の閉盘価格が前日より低くなって,ランダムなスローラインが50より高くなれば,売り出シグナルが生じる.これは,急速な短線反転の機会を捉える.もう1つの部分は,自在移動平均線であり,市場が不活発であるとき,それはゆっくりと反応し,活発であるとき,迅速に反応し,振動の騒音を回避し,主にトレンドシグナルを判断する.
双管齐の定量反転追跡戦略の最大の利点は,反転形状とトレンドフィルターの組み合わせによるもので,それが急速な反転を捕捉し,波動的な市場で閉じ込められることを避けるようにするものである.利益の源は主に2つである.第一に,123形状の識別は,多くの安定した戦略では実現できない,価格の急速な調節の機会をタイムリーに追跡することができる.第二に,自主的な移動平均の適用は,取引方向と主動トレンドが一致することを確保し,ノイズを効果的にフィルターし,不要な損失を減らす.
この戦略の主なリスクは,パラメータの設定が不適切であることが取引頻度が過高または信号認識能力が不足することにある.123形状のパラメータが過度に敏感である場合,波動的な状況で頻繁に取引され,より多くの平仓損失を生じることがある.移動平均パラメータの設定が過度に遅い場合,逆転の機会が逃れることがある.さらに,トレンドの状況で高殺し下落を追うことは,より大きな資本変動をもたらす.
この戦略は,次のいくつかの点で最適化することができる:第一に,123形状のパラメータを,明瞭な反転を識別し,誤信号を発生させるには過度に敏感にならないように調整する.第二に,平坦と敏感の間の最適なバランスを見つけ,自律的に移動平均に適応するパラメータを最適化する.第三に,単一損失を制御するためにストップ・ストップ戦略を導入する.第四に,市場情緒指標と組み合わせて,意思決定の質を高める.
双管齐の量化逆転追跡戦略は,逆転取引とトレンドフィルタリングの2つの欠かせない部分を成功裏に統合し,組み合わせの優位性は顕著である.パラメータ設定の継続的な最適化,止損とリスク管理の仕組みの継続的な改善により,この戦略は,収益を容易に達成し,リスクを制御できる高効率の量化取引戦略になる見込みである.
/*backtest
start: 2024-01-18 00:00:00
end: 2024-02-17 00:00:00
period: 1h
basePeriod: 15m
exchanges: [{"eid":"Futures_Binance","currency":"BTC_USDT"}]
*/
//@version=4
////////////////////////////////////////////////////////////
// Copyright by HPotter v1.0 08/12/2020
// 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
// Everyone wants a short-term, fast trading trend that works without large
// losses. That combination does not exist. But it is possible to have fast
// trading trends in which one must get in or out of the market quickly, but
// these have the distinct disadvantage of being whipsawed by market noise
// when the market is volatile in a sideways trending market. During these
// periods, the trader is jumping in and out of positions with no profit-making
// trend in sight. In an attempt to overcome the problem of noise and still be
// able to get closer to the actual change of the trend, Kaufman developed an
// indicator that adapts to market movement. This indicator, an adaptive moving
// average (AMA), moves very slowly when markets are moving sideways but moves
// swiftly when the markets also move swiftly, change directions or break out of
// a trading range.
//
// 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
KAMA(Length) =>
pos = 0.0
nAMA = 0.0
xPrice = close
xvnoise = abs(xPrice - xPrice[1])
nfastend = 0.666
nslowend = 0.0645
reverse = input(false, title="Trade reverse")
nsignal = abs(xPrice - xPrice[Length])
nnoise = sum(xvnoise, Length)
nefratio = iff(nnoise != 0, nsignal / nnoise, 0)
nsmooth = pow(nefratio * (nfastend - nslowend) + nslowend, 2)
nAMA := nz(nAMA[1]) + nsmooth * (xPrice - nz(nAMA[1]))
pos := iff(close[1] > nAMA, 1,
iff(close[1] < nAMA, -1, nz(pos[1], 0)))
pos
strategy(title="Combo Backtest 123 Reversal & Kaufman Moving Average Adaptive", shorttitle="Combo", overlay = true)
Length = input(14, minval=1)
KSmoothing = input(1, minval=1)
DLength = input(3, minval=1)
Level = input(50, minval=1)
//-------------------------
LengthKAMA = input(21, minval=2)
reverse = input(false, title="Trade reverse")
posReversal123 = Reversal123(Length, KSmoothing, DLength, Level)
posKAMA = KAMA(LengthKAMA)
pos = iff(posReversal123 == 1 and posKAMA == 1 , 1,
iff(posReversal123 == -1 and posKAMA == -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 )