
この戦略は,複数の技術指標に基づいたトレンド追跡と動力の取引システムである.これは,潜在的に多重な取引機会を識別するために,主に平均トレンド指標 ((ADX),相対的に強い指標 ((RSI) と実際の波幅 ((ATR) を組み合わせ,ATRを使用して動的な利益と停止価格を設定する.この戦略は,1分間の期許取引に特に適しており,厳格な入場条件とリスク管理により取引の成功率を向上させる.
戦略の中核となるロジックには、次の主要なコンポーネントが含まれます。
この戦略は,複数の技術指標を総合的に使用することによって,完全な取引システムを構築している.その優点は,傾向と動態分析を組み合わせ,ダイナミックなリスク管理方法を採用していることである.ある程度のリスクがあるにもかかわらず,合理的なパラメータ最適化とリスク管理措置によって,実際の取引で安定したパフォーマンスを得ることができる.トレーダーは,実況使用の前に,戦略に十分な反測とパラメータ最適化を行い,特定の取引品種の特徴に応じて適切な調整を行うことをお勧めする.
/*backtest
start: 2024-02-21 00:00:00
end: 2025-02-18 08:00:00
period: 1d
basePeriod: 1d
exchanges: [{"eid":"Binance","currency":"ETH_USDT"}]
*/
// This Pine Script™ code is subject to the terms of the Mozilla Public License 2.0 at https://mozilla.org/MPL/2.0/
// © SPcuttack
//@version=6
strategy("ADX & RSI Strategy with ATR Targets", overlay=true)
// Input parameters
adxLength = input.int(14, title="ADX Length")
adxSmoothing = input.int(14, title="ADX Smoothing")
rsiLength = input.int(14, title="RSI Length")
rsiSmaLength = input.int(20, title="RSI SMA Length")
atrLength = input.int(14, title="ATR Length")
atrMultiplierTarget = input.float(2.5, title="ATR Multiplier for Target")
atrMultiplierStop = input.float(1.5, title="ATR Multiplier for Stop Loss")
// ADX and DMI calculations
[adx, plusDI, minusDI] = ta.dmi(adxLength, adxSmoothing)
// RSI calculations
rsi = ta.rsi(close, rsiLength)
rsiSma = ta.sma(rsi, rsiSmaLength)
// ATR calculation
atr = ta.atr(atrLength)
// Slope calculations (difference from the previous value)
adxSlope = adx - adx[1]
rsiSlope = rsi - rsi[1]
// Entry conditions
adxCondition = adx > 18 and plusDI > minusDI and adxSlope > 0
rsiCondition = rsi > rsiSma and rsiSlope > 0
rsiCross60 = ta.crossover(rsi, 60)
// Global variable for long entry
var bool longEntry = false
if (adxCondition and rsiCondition and rsiCross60)
longEntry := true
else
longEntry := false
// Variables for target and stop loss levels
var float entryPrice = na
var float targetLevel = na
var float stopLossLevel = na
// Strategy actions
if (longEntry)
entryPrice := close
targetLevel := entryPrice + atr * atrMultiplierTarget
stopLossLevel := entryPrice - atr * atrMultiplierStop
strategy.entry("Long", strategy.long)
if (strategy.position_size > 0)
if (close >= targetLevel)
strategy.close("Long", comment="Tgt Hit")
if (close <= stopLossLevel)
strategy.close("Long", comment="SL Hit")
// Ensure lines plot on the chart body
targetLine = strategy.position_size > 0 ? targetLevel : na
stopLossLine = strategy.position_size > 0 ? stopLossLevel : na
plot(targetLine, title="Target Level", color=color.green, linewidth=2, offset=0)
plot(stopLossLine, title="Stop Loss Level", color=color.red, linewidth=2, offset=0)
// Add entry price for reference
plot(strategy.position_size > 0 ? entryPrice : na, title="Entry Price", color=color.blue, linewidth=1, style=plot.style_cross, offset=0)