该策略是一个基于多重技术指标的趋势跟踪和动量交易系统。它结合了布林带(Bollinger Bands)、相对强弱指标(RSI)和能量潮指标(OBV)三个主要技术指标,通过分析价格波动、动量和交易量来识别市场趋势和交易机会。策略采用中长期持仓方式,在市场呈现明显上升趋势且动量强劲时进场做多,在价格跌破布林带下轨时平仓出场。
策略的核心逻辑基于以下三个方面: 1. 使用布林带(BB)判断价格趋势 - 当价格位于布林带中轨之上时,表明上升趋势成立。布林带参数设置为20日均线和2倍标准差。 2. 使用相对强弱指标(RSI)确认价格动量 - RSI大于50表明价格具有上升动量。RSI参数设置为14日。 3. 使用能量潮指标(OBV)验证交易量支撑 - OBV的10日指数移动平均线上升,说明成交量配合价格上涨。
入场信号需要同时满足:价格高于布林带中轨、RSI大于50、OBV趋势向上。 出场信号为:价格跌破布林带下轨。
该策略是一个稳健的趋势跟踪系统,通过多重技术指标的配合使用,能够有效捕捉市场趋势性机会。策略逻辑清晰,参数设置合理,具有较好的实用性。通过建议的优化方向,策略的稳定性和收益性还可以进一步提升。在实盘应用时,建议根据具体市场特点和资金规模做相应调整。
/*backtest
start: 2024-02-18 00:00:00
end: 2025-02-17 00:00:00
period: 1h
basePeriod: 1h
exchanges: [{"eid":"Futures_Binance","currency":"BTC_USDT"}]
*/
// This Pine Script™ code is subject to the terms of the Mozilla Public License 2.0 at https://mozilla.org/MPL/2.0/
// © ahmetkaratas4238
//@version=5
strategy("İstanbul Stratejisi", overlay=true)
// Bollinger Bantları Hesaplamaları
bbLength = 20
bbMult = 2.0
basis = ta.sma(close, bbLength)
dev = bbMult * ta.stdev(close, bbLength)
upperBand = basis + dev
lowerBand = basis - dev
// RSI Hesaplamaları
rsiLength = 14
rsi = ta.rsi(close, rsiLength)
rsiThreshold = 50
// OBV Hesaplaması
obv = ta.cum(volume * math.sign(ta.change(close))) // ta.cum yerine ta.cumulative kullanılmalı
obvTrend = ta.ema(obv, 10) > ta.ema(obv[1], 10) // OBV'nin yükseliş trendinde olup olmadığını kontrol eder
// ALIM ŞARTLARI
buyCondition = close > basis and rsi > rsiThreshold and obvTrend
// SATIM ŞARTI
sellCondition = close < lowerBand
// Alım İşlemi Aç
if buyCondition
strategy.entry("Long", strategy.long)
// Satım İşlemi Yap (Pozisyon Kapat)
if sellCondition
strategy.close("Long")
// Bollinger Bantlarını Göster
plot(upperBand, title="Üst Bollinger Bandı", color=color.red)
plot(lowerBand, title="Alt Bollinger Bandı", color=color.green)
plot(basis, title="Orta Bollinger Bandı", color=color.blue)
// Alım ve Satım Sinyallerini İşaretle
plotshape(series=buyCondition, location=location.belowbar, color=color.green, style=shape.labelup, title="Alım Sinyali")
plotshape(series=sellCondition, location=location.abovebar, color=color.red, style=shape.labeldown, title="Satım Sinyali")