OPEN-SOURCE SCRIPT
업데이트됨 Reverse Pulse System

# Reverse Pulse Trading System – Strategy Description for TradingView
---
## Overview
**Reverse Pulse** is a deterministic sweep-and-reverse trading system for TradingView. It identifies liquidity sweeps at fractal-defined Point-of-Interest (POI) levels and enters counter-trend when the price fails to follow through—using an "Attempted Candle" or "Trigger Break" confirmation.
- **Type:** Mean-reversion / Sweep-reversal
- **Timeframe:** M5 (recommended)
- **Instruments:** XAUUSD, EURUSD, and similar liquid pairs
- **Session:** 09:00–20:00 (Europe/Berlin, DST-safe; default for Gold US session)
- **Non-repainting:** Closed-bar logic, no lookahead bias
---
## Concept
1. **Trend Bias (H1):** Supertrend on H1 with body-break confirmation—long setups only when bias is long, short setups only when bias is short.
2. **POI Level:** Fractal highs (short bias) or fractal lows (long bias) define the key levels to watch.
3. **Sweep:** Price breaks the POI level (wick) but reverses back.
4. **Entry:** "Attempted Candle"—the candle that prints the new extreme and confirms reversal (either directly bullish/bearish or via a trigger break).
---
## Components
### Trend Bias (Supertrend H1)
- Supertrend on H1 with adjustable Factor and ATR Length.
- **Body-break:** Direction change only when the candle body breaks the Supertrend line (not just the wick).
- Reduces false signals from volatile wicks.
### POI (Point of Interest)
- **MTF Fractals [RunRox]** – CC BY-NC-SA 4.0
- Long bias: Fractal low as POI (lowest fractal low in lookback).
- Short bias: Fractal high as POI (highest fractal high in lookback).
- Fractal size: 3, 5, 7, or 9 bars.
- Optional: Higher timeframe for fractals (MTF).
### Sweep Detection
- **Long:** Price makes a new low below the POI level.
- **Short:** Price makes a new high above the POI level.
- While sweep is active, the extreme low/high is tracked.
### Entry Logic (Two Paths)
**1. Attempted Candle (direct)** – Sweep + failure on the same candle:
- **Long:** `low < poiLevel` (sweep), `close > open` (bullish), `low < low[1]` (new low).
- **Short:** `high > poiLevel` (sweep), `close < open` (bearish), `high > high[1]` (new high).
- SL: Low/High of this attempted candle. Entry: Close.
**2. Trigger + Break** – Candle prints the extreme but has the wrong color → wait for break:
- **Long:** Trigger candle = bearish, prints low. Trigger level = its high. Entry when a bullish candle closes above the trigger level.
- **Short:** Trigger candle = bullish, prints high. Trigger level = its low. Entry when a bearish candle closes below the trigger level.
- SL: Option A = Low/High of the break candle. Option B = Low/High of the trigger candle.
### Williams %R Filter (Optional)
- **Long:** Trade only if Williams %R (0–100) reached at least 95 (overbought) within the last X bars.
- **Short:** Trade only if Williams %R (0–100) reached at most 5 (oversold) within the last X bars.
- Default lookback: 20 bars. Default length: 14.
- When disabled, the filter is not applied.
---
## Exits
- **TP:** Minimum R:R (e.g. 2R)—Take-Profit = Entry ± (Risk × Min R:R).
- **SL:** Stop-Loss based on entry logic (Low/High of the relevant candle).
---
## Risk Management
- **Position sizing:** `qty = RiskAmount / (SL distance × USD per point)`.
- **XAUUSD:** USD per point = 1 (1 USD P&L per 1 USD price move per oz).
- **Daily stop:** After N stop-loss losses (default: 4), no further trades until session reset (09:00).
- **Max Qty:** Upper limit for position size (e.g. 500 oz for Gold).
---
## Session & Time
- **DST-safe:** Timestamps use IANA timezone (e.g. `Europe/Berlin`).
- **Default:** 09:00–20:00 Europe/Berlin (for Gold US session).
- **Session OFF:** Debug option to disable session filter (24/7 testing).
---
## Settings Overview
| Group | Parameter | Default |
|-------|-----------|---------|
| Session | Start/End Hour, Min, Timezone | 09:00–20:00, Europe/Berlin |
| Supertrend | Factor, ATR Length | 3.0, 10 |
| Fractals | Bars in Fractal, Timeframe | 5, Chart TF |
| Entry | Trigger-Break SL (A/B) | A |
| Filter Williams %R | Use Filter, Lookback, Length | Off, 20, 14 |
| Filter Williams %R | Min for Long, Max for Short | 95, 5 |
| Risk | Risk %, USD per Point, Max Qty | 1%, 1, 500 |
| Risk | Min R:R, Max SL per Day | 2, 4 |
| Debug | Show Debug, Level Lines, Legend | true, true, true |
---
## Recommended Instruments
- **XAUUSD** (Gold)
- **EURUSD**
- Other liquid forex and metal pairs with suitable tick size
---
## Technical Notes
- **process_orders_on_close:** Orders are executed at bar close.
- **pyramiding:** 0 (no pyramiding).
- **Float comparison:** `approxEq()` with `syminfo.mintick` for stable behavior.
---
## License Notice
- Fractals: MTF Fractals [RunRox] – CC BY-NC-SA 4.0
creativecommons.org/licenses/by-nc-sa/4.0/
---
## Disclaimer
This system is for educational and research purposes only. There is no guarantee of profits. Trading involves substantial risk. Only trade with capital you can afford to lose.
---
## Overview
**Reverse Pulse** is a deterministic sweep-and-reverse trading system for TradingView. It identifies liquidity sweeps at fractal-defined Point-of-Interest (POI) levels and enters counter-trend when the price fails to follow through—using an "Attempted Candle" or "Trigger Break" confirmation.
- **Type:** Mean-reversion / Sweep-reversal
- **Timeframe:** M5 (recommended)
- **Instruments:** XAUUSD, EURUSD, and similar liquid pairs
- **Session:** 09:00–20:00 (Europe/Berlin, DST-safe; default for Gold US session)
- **Non-repainting:** Closed-bar logic, no lookahead bias
---
## Concept
1. **Trend Bias (H1):** Supertrend on H1 with body-break confirmation—long setups only when bias is long, short setups only when bias is short.
2. **POI Level:** Fractal highs (short bias) or fractal lows (long bias) define the key levels to watch.
3. **Sweep:** Price breaks the POI level (wick) but reverses back.
4. **Entry:** "Attempted Candle"—the candle that prints the new extreme and confirms reversal (either directly bullish/bearish or via a trigger break).
---
## Components
### Trend Bias (Supertrend H1)
- Supertrend on H1 with adjustable Factor and ATR Length.
- **Body-break:** Direction change only when the candle body breaks the Supertrend line (not just the wick).
- Reduces false signals from volatile wicks.
### POI (Point of Interest)
- **MTF Fractals [RunRox]** – CC BY-NC-SA 4.0
- Long bias: Fractal low as POI (lowest fractal low in lookback).
- Short bias: Fractal high as POI (highest fractal high in lookback).
- Fractal size: 3, 5, 7, or 9 bars.
- Optional: Higher timeframe for fractals (MTF).
### Sweep Detection
- **Long:** Price makes a new low below the POI level.
- **Short:** Price makes a new high above the POI level.
- While sweep is active, the extreme low/high is tracked.
### Entry Logic (Two Paths)
**1. Attempted Candle (direct)** – Sweep + failure on the same candle:
- **Long:** `low < poiLevel` (sweep), `close > open` (bullish), `low < low[1]` (new low).
- **Short:** `high > poiLevel` (sweep), `close < open` (bearish), `high > high[1]` (new high).
- SL: Low/High of this attempted candle. Entry: Close.
**2. Trigger + Break** – Candle prints the extreme but has the wrong color → wait for break:
- **Long:** Trigger candle = bearish, prints low. Trigger level = its high. Entry when a bullish candle closes above the trigger level.
- **Short:** Trigger candle = bullish, prints high. Trigger level = its low. Entry when a bearish candle closes below the trigger level.
- SL: Option A = Low/High of the break candle. Option B = Low/High of the trigger candle.
### Williams %R Filter (Optional)
- **Long:** Trade only if Williams %R (0–100) reached at least 95 (overbought) within the last X bars.
- **Short:** Trade only if Williams %R (0–100) reached at most 5 (oversold) within the last X bars.
- Default lookback: 20 bars. Default length: 14.
- When disabled, the filter is not applied.
---
## Exits
- **TP:** Minimum R:R (e.g. 2R)—Take-Profit = Entry ± (Risk × Min R:R).
- **SL:** Stop-Loss based on entry logic (Low/High of the relevant candle).
---
## Risk Management
- **Position sizing:** `qty = RiskAmount / (SL distance × USD per point)`.
- **XAUUSD:** USD per point = 1 (1 USD P&L per 1 USD price move per oz).
- **Daily stop:** After N stop-loss losses (default: 4), no further trades until session reset (09:00).
- **Max Qty:** Upper limit for position size (e.g. 500 oz for Gold).
---
## Session & Time
- **DST-safe:** Timestamps use IANA timezone (e.g. `Europe/Berlin`).
- **Default:** 09:00–20:00 Europe/Berlin (for Gold US session).
- **Session OFF:** Debug option to disable session filter (24/7 testing).
---
## Settings Overview
| Group | Parameter | Default |
|-------|-----------|---------|
| Session | Start/End Hour, Min, Timezone | 09:00–20:00, Europe/Berlin |
| Supertrend | Factor, ATR Length | 3.0, 10 |
| Fractals | Bars in Fractal, Timeframe | 5, Chart TF |
| Entry | Trigger-Break SL (A/B) | A |
| Filter Williams %R | Use Filter, Lookback, Length | Off, 20, 14 |
| Filter Williams %R | Min for Long, Max for Short | 95, 5 |
| Risk | Risk %, USD per Point, Max Qty | 1%, 1, 500 |
| Risk | Min R:R, Max SL per Day | 2, 4 |
| Debug | Show Debug, Level Lines, Legend | true, true, true |
---
## Recommended Instruments
- **XAUUSD** (Gold)
- **EURUSD**
- Other liquid forex and metal pairs with suitable tick size
---
## Technical Notes
- **process_orders_on_close:** Orders are executed at bar close.
- **pyramiding:** 0 (no pyramiding).
- **Float comparison:** `approxEq()` with `syminfo.mintick` for stable behavior.
---
## License Notice
- Fractals: MTF Fractals [RunRox] – CC BY-NC-SA 4.0
creativecommons.org/licenses/by-nc-sa/4.0/
---
## Disclaimer
This system is for educational and research purposes only. There is no guarantee of profits. Trading involves substantial risk. Only trade with capital you can afford to lose.
릴리즈 노트
Change of default values. 오픈 소스 스크립트
트레이딩뷰의 진정한 정신에 따라, 이 스크립트의 작성자는 이를 오픈소스로 공개하여 트레이더들이 기능을 검토하고 검증할 수 있도록 했습니다. 작성자에게 찬사를 보냅니다! 이 코드는 무료로 사용할 수 있지만, 코드를 재게시하는 경우 하우스 룰이 적용된다는 점을 기억하세요.
면책사항
해당 정보와 게시물은 금융, 투자, 트레이딩 또는 기타 유형의 조언이나 권장 사항으로 간주되지 않으며, 트레이딩뷰에서 제공하거나 보증하는 것이 아닙니다. 자세한 내용은 이용 약관을 참조하세요.
오픈 소스 스크립트
트레이딩뷰의 진정한 정신에 따라, 이 스크립트의 작성자는 이를 오픈소스로 공개하여 트레이더들이 기능을 검토하고 검증할 수 있도록 했습니다. 작성자에게 찬사를 보냅니다! 이 코드는 무료로 사용할 수 있지만, 코드를 재게시하는 경우 하우스 룰이 적용된다는 점을 기억하세요.
면책사항
해당 정보와 게시물은 금융, 투자, 트레이딩 또는 기타 유형의 조언이나 권장 사항으로 간주되지 않으며, 트레이딩뷰에서 제공하거나 보증하는 것이 아닙니다. 자세한 내용은 이용 약관을 참조하세요.