
Il s’agit d’une stratégie de suivi de tendance basée sur une combinaison d’indicateurs d’analyse technique, principalement utilisée pour les transactions sur le RSI, les EMA croisées et les arrêts dynamiques. La stratégie utilise un contrôle de risque de 1,5% et une combinaison de levier pour maximiser les gains.
La stratégie utilise trois principaux indicateurs techniques: le RSI (indicateur de la force relative), l’EMA (moyenne mobile de l’indice) et l’ATR (amplitude réelle moyenne). Les signaux d’entrée sont confirmés par une confirmation croisée de l’EMA à court terme (9 cycles) et de l’EMA à long terme (21 cycles), tout en exigeant que le RSI se situe dans un intervalle raisonnable (le RSI à plusieurs têtes < 70, le RSI à vide > 30). La stratégie utilise un arrêt-perte dynamique basé sur l’ATR, avec une position d’arrêt 4 fois supérieure à la position d’arrêt-perte, ce qui permet de contrôler le risque tout en garantissant un profit.
Il s’agit d’une stratégie de suivi de tendance conçue de manière rationnelle pour améliorer le taux de réussite des transactions en combinant plusieurs indicateurs techniques. Le mécanisme de contrôle des risques de la stratégie est parfait et convient aux comptes à petit capital.
/*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)