
この戦略は,価格の形状と技術指標の組み合わせに基づいた定量取引システムである.これは,主に三角形状の突破を識別し,RSI指標の動力の確認と組み合わせて取引を行う.この戦略は,線形回帰方法を使用して,上下トレンドラインを構築し,価格の突破とRSIの位置から取引信号を決定し,形状分析と動力の分析の有機的な組み合わせを実現する.
戦略の核心的な論理には2つの主要な部分が含まれています. 三角形の形状認識とRSIの動態確認. まず,線形回帰法を使用して,最新のNサイクルの高点と低点を計算し,上下トレンドラインの三角形を形成します. 価格が上下トレンドラインを突破し,RSIが50を超えると,多信号を触発し,価格が下下トレンドラインを突破し,RSIが50未満になると,空信号を触発します.
三角突破結合RSI動力の戦略は,構造が整った,論理が明確な量化取引システムである.形状と動力の二重確認機構によって,取引信号の信頼性が効果的に向上する.ある程度のリスクがあるが,合理的なパラメータ最適化とリスク管理措置によって,この戦略は良好な実用的な価値を持っている.現場で使用する時には,特定の市場の特徴に応じて十分なパラメータ最適化と裏付けを推奨する.
/*backtest
start: 2019-12-23 08:00:00
end: 2024-12-04 00:00:00
period: 1d
basePeriod: 1d
exchanges: [{"eid":"Futures_Binance","currency":"BTC_USDT"}]
*/
//@version=5
strategy("Triangle Breakout with RSI", overlay=true)
// Input parameters
len = input.int(15, title="Triangle Length")
rsiPeriod = input.int(14, title="RSI Period")
rsiThresholdBuy = input.int(50, title="RSI Threshold for Buy")
rsiThresholdSell = input.int(50, title="RSI Threshold for Sell")
// Calculate the RSI
rsi = ta.rsi(close, rsiPeriod)
// Calculate highest high and lowest low for triangle pattern
highLevel = ta.highest(high, len)
lowLevel = ta.lowest(low, len)
// Create trendlines for the triangle
upperTrend = ta.linreg(high, len, 0)
lowerTrend = ta.linreg(low, len, 0)
// Plot the trendlines on the chart
plot(upperTrend, color=color.green, linewidth=2, title="Upper Trendline")
plot(lowerTrend, color=color.red, linewidth=2, title="Lower Trendline")
// Detect breakout conditions
breakoutUp = close > upperTrend
breakoutDown = close < lowerTrend
// Confirm breakout with RSI
buyCondition = breakoutUp and rsi > rsiThresholdBuy
sellCondition = breakoutDown and rsi < rsiThresholdSell
// Plot breakout signals with confirmation from RSI
plotshape(series=buyCondition, title="Buy Signal", location=location.belowbar, color=color.green, style=shape.labelup, size=size.small)
plotshape(series=sellCondition, title="Sell Signal", location=location.abovebar, color=color.red, style=shape.labeldown, size=size.small)
// Strategy: Buy when triangle breaks upwards and RSI is above 50; Sell when triangle breaks downwards and RSI is below 50
if (buyCondition)
strategy.entry("Buy", strategy.long)
if (sellCondition)
strategy.entry("Sell", strategy.short)
// Plot RSI on the bottom pane
hline(50, "RSI 50 Level", color=color.gray, linestyle=hline.style_dotted)
plot(rsi, color=color.blue, linewidth=2, title="RSI")