
This strategy is a quantitative trading system based on logarithmic transformation and Weighted Moving Average (WMA) crossovers. It reduces market noise by applying logarithmic transformation to price data and generates trading signals through the intersection of short-term and long-term WMAs. The core concept is to smooth price fluctuations in logarithmic space for more stable trend identification.
The strategy first applies logarithmic transformation to closing prices to minimize the impact of extreme price movements. It then calculates short-term (5-period) and long-term (20-period) weighted moving averages. The system generates long signals when the short-term WMA crosses above the long-term WMA, and short signals when the short-term WMA crosses below the long-term WMA. Trend transition points are identified through moving average crossovers in logarithmic space, enabling effective trend following.
This is a trend-following strategy combining logarithmic transformation and weighted moving averages. It reduces price volatility impact through logarithmic transformation and captures trend transition points using dual moving average crossovers. The strategy has clear logic and good operability but requires careful risk management in ranging markets. Through parameter optimization and additional indicator integration, this strategy has potential for improved performance.
/*backtest
start: 2022-02-09 00:00:00
end: 2025-02-06 08:00:00
period: 1d
basePeriod: 1d
exchanges: [{"eid":"Futures_Binance","currency":"BTC_USDT"}]
*/
//@version=6
strategy("Logaritmik WMA Al-Sat Stratejisi", overlay=true)
// Parametreler
shortWMA_length = input.int(5, title="Kısa WMA (5)")
longWMA_length = input.int(20, title="Uzun WMA (20)")
// Logaritmik Fiyat Hesaplaması
log_close = math.log(close) // Fiyatların logaritmasını alıyoruz
// Logaritmik WMA'ların Hesaplanması
log_shortWMA = ta.wma(log_close, shortWMA_length) // Kısa WMA (Log)
log_longWMA = ta.wma(log_close, longWMA_length) // Uzun WMA (Log)
// WMA'ları Normal Ölçeğe Geri Dönüştürme
shortWMA = math.exp(log_shortWMA) // Logaritmadan geri dönüştürülmüş kısa WMA
longWMA = math.exp(log_longWMA) // Logaritmadan geri dönüştürülmüş uzun WMA
// Al-Sat Koşulları
longCondition = ta.crossover(shortWMA, longWMA) // Kısa WMA uzun WMA'yı yukarı keserse
shortCondition = ta.crossunder(shortWMA, longWMA) // Kısa WMA uzun WMA'yı aşağı keserse
// WMA'ları Çizdirme
plot(shortWMA, color=color.green, title="Kısa WMA (Log)", linewidth=2, style=plot.style_line)
plot(longWMA, color=color.red, title="Uzun WMA (Log)", linewidth=2, style=plot.style_line)
// İşlem Girişleri
if (longCondition)
strategy.entry("AL", strategy.long)
if (shortCondition)
strategy.entry("SAT", strategy.short)
// Alarm Fonksiyonu
if (longCondition)
alert("AL Sinyali: Kısa WMA (Log), Uzun WMA (Log)'yı yukarı kesti.", alert.freq_once_per_bar_close)
if (shortCondition)
alert("SAT Sinyali: Kısa WMA (Log), Uzun WMA (Log)'yı aşağı kesti.", alert.freq_once_per_bar_close)