
この戦略は,RSI指数とその平均線の交差を介して買入点を決定し,ショートライン取引戦略に属します.この戦略は,RSI指数が平均線より低いときに購入し,平均線より高いときに販売し,典型的な低買い高売り戦略に属します.
これは,RSIの超買超売の特性を利用して,買い買いするタイミングを決定する典型的なトレンド反転戦略である.この戦略には以下の利点があります.
簡単な,実用的なショートラインの取引戦略です.
この戦略にはいくつかのリスクがあります.
これらのリスクは,パラメータの最適化,フィルタリング条件の追加などによって軽減できます.
この戦略は,以下の側面から最適化できます.
複数の指標の組み合わせ,ストップ管理,パラメータ最適化などの手段によって,戦略のパフォーマンスを大幅に向上させることができます.
この戦略は,全体的に非常に典型的で実用的なショートライン取引戦略である.これは,RSI指標の超買い超売り状態を使用して,買い売りのタイミングを判断し,均線フィルターで補足する.戦略の論理はシンプルで明確で,パラメータの調整は柔軟で,実行しやすい.一定の市場リスクは存在するが,入場退出機構の改善,パラメータの最適化などによって制御することができる.より多くの技術指標とリスク管理手段を組み合わせれば,この戦略は,比較的安定した収益のショートライン戦略になることができる.
/*backtest
start: 2022-11-24 00:00:00
end: 2023-11-30 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/
// © I11L
//@version=5
strategy("I11L - Meanreverter 4h", overlay=false, pyramiding=3, default_qty_value=10000, initial_capital=10000, default_qty_type=strategy.cash,process_orders_on_close=false, calc_on_every_tick=false)
frequency = input.int(10)
rsiFrequency = input.int(40)
buyZoneDistance = input.int(5)
avgDownATRSum = input.int(3)
useAbsoluteRSIBarrier = input.bool(true)
barrierLevel = 50//input.int(50)
momentumRSI = ta.rsi(close,rsiFrequency)
momentumRSI_slow = ta.sma(momentumRSI,frequency)
isBuy = momentumRSI < momentumRSI_slow*(1-buyZoneDistance/100) and (strategy.position_avg_price - math.sum(ta.atr(20),avgDownATRSum)*strategy.opentrades > close or strategy.opentrades == 0 ) //and (momentumRSI < barrierLevel or not(useAbsoluteRSIBarrier))
isShort = momentumRSI > momentumRSI_slow*(1+buyZoneDistance/100) and (strategy.position_avg_price - math.sum(ta.atr(20),avgDownATRSum)*strategy.opentrades > close or strategy.opentrades == 0 ) and (momentumRSI > barrierLevel or not(useAbsoluteRSIBarrier))
momentumRSISoftClose = (momentumRSI > momentumRSI_slow) and (momentumRSI > barrierLevel or not(useAbsoluteRSIBarrier))
isClose = momentumRSISoftClose
plot(momentumRSI,color=isClose ? color.red : momentumRSI < momentumRSI_slow*(1-buyZoneDistance/100) ? color.green : color.white)
plot(momentumRSI_slow,color=color.gray)
plot(barrierLevel,color=useAbsoluteRSIBarrier ? color.white : color.rgb(0,0,0,0))
plot(momentumRSI_slow*(1-buyZoneDistance/100),color=color.gray)
plot(momentumRSI_slow*(1+buyZoneDistance/100),color=color.gray)
plot(momentumRSI_slow*(1+(buyZoneDistance*2)/100),color=color.gray)
// plot(strategy.wintrades - strategy.losstrades)
if(isBuy)
strategy.entry("Buy",strategy.long, comment="#"+str.tostring(strategy.opentrades+1))
// if(isShort)
// strategy.entry("Sell",strategy.short, comment="#"+str.tostring(strategy.opentrades+1))
if(isClose)
strategy.exit("Close",limit=close)