
突破回調取引戦略は,価格の絶対強度指数とMACD指数を計算して,特定のトレンドの下での突破回調取引を実現し,ショートライン取引戦略の1つである.この戦略は,複数の指標を統合して,大傾向,中期傾向および短期傾向を判断し,トレンド同向で指標互補の確認信号を使用してトレンド追跡を行う.
この戦略は,価格の絶対強度指数とMACD指数に基づいて,突破逆調取引を実現する.まずは,価格の9サイクル,21サイクルおよび50サイクルEMAを計算して,大トレンドの方向を判断する.次に,価格の絶対強度指数を計算して,短期調整の強さを反映する.最後に,短期トレンドの方向を判断するためにMACD指数を計算する.大トレンドが上昇し,短期調整が発生したとき,購入する.大トレンドが低下し,短期反発が発生したとき,販売する.
具体的には,品種大傾向は上昇のため9日EMAを21日EMAより高く,21日EMAを50日EMAより高く満たす必要がある.短期調整判断基準は,絶対強度指標差値が0より低い,MACDDIFFが0より小さいである.品種大傾向は下落のため9日EMAを21日EMAより低く,21日EMAを50日EMAより低いを満たす必要がある.短期反転判断基準は,絶対強度指標差値が0より高く,MACDDIFFが0より高いである.
この戦略の利点は以下の通りです.
この戦略にはいくつかのリスクがあります.
上記のリスクに対して,最適化パラメータによって,異なる周期指標を判断し,ポジション保持ルールを調整し,単一損失を制御し,より多くの指標フィルター信号と組み合わせて,精度を増やすなどにより改善することができる.
この戦略は以下の点で最適化できます.
概して,突破回調取引戦略は,全体的に比較して安定したショートライン取引戦略である.それは,大中短の多重トレンド判断を組み合わせて,波動的な状況で誤った取引を避ける.また,指標の組み合わせを使用すると判断の正確性が向上する.その後のテストと最適化により,この戦略は,長期にわたって保持する価値のある安定した戦略になることができる.
/*backtest
start: 2024-01-01 00:00:00
end: 2024-01-31 23:59:59
period: 1h
basePeriod: 15m
exchanges: [{"eid":"Futures_Binance","currency":"BTC_USDT"}]
*/
//@version=5
strategy("Divergence Scalper [30MIN]", overlay=true , commission_value=0.04 )
message_long_entry = input("long entry message")
message_long_exit = input("long exit message")
message_short_entry = input("short entry message")
message_short_exit = input("short exit message")
//3x ema
out9 = ta.ema(close,9)
out21 = ta.ema(close,21)
out50 = ta.ema(close,50)
//abs
absolute_str_formula( ) =>
top=0.0
bottom=0.0
if(close>close[1])
top:= nz(top[1])+(close/close[1])
else
top:=nz(top[1])
if(close<=close[1])
bottom:= nz(bottom[1])+(close[1]/close)
else
bottom:=nz(bottom[1])
if (top+bottom/2>=0)
1-1/(1+(top/2)/(bottom/2))
abs_partial=absolute_str_formula()
abs_final = abs_partial - ta.sma(abs_partial,50)
//macd
fast_length = input(title="Fast Length", defval=23)
slow_length = input(title="Slow Length", defval=11)
src = input(title="Source", defval=open)
signal_length = input.int(title="Signal Smoothing", minval = 1, maxval = 50, defval = 6)
sma_source = input.string(title="Oscillator MA Type", defval="EMA", options=["SMA", "EMA"])
sma_signal = input.string(title="Signal Line MA Type", defval="SMA", options=["SMA", "EMA"])
// Calculating
fast_ma = sma_source == "SMA" ? ta.sma(src, fast_length) : ta.ema(src, fast_length)
slow_ma = sma_source == "SMA" ? ta.sma(src, slow_length) : ta.ema(src, slow_length)
macd = fast_ma - slow_ma
signal = sma_signal == "SMA" ? ta.sma(macd, signal_length) : ta.ema(macd, signal_length)
hist = macd - signal
long= abs_final > 0 and hist <0 and out9<out21 and out21<out50
short = abs_final <0 and hist >0 and out9>out21 and out21>out50
long_exit = abs_final <0 and hist >0 and out9>out21 and out21>out50
short_exit = abs_final > 0 and hist <0 and out9<out21 and out21<out50
strategy.entry("long", strategy.long, when = long and barstate.isconfirmed, alert_message = message_long_entry)
strategy.entry("short", strategy.short, when = short and barstate.isconfirmed, alert_message = message_short_entry)
strategy.close("long", when = long_exit and barstate.isconfirmed, alert_message = message_long_exit)
strategy.close("short", when = short_exit and barstate.isconfirmed, alert_message = message_short_exit)