This strategy is an intelligent trading system based on multiple technical indicators, combining signals from Moving Averages (MA), Volume, and Average True Range (ATR) to capture market opportunities through comprehensive analysis of price trends, trading activity, and market volatility. The strategy employs a dual moving average system as the primary trend indicator, while incorporating volume and volatility as trading filters to achieve multiple validations of trading signals.
The core logic is based on three dimensions:
Trading signals are generated only when conditions in all three dimensions are simultaneously satisfied, significantly improving trading accuracy through this multi-filter mechanism.
This strategy constructs a comprehensive trading decision system through the synergistic analysis of multiple technical indicators. The design thoroughly considers market characteristics including trends, liquidity, and volatility, demonstrating strong practicality and reliability. Through continuous optimization and improvement, the strategy shows promise for maintaining stable performance across various market environments. Its modular design provides a solid foundation for future extensions, allowing flexible adjustments and optimizations based on actual needs.
/*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")