这是一个基于技术分析指标组合的趋势跟踪策略,主要通过RSI超买超卖、EMA交叉以及动态止损来进行交易。策略采用1.5%的风险控制,并结合杠杆来放大收益。该策略的核心在于通过多重技术指标的配合来确认趋势,同时运用动态的止盈止损来保护资金。策略设计充分考虑了小资金账户的特点,适合进行快速且频繁的交易。
策略使用了三个主要的技术指标:RSI(相对强弱指标)、EMA(指数移动平均线)和ATR(平均真实波幅)。入场信号由短期EMA(9周期)和长期EMA(21周期)的交叉确认,同时要求RSI在合理区间内(多头RSI<70,空头RSI>30)。策略采用基于ATR的动态止损方式,止盈位置为止损的4倍,这种设置可以在保证盈利的同时控制风险。每次交易的风险控制在账户的1.5%,通过2倍杠杆来提升收益潜力。
这是一个设计合理的趋势跟踪策略,通过多重技术指标的配合来提高交易的成功率。策略的风险控制机制完善,适合小资金账户使用。但是在实盘交易中,需要注意市场环境的变化,适时调整参数来适应不同的市场状态。建议在实盘之前,进行充分的回测验证,并在小仓位下逐步适应策略特点。
/*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)