
概要:この戦略は,ブリン・チャネル,KDJ指標,およびトレンド・トラッキングを利用して価格突破操作を行う戦略である. 突破点で買入および販売操作を行うことができ,リスクを管理するためにストップラインを設定できます.
戦略の原則:
優位分析:
リスクと改善:
オピティマイゼーション:
結論から言うと
この戦略は,ブルリン・チャネル,RSIなどの複数の指標を総合的に使用して,買入と売却のタイミングを判断し,一定の取引信号の正確性を保証する一方で,リスクを制御するために損失を設定します.しかし,特定の品種に対してパラメータを最適化して,シグナルをより正確で信頼できるようにする必要があります.さらに,複数の要因を構成するより多くの要因を加えることも考えることができます.
/*backtest
start: 2023-12-01 00:00:00
end: 2023-12-31 23:59:59
period: 1h
basePeriod: 15m
exchanges: [{"eid":"Futures_Binance","currency":"BTC_USDT"}]
*/
//@version=4
strategy("Custom Strategy", overlay=true)
length = 14
mult = 0.75
atr = atr(length) * mult
// Moving averages
ma15 = sma(close, 15)
ma30 = sma(close, 30)
// Bullish Engulfing pattern
bullishEngulfing = close[1] < open[1] and close > open and close[1] < open and close > open[1]
// Bearish Engulfing pattern
bearishEngulfing = close[1] > open[1] and close < open and close[1] > open and close < open[1]
// RSI
rsi = rsi(close, length)
// Buy condition
if (bullishEngulfing and close[1] > ma15 and rsi > 50)
strategy.entry("Buy", strategy.long)
strategy.exit("Sell", "Buy", stop=close - atr)
// Sell condition
if (bearishEngulfing and close[1] < ma15 and rsi < 50)
strategy.entry("Sell", strategy.short)
strategy.exit("Cover", "Sell", stop=close + atr)
// Plotting
plotshape(series=strategy.position_size > 0, title="Buy", location=location.belowbar, color=color.green, style=shape.labelup, text="Buy")
plotshape(series=strategy.position_size < 0, title="Sell", location=location.abovebar, color=color.red, style=shape.labeldown, text="Sell")