
이 전략은 Supertrend 지표를 사용하여 거래의 입구와 출구를 결정합니다. Supertrend은 동적 지원 저항과 가격 돌파의 개념을 결합한 트렌드 추적 지표입니다. 이 전략은 강력한 상승 추세를 포착하면서 위험을 엄격하게 통제하고 1: 5의 위험 수익률으로 거래합니다.
이 전략은 Supertrend 지표를 사용하여 강력한 상승 추세를 추적하면서 위험을 엄격하게 제어합니다. 그것은 추세적 기회를 잡을 수있는 간단하고 효과적인 프레임 워크를 제공합니다. 그러나 전략은 추세 반전과 변수 민감성 등의 위험에 직면 할 수 있습니다. 동적 변수를 최적화하고 다른 지표와 결합하여 시장 환경에 적응하고 자금 관리를 최적화함으로써 전략을 더욱 개선 할 수 있습니다.
/*backtest
start: 2024-05-01 00:00:00
end: 2024-05-31 23:59:59
period: 1h
basePeriod: 15m
exchanges: [{"eid":"Futures_Binance","currency":"BTC_USDT"}]
*/
//@version=5
strategy("Supertrend Strategy with 1:5 Risk Reward", overlay=true)
// Supertrend Indicator
factor = input(3.0, title="ATR Factor")
atrLength = input(10, title="ATR Length")
[supertrendUp, supertrendDown] = ta.supertrend(factor, atrLength)
supertrend = ta.crossover(ta.lowest(close, 1), supertrendDown) ? supertrendDown : supertrendUp
plot(supertrend, title="Supertrend", color=supertrend == supertrendUp ? color.green : color.red, linewidth=2, style=plot.style_line)
// Strategy parameters
risk = input(1.0, title="Risk in %")
reward = input(5.0, title="Reward in %")
riskRewardRatio = reward / risk
// Entry and exit conditions
longCondition = ta.crossover(close, supertrendUp)
if (longCondition)
// Calculate stop loss and take profit levels
stopLossPrice = close * (1 - (risk / 100))
takeProfitPrice = close * (1 + (reward / 100))
// Submit long order
strategy.entry("Long", strategy.long, stop=stopLossPrice, limit=takeProfitPrice)
// Exit conditions
shortCondition = ta.crossunder(close, supertrendDown)
if (shortCondition)
strategy.close("Long")