
이 전략은 가격 트렌드를 포착하기 위해 두 개의 다른 주기의 간단한 이동 평균 (SMA) 을 사용하며 상대적으로 약한 지수 (RSI) 와 평균 실제 파도 (ATR) 지표를 사용하여 거래 신호 및 위험 관리를 최적화합니다. 단기 SMA에서 장기 SMA를 통과하면 구매 신호가 발생하고 판매 신호가 발생합니다. 동시에, 이 전략은 이동 스톱 스톱 손실 방식을 사용하여 가격 움직임에 따라 스톱 스톱 및 손실 위치를 조정하여 수익을 더 잘 보호하고 위험을 제어합니다.
평평선 교차 이동 중지 손실 전략은 클래식 기술 분석 원칙에 기반한 정량 거래 전략으로, 두 개의 다른 주기의 SMA를 통해 시장 추세를 포착하고 이동 중지 손실 방법을 사용하여 동적 위험을 제어한다. 이 전략은 또한 RSI와 ATR 지표를 결합하여 시장 상태를 더 포괄적으로 평가한다. 이 전략의 논리는 명확하고 구현하기 쉽지만, 실제 응용에서는 여전히 변수 최적화, 충격 시장 위험 및 추세 전환 위험과 같은 문제에 주의를 기울여야 한다.
/*backtest
start: 2023-05-23 00:00:00
end: 2024-05-28 00:00:00
period: 1h
basePeriod: 15m
exchanges: [{"eid":"Futures_Binance","currency":"BTC_USDT"}]
*/
//@version=5
// suitable for : AMZN - 30 minutes, MSFT - 30 minutes, NVDA -15 minutes
strategy("AAPL-SIMPLE_SMA", overlay=true)
// Create Indicator's
// Create Indicator's
shortSMA = ta.sma(close, 10)
longSMA = ta.sma(close, 30)
rsi = ta.rsi(close, 14)
atr = ta.atr(14)
qty = 1
// Specify crossover conditions
longCondition = ta.crossover(shortSMA, longSMA)
shortCondition = ta.crossunder(shortSMA, longSMA)
// // Execute trade if condition is True
if (longCondition)
stopLoss = close -2
// stopLoss=1
takeProfit = close +6
action = "buy"
strategy.entry("long", strategy.long, qty=qty)
// strategy.exit("exit", "long", stop=stopLoss, limit=takeProfit)
strategy.exit("exit", "long", limit=takeProfit)
alert('{"TICKER":"'+syminfo.ticker+'","ACTION":"'+action+'","PRICE":"'+str.tostring(close)+'","STOPLOSS":"'+str.tostring(stopLoss)+'","TAKEPROFIT":"'+str.tostring(takeProfit)+'","QTY":"'+str.tostring(qty)+'"}')
plot(shortSMA)
plot(longSMA, color=color.purple)