
Il s’agit d’une stratégie de négociation intraday combinant une moyenne pondérée en volume de transaction (VWAP), un indicateur d’amplitude réelle (ATR) et une analyse du comportement des prix. Cette stratégie permet de juger de la tendance du marché en observant le croisement des prix avec le VWAP, tout en utilisant l’ATR pour définir des objectifs de stop-loss et de prise de profit. L’idée centrale de la stratégie est de rechercher des opportunités de négociation lorsque les prix reviennent au VWAP et de contrôler les risques avec l’ATR.
La stratégie repose principalement sur les principes suivants:
Il s’agit d’une stratégie de trading quantitatif combinant l’analyse technique et la gestion dynamique des risques. Grâce à l’utilisation conjointe du VWAP et de l’ATR, l’objectivité des signaux de trading est garantie et un contrôle efficace des risques est réalisé. La conception de la stratégie est conforme aux exigences de la négociation quantitative moderne, avec une meilleure praticité et une évolutivité.
/*backtest
start: 2019-12-23 08:00:00
end: 2024-11-25 08:00:00
period: 1d
basePeriod: 1d
exchanges: [{"eid":"Futures_Binance","currency":"BTC_USDT"}]
*/
//@version=5
strategy("Price Action + VWAP + ATR Intraday Strategy", overlay=true)
// VWAP Calculation
vwapValue = ta.vwap(close)
// ATR Calculation (14-period)
atr = ta.atr(14)
// Price Action Setup for Bullish and Bearish Trades
bullishCondition = close > vwapValue and close[1] < vwapValue // Price above VWAP (Bullish bias) and Price action pullback to VWAP
bearishCondition = close < vwapValue and close[1] > vwapValue // Price below VWAP (Bearish bias) and Price action rally to VWAP
// Set stop loss and take profit based on ATR
atrMultiplier = 1.5
longStopLoss = low - atr
shortStopLoss = high + atr
longTakeProfit = close + (atr * atrMultiplier)
shortTakeProfit = close - (atr * atrMultiplier)
// Entry and Exit Rules
// Bullish Trade: Price pullback to VWAP and a bounce with ATR confirmation
if (bullishCondition and ta.crossover(close, vwapValue))
strategy.entry("Long", strategy.long)
strategy.exit("Take Profit/Stop Loss", from_entry="Long", limit=longTakeProfit, stop=longStopLoss)
// Bearish Trade: Price rally to VWAP and a rejection with ATR confirmation
if (bearishCondition and ta.crossunder(close, vwapValue))
strategy.entry("Short", strategy.short)
strategy.exit("Take Profit/Stop Loss", from_entry="Short", limit=shortTakeProfit, stop=shortStopLoss)
// Plot VWAP on the chart
plot(vwapValue, color=color.blue, linewidth=2, title="VWAP")
// Plot ATR on the chart for reference (Optional)
plot(atr, title="ATR", color=color.orange, linewidth=1)