
이것은 다중 기술 지표의 집합에 기초한 고주파 트레이딩 전략이다. 이 전략은 지수 이동 평균 ((EMA), 상대적으로 강한 지수 ((RSI), 거래량 분석 및 N주기 가격 형태 식별과 같은 여러 차원의 시장 신호를 결합하여 짧은 라인 거래에서 최적의 입문 시기를 찾습니다. 이 전략은 엄격한 위험 제어 메커니즘을 적용하여 스톱 손실을 설정하여 자금을 보호합니다.
이 전략의 핵심 논리는 다차원 신호의 협동적 협동으로 거래 방향을 확인하는 것이다:
이 전략은 다차원 기술 지표의 협동 협력으로 고주파 거래에서 우수한 거래 기회를 찾습니다. 전략 설계는 추세, 운동, 거래량과 같은 시장 특성을 충분히 고려하고 엄격한 위험 통제를 통해 안정성을 보장합니다. 약간의 최적화 공간이 있지만 전체적으로 논리적으로 명확하고 실용적인 거래 전략입니다.
/*backtest
start: 2019-12-23 08:00:00
end: 2024-12-25 08:00:00
period: 1d
basePeriod: 1d
exchanges: [{"eid":"Futures_Binance","currency":"BTC_USDT"}]
*/
//@version=5
strategy("XRP/USD Scalping Strategy with Alerts", overlay=true)
// Input parameters
ema_short = input.int(8, title="Short EMA Period")
ema_long = input.int(21, title="Long EMA Period")
rsiperiod = input.int(14, title="RSI Period")
vol_lookback = input.int(20, title="Volume Lookback Period")
n_bars = input.int(5, title="N-Bars Detection")
take_profit_perc = input.float(1.5, title="Take Profit (%)") / 100
stop_loss_perc = input.float(0.7, title="Stop Loss (%)") / 100
// Indicators
ema_short_line = ta.ema(close, ema_short)
ema_long_line = ta.ema(close, ema_long)
rsi = ta.rsi(close, rsiperiod)
avg_volume = ta.sma(volume, vol_lookback)
// N-bar detection function
bullish_nbars = ta.lowest(low, n_bars) > ta.lowest(low, n_bars * 2)
bearish_nbars = ta.highest(high, n_bars) < ta.highest(high, n_bars * 2)
// Entry conditions
long_condition = ta.crossover(ema_short_line, ema_long_line) and rsi > 50 and volume > avg_volume and bullish_nbars
short_condition = ta.crossunder(ema_short_line, ema_long_line) and rsi < 50 and volume > avg_volume and bearish_nbars
// Plot signals
plotshape(long_condition, title="Buy Signal", location=location.belowbar, color=color.green, style=shape.labelup, text="BUY")
plotshape(short_condition, title="Sell Signal", location=location.abovebar, color=color.red, style=shape.labeldown, text="SELL")
// Strategy execution
if (long_condition)
strategy.entry("Long", strategy.long)
strategy.exit("TP/SL", from_entry="Long", limit=close * (1 + take_profit_perc), stop=close * (1 - stop_loss_perc))
if (short_condition)
strategy.entry("Short", strategy.short)
strategy.exit("TP/SL", from_entry="Short", limit=close * (1 - take_profit_perc), stop=close * (1 + stop_loss_perc))
// Plot EMA lines
plot(ema_short_line, color=color.blue, title="Short EMA")
plot(ema_long_line, color=color.orange, title="Long EMA")
// Create alerts
alertcondition(long_condition, title="Buy Alert", message="Buy Signal: EMA Crossover, RSI > 50, Volume > Avg, Bullish N-Bars")
alertcondition(short_condition, title="Sell Alert", message="Sell Signal: EMA Crossunder, RSI < 50, Volume > Avg, Bearish N-Bars")