
Đây là một chiến lược theo dõi xu hướng dựa trên một bộ chỉ số phân tích kỹ thuật, được giao dịch chủ yếu thông qua RSI overbought, oversold, EMA crossover và dừng động. Chiến lược sử dụng kiểm soát rủi ro 1,5% và kết hợp với đòn bẩy để tăng lợi nhuận.
Chiến lược sử dụng ba chỉ số kỹ thuật chính: RSI ((thường là chỉ số tương đối mạnh), EMA ((thường là chỉ số di chuyển) và ATR ((thường là sóng thực). Các tín hiệu đầu vào được xác nhận chéo bởi EMA ngắn hạn ((thời gian 9) và EMA dài hạn ((thời gian 21), đồng thời yêu cầu RSI trong một khoảng hợp lý ((RSI đa đầu <70, RSI không đầu> 30).
Đây là một chiến lược theo dõi xu hướng hợp lý được thiết kế để tăng tỷ lệ thành công của giao dịch bằng cách kết hợp nhiều chỉ số kỹ thuật. Cơ chế kiểm soát rủi ro của chiến lược được hoàn thiện, phù hợp với tài khoản nhỏ. Tuy nhiên, trong giao dịch thực tế, cần chú ý đến sự thay đổi của môi trường thị trường và điều chỉnh các tham số phù hợp để thích ứng với các trạng thái thị trường khác nhau.
/*backtest
start: 2019-12-23 08:00:00
end: 2024-12-04 00:00:00
period: 1d
basePeriod: 1d
exchanges: [{"eid":"Futures_Binance","currency":"BTC_USDT"}]
*/
//@version=5
strategy("Aggressive Scalper Strategy", overlay=true)
// Parameters
account_balance = input.float(28.37, title="Account Balance", tooltip="Update this with your balance")
risk_per_trade = input.float(0.015, title="Risk per Trade", tooltip="1.5% risk")
leverage = input.int(2, title="Leverage", minval=1)
stop_loss_percentage = input.float(0.015, title="Stop Loss Percentage", tooltip="1.5% stop loss")
take_profit_multiplier = input.float(4, title="Take Profit Multiplier", tooltip="Take Profit is 4x Stop Loss")
stop_loss_multiplier = input.float(2, title="Stop Loss Multiplier", tooltip="Dynamic Stop Loss Multiplier")
// Trade Size Calculation
position_size = account_balance * risk_per_trade / (stop_loss_percentage / leverage)
trade_qty = position_size / close // This gives you the qty in terms of contracts
// Indicators
rsiLength = input.int(14, title="RSI Length")
emaShort = input.int(9, title="Short-term EMA Length")
emaLong = input.int(21, title="Long-term EMA Length")
rsi = ta.rsi(close, rsiLength)
emaShortLine = ta.ema(close, emaShort)
emaLongLine = ta.ema(close, emaLong)
// Entry Conditions
longCondition = ta.crossover(emaShortLine, emaLongLine) and rsi < 70
shortCondition = ta.crossunder(emaShortLine, emaLongLine) and rsi > 30
// ATR for dynamic stop loss and take profit levels
atrLength = input.int(14, title="ATR Length")
atrMultiplier = input.float(1.5, title="ATR Multiplier")
atr = ta.atr(atrLength)
// Dynamic Take Profit and Stop Loss Levels
longTakeProfitLevel = close + (atr * take_profit_multiplier)
longStopLossLevel = close - (atr * stop_loss_multiplier)
shortTakeProfitLevel = close - (atr * take_profit_multiplier)
shortStopLossLevel = close + (atr * stop_loss_multiplier)
// Strategy Execution
if (longCondition)
strategy.entry("Long", strategy.long, qty=trade_qty)
strategy.exit("Take Profit/Stop Loss", from_entry="Long", limit=longTakeProfitLevel, stop=longStopLossLevel)
if (shortCondition)
strategy.entry("Short", strategy.short, qty=trade_qty)
strategy.exit("Take Profit/Stop Loss", from_entry="Short", limit=shortTakeProfitLevel, stop=shortStopLossLevel)
// Alert Conditions
alertcondition(longCondition, title="Buy Signal", message="Long position entry signal detected.")
alertcondition(shortCondition, title="Sell Signal", message="Short position entry signal detected.")
// Display Information on Chart
var table_info = table.new(position.top_right, 2, 2, frame_color=color.blue, frame_width=1)
if (bar_index == na)
table.cell(table_info, 0, 0, text="Aggressive Scalper", bgcolor=color.blue)
table.cell(table_info, 1, 0, text="Account Balance: $" + str.tostring(account_balance), text_color=color.white)
table.cell(table_info, 1, 1, text="Risk per Trade: " + str.tostring(risk_per_trade * 100) + "%", text_color=color.white)
table.cell(table_info, 0, 1, text="Leverage: " + str.tostring(leverage) + "x", text_color=color.white)