双方向トレンドフォロー戦略


作成日: 2023-09-17 18:20:27 最終変更日: 2023-09-17 18:20:27
コピー: 2 クリック数: 695
1
フォロー
1617
フォロワー

概要

この戦略は,Aroon指標による双方向のトレンドの識別と追跡に基づいています. Aroon指標は,市場のトレンドの方向を効果的に判断することができ,RSI指標と組み合わせて,超買い超売り領域の判断を行うことで,より完全な追跡戦略を形成します.

戦略原則

  1. Aroon指数を使用して価格のトレンド方向を判断する.指数0線以上は上昇傾向,0線以下は下降傾向である.

  2. Aroonの指数が0線を下から突破すると,買取操作が行われます.

  3. 倉庫が建設され,閉盘価格が買取価格より低くなっており,RSIが30を下回っている場合は,超売りとみなされ,倉庫を追加する.

  4. アルーン指数が0線を下回ると,全額で売ります.

  5. 5%のストップポイントを設定し,そのポイントを超えるとストップオフをします.

優位分析

  1. Aroonの指数は,トレンドの方向を判断するために使用され,市場の回転の点を効果的に捉えることができます.

  2. RSIは,市場転換点での高落追及を避けるために,超買超売の領域を判断するのに役立ちます.

  3. 双方向取引は,上昇と低下の両方の市場環境で利益を得ることができます.

  4. ストップポイントを設定することで,リスクをコントロールできます.

リスク分析

  1. Aroonの指標は遅滞しており,短期的および突然の反転を逃している可能性があります.

  2. 市場を効率的に処理できなければ,不必要な取引が多くなるでしょう.

  3. 双方向取引は取引頻度や手数料のコストを増加させます.

  4. 異なる周期と品種に対応するためにパラメータを適切に調整する必要があります.

最適化の方向

  1. 他の指標のフィルタリング信号と組み合わせると,遅滞による誤った取引の確率を減らす.

  2. 定量的な研究を増やし,異なる品種にマッチするパラメータの組み合わせを最適化する.

  3. 収益因子を増やすための 止まり止め戦略を導入する

  4. トレンドがはっきりしたときに取引する事を考え,無効取引を減らす.

要約する

この戦略は,AroonとRSIの2つの指標を統合して,より完全な双方向のトレンド取引戦略を形成する.しかし,誤った取引の確率を減らすために,他のフィルタリング指標と組み合わせて,さらに最適化パラメータの設定が必要である.パラメータの最適化とリスクの制御が実行された後,この戦略は,より安定した余剰利益を得る見込みである.

ストラテジーソースコード
/*backtest
start: 2023-09-09 00:00:00
end: 2023-09-12 00:00:00
period: 1m
basePeriod: 1m
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/
// © mohanee

//@version=4
// strategy(title="Aroon Oscillator Strategy", overlay=false, pyramiding=2,    initial_capital=10000, currency=currency.USD)  //default_qty_value=10, default_qty_type=strategy.fixed, 

//variables BEGIN
aroonLength=input(169,title="Aroon Length")   //square root of 13
rsiLength=input(13, title="RSI Length")
stopLoss = input(title="Stop Loss%", defval=5, minval=1)
//variables  END

//RSI 
rsi13=rsi(close,rsiLength)




// Drawings

//Aroon oscillator

arronUpper = 100 * (highestbars(high, aroonLength+1) + aroonLength)/aroonLength
aroonLower = 100 * (lowestbars(low, aroonLength+1) + aroonLength)/aroonLength

aroonOsc  = arronUpper - aroonLower

aroonMidpoint = 0
oscPlot = plot(aroonOsc, color=color.green)
midLine= plot(aroonMidpoint, color=color.green)
topLine = plot(90,style=plot.style_circles, color=color.green)
bottomLine = plot(-90,style=plot.style_circles, color=color.red)

fill(oscPlot, midLine, color=aroonOsc>0?color.green:color.red, transp=50)
fill(topLine,bottomLine, color=color.blue)


// RSI 
//plot(rsi13, title="RSI", linewidth=2, color=color.purple)
//hline(50, title="Middle Line", linestyle=hline.style_dotted)
//obLevel = hline(80, title="Overbought", linestyle=hline.style_dotted)
//osLevel = hline(30, title="Oversold", linestyle=hline.style_dotted)
//fill(obLevel, osLevel, title="Background", color=rsi13 >=30 ? color.green:color.purple, transp=65)  // longTermRSI >=50


//Entry--

strategy.entry(id="Long Entry", comment="LE",  long=true,  when= crossover(aroonOsc,0)   )     //crossover(close,ema34)  //and close>ema34  //crossover(rsi5Val,rsiBuyLine)

//Add
if(strategy.position_size>=1 and close < strategy.position_avg_price and crossover(rsi13,30))
    strategy.order(id="Long Entry", comment="Add", long=true )     //crossover(close,ema34)  //and close>ema34  //crossover(rsi5Val,rsiBuyLine)  --


stopLossVal= abs(strategy.position_size)>1 ? strategy.position_avg_price*(1-0.5) : 0.00 


//close partial
strategy.close(id="Long Entry", comment="Partial X",  qty=strategy.position_size/3, when=abs(strategy.position_size)>=1 and crossunder(aroonOsc, 90) )   //close<ema55 and rsi5Val<20 //ema34<ema55 


//close All
strategy.close(id="Long Entry", comment="Exit All",  when=abs(strategy.position_size)>=1 and crossunder(aroonOsc, 0) )   //close<ema55 and rsi5Val<20 //ema34<ema55  //close<ema89

//close All on stop loss
strategy.close(id="Long Entry", comment="Stoploss X",  when=abs(strategy.position_size)>=1 and close < stopLossVal )   //close<ema55 and rsi5Val<20 //ema34<ema55  //close<ema89