
DCA 쌍평선 해파리 거래 전략은 쌍평선 교차와 DCA (Dollar Cost Averaging, 정량 비용 평균법) 에 기반한 양적 거래 전략이다. 이 전략은 두 개의 다른 주기의 간단한 이동 평균 (SMA) 을 구매/판매 신호로 사용하며, DCA 방법을 사용하여 구매 비용을 감소시킨다. 빠른 SMA를 가로질러 느린 SMA를 통과할 때 구매 신호가 발생하고, 반대로 판매 신호가 발생한다. 이 전략은 시장의 중장기적 추세를 포착하고, DCA 방법을 통해 시장 변동으로 인한 위험을 줄이는 것을 목표로 한다.
DCA 쌍평선 해수욕 거래 전략은 쌍평선 교차를 통해 시장 추세를 포착하고 DCA 방법을 사용하여 구매 비용과 위험을 줄인다. 이 전략의 논리는 간단하고 적용 범위는 넓지만 실제 응용에서는 최적화 파라미터와 제어 위험을 주의해야 한다. 다른 기술 지표를 도입하고 DCA 파라미터를 최적화하고 스톱 스톱 메커니즘을 추가함으로써 전략의 성능과 안정성을 더욱 향상시킬 수 있다.
/*backtest
start: 2024-04-21 00:00:00
end: 2024-04-28 00:00:00
period: 10m
basePeriod: 1m
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/
// © loggolitasarim
//@version=5
strategy("DCA YSMA HSMA Stratejisi", overlay=true, calc_on_every_tick=true)
// Parametreler
sma_fast = input(14, "Hızlı SMA Dönemi")
sma_slow = input(28, "Yavaş SMA Dönemi")
dca_amount = input(100, "DCA Miktarı")
dca_interval = input(14, "DCA Aralığı (Gün)")
// Hızlı ve yavaş SMA hesaplamaları
fast_sma = ta.sma(close, sma_fast)
slow_sma = ta.sma(close, sma_slow)
// DCA hesaplamaları
var float dca_average_price = na
var int dca_count = na
if (bar_index % dca_interval == 0)
dca_count := nz(dca_count, 0) + 1
dca_average_price := nz(dca_average_price, close) * (dca_count - 1) + close
dca_average_price /= dca_count
// Alım ve satım sinyalleri
longCondition = ta.crossover(fast_sma, slow_sma)
shortCondition = ta.crossunder(fast_sma, slow_sma)
if (longCondition)
strategy.entry("Alım", strategy.long, qty=dca_amount)
if (shortCondition)
strategy.entry("Satım", strategy.short)
// Grafik
plot(fast_sma, "Hızlı SMA", color=color.blue)
plot(slow_sma, "Yavaş SMA", color=color.red)
// Uyarılar
alertcondition(longCondition, "Alım Sinyali", "Alım Sinyali")
alertcondition(shortCondition, "Satım Sinyali", "Satım Sinyali")