
Chiến lược này là một hệ thống giao dịch định lượng phức tạp kết hợp nhiều chỉ số kỹ thuật, được giao dịch bằng cách kết hợp theo dõi xu hướng và phân tích động lực. Chiến lược này tích hợp nhiều chỉ số như giá trung bình trọng lượng giao dịch (VWAP), chỉ số di chuyển trung bình (EMA) và chỉ số tương đối mạnh (RSI) để xây dựng một khung quyết định giao dịch toàn diện. Chiến lược này tập trung vào việc xác nhận xu hướng và động lực của thị trường, đồng thời áp dụng các biện pháp kiểm soát rủi ro nghiêm ngặt.
Chiến lược sử dụng nhiều lớp lọc để xác nhận tín hiệu giao dịch. Khi giá nằm trên VWAP và EMA20 và chỉ số SuperTrend cho thấy xu hướng tăng, hệ thống bắt đầu tìm kiếm nhiều cơ hội. Đồng thời kết hợp với chỉ số RSI để xác nhận động lực, sử dụng Bollinger để xác định sự mở rộng biến động.
Chiến lược này đã xây dựng một hệ thống giao dịch tốt hơn bằng cách sử dụng tổng hợp nhiều chỉ số kỹ thuật. Mặc dù có một số rủi ro về sự chậm trễ và tối ưu hóa tham số, nhưng bằng cách kiểm soát rủi ro nghiêm ngặt và xác nhận nhiều tín hiệu, chiến lược thể hiện sự ổn định và thích ứng tốt. Bằng cách tối ưu hóa và cải tiến liên tục, chiến lược này có thể duy trì hiệu suất ổn định trong các môi trường thị trường khác nhau.
/*backtest
start: 2024-02-10 00:00:00
end: 2025-02-09 00:00:00
period: 1h
basePeriod: 1h
exchanges: [{"eid":"Futures_Binance","currency":"BTC_USDT"}]
*/
//@version=5
strategy("Nifty 1-Min Advanced Scalping", overlay=true, default_qty_type=strategy.percent_of_equity, default_qty_value=200)
// Indicators
vwap = ta.vwap(close)
ema20 = ta.ema(close, 20)
supertrendFactor = 2
supertrendLength = 10
[superTrend, superTrendDirection] = ta.supertrend(supertrendFactor, supertrendLength)
atr = ta.atr(14)
psar = ta.sar(0.02, 0.2, 0.2)
rsi = ta.rsi(close, 14)
[bbMid, bbUpper, bbLower] = ta.bb(close, 20, 2)
[macdLine, macdSignal, _] = ta.macd(close, 12, 26, 9)
[adx, _, _] = ta.dmi(14, 14)
stochRsi = ta.stoch(close, 14, 3, 3)
// Buy Condition
buyCondition = close > vwap and close > ema20 and superTrendDirection == 1 and rsi > 50 and close > bbMid and close > psar and macdLine > macdSignal and adx > 25 and stochRsi > 20
// Sell Condition
sellCondition = close < vwap and close < ema20 and superTrendDirection == -1 and rsi < 50 and close < bbMid and close < psar and macdLine < macdSignal and adx > 25 and stochRsi < 80
// Stop Loss & Take Profit
sl = atr * 1.5
long_sl = close - sl
short_sl = close + sl
tp = sl * 1.5
long_tp = close + tp
short_tp = close - tp
// Execute Trades
if buyCondition
strategy.entry("Long", strategy.long)
strategy.exit("Long Exit", from_entry="Long", stop=long_sl, limit=long_tp)
if sellCondition
strategy.entry("Short", strategy.short)
strategy.exit("Short Exit", from_entry="Short", stop=short_sl, limit=short_tp)
// Plot indicators
plot(vwap, title="VWAP", color=color.blue)
plot(ema20, title="EMA 20", color=color.orange)
plot(superTrend, title="SuperTrend", color=color.green)
plot(psar, title="Parabolic SAR", color=color.red, style=plot.style_cross)
plot(bbMid, title="Bollinger Mid", color=color.purple)
plot(macdLine, title="MACD Line", color=color.blue)
plot(macdSignal, title="MACD Signal", color=color.red)
plot(adx, title="ADX", color=color.green)
plot(stochRsi, title="Stochastic RSI", color=color.orange)
// Alerts
alertcondition(buyCondition, title="Buy Signal", message="Buy Signal Triggered")
alertcondition(sellCondition, title="Sell Signal", message="Sell Signal Triggered")