
Chiến lược này dựa trên các tín hiệu giao dịch dựa trên các chỉ số trung bình di chuyển tự điều chỉnh (AIOMA) và các chỉ số trung bình di chuyển nặng (WMA). Nó tạo ra tín hiệu mua và bán thông qua sự giao thoa của AIOMA và WMA.
AIOMA-WMA - Chiến lược thích nghi chéo
Chiến lược này bao gồm:
Tính toán chỉ số AIOMA
Tính toán chỉ số WMA
Tạo tín hiệu giao dịch
Logic giao dịch
Có thể giảm rủi ro bằng cách tối ưu hóa các tham số, thiết lập điểm dừng hoặc lọc kết hợp với các chỉ số khác.
Chiến lược này tích hợp lợi thế của hai chỉ số AIOMA và WMA để tạo ra tín hiệu giao dịch bằng cách chéo. Chất lượng tín hiệu có thể được cải thiện so với chỉ số trung bình di chuyển đơn. Có thể trở thành một hệ thống giao dịch ổn định và đáng tin cậy bằng cách tối ưu hóa tham số, chiến lược dừng lỗ và lọc biến động.
/*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")