
Đây là một chiến lược giao dịch định lượng cao cấp kết hợp các chỉ số siêu xu hướng và phân tích khối lượng giao dịch. Chiến lược này xác định các điểm biến động tiềm năng bằng cách theo dõi động các điểm giao dịch bất thường và giao dịch bằng cách giám sát giá giao dịch với đường siêu xu hướng. Chiến lược sử dụng thiết lập dừng lỗ và lợi nhuận động dựa trên sóng thực (ATR), đảm bảo tính linh hoạt của giao dịch và cung cấp độ tin cậy của kiểm soát rủi ro.
Logic cốt lõi của chiến lược này dựa trên các yếu tố chính sau:
Chiến lược này được xây dựng bằng cách kết hợp các chỉ số siêu xu hướng với phân tích khối lượng giao dịch để xây dựng một hệ thống giao dịch có khả năng tin cậy và thích ứng. Điểm mạnh của chiến lược là tính đa chiều của tín hiệu xác nhận và tính năng động của quản lý rủi ro, nhưng vẫn cần chú ý đến tác động của môi trường thị trường đối với hiệu suất của chiến lược. Bằng cách tiếp tục tối ưu hóa và hoàn thiện, chiến lược này có khả năng duy trì hiệu suất ổn định trong các môi trường thị trường khác nhau.
/*backtest
start: 2019-12-23 08:00:00
end: 2024-12-11 08:00:00
period: 1d
basePeriod: 1d
exchanges: [{"eid":"Futures_Binance","currency":"BTC_USDT"}]
*/
//@version=5
strategy("Supertrend with Volume Strategy", overlay=true)
// Input parameters for Supertrend
atrLength = input(10, title="ATR Length")
multiplier = input(3.0, title="Multiplier")
// Calculate Supertrend
[supertrend, direction] = ta.supertrend(multiplier, atrLength)
// Plot Supertrend
plot(supertrend, color=direction == 1 ? color.green : color.red, title="Supertrend")
// Volume condition
volumeThreshold = input(1.5, title="Volume Threshold (x Average)")
avgVolume = ta.sma(volume, 20) // 20-period average volume
highVolume = volume > (avgVolume * volumeThreshold)
// Define entry conditions
longCondition = ta.crossover(close, supertrend) and highVolume
shortCondition = ta.crossunder(close, supertrend) and highVolume
// Execute trades
if (longCondition)
strategy.entry("Long", strategy.long)
if (shortCondition)
strategy.entry("Short", strategy.short)
// Optional: Add stop loss and take profit
stopLoss = input(1.5, title="Stop Loss (in ATRs)")
takeProfit = input(3.0, title="Take Profit (in ATRs)")
if (longCondition)
strategy.exit("Take Profit/Stop Loss", from_entry="Long",
limit=close + (takeProfit * ta.atr(atrLength)),
stop=close - (stopLoss * ta.atr(atrLength)))
if (shortCondition)
strategy.exit("Take Profit/Stop Loss", from_entry="Short",
limit=close - (takeProfit * ta.atr(atrLength)),
stop=close + (stopLoss * ta.atr(atrLength)))