
이 전략은 자기 적응 이동 평균 지표 (AIOMA) 와 중화 이동 평균 지표 (WMA) 를 기반으로 거래 신호를 구현한다. AIOMA와 WMA의 교차로 구매 및 판매 신호를 생성한다.
AIOMA-WMA 적응 교차 전략
이 전략은 다음과 같은 부분들을 포함하고 있습니다.
AIOMA 지표 계산
WMA 지수 계산
거래 신호 생성
거래 로직
적절한 최적화 매개 변수, 정지점 설정, 또는 다른 지표 필터링과 결합하여 위험을 줄일 수 있습니다.
이 전략은 AIOMA와 WMA의 두 지표의 장점을 통합하여 교차하여 거래 신호를 생성한다. 단일 이동 평균에 비해 신호 품질을 향상시킬 수 있다. 파라미터 최적화, 스톱 손실 전략 및 변동성 필터링 등의 추가적인 개선을 통해 안정적이고 신뢰할 수있는 거래 시스템이 될 수 있다.
/*backtest
start: 2023-12-01 00:00:00
end: 2023-12-31 23:59:59
period: 1h
basePeriod: 15m
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/
// © SDTA
//@version=5
strategy("AIOMA-WMA Strategy", overlay=true)
// Parametreler
aioma_length = input(14, "AIOMA Length")
wma_length = input(21, "WMA Length")
// AIOMA hesaplama
length1 = aioma_length
ema1 = ta.ema(close, length1)
length2 = aioma_length
ema2 = ta.ema(ema1, length2)
length3 = aioma_length
ema3 = ta.ema(ema2, length3)
length4 = aioma_length
ema4 = ta.ema(ema3, length4)
aioma = ta.ema(ema4, aioma_length)
// WMA hesaplama
wma = ta.wma(close, wma_length)
// Kesişim kontrolü
cross_up = ta.crossover(wma, aioma)
cross_down = ta.crossunder(wma, aioma)
// İşlem fonksiyonu
enterTrade(dir, price, signalText, color) =>
if dir
strategy.entry("Enter", strategy.long)
label.new(x = bar_index, y = price, text = signalText, color = color, textcolor = color, style = label.style_label_up, size = size.small, tooltip = "Entry Signal")
else if not dir
strategy.entry("Exit", strategy.short)
label.new(x = bar_index, y = price, text = signalText, color = color, textcolor = color, style = label.style_label_down, size = size.small, tooltip = "Exit Signal")
// Long pozisyon girişi
if cross_up
enterTrade(true, low, "Buy Signal", color.green)
// Short pozisyon girişi
if cross_down
enterTrade(false, high, "Sell Signal", color.red)
// Pozisyon kapatma
if cross_up and strategy.position_size > 0
strategy.close("Enter")
if cross_down and strategy.position_size < 0
strategy.close("Exit")
// Grafiğe plot
plot(aioma, color=color.blue, linewidth=2, title="AIOMA")
plot(wma, color=color.red, linewidth=2, title="WMA")