
超トレンド逆転戦略は,超トレンド指標とRSI指標を組み合わせた逆転取引戦略である.この戦略は,超トレンドを使用して市場の傾向の方向を判断し,その後RSI指標と組み合わせて逆転の機会を特定し,トレンドの逆転点で取引する.
スーパートレンド反転戦略は主に2つの部分から構成されています.
スーパートレンド指数は,現在の価格と一定の周期の平均実際の波幅の価格を計算して,トレンドの方向を判断します.価格が上線を突破すると看板であり,価格が下線を突破すると下落です.
RSI指標は,一期間の終盤上昇日数と下落日数を比較して,現在超買い状態にあるかどうかを判断する.超トレンド指標と組み合わせて,トレンドの逆転のタイミングを検出することができます.
この戦略では,一定のトランスフォーメーションによって処理されたRSI曲線を得て,値線を設定し,RSI曲線が相応の値を破るときに買入と売却のシグナルを生成します.
スーパートレンド反転戦略は,トレンドと反転指標を組み合わせ,トレンドの力を総合的に考慮し,超買いと超売り現象を考慮し,比較的良い位置で平和なポジションを開け,優れた戦略の利益を得ることができます.
主要な優位性は以下の通りです.
スーパートレンドの逆転策にはいくつかのリスクがあります.
逆転信号は偽信号であり,逆転が成功しない場合,損失が増加する可能性があります.
不適切なパラメータ最適化により,戦略が過度に適合し,市場の変化に適応できない可能性があります.
すべての技術指標が遅れているため,最適なエントリー位置を逃す可能性があります.
これらのリスクに対して,他の指標を組み合わせ,パラメータ最適化方法を調整するなど,さらなる最適化と改善が可能である.
スーパートレンド反転戦略は,市場と需要に応じて,以下の次元で最適化できます.
スーパートレンド逆転戦略は,トレンド取引と逆転取引を融合させ,順番を順番にすることも,逆転点でポジションを開くこともできる.パラメータを継続的にテストし,最適化し,リスクを適切に制御することによって,この戦略は,安定した戦略的利益を得ることができる.最適化余地も非常に大きく,市場の実際の状況に応じて調整することができる.
/*backtest
start: 2022-12-21 00:00:00
end: 2023-12-27 00:00:00
period: 1d
basePeriod: 1h
exchanges: [{"eid":"Futures_Binance","currency":"BTC_USDT"}]
*/
//@version=3
strategy(title = "Super-Trend-reverse Strategy", overlay = true)
// Super Trend Strategy
Factor=input(2,type =float, minval=1,maxval = 100)
Pd=10 //input(10,minval=1,maxval = 100)
// ST1
UP=hlc3-(Factor*atr(Pd))
DOWN=hlc3+(Factor*atr(Pd))
// ST1.2
TrendUp=na
TrendUp:=close[1]>TrendUp[1]? max(UP,TrendUp[1]) : UP
TrendDown=na
TrendDown:=close[1]<TrendDown[1]? min(DOWN,TrendDown[1]) : UP
Trend = na
Tsl = na
Trend := close[1] > TrendDown[1] ? 1: close[1] < TrendUp[1]? -1: nz(Trend[1],1)
Tsl := Trend==1 ? TrendUp: TrendDown
/////////////// Functions for Reverse //////////////////////////////
IF(input) => (exp(2*input)-1) / (exp(2*input)+1)
//////////////////////// RSI REVERSE /////////////////////
RSI_main = input(14, title="RSI Main Period")
RSI_smooth = input(5, title="RSI Smooth Period")
//Functions
RVS(input) => (exp(2*input)-1) / (exp(2*input)+1)
//RSI Calculation
raw_RSI=0.1*(rsi(close,RSI_main)-50)
wma_RSI=wma(raw_RSI,RSI_smooth)
RVS_RSI = RVS(wma_RSI)
threshold1 = RVS_RSI < 0.8? 1 : 0
threshold2 = -0.8
RSIbuy = (RVS_RSI<threshold2)
RSIsell = (RVS_RSI > threshold1)
////////////////////// RSI REVERSE ///////////////////////
// Conditions
longCond = na
shortCond = na
longCond := RSIbuy and crossover(close, Tsl)
shortCond := RSIsell and crossunder(close, Tsl)
yearfrom = input(2018)
yearuntil =input(2039)
monthfrom =input(6)
monthuntil =input(12)
dayfrom=input(1)
dayuntil=input(31)
if ( longCond and year >= yearfrom and year <= yearuntil and month>=monthfrom and month <=monthuntil and dayofmonth>=dayfrom and dayofmonth < dayuntil)
strategy.entry("BUY", strategy.long, stop=close, oca_name="TREND", comment="BUY")
else
strategy.cancel(id="BUY")
if ( shortCond and year >= yearfrom and year <= yearuntil and month>=monthfrom and month <=monthuntil and dayofmonth>=dayfrom and dayofmonth < dayuntil )
strategy.close("BUY")