
이 전략은 1시간 차트의 트렌드 편차, 15분 차트의 MACD 지표의 교차 신호, 그리고 5분 차트의 빠른 변동률과 구멍을 기반으로 진입 지점을 결정한다. 이 전략은 다른 시간 주기에서 여러 지표를 사용하여 시장의 장기적인 트렌드, 중기 운동 및 단기간의 변동성을 포착하여 더 정확한 시장 예측을 가능하게 한다.
이 전략의 핵심 원칙은 다양한 시기의 기술 지표를 결합하여 보다 포괄적으로 시장을 분석하는 것이다. 구체적으로:
이 전략은 3개의 다른 시기의 신호를 결합하여 시장의 전반적인 움직임을 더 잘 파악할 수 있으며, 단기간의 변동성을 활용하여 진입 지점을 최적화하여 거래의 정확성과 수익 가능성을 향상시킵니다.
이 전략은 1시간 차트에서의 트렌드 편차, 15분 차트에서의 MACD 동력 신호, 그리고 5분 차트에서의 급격한 변동률과 가격 간격을 결합하여 다중 시간 주기, 다중 지표의 거래 시스템을 구축한다. 이 방법은 더 포괄적으로 시장을 분석하고, 다양한 차원의 추세와 기회를 포착하면서 위험을 제어한다. 그러나, 전략의 성능은 파라미터 선택에 민감할 수 있으며, 시장의 급격한 변동이 있을 때 특정 과제에 직면할 수 있다.
/*backtest
start: 2023-05-05 00:00:00
end: 2024-05-10 00:00:00
period: 1d
basePeriod: 1h
exchanges: [{"eid":"Futures_Binance","currency":"BTC_USDT"}]
*/
//@version=5
strategy("H1 Bias + M15 MSS + M5 FVG", overlay=true, initial_capital=1000, default_qty_type=strategy.percent_of_equity, default_qty_value=10)
// H1 Bias
h1_bias = request.security(syminfo.tickerid, "60", close)
h1_ma = ta.sma(h1_bias, 50)
// M15 MSS
[m15_macd_line, m15_macd_signal, _] = ta.macd(request.security(syminfo.tickerid, "15", close), 12, 26, 9)
// M5 FVG Entry
m5_volatility = ta.atr(14)
// Entry conditions for long and short positions
long_condition = m15_macd_line > m15_macd_signal and m5_volatility > 0.001
short_condition = m15_macd_line < m15_macd_signal and m5_volatility > 0.001
// Exit conditions
exit_long_condition = m15_macd_line < m15_macd_signal
exit_short_condition = m15_macd_line > m15_macd_signal
// Strategy
if (long_condition)
strategy.entry("Long", strategy.long)
if (short_condition)
strategy.entry("Short", strategy.short)
if (exit_long_condition)
strategy.close("Long")
if (exit_short_condition)
strategy.close("Short")
// Take-Profit and Stop-Loss settings considering leverage
leverage = 10.0 // Leverage as a float
tp_percentage = 15.0 // TP percentage without leverage as a float
sl_percentage = 5.0 // SL percentage without leverage as a float
tp_level = strategy.position_avg_price * (1.0 + (tp_percentage / 100.0 / leverage)) // TP considering leverage as a float
sl_level = strategy.position_avg_price * (1.0 - (sl_percentage / 100.0 / leverage)) // SL considering leverage as a float
strategy.exit("TP/SL", "Long", limit=tp_level, stop=sl_level)
strategy.exit("TP/SL", "Short", limit=tp_level, stop=sl_level)
// Plotting
plot(h1_ma, color=color.blue, linewidth=2)
plotshape(long_condition, style=shape.triangleup, location=location.belowbar, color=color.green, size=size.small)
plotshape(short_condition, style=shape.triangledown, location=location.abovebar, color=color.red, size=size.small)