
이 전략의 핵심 아이디어는 RSI 지표와 맞춤형 AI 조건과 결합하여 거래 기회를 발견하는 것입니다. 이 전략은 여러 조건을 충족시키면 다단계 또는 공소수 포지션을 구축하고 고정된 스톱 스톱 손실 수준을 사용합니다.
이 전략은 다음과 같은 몇 가지 단계를 통해 이루어집니다.
이 전략은 또한 거래 신호가 형성될 때 경보를 발산하고 RSI 곡선을 차트에 그려줍니다.
이 전략에는 다음과 같은 장점이 있습니다.
이 전략에는 몇 가지 위험도 있습니다.
이러한 위험을 줄이는 방법은 RSI 변수를 조정하고, AI 조건을 최적화하고, 스톱 라인지를 적절하게 풀어주는 것입니다.
이 전략은 다음의 몇 가지 측면에서 최적화될 수 있습니다.
전체적으로, 이것은 RSI 지표와 AI 사용자 정의 조건에 기반하여 거래 할 수있는 사용자 정의 및 최적화 할 수있는 넓은 공간을 가진 고급 전략입니다. 그것은 여러 신호 출처를 조합하여 트렌드 방향을 판단하고, 위험 관리 및 스톱 손실 메커니즘을 적용하여 거래합니다. 이 전략은 사용자에게 더 나은 거래 효과를 제공 할 수 있으며, 또한 매우 강력한 확장성과 최적화 공간을 가지고 있습니다.
/*backtest
start: 2022-12-28 00:00:00
end: 2024-01-03 00:00:00
period: 1d
basePeriod: 1h
exchanges: [{"eid":"Futures_Binance","currency":"BTC_USDT"}]
*/
//@version=5
strategy("Improved RSI Scalping Strategy", overlay=true)
// Parameters
rsiLength = input.int(14, title="RSI Length")
rsiOverbought = input.int(70, title="RSI Overbought Threshold")
rsiOversold = input.int(30, title="RSI Oversold Threshold")
takeProfitPips = input.int(10, title="Take Profit (Pips)")
stopLossPips = input.int(5, title="Stop Loss (Pips)")
riskPercentage = input.float(1, title="Risk Percentage", minval=0, maxval=100, step=0.1)
// Calculate RSI
rsiValue = ta.rsi(close, rsiLength)
// Custom AI Conditions
aiCondition1Long = ta.crossover(rsiValue, 50)
aiCondition1Short = ta.crossunder(rsiValue, 50)
// Add more AI conditions here
var aiCondition2Long = ta.crossover(rsiValue, 30)
var aiCondition2Short = ta.crossunder(rsiValue, 70)
// Combine AI conditions with RSI
longCondition = aiCondition1Long or aiCondition2Long or ta.crossover(rsiValue, rsiOversold)
shortCondition = aiCondition1Short or aiCondition2Short or ta.crossunder(rsiValue, rsiOverbought)
// Calculate position size based on risk percentage
equity = strategy.equity
riskAmount = (equity * riskPercentage) / 100
positionSize = riskAmount / (stopLossPips * syminfo.mintick)
// Calculate Take Profit and Stop Loss levels
takeProfitLevel = close + takeProfitPips * syminfo.mintick
stopLossLevel = close - stopLossPips * syminfo.mintick
// Long entry
strategy.entry("Long Entry", strategy.long, when=longCondition[1] and not longCondition, qty=1)
strategy.exit("Take Profit/Stop Loss", from_entry="Long Entry", limit=takeProfitLevel, stop=stopLossLevel)
// Short entry
strategy.entry("Short Entry", strategy.short, when=shortCondition[1] and not shortCondition, qty=1)
strategy.exit("Take Profit/Stop Loss", from_entry="Short Entry", limit=takeProfitLevel, stop=stopLossLevel)
// Alerts
alertcondition(longCondition, title="Long Entry Signal", message="Long Entry Signal")
alertcondition(shortCondition, title="Short Entry Signal", message="Short Entry Signal")
// Plot RSI on the chart
plot(rsiValue, title="RSI", color=color.blue)