
Die Strategie baut ein umfassendes Handelssystem auf, indem sie mehrere Transaktionsindikatoren wie OBV, A/D-Leitung, CMF, MFI, VWAP, Transaktionsoscillator und Transaktions-RSI integriert. Im Mittelpunkt der Strategie steht die Verbesserung der Handelsgenauigkeit durch Signalbestätigung von mehreren Indikatoren, die nur dann ausgeführt werden, wenn mehr als 4 Indikatoren gleichzeitig ein Kauf- oder Verkaufssignal geben.
Die Strategie basiert auf mehrfachen Kennzahlen, darunter:
Wenn mehr als vier Indikatoren gleichzeitig einheitliche Signale geben, wird die Strategie als eine starke Trendchance angesehen, wodurch der Handel stattfindet.
Es handelt sich um eine auf mehreren Transaktionsvolumenindikatoren basierende, integrierte Handelsstrategie, die die Genauigkeit von Transaktionen durch eine mehrdimensionale Analyse des Marktes verbessert. Die Strategie hat eine starke theoretische Grundlage und praktische Bedeutung, erfordert jedoch in der praktischen Anwendung eine angemessene Parameteroptimierung und Risikomanagement entsprechend der Marktlage.
/*backtest
start: 2024-01-01 00:00:00
end: 2024-11-11 00:00:00
period: 1d
basePeriod: 1d
exchanges: [{"eid":"Futures_Binance","currency":"BTC_USDT"}]
*/
//@version=5
strategy("Combined Volume Indicators Strategy", overlay=true)
// تنظیمات
lengthRSI = 14
lengthMFI = 14
lengthCMF = 20
fastLength = 5
slowLength = 10
// محاسبه OBV
obv = ta.cum(close > close[1] ? volume : close < close[1] ? -volume : 0)
// محاسبه A/D بهصورت دستی
var float ad = na
ad := na(ad[1]) ? 0 : ad[1] + ((close - low) - (high - close)) / (high - low) * volume
// محاسبه CMF (Chaikin Money Flow)
moneyFlowMultiplier = ((close - low) - (high - close)) / (high - low)
moneyFlowVolume = moneyFlowMultiplier * volume
cmf = ta.sma(moneyFlowVolume, lengthCMF) / ta.sma(volume, lengthCMF)
// محاسبه MFI بهصورت دستی
typicalPrice = (high + low + close) / 3
moneyFlow = typicalPrice * volume
// محاسبه جریان پول مثبت و منفی
positiveFlow = 0.0
negativeFlow = 0.0
for i = 0 to lengthMFI - 1
positiveFlow := positiveFlow + (close[i] > close[i + 1] ? moneyFlow[i] : 0)
negativeFlow := negativeFlow + (close[i] < close[i + 1] ? moneyFlow[i] : 0)
mfi = 100 - (100 / (1 + (positiveFlow / negativeFlow)))
// محاسبه VWAP
vwap = ta.vwap(close)
// محاسبه Volume Oscillator
fastVolMA = ta.sma(volume, fastLength)
slowVolMA = ta.sma(volume, slowLength)
volumeOscillator = fastVolMA - slowVolMA
// محاسبه VRSI (Volume RSI)
vrsi = ta.rsi(volume, lengthRSI)
// شمارش اندیکاتورهای سیگنال خرید
buySignals = 0
buySignals := buySignals + (obv > obv[1] ? 1 : 0)
buySignals := buySignals + (ad > ad[1] ? 1 : 0)
buySignals := buySignals + (cmf > 0 ? 1 : 0)
buySignals := buySignals + (mfi < 40 ? 1 : 0)
buySignals := buySignals + (close < vwap ? 1 : 0)
buySignals := buySignals + (volumeOscillator > 0 ? 1 : 0)
buySignals := buySignals + (vrsi < 40 ? 1 : 0)
// شمارش اندیکاتورهای سیگنال فروش
sellSignals = 0
sellSignals := sellSignals + (obv < obv[1] ? 1 : 0)
sellSignals := sellSignals + (ad < ad[1] ? 1 : 0)
sellSignals := sellSignals + (cmf < 0 ? 1 : 0)
sellSignals := sellSignals + (mfi > 60 ? 1 : 0)
sellSignals := sellSignals + (close > vwap ? 1 : 0)
sellSignals := sellSignals + (volumeOscillator < 0 ? 1 : 0)
sellSignals := sellSignals + (vrsi > 60 ? 1 : 0)
// شرایط سیگنال خرید: اگر بیش از 4 اندیکاتور سیگنال خرید دهند
buyCondition = (buySignals > 4)
// شرایط سیگنال فروش: اگر بیش از 4 اندیکاتور سیگنال فروش دهند
sellCondition = (sellSignals > 4)
// ورود به معامله خرید
if (buyCondition)
strategy.entry("Buy", strategy.long)
// خروج از معامله فروش
if (sellCondition)
strategy.close("Buy")
// رسم سیگنالهای خرید و فروش بر روی چارت
plotshape(buyCondition, title="Buy Signal", location=location.belowbar, color=color.green, style=shape.labelup, text="BUY")
plotshape(sellCondition, title="Sell Signal", location=location.abovebar, color=color.red, style=shape.labeldown, text="SELL")