この戦略は,相対強度指数 (RSI),移動平均収束差異 (MACD),ボリンジャー帯,およびボリュームを含む複数の技術指標を組み合わせ,最適な取引機会を決定する.この戦略は,トレンドと変動性を特定するために価格とボリュームデータを分析し,モメンタムと変動性の指標を使用して取引信号を生成する.さらに,この戦略は,取引信号をさらに最適化するために流動性ゾーンの概念を導入する.
この戦略は,RSI,MACD,ボリンジャー帯,およびボリュームを含む複数の技術指標を組み合わせ,包括的な取引システムを形成する.この戦略は価格,トレンド,変動,市場情緒などのさまざまな側面を検討し,取引信号を最適化するために流動性ゾーンの概念を導入する.この戦略には一定の利点があるが,パラメータ最適化や市場リスクなどの課題に直面している.将来,戦略はダイナミックパラメータ最適化,リスク管理,機械学習方法によってさらに改善することができる.
/*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")