
This strategy combines multiple technical indicators, including the Relative Strength Index (RSI), Moving Average Convergence Divergence (MACD), Bollinger Bands, and volume, to determine optimal trading opportunities. The strategy analyzes price and volume data to identify trends and volatility, and generates trading signals using momentum and volatility indicators. Additionally, the strategy introduces the concept of liquidity zones to further optimize trading signals.
This strategy combines multiple technical indicators, including RSI, MACD, Bollinger Bands, and volume, to form a comprehensive trading system. The strategy considers various aspects, such as price, trends, volatility, and market sentiment, and introduces the concept of liquidity zones to optimize trading signals. Although the strategy has certain advantages, it still faces challenges such as parameter optimization and market risks. In the future, the strategy can be further improved through dynamic parameter optimization, risk management, and machine learning methods.
/*backtest
start: 2024-05-01 00:00:00
end: 2024-05-31 23:59:59
period: 1h
basePeriod: 15m
exchanges: [{"eid":"Futures_Binance","currency":"BTC_USDT"}]
*/
//@version=5
strategy("Optimize Edilmiş Kapsamlı Ticaret Stratejisi - Likidite Bölgeleri ile 30 Dakika", overlay=true, default_qty_type=strategy.percent_of_equity, default_qty_value=10)
// Optimize edilebilir parametreler
rsiPeriod = input.int(14, minval=5, maxval=30, title="RSI Periyodu")
macdShortPeriod = input.int(12, minval=5, maxval=30, title="MACD Kısa Periyodu")
macdLongPeriod = input.int(26, minval=20, maxval=50, title="MACD Uzun Periyodu")
macdSignalPeriod = input.int(9, minval=5, maxval=20, title="MACD Sinyal Periyodu")
smaPeriod = input.int(20, minval=10, maxval=50, title="SMA Periyodu")
bollingerMultiplier = input.float(2.0, minval=1.0, maxval=3.0, title="Bollinger Bantları Çarpanı")
volumeSpikeMultiplier = input.float(1.5, minval=1.0, maxval=3.0, title="Hacim Artış Çarpanı")
shortTermMAPeriod = input.int(50, minval=20, maxval=100, title="Kısa Dönem MA Periyodu")
longTermMAPeriod = input.int(200, minval=100, maxval=300, title="Uzun Dönem MA Periyodu")
liquidityZonePeriod = input.int(50, minval=10, maxval=100, title="Likidite Bölgesi Periyodu")
// İndikatörleri Tanımla
rsi = ta.rsi(close, rsiPeriod)
[macdLine, signalLine, _] = ta.macd(close, macdShortPeriod, macdLongPeriod, macdSignalPeriod)
macdHist = macdLine - signalLine
basis = ta.sma(close, smaPeriod)
dev = bollingerMultiplier * ta.stdev(close, smaPeriod)
upperBand = basis + dev
lowerBand = basis - dev
volumeSpike = volume > ta.sma(volume, 20) * volumeSpikeMultiplier
// Hareketli Ortalamaları Kullanarak Trend Takibi
shortTermMA = ta.sma(close, shortTermMAPeriod)
longTermMA = ta.sma(close, longTermMAPeriod)
trendUp = shortTermMA > longTermMA
trendDown = shortTermMA < longTermMA
// Likidite Bölgelerini Belirleme
liquidityZoneHigh = ta.highest(high, liquidityZonePeriod)
liquidityZoneLow = ta.lowest(low, liquidityZonePeriod)
// Likidite Bölgelerini Çiz
plot(liquidityZoneHigh, color=color.red, title="Likidite Bölgesi Üst")
plot(liquidityZoneLow, color=color.green, title="Likidite Bölgesi Alt")
// Sinyal Durumlarını Saklamak İçin Değişkenler
var bool inPosition = false
var bool isBuy = false
// Al ve Sat Sinyali Bayrakları
var bool buyFlag = false
var bool sellFlag = false
// Bayrakları Sıfırla
buyFlag := false
sellFlag := false
// Al ve Sat Sinyallerini Tanımla
var bool buySignal = false
var bool sellSignal = false
if (barstate.isconfirmed)
buySignal := ((rsi < 30 and close < lowerBand and close > liquidityZoneLow) or
(macdHist > 0 and trendUp and close > ta.highest(high, 10)[1] and close > liquidityZoneLow) or
(volumeSpike and close > upperBand and close > liquidityZoneLow))
sellSignal := ((rsi > 70 and close > upperBand and close < liquidityZoneHigh) or
(macdHist < 0 and trendDown and close < ta.lowest(low, 10)[1] and close < liquidityZoneHigh) or
(volumeSpike and close < lowerBand and close < liquidityZoneHigh))
// Aynı Sinyali Tekrarlamamak İçin Kontroller
if (buySignal and (not inPosition or not isBuy))
inPosition := true
isBuy := true
buyFlag := true
sellFlag := false
strategy.entry("Buy", strategy.long)
if (sellSignal and inPosition and isBuy)
inPosition := false
isBuy := false
sellFlag := true
buyFlag := false
strategy.close("Buy")
// Sinyalleri Grafiğe Çiz
plotshape(series=buyFlag, location=location.belowbar, color=color.green, style=shape.labelup, text="AL")
plotshape(series=sellFlag, location=location.abovebar, color=color.red, style=shape.labeldown, text="SAT")
// Hareketli Ortalamaları ve Bollinger Bantlarını Çiz
plot(shortTermMA, color=color.blue, title="50 MA")
plot(longTermMA, color=color.orange, title="200 MA")
plot(upperBand, color=color.red, title="Üst Bant")
plot(lowerBand, color=color.green, title="Alt Bant")