
この戦略は、ピラミッド型ポジション管理と組み合わせた、2 期間 RSI (相対力指数) に基づくトレンド追従型取引システムです。この戦略では、2 つの異なる期間 (14 と 30) の RSI インジケーターを比較し、トレンドの開始時に介入し、トレンドが継続している場合は指値注文を通じてポジションを増やして、トレンドの把握を最大化します。このシステムは、ポジション管理や動的な清算条件を含む完全なリスク管理メカニズムを備えて設計されています。
この戦略では、デュアル期間 RSI クロスオーバー信号を取引トリガー条件として使用し、それをピラミッド型の位置管理と組み合わせます。具体的には:
この戦略は、デュアル期間 RSI とピラミッド スタイルのポジション追加を組み合わせることで、トレンドを適切に把握します。この戦略は、エントリー、ポジションの増加、ストップロス、ポジション管理などの主要要素を含む完全な取引システムを設計します。パラメータの最適化とリスク管理の改善により、実際の取引において安定したパフォーマンスを実現することが期待されます。トレーダーは、実際の取引で使用する前に、特定の市場特性に応じてパラメータを十分にテストし、調整することをお勧めします。
/*backtest
start: 2024-12-17 00:00:00
end: 2025-01-16 00:00:00
period: 3h
basePeriod: 3h
exchanges: [{"eid":"Futures_Binance","currency":"BTC_USDT","balance":49999}]
*/
//@version=5
strategy("RSI Top Strategy", overlay=true, pyramiding=2)
qty1 = input( 1 , "Qty first entry", group="Strategy settings")
qty2 = input( 1 , "Qty second entry", group="Strategy settings")
avg1 = input.float( 1.5 , "% averaging ", group="Strategy settings")
overSold = input( 30 , group="open RSI Settings")
overBought = input( 70 , group="open RSI Settings")
rsi1len = input.int(14, minval=1, title="open RSI Length", group="open RSI Settings")
overSold2 = input( 30 , group="close RSI Settings")
overBought2 = input( 70 , group="close RSI Settings")
rsi2len = input.int(30, minval=1, title="close RSI Length", group="close RSI Settings")
price = close
vrsi = ta.rsi(price, rsi1len)
vrsi2 = ta.rsi(price, rsi2len)
sz=strategy.position_size
co = ta.crossover(vrsi, overSold)
cu = ta.crossunder(vrsi, overBought)
if (not na(vrsi))
if (co) and not (sz>0)
strategy.entry("Long", strategy.long, qty = qty1, comment="Long")
Avgl=close-close*0.01*avg1
strategy.entry("AvgL", strategy.long, qty = qty2, limit=Avgl, comment="AvgL")
if (cu) and not (sz<0)
strategy.entry("Short", strategy.short, qty = qty1, comment="Short")
Avgs=close+close*0.01*avg1
strategy.entry("AvgS", strategy.short, qty = qty2, limit=Avgs, comment="AvgS")
//plot(strategy.equity, title="equity", color=color.red, linewidth=2, style=plot.style_areabr)
if sz[1]<0 and sz<0 and vrsi2<overBought2 and vrsi2[1]>=overBought2
strategy.close_all("x")
if sz[1]>0 and sz>0 and vrsi2>overSold2 and vrsi2[1]<=overSold2
strategy.close_all("x")
plot(vrsi,'open rsi',color=color.green)
plot(vrsi2,'close rsi',color=color.red)
hline(overBought, "RSI Upper Band", color=#787B86)
hline(overSold, "RSI Upper Band", color=#787B86)