
この戦略は,まず高時間枠でADXとSMAを計算し,トレンドの方向とトレンドの変化を識別します. そして,低時間枠でRSIを計算し,超買い超売り現象を識別し,取引シグナルを形成します.
高時間枠でのADX判断トレンドの強さを計算する。ADXの上昇はトレンドの強化を表す。
高い時間枠でSMAを計算してトレンドの方向を判断する.SMAの上昇は価格の上昇を表し,SMAの低下は価格の低下を表す.
低時間枠でRSIを計算すると,オーバーバイとオーバーセールが発生する. 値より高いRSIはオーバーバイを表し,値より低いRSIはオーバーセールを表す.
ADXが上昇し,SMAが上昇し,低時間枠RSIが超買いすると,トレンドが向上していると考えられ,空白することができる.
ADXが上昇し,SMAが低下し,低タイムフレームRSIが超売りすると,トレンドが下方に向き合っていると考えると,このときより多くを行うことができます.
トレンド判断と反転取引を組み合わせることで,大きなトレンドの中で反転の機会を捉えることができます.
異なる時間枠での指標の組み合わせを使用して,信号の信頼性を向上させることができます.
RSI戦略のシンプルさは,理解し,実行しやすいものです.
RSIが偽信号を生じ,取引を損なう可能性がある.パラメータの最適化により偽信号の確率を減らすことができる.
大周期トレンド判断は誤りになり,戦略が市場環境に適さないだろう.より多くの指標判断トレンドを組み合わせることを考慮することができる.
取引頻度が高く,取引コストが収益性に影響する可能性がある.RSIパラメータを適切に調整して取引回数を減らすことができる.
RSIパラメータとADX,SMAパラメータの最適なマッチを探すために,より多くのパラメータの組み合わせをテストします.
単一損失を抑えるため,損失防止の仕組みを増やす.
波動率指標と組み合わせて,波動平衡が緩やかであるときにポジションを下げることを考慮してください.
入場と出場の特定の価格を最適化します.例えば,前K線を突破した最高価格が空白に入ります.
この戦略は,トレンド判断と反転取引シグナルを統合し,大周期的なトレンドの中で局所的な反転の機会を探します. RSIを使用する単体と比較して,信頼性が高く,設定を回避します. 全体的に,偽の信号の確率を減らす投資家に適した,より保守的な戦略です. パラメータテストとメカニズムの最適化により,より良い戦略のパフォーマンスを期待できます.
/*backtest
start: 2022-12-27 00:00:00
end: 2024-01-02 00:00:00
period: 1d
basePeriod: 1h
exchanges: [{"eid":"Futures_Binance","currency":"BTC_USDT"}]
*/
//@version=3
strategy("RSI scalping", overlay=true)
CustSession = input(defval=true,title= "Custom Resolution / TF ? ",type=bool)
SessionTF0 = input(title="Custom Resolution / TF", defval="180")
adxlen = input(14, title="ADX Smoothing")
dilen = input(14, title="DI Length")
length = input(7, title= "RSI length")
overSold = input( 28, title= "RSI oversold" )
overBought = input( 68, title= "RSI overbought" )
RSI = rsi(close, 7)
res = CustSession ? SessionTF0 : period
o = request.security(syminfo.tickerid, res, open)
c = request.security(syminfo.tickerid, res, close)
l = request.security(syminfo.tickerid, res, low)
h = request.security(syminfo.tickerid, res, high)
// ADX higher time frame
dirmov(len) =>
up = change(h)
down = -change(l)
plusDM = na(up) ? na : (up > down and up > 0 ? up : 0)
minusDM = na(down) ? na : (down > up and down > 0 ? down : 0)
truer = request.security(syminfo.tickerid, res, tr)
truerange = rma(truer, len)
plus = fixnan(100 * rma(plusDM, len) / truerange)
minus = fixnan(100 * rma(minusDM, len) / truerange)
[plus, minus]
adx(dilen, adxlen) =>
[plus, minus] = dirmov(dilen)
sum = plus + minus
adx = 100 * rma(abs(plus - minus) / (sum == 0 ? 1 : sum), adxlen)
sig = adx(dilen, adxlen)
// SMA higher time frame
len = input(20, minval=1, title="SMA HTF Length")
smma = 0.0
smma := na(smma[1]) ? sma(c, len) : (smma[1] * (len - 1) + c) / len
ADXrising = (sig > sig[1]) and (sig[1] > sig[2]) and (sig[2] > sig[3]) and (sig > 15)
SMAdrop= (smma < smma[1]) and (smma[1] < smma[2]) and (smma[2] < smma[3])
SMArising = (smma > smma[1]) and (smma[1] > smma[2]) and (smma[2] > smma[3])
longCondition = crossover(RSI, overBought) and ADXrising and SMArising
shortCondition = crossunder(RSI, overSold) and SMAdrop and ADXrising
if (longCondition)
strategy.entry("Long entry", strategy.long)
if (shortCondition)
strategy.entry("Short Entry", strategy.short)