
이 전략은 인공지능 최적화와 다중 기술 지표를 결합한 적응 거래 시스템이다. 그것은 주로 브린 밴드, 상대적으로 약한 지수 ((RSI) 와 슈퍼 트렌드 ((Supertrend) 지표를 사용하여 거래 신호를 생성하고 인공지능 최적화를 통해 거래 매개 변수를 조정한다. 이 시스템은 또한 ATR 기반의 적응 손해 방지 장치를 포함하고 있으며, 이는 전략이 시장의 변동성에 따라 자동으로 위험 관리 매개 변수를 조정할 수 있게 한다.
전략은 거래 신호를 결정하기 위해 여러 층의 필터링 메커니즘을 사용합니다. 첫째, 부린을 통해 시장의 변동 범위를 결정합니다. 가격이 부린을 통과하고 RSI가 초매 지역에있을 때, 시스템은 더 많은 신호를 고려합니다. 반대로, 가격이 부린을 통과하고 RSI가 초매 지역에있을 때, 시스템은 누락 신호를 고려합니다. 슈퍼 트렌드 지표는 트렌드 확인 도구로서 가격과 슈퍼 트렌드의 위치 관계가 거래 방향에 부합하는 경우에만 거래가 수행됩니다. 인공 지능 모듈은 다양한 매개 변수를 최적화하여 전략의 적응력을 향상시킵니다.
이것은 전통적인 기술 분석과 현대 인공지능 기술을 결합하는 포괄적 인 거래 전략입니다. 다중 기술 지표의 조합 사용으로 전략은 시장 기회를 효과적으로 식별 할 수 있으며, 인공지능 최적화 모듈은 강력한 적응력을 제공합니다. 동적 중단 메커니즘은 전략에 대한 좋은 위험 제어 능력을 제공합니다. 전략에는 여전히 최적화가 필요한 부분이 있지만, 전체 설계 아이디어는 합리적이며, 좋은 실용적 가치와 개발 잠재력을 가지고 있습니다.
/*backtest
start: 2024-10-01 00:00:00
end: 2024-10-31 23:59:59
period: 1h
basePeriod: 1h
exchanges: [{"eid":"Futures_Binance","currency":"BTC_USDT"}]
*/
//@version=5
strategy("AI-Optimized Crypto Trading with Trailing Stop", overlay=true, precision=4)
// Input settings for AI optimization
risk_per_trade = input.float(1.0, title="Risk per Trade (%)", minval=0.1, maxval=100) / 100
atr_period = input.int(14, title="ATR Period") // ATR период должен быть целым числом
atr_multiplier = input.float(2.0, title="ATR Multiplier for Stop Loss")
take_profit_multiplier = input.float(2.0, title="Take Profit Multiplier")
ai_optimization = input.bool(true, title="Enable AI Optimization")
// Indicators: Bollinger Bands, RSI, Supertrend
rsi_period = input.int(14, title="RSI Period")
upper_rsi = input.float(70, title="RSI Overbought Level")
lower_rsi = input.float(30, title="RSI Oversold Level")
bb_length = input.int(20, title="Bollinger Bands Length")
bb_mult = input.float(2.0, title="Bollinger Bands Multiplier")
supertrend_factor = input.int(3, title="Supertrend Factor") // Изменено на целое число
// Bollinger Bands
basis = ta.sma(close, bb_length)
dev = bb_mult * ta.stdev(close, bb_length)
upper_band = basis + dev
lower_band = basis - dev
// RSI
rsi = ta.rsi(close, rsi_period)
// Supertrend calculation
atr = ta.atr(atr_period)
[supertrend, _] = ta.supertrend(atr_multiplier, supertrend_factor)
// AI-based entry/exit signals (dynamic optimization)
long_signal = (rsi < lower_rsi and close < lower_band) or (supertrend[1] < close and ai_optimization)
short_signal = (rsi > upper_rsi and close > upper_band) or (supertrend[1] > close and ai_optimization)
// Trade execution with trailing stop-loss
if (long_signal)
strategy.entry("Long", strategy.long, stop=close - atr * atr_multiplier, limit=close + atr * take_profit_multiplier)
if (short_signal)
strategy.entry("Short", strategy.short, stop=close + atr * atr_multiplier, limit=close - atr * take_profit_multiplier)
// Plotting the MAs and Ichimoku Cloud for visualization
plot(upper_band, color=color.red, title="Upper Bollinger Band")
plot(lower_band, color=color.green, title="Lower Bollinger Band")
plot(supertrend, color=color.blue, title="Supertrend")