
この戦略は,異なる時間帯の動量指標を組み合わせて,複数の時間尺度で市場トレンドの逆転を判断する能力を実現します.戦略は,ストキャスティックオシレータを使用して,短期トレンドの逆転点を判断し,より長い周期の ((最高価格 - 最低価格) /閉店価格指標を組み合わせて,中長期のトレンドを判断し,複数の時間尺度でトレンドの逆転を判断する能力を実現します.
戦略は2つの部分から構成されています.
このセクションは,ストキャスティックオシレータの快線と慢線の交差によって短期トレンドの逆転を判断する.具体的には,閉盘価格が前日より高くなり,ストキャスティックの快線が慢線より低くなり,快線が50より低くなり,多めに取引する.閉盘価格が前日より低くなり,ストキャスティックの快線が慢線より高くなり,快線が50より高くなり,空っぽにする.この戦略は,ストキャスティックを使用して,短期オーバーオーバーオール状態を判断し,ショートライン逆転取引を行う.
この指標は,現在のK線の波動性を反映している.指標値が大きいときは,現在の波動が増加し,反転する可能性を示している.指標値が小さい場合は,現在の波動が弱まり,トレンドが継続する可能性を示している.戦略は,この指標のSMA値を使用して,中長線トレンド反転を判断している.
この2つの指標を組み合わせると,短期期と中期期の両方でトレンドの逆転を判断し,多時間スケールの取引戦略を実現できます.
戦略は,短期および中長期の指標を同時に利用することで,反転信号の信頼性を確保し,単一の指標による偽信号を回避することができます.
ストキャスティック・オシレータと (最高価格 - 最低価格) /閉店価格指標のパラメータは,市場に応じて調整され,戦略をより柔軟にすることができる.
戦略はストキャスティックを中心に,中長期のトレンド判断を補助し,構造はシンプルで明確で,理解し,変更しやすい.
戦略の枠組みはシンプルで汎用的で,より多くの指標を簡単に導入し,多要素モデルを構築できます.
戦略は反転を主としており,継続的なトレンド市場では不良なパフォーマンスを示す可能性がある.トレンド市場に対応するためにパラメータを適切に調整する必要があります.
異常な市場状況では,ストキャスティックと (最高価格 - 最低価格) /閉盤価格指標は誤った信号を発する可能性があるので,偽信号のリスクを防いでいる必要がある.
ストキャスティックと (最高価格 - 最低価格) /閉店価格指標のパラメータは,市場の状況に応じて最適化する必要があります.そうでなければ,戦略のパフォーマンスを影響する可能性があります.
戦略は逆転戦略で,利益・損失の変動が大きい可能性があり,ポジションとリスクを管理する必要があります.
既存のフレームワークの下で,交差量,その他の反転指標などのより多くの要因を導入して,多要素モデルを構築することができる.
移動ストップまたはタイムストップを設定し,単一取引の損失を効果的に制御します.
遺伝的アルゴリズムなどの方法により,より体系的な方法によってパラメータを最適化することができる.
機械学習のアルゴリズムを適用してトレンドの逆転を判断するモデルを訓練することで,さらに高い精度が得られます.
社会的データなどの非構造化データの感情分析を導入し,逆転の予測を補助する.
この戦略は,短期および中期の2つの時間次元の指標を統合して,複数の時間帯の判断トレンド反転を実現する.これは非常に良い反転戦略の枠組みである.指標パラメータの柔軟性,構造の簡素性,拡張性の強さなどの利点がある.次のステップは,より多くの要因,パラメータ最適化,停止,および機械学習の導入などによって改善され,戦略の収益性およびリスク制御能力をさらに向上させることができる.全体的に,この戦略は,新しいアイデアであり,研究と適用の価値があります.
//@version=3
////////////////////////////////////////////////////////////
// Copyright by HPotter v1.0 23/05/2019
// This is combo strategies for get
// a cumulative signal. Result signal will return 1 if two strategies
// is long, -1 if all strategies is short and 0 if signals of strategies is not equal.
//
// 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 histogram displays (high-low)/close
// Can be applied to any time frame.
//
// 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
HLCHist(input_barsback, input_percentorprice, input_smalength) =>
xPrice = (high-low)/close
xPriceHL = (high-low)
xPrice1 = iff(input_percentorprice, xPrice * 100, xPriceHL)
xPrice1SMA = sma(abs(xPrice1), input_smalength)
pos = 0.0
pos := iff(xPrice1SMA[input_barsback] > abs(xPrice1), 1,
iff(xPrice1SMA[input_barsback] < abs(xPrice1), -1, nz(pos[1], 0)))
pos
strategy(title="Combo Backtest 123 Reversal & (H-L)/C Histogram", shorttitle="Combo", overlay = true)
Length = input(14, minval=1)
KSmoothing = input(1, minval=1)
DLength = input(3, minval=1)
Level = input(50, minval=1)
//-------------------------
input_barsback = input(4, title="Look Back")
input_percentorprice = input(false, title="% change")
input_smalength = input(13, title="SMA Length")
reverse = input(false, title="Trade reverse")
posReversal123 = Reversal123(Length, KSmoothing, DLength, Level)
posHLCHist = HLCHist(input_barsback, input_percentorprice, input_smalength)
pos = iff(posReversal123 == 1 and posHLCHist == 1 , 1,
iff(posReversal123 == -1 and posHLCHist == -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 ? red: possig == 1 ? green : blue )