
Chiến lược này là một hệ thống giao dịch kết hợp các chỉ số crossover bi-homogeneous và tương đối yếu ((RSI)). Chiến lược sử dụng chỉ số chuyển động trung bình 9 chu kỳ và 21 chu kỳ ((EMA) như một công cụ tạo tín hiệu chính, đồng thời giới thiệu chỉ số RSI như một bộ lọc để tránh giao dịch trong khu vực mua / bán quá mức. Phương pháp kết hợp này giữ nguyên đặc điểm theo dõi xu hướng và tăng chiều kích xác nhận động lực.
Logic cốt lõi của chiến lược này dựa trên các thành phần chính sau:
Chiến lược này xây dựng một hệ thống giao dịch hoàn chỉnh hơn bằng cách kết hợp các công cụ phân tích kỹ thuật cổ điển. Bằng cách nắm bắt xu hướng chéo bằng đường thẳng, lọc tín hiệu bằng RSI, thực hiện sự kết hợp hữu cơ của theo dõi xu hướng và xác nhận động lực. Ưu điểm chính của chiến lược là khả năng kiểm soát độ tin cậy và rủi ro của nó, nhưng cũng cần chú ý đến sự chậm trễ của đường trung bình di chuyển và sự nhạy cảm của các thiết lập tham số.
/*backtest
start: 2025-01-01 00:00:00
end: 2025-02-19 08:00:00
period: 1d
basePeriod: 1d
exchanges: [{"eid":"Binance","currency":"ETH_USDT"}]
*/
// This Pine Script™ code is subject to the terms of the Mozilla Public License 2.0 at https://mozilla.org/MPL/2.0/
// © McTunT
// Gold Price Trading Signals
// Pine Script version 6 code for TradingView
//@version=6
strategy("Ausiris Gold Trading Strategy", overlay=true)
// Input parameters
fastLength = input.int(9, title="Fast MA Length", minval=1)
slowLength = input.int(21, title="Slow MA Length", minval=1)
rsiLength = input.int(14, title="RSI Length", minval=1)
rsiOverbought = input.int(70, title="RSI Overbought Level", minval=50, maxval=100)
rsiOversold = input.int(30, title="RSI Oversold Level", minval=0, maxval=50)
// Calculate moving averages
fastMA = ta.ema(close, fastLength)
slowMA = ta.ema(close, slowLength)
// Calculate RSI
rsiValue = ta.rsi(close, rsiLength)
// Plot moving averages
plot(fastMA, color=color.blue, title="Fast MA")
plot(slowMA, color=color.red, title="Slow MA")
// Generate signals
longCondition = ta.crossover(fastMA, slowMA) and rsiValue < rsiOverbought
shortCondition = ta.crossunder(fastMA, slowMA) and rsiValue > rsiOversold
// Plot buy/sell signals
plotshape(longCondition, title="Buy Signal", location=location.belowbar, color=color.green, style=shape.triangleup, size=size.small)
plotshape(shortCondition, title="Sell Signal", location=location.abovebar, color=color.red, style=shape.triangledown, size=size.small)
// Strategy entry/exit
if (longCondition)
strategy.entry("Long", strategy.long)
if (shortCondition)
strategy.entry("Short", strategy.short)
// Add alert conditions
alertcondition(longCondition, title="Buy Alert", message="Gold Buy Signal!")
alertcondition(shortCondition, title="Sell Alert", message="Gold Sell Signal!")
// Display RSI values
hline(rsiOverbought, "Overbought", color=color.red)
hline(rsiOversold, "Oversold", color=color.green)
plot(rsiValue, "RSI", color=color.purple, display=display.none)