
この戦略は,反転戦略と復活振動指標戦略を組み合わせた組み合わせの戦略で,より信頼性の高い取引シグナルを得ることを目的としている.
この戦略は2つの部分から構成されています.
逆転戦略は,ウルフ・ジェンセンによる”将来市場での資金の倍増方法”の第183ページにある.この戦略は逆転型のもので,具体的論理は次のとおりである.
閉盤価格が前日の閉盤価格より高くなって,連続して2日,そして9日目にはスローローストック指標が50以下であるとき,多入場する.
閉盤価格が前日の閉盤価格より低くなって,連続して2日,そして9日目には急速ストック指標が50以上であるとき,空調入場を行う.
復活振動指数は,市場における最も微妙な波動の差値を計算することによって,その値は一般的に-1から1の間で波動する.指数の値が高くなるほど,上昇傾向または下降傾向であるかを示す傾向性がある.
指数が高値に達すると,多行;指数が低値に達すると,空行. この指数は,日内取引に適しています.
最後に,二つの戦略信号が同方向になると,関連する方向の取引が行われる.
逆転戦略とトレンド戦略を組み合わせると,偽信号をフィルターして,取引信号の信頼性を高めることができます.
逆転戦略は短期的な逆転の機会を捉え,復活振動指標戦略は中長期のトレンドを捉えることができる.
ストッチ指標のパラメータは最適化されていて,揺れ動いている市場の偽信号を効果的にフィルターすることができます.
復活振動指数は,微妙な市場の変動に敏感で,トレンドの転換を早期に捉えることができる.
逆転策は,巨大なトレンドの逆転によって飲み込まれる可能性があり,適切なパラメータを調整したり,トレンド策の組み合わせで使用することができます.
指標策は,過剰な取引信号を生成しやすいため,適切なパラメータを調整したり,他のフィルタリング指標の組み合わせで使用することができます.
2つの戦略信号は不一致で衝突する可能性があります. 履歴回測データに基づいてパラメータを調整して両方を最適化できます.
単一損失をコントロールするために,ストップ・ロスの戦略を導入できます.
異なる反転パラメータの組み合わせをテストし,最適なパラメータを見つけます.
異なる復活振動指標のパラメータをテストし,最適なパラメータを見つけます.
遺伝的アルゴリズム,ランダムな森林など,様々な指標パラメータの最適化方法を試す.
フィルタリング信号をさらに加えるために,他の補助指標を追加します.
機械学習モデルを追加し,信号の精度を向上させる.
リスク管理の仕組みを導入する.例えば,ストップ・損失,ポジション管理など.
この戦略は,反転戦略と復活振動指標戦略を組み合わせて,二つの異なるタイプの戦略の優位性を総合的に利用することで,取引信号の質を向上させ,反測で優れた効果を現しています.パラメータ最適化,他の指標の追加,リスク管理などのさらなる最適化により,この戦略は,よりよい現場効果を期待しています.全体的に,これは非常に革新的な戦略であり,さらなる研究と応用に値します.
/*backtest
start: 2023-10-02 00:00:00
end: 2023-10-26 00:00:00
period: 1h
basePeriod: 15m
exchanges: [{"eid":"Futures_Binance","currency":"BTC_USDT"}]
*/
//@version=4
////////////////////////////////////////////////////////////
// Copyright by HPotter v1.0 07/10/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
// The value of Fractal Chaos Oscillator is calculated as the difference between
// the most subtle movements of the market. In general, its value moves between
// -1.000 and 1.000. The higher the value of the Fractal Chaos Oscillator, the
// more one can say that it follows a certain trend – an increase in prices trend,
// or a decrease in prices trend.
//
// Being an indicator expressed in a numeric value, traders say that this is an
// indicator that puts a value on the trendiness of the markets. When the FCO reaches
// a high value, they initiate the “buy” operation, contrarily when the FCO reaches a
// low value, they signal the “sell” action. This is an excellent indicator to use in
// intra-day trading.
//
// 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
fractalUp(pattern) =>
p = high[pattern+1]
okl = 1
okr = 1
res = 0.0
for i = pattern to 1
okl := iff(high[i] < high[i+1] and okl == 1 , 1, 0)
for i = pattern+2 to pattern*2+1
okr := iff(high[i] < high[i-1] and okr == 1, 1, 0)
res := iff(okl == 1 and okr == 1, p, res[1])
res
fractalDn(pattern) =>
p = low[pattern+1]
okl = 1
okr = 1
res = 0.0
for i = pattern to 1
okl := iff(low[i] > low[i+1] and okl == 1 , 1, 0)
for i = pattern+2 to pattern*2+1
okr := iff(low[i] > low[i-1] and okr == 1, 1, 0)
res := iff(okl == 1 and okr == 1, p, res[1])
res
FCO(Pattern) =>
pos = 0.0
xUpper = fractalUp(Pattern)
xLower = fractalDn(Pattern)
xRes = iff(xUpper != xUpper[1], 1,
iff(xLower != xLower[1], -1, 0))
pos := iff(xRes == 1, 1,
iff(xRes == -1, -1, nz(pos[1], 0)))
pos
strategy(title="Combo Backtest 123 Reversal & Fractal Chaos Oscillator", shorttitle="Combo", overlay = true)
Length = input(15, minval=1)
KSmoothing = input(1, minval=1)
DLength = input(3, minval=1)
Level = input(50, minval=1)
//-------------------------
Pattern = input(1, minval=1)
reverse = input(false, title="Trade reverse")
posReversal123 = Reversal123(Length, KSmoothing, DLength, Level)
posFCO = FCO(Pattern)
pos = iff(posReversal123 == 1 and posFCO == 1 , 1,
iff(posReversal123 == -1 and posFCO == -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 )