
이동 평균 크로스 크로스 전략은 기술 지표에 기반한 양적 거래 전략이다. 이 전략은 두 개의 이동 평균 사이의 교차 관계를 계산하여 시장의 경향 방향을 판단하고 그에 따라 거래 신호를 생성한다.
이 전략의 핵심 지표는 두 개의 이동 평균입니다: 더 긴 기간의 40 주기의 간단한 이동 평균 ((SMA), 그리고 주식의 종결 가격. 주식의 종결 가격이 하향에서 40 주기의 SMA를 돌파했을 때, 시장 추세가 전환 될 수 있음을 나타내고 주식이 새로운 상승 추세로 들어가면 전략은 더 많은 것을 생성합니다.
마감 가격과 SMA의 돌파구 관계를 비교함으로써 가격 추세의 전환점을 포착할 수 있으며, 추세 방향에 따라 거래 결정을 내릴 수 있다.
이 전략에는 다음과 같은 장점이 있습니다.
이 전략에는 다음과 같은 위험도 있습니다.
SMA 파라미터를 조정하고, 스톱로스 라인을 설정하는 등의 방법으로 위험을 제어할 수 있다.
이 전략은 다음과 같은 부분에서 최적화될 수 있습니다.
이동 평균 가로 전략은 가격과 SMA의 관계 변화를 비교하여 추세를 판단하는 트렌드 회전이다. 이 전략은 간단하고 중장기 추세를 쉽게 추적하여 수익을 올릴 수 있으며, 동시에 수익 회전과 지연의 위험을 식별 할 수 있다. 매개 변수 설정과 조합 지표 판단을 통해 위험을 제어하고 의사결정 효과를 향상시킬 수 있다.
/*backtest
start: 2023-11-04 00:00:00
end: 2023-12-04 00:00:00
period: 1h
basePeriod: 15m
exchanges: [{"eid":"Futures_Binance","currency":"BTC_USDT"}]
*/
//@version=5
strategy(title="MA Crossover (40)", overlay=true)
// Input for the SMA length (24)
sma_length = input(40, title="SMA Length")
sma = ta.sma(close, sma_length)
// Determine if the current candle crosses above the 24-period SMA
longCondition = ta.crossover(close, sma)
// Determine if the current candle crosses and closes below the 24-period SMA
closeLongCondition = ta.crossunder(close, sma)
// Plot the 24-period SMA
plot(sma, color=color.blue, title="24-period SMA")
// Long entry signal
if (longCondition)
strategy.entry("Long", strategy.long)
// Close long position when the current candle crosses and closes below the 24-period SMA
if (closeLongCondition)
strategy.close("Long")
// Create alerts
alertcondition(longCondition, title="Candle Crosses Above SMA 40", message="Candle has crossed above SMA 40.")
alertcondition(longCondition, title="Candle Closes Above SMA 40", message="Candle has closed above SMA 40.")