
Il s’agit d’une stratégie de trading quantitatif intraday qui combine de manière organique plusieurs indicateurs techniques pour construire un système de signaux de trading multidimensionnel en intégrant la moyenne pondérée de la transaction (VWAP), le niveau de régression de Fibonacci, l’indicateur de force relative (RSI) et la moyenne mobile simple (SMA). Cette stratégie recherche des opportunités de trading à haute probabilité dans les fluctuations du marché en s’associant de manière synchrone avec différents indicateurs.
La stratégie utilise un mécanisme de filtrage à plusieurs niveaux pour confirmer les signaux de transaction:
Il s’agit d’une stratégie de day trading globale et logiquement rigoureuse. La stratégie est très pratique et évolutive, et peut s’adapter à différents environnements de marché grâce à une optimisation des paramètres et à un contrôle des risques raisonnables. Cependant, l’utilisateur doit avoir une compréhension approfondie des caractéristiques de chaque indicateur, définir raisonnablement les paramètres et toujours faire attention au contrôle des risques.
/*backtest
start: 2025-01-25 00:00:00
end: 2025-02-18 08:00:00
period: 1d
basePeriod: 1d
exchanges: [{"eid":"Binance","currency":"ETH_USDT"}]
*/
// Pine Script v5 kodu
//@version=5
strategy("Intraday Strategy with VWAP, Fibonacci, RSI, and SMA", shorttitle="Intraday Strategy", overlay=true)
// Input settings
lengthRSI = input.int(14, title="RSI Length")
lengthFib = input.int(5, title="Fibonacci Lookback Period")
timeframeVWAP = input.timeframe("", title="VWAP Timeframe")
smaLength = input.int(9, title="SMA Length")
rsi = ta.rsi(close, lengthRSI)
sma = ta.sma(close, smaLength)
[fibHigh, fibLow] = request.security(syminfo.tickerid, timeframe.period, [high, low])
upper = fibHigh - (fibHigh - fibLow) * 0.382
lower = fibHigh - (fibHigh - fibLow) * 0.618
vwav = request.security(syminfo.tickerid, timeframeVWAP, ta.vwap(close))
price_above_vwap = close > vwav
// Trading conditions
buySignalRSI = ta.crossover(rsi, 30) and close > lower and close < upper and price_above_vwap
sellSignalRSI = ta.crossunder(rsi, 70) and close < upper and close > lower and not price_above_vwap
buySignalSMA = ta.crossover(close, sma)
sellSignalSMA = ta.crossunder(close, sma)
finalBuySignal = buySignalRSI or buySignalSMA
finalSellSignal = sellSignalRSI or sellSignalSMA
// Execute trades
if finalBuySignal
strategy.entry("Buy", strategy.long)
if finalSellSignal
strategy.entry("Sell", strategy.short)
// Plot signals
plotshape(finalBuySignal, title="Buy Signal", location=location.belowbar, color=color.green, style=shape.labelup, text="BUY")
plotshape(finalSellSignal, title="Sell Signal", location=location.abovebar, color=color.red, style=shape.labeldown, text="SELL")
// Plot VWAP, SMA, and levels
plot(vwav, color=color.blue, title="VWAP")
plot(sma, color=color.yellow, title="SMA 9")
lineUpper = plot(upper, color=color.orange, title="Fibonacci Upper")
lineLower = plot(lower, color=color.purple, title="Fibonacci Lower")