
이 전략은 이동 평균(MA), 거래량(Volume) 및 변동성(ATR)의 세 가지 차원의 시장 신호를 결합한 여러 가지 기술 지표를 기반으로 하는 지능형 거래 시스템입니다. 시장 기회를 포착하기 위한 변동성의 포괄적 분석. 이 전략은 추세를 판단하는 주요 기준으로 이중 이동 평균 시스템을 사용하고, 거래량과 변동성을 거래 필터 조건으로 도입하여 거래 신호에 대한 다중 검증을 달성합니다.
전략의 핵심 논리는 다음 세 가지 차원에 기초합니다.
이 전략은 이 세 가지 차원의 조건이 동시에 충족될 때만 거래 신호를 내보냅니다. 이러한 다중 필터링 메커니즘은 거래의 정확성을 효과적으로 향상시킵니다.
이 전략은 여러 기술 지표에 대한 협업적 분석을 통해 완전한 거래 의사 결정 시스템을 구축합니다. 전략 설계는 추세, 유동성, 변동성 등의 시장 특성을 충분히 고려하였으며, 매우 실용성과 신뢰성이 높습니다. 이 전략은 지속적인 최적화와 개선을 통해 다양한 시장 환경에서 안정적인 성과를 유지할 것으로 기대됩니다. 전략의 모듈식 설계는 이후 확장을 위한 좋은 기반을 제공하며, 실제 요구 사항에 따라 유연하게 조정 및 최적화할 수 있습니다.
/*backtest
start: 2019-12-23 08:00:00
end: 2025-01-04 08:00:00
period: 1d
basePeriod: 1d
exchanges: [{"eid":"Futures_Binance","currency":"BTC_USDT"}]
*/
//@version=5
strategy("Advanced Trading Strategy", overlay=true)
// Parâmetros de entrada
shortPeriod = input.int(9, title="Short Period", minval=1)
longPeriod = input.int(21, title="Long Period", minval=1)
volumeThreshold = input.float(1.5, title="Volume Threshold Multiplier", minval=0.1)
volatilityPeriod = input.int(14, title="Volatility Period", minval=1)
// Cálculo das médias móveis
shortSMA = ta.sma(close, shortPeriod)
longSMA = ta.sma(close, longPeriod)
// Cálculo do volume médio
averageVolume = ta.sma(volume, longPeriod)
// Cálculo da volatilidade (ATR - Average True Range)
volatility = ta.atr(volatilityPeriod)
// Condições de compra e venda baseadas em médias móveis
maBuyCondition = ta.crossover(shortSMA, longSMA)
maSellCondition = ta.crossunder(shortSMA, longSMA)
// Verificação do volume
volumeCondition = volume > averageVolume * volumeThreshold
// Condição de volatilidade (volatilidade acima de um certo nível)
volatilityCondition = volatility > ta.sma(volatility, volatilityPeriod)
// Condições finais de compra e venda
buyCondition = maBuyCondition and volumeCondition and volatilityCondition
sellCondition = maSellCondition and volumeCondition and volatilityCondition
// Plotando as médias móveis
plot(shortSMA, title="Short SMA", color=color.red)
plot(longSMA, title="Long SMA", color=color.blue)
// Sinal de compra
if (buyCondition)
strategy.entry("Buy", strategy.long)
// Sinal de venda
if (sellCondition)
strategy.close("Buy")
// Plotando sinais no gráfico
plotshape(series=buyCondition, title="Buy Signal", location=location.belowbar, color=color.green, style=shape.labelup, text="BUY")
plotshape(series=sellCondition, title="Sell Signal", location=location.abovebar, color=color.red, style=shape.labeldown, text="SELL")
// Configurando alertas
alertcondition(buyCondition, title="Buy Alert", message="Buy Signal Triggered")
alertcondition(sellCondition, title="Sell Alert", message="Sell Signal Triggered")