このストラテジーは,複数の時間枠で,RSIを書き換えないストラテジーであり,より高い2つの時間枠でオーバーソールするときにのみオーバーソールします.私はBTC/USDの1分線で書き込みましたが,論理は他の資産にも適用できます.資産が下落傾向にあるときに利益を得ることを目的としています.
対角層は,入場と退出条件が異なるタイムフレームに分布することを指します. 通常,指標は,下行傾向では,現在のタイムフレームの超買区は触れないので,より高いタイムフレームの超買区に触れて,再調整が起こるので,不利益になる可能性があります.対角層戦略は,より早いタイムフレームが超買っているときに売る,より遅いタイムフレームが超売っているときに買うという対角的な方法でこの問題を軽減します.
したがって,この戦略は対角の重なりである。私は,全体的なトレンドに応じて対角上方と対角下方との間で切り替える別のスクリプトを作成するかもしれない,なぜなら,延長された上方トレンドの間,この指標は頻繁に点滅しないかもしれない。これは,タイムセリフとタイムフレームのグラフでX形として見られる。これは,考慮すべきことだ…
この戦略は,全体的に非常に効果的な下降トレンド取引戦略である. 多時間枠のRSI指標と対角層の積み重ね入場方法を活用して,下降の段階で反発の機会を捉えることができる. また,非再描画特性は,信号の信頼性を高めます. パラメータを最適化して,フィルターと空白策を追加することで,任意の市場に適応する強力な戦略にすることができます.
/*backtest
start: 2022-09-21 00:00:00
end: 2023-06-24 00:00:00
period: 1d
basePeriod: 1h
exchanges: [{"eid":"Futures_Binance","currency":"BTC_USDT"}]
*/
// This source code is subject to the terms of the Mozilla Public License 2.0 at https://mozilla.org/MPL/2.0/
// © wbburgin
//@version=5
strategy("MTF Layered RSI - Bitcoin Bot [wbburgin]",overlay=false, pyramiding = 20, initial_capital=10000)
length = input.int(7,"RSI Length")
tf2 = input.timeframe("3",title="HT 1")
tf3 = input.timeframe("5",title="HT 2")
ob = input.int(80,"Overbought Level")
os = input.int(20,"Oversold Level")
rsi = ta.rsi(close,length)
rsi2 = request.security(syminfo.tickerid, tf2, rsi[1], barmerge.gaps_off, lookahead=barmerge.lookahead_on)
rsi3 = request.security(syminfo.tickerid, tf3, rsi[1], barmerge.gaps_off, lookahead=barmerge.lookahead_on)
plot(rsi,color=color.yellow,title="RSI Current TF")
plot(rsi2,color=color.new(color.yellow,50),title="RSI HT1")
plot(rsi3,color=color.new(color.yellow,75),title="RSI HT2")
lm=hline(os,title="Oversold")
hm=hline(ob,title="Overbought")
fill(hm,lm,color=color.new(color.blue,95))
htCross = (ta.crossover(rsi2,os) and rsi3>os and rsi>os) or (ta.crossover(rsi3,os) and rsi2>os and rsi>os)
buySig = (ta.crossover(rsi,os) and rsi2 < os and rsi3 < os) or htCross
sellSig = ta.crossunder(rsi,ob)
if buySig
strategy.entry("Long",strategy.long)
if sellSig
strategy.close("Long")
plotshape(buySig,title="Buysig",style=shape.triangleup,location=location.bottom,color=color.green,size=size.tiny)
plotshape(sellSig,title="Sellsig",style=shape.triangledown,location=location.top,color=color.red,size=size.tiny)