OPEN-SOURCE SCRIPT

Ruben.Ramiro - Momentum Breakout Strategy

634
This strategy is designed to capture breakout movements aligned with the prevailing trend, using a combination of Exponential Moving Averages (EMAs), Relative Strength Index (RSI), and Average True Range (ATR) for entry signals and risk management. It includes clear long/short entry conditions, dynamic stop-losses.

1. Trend Identification
Uses two EMAs:
• Fast EMA (default 20 periods)
• Slow EMA (default 50 periods)
The trend is considered bullish if EMA Fast > EMA Slow, and bearish if EMA Fast < EMA Slow.

2. Momentum Filter (RSI)
Applies a 14-period RSI to avoid entries during overbought/oversold conditions:
• Avoids long entries when RSI > 70 (overbought)
• Avoids short entries when RSI < 30 (oversold)

3. Breakout Logic
Detects breakouts over a configurable period (default: 5 candles):
• Resistance: Highest high over the last N periods (excluding the current one)
• Support: Lowest low over the last N periods (excluding the current one)

4. Entry Conditions
Long Entry:
• Price breaks above recent resistance
• Uptrend confirmed (EMA Fast > EMA Slow)
• RSI not overbought
Short Entry:
• Price breaks below recent support
• Downtrend confirmed (EMA Fast < EMA Slow)
• RSI not oversold

5. Position Management
Stop-Loss and Trailing Stop based on ATR:
Stop-Loss:
• For long: entry price - (ATR * SL multiplier)
• For short: entry price + (ATR * SL multiplier)
Trailing Stop:
• Uses same ATR * trailing multiplier for both trail_points and trail_offset
• Defaults for both SL and trailing multiplier: 1.5x ATR

6. Alerts (Webhook)
JSON-formatted webhook alerts:
• Long entry: Market buy order
• Short entry: Market sell order

7. Visual Cues
• Green triangle below bar for Long entries
• Red triangle above bar for Short entries

면책사항

이 정보와 게시물은 TradingView에서 제공하거나 보증하는 금융, 투자, 거래 또는 기타 유형의 조언이나 권고 사항을 의미하거나 구성하지 않습니다. 자세한 내용은 이용 약관을 참고하세요.