HTF Candle Sweep Signals Pro
- 지표
-
Allan Aparece Ninal
MetaTrader 5용 인디케이터와 전문가 어드바이저(EA)를 개발합니다.
작업 방식:
- 모든 인디케이터는 리페인팅 여부를 확인합니다. 신호는 마감된 봉에서만 결정되며, 모든 틱 테스트로 이후에 바뀌지 않는다는 것을 확인합니다.
- 모든 계산은 독립적인 기준 계산과 봉 단위로 비교합니다.
- 전략은 최적화에 사용하지 않은 데이터로 백테스트합니다. 우위가 없는 규칙은 그렇다고 분명히 밝히고 전략으로 판매하지 않습니다. - 버전: 1.0
- 활성화: 5
HTF Candle Sweep Signals Pro is an indicator for MetaTrader 5. It draws higher-timeframe candles on up to three timeframes and signals a sweep of the previous candle's high or low on each. It adds a change-of-delivery mark, a candle statistics panel and a scanner that looks for sweeps on other symbols. Signals come from completed candles and closed bars, and they do not move afterwards. Run the free edition in the Strategy Tester on your own symbol before you decide.
It draws, marks, scans and alerts. It does not trade. It places no orders and promises no profit. The section How it was checked shows what held up.
Standalone: everything is built in. You do not need to buy or install any other product named on this page.
In plain words
A daily candle holds 24 hourly candles. Many traders watch the higher-timeframe candle because its open, high, low and close show where price traded over a longer span. This indicator draws those candles on the chart you already use.
The idea behind the signal is simple. Take two higher-timeframe candles in a row. If the second one goes above the first one's high but closes back below it, price reached beyond the high and did not stay there. That is a sweep. The mirror at the low is a buy sweep. This idea is often called candle range theory.
Traders also describe a candle as three phases: the open, a move against the main direction (the sweep), and the move that follows. The dashed open line and the dashed forming candle let you see which phase the current candle is in.
A sweep is context for your own decision. It does not say that price will reverse.
What you see on the chart
- Each completed higher-timeframe candle is a soft green or red body with a thin wick, drawn over the time it covers. Green closed above its open, red below.
- The forming candle is dashed and labelled, for example H4 forming. It changes until it is complete, and no signal ever uses it.
- A dashed line marks the forming candle's open. Dotted blue lines mark the previous candle's high and low, named PH and PL.
- A small pill in the bottom left says what the forming candle has done so far. It reads inside the previous range, swept the previous high, swept the previous low, or swept both.
- When a candle completes with a sweep, its last chart bar gets an arrow. Red above the bar means a sweep of the high (sell). Green below it means a sweep of the low (buy). A short line shows the swept level.
Worked example: a sell sweep
EURUSD H1 chart, higher timeframe H4, default settings, from the parity test of the indicator, on broker history in server time.
| H4 candle opens | Open | High | Low | Close |
|---|---|---|---|---|
| 19 Nov 2026 08:00 (previous) | 1.09651 | 1.09998 | 1.09626 | 1.09920 |
| 19 Nov 2026 12:00 (sweeping) | 1.09919 | 1.10095 | 1.09840 | 1.09985 |
The 12:00 candle went above the previous high 1.09998 (it reached 1.10095). Its low 1.09840 stayed above the previous low 1.09626. It closed at 1.09985, back below 1.09998. The last H1 bar of that candle opened at 15:00. When it closed, a red sell arrow appeared above it, and it stays there.
Key facts
| Type | Indicator drawn on the price chart, for MetaTrader 5. |
| Draws | Higher-timeframe candles with body and wick. The forming candle is dashed, with its open line. Also the previous candle's high and low, and sweep arrows with a name and a line at the swept level. Pro also draws outlined candles of a second and third timeframe, change-of-delivery dots and a statistics panel, and shows a scanner panel. |
| When a signal is final | A sweep arrow is final when the last chart bar of the sweeping candle has closed and the next bar has opened. The arrow, the buffer value and the alert never change afterwards. The forming bar stays empty. A change of delivery is final when its bar closes. |
| Reload and timeframe change | Everything is calculated again from closed bars and comes out the same, with the same inputs and the same history. No alerts are sent for old signals. |
| Alerts | Pop-up and push are on. Sound and e-mail are off. One alert per closed bar, for sweeps, changes of delivery and new scanner sweeps. Alerts are silent in the Strategy Tester. |
| Trades | No. It places no orders. |
| Other products needed | None. |
| Symbols and timeframes | Any symbol. Any chart timeframe from M1 to W1, with a higher timeframe above it: M15, M30, H1, H4, D1, W1 or MN1. Tested on EURUSD, GBPJPY, XAUUSD and BTCUSD. |
| Higher-timeframe candles | Built from the chart's own bars, so no other timeframe has to be loaded. They match the platform's own candles, as the section How it was checked shows. |
Quick start
- Attach it to any chart. Candles, lines and arrows appear at once. The defaults work without tuning.
- The higher timeframe is chosen for you. M1 shows M15, M5 shows H1, M15 and M30 show H4, and H1 to H12 show D1. D1 shows W1, and W1 shows MN1. Pick another one in the first input.
- Read the pill at the bottom left. It tells you what the forming candle has done.
- Choose your alert types. Pop-up and push alerts are on by default. Push needs your MetaQuotes ID under Tools, Options, Notifications.
- To see two more timeframes, set the second and third higher timeframe. The scanner reads your Market Watch by default.
Who it is for
For traders who read the higher-timeframe candle on a lower-timeframe chart. It marks the previous high and low, and the sweeps of them, without switching charts.
Not for you if you want a trading system. It draws, marks and alerts. I have not tested sweeps as a trading rule.
How it works under the hood
Higher-timeframe candles from chart bars
The indicator groups the chart's closed bars by the period of the higher timeframe. Each period gives one candle: the open of its first bar, the highest high, the lowest low and the close of its last bar.
Periods follow the broker's server time. H1 and H4 start on the hour grid. D1 starts at server midnight. W1 starts on Sunday 00:00, as the platform's weekly bars do. MN1 starts on the first of the month.
The first candle that the indicator sees may start before its data, so it is never used as a reference or as a sweeping candle. With the default 5000 bars, that is the oldest candle only.
The sweep rule
Let the previous completed candle have high PH and low PL, and the candle just completed have high H, low L and close C.
- Sell sweep: H is above PH, L is not below PL, and C is below PH.
- Buy sweep: L is below PL, H is not above PH, and C is above PL.
A candle that goes beyond both sides is not a sweep. With a minimum sweep above 0, H must reach beyond PH (or L beyond PL) by at least that share of the previous candle's range.
When a signal is final
A candle is complete when the next chart bar opens in a later period. The arrow goes on the last chart bar of the sweeping candle. It appears when that bar has closed and the next bar has opened, and it does not move afterwards.
Before a weekend or holiday gap, the next bar opens late. The arrow then appears when trading resumes, still on the last bar of its candle.
The forming candle is drawn from the bars so far, and the pill reads it. It is never used for an arrow, a buffer value or an alert.
Reload, restart and timeframe change
After a reload, a terminal restart or a timeframe change, the indicator feeds the closed bars again and redraws everything. With the same inputs and the same history, the arrows land on the same bars. No alert is sent for signals found during that reload. If your broker corrects old bars, arrows on those bars can change.
More timeframes
The second and third timeframe run the same engine. Their candles are drawn as outlines, so they stay readable beside the first timeframe's filled candles. Each one gives its own sweep arrows, named with its timeframe, and its own alerts. A timeframe that is not above the chart's, or that repeats another one, is left out.
Change of delivery
A run is bars in a row that close in one direction. The default minimum is 2. After a run of up bars ends, a bar within 10 bars may close below the first open of that run. The first such bar is a bearish change of delivery. After a run of down bars, a close above the run's first open is a bullish one.
By default the run must also have gone beyond the previous higher-timeframe candle's high (or low), as it stood at that bar. This ties the mark to a sweep. Switch that off to see every change of delivery. A change of delivery is a dot at the closing price with the label CoD. It is decided on closed bars only.
Candle statistics
The panel covers the last 20 completed candles of the first timeframe that have a completed candle before them. It shows the average range and the body share of the range. It shows the upper and lower wick shares and the share of bullish candles. It also shows the share of candles that swept the previous high or low and closed back inside. A last row shows how much of the average range the forming candle has used. The numbers describe the past. They are not a forecast.
The scanner
The scanner reads the platform's own completed candles of each symbol and timeframe in the list. For each cell it applies the same sweep rule to the last 3 completed candles. It shows the newest sweep, BUY or SELL, with its age in candles. A caret ^ or v after the text means the forming candle has already gone beyond the previous high or low. That is not a signal until the candle is complete.
Cells fill in as the history loads. A new sweep that appears while the scanner runs raises one alert. What is already there at the start raises none. Clicking a cell opens that symbol and timeframe.
Inputs
| Input | Default | Description |
|---|---|---|
| First higher timeframe (must be above the chart's) | Automatic | Automatic, or M15, M30, H1, H4, D1, W1 or MN1. A choice that is not above the chart's timeframe is replaced by the automatic one. |
| Completed candles drawn (1-30) | 6 | How many completed candles are drawn. |
| Line at the forming candle's open | true | The dashed open line. |
| Previous candle's high and low | true | The dotted lines. |
| Name next to the high / low lines | true | PH and PL labels. |
| Second higher timeframe | Off | A second timeframe, drawn as outlines, with its own sweep arrows. |
| Third higher timeframe | Off | A third timeframe, the same way. |
| Minimum sweep, % of the previous candle's range | 0.0 | How far beyond the previous high or low a candle must reach. 0 means any distance. |
| Show sweep arrows | true | Arrows, names and lines for sweeps. |
| Name next to each mark | true | The sweep name beside each mark. |
| Draw at most this many marks (newest first) | 60 | Older marks are removed from the chart. |
| Show change of delivery | true | The dots with the label CoD. |
| Only after the previous candle's high / low was swept | true | Ties the mark to a sweep. |
| Run: at least this many bars in a row (1-10) | 2 | Bars in one direction before a change of delivery counts. |
| Valid for this many bars after the run (1-50) | 10 | How long a run can still be taken back. |
| Statistics panel for the first timeframe | true | The panel. |
| Completed candles in the statistics (5-100) | 20 | The sample size. |
| Panel corner / Distance from the side / Distance from the top | Top right / 10 / 24 | Where the statistics panel sits. |
| Calculate this many bars back (0 = all) | 5000 | 0 = all bars. |
| Status pill (state of the forming candle) | true | The pill at the bottom left. |
| Buy and sell colours | soft tones | Soft mid-tones that read on dark and light charts. |
| Show the scanner | true | The scanner panel. |
| Which symbols | Market Watch | Market Watch, or your own list. |
| My list, comma separated | EURUSD,GBPUSD,USDJPY,XAUUSD,BTCUSD | Used when you choose your own list. |
| Broker suffix to try first | empty | For example .m. It is found automatically when empty. |
| Most symbols shown (1-60) | 10 | Limits the rows. |
| Candle timeframes, comma separated | H1,H4,D1 | The columns. |
| Look back this many completed candles (1-10) | 3 | How many completed candles each cell checks. |
| Scanner corner, distances, font size | Top left / 10 / 24 / 9 | Where and how large the scanner is. |
| Clicking a cell opens that symbol and timeframe | true | Opens or shows the chart. |
| Template for charts opened by a click | empty | Applied to a chart a click opens. |
| Scanner panel, text and header colours | soft tones | The scanner's dark panel colours. |
| Debug log for bug reports | false | See Found a problem? |
| Pop-up alert | true | Alert window in the terminal. |
| Play a sound | false | Plays the sound file below. |
| Sound file | alert.wav | File from the terminal Sounds folder. |
| Push notification | true | Needs your MetaQuotes ID. |
| false | Needs e-mail set up in the terminal options. | |
| Alert: sweep signal | true | Alert for sweeps. |
| Alert: change of delivery | true | Alert for the dots. |
| Alert: new sweep in the scanner | true | Alert for a new sweep in a cell. |
Alerts and Expert Advisor use
Alerts. One alert per closed bar, sent when the next bar opens. The message names the timeframe, the side and the swept level, for example H4 sweep sell. Nothing is sent while the history loads, twice for the same bar, or in the Strategy Tester.
Buffers for Expert Advisors (iCustom). A buffer holds a price on the bar of a mark and is empty otherwise. The forming bar stays empty. Read from shift 1.
| Buffer | Content |
|---|---|
| 0 / 1 | Sweep buy / sell: the bar's low / high |
| 2 / 3 | Previous candle high / low, as seen from this bar |
| 4 / 5 / 6 / 7 | Open, high, low and close of the higher-timeframe candle so far |
| 8 / 9 | Change of delivery buy / sell: the closing price |
| 10 / 11 | Sweep buy / sell, second timeframe |
| 12 / 13 | Sweep buy / sell, third timeframe |
| 14 | Average range of the last completed candles |
| 15 | Average body, share of the range, % |
| 16 | Candles that swept and closed back inside, % |
How it was checked
- Candles: the candles built from chart bars equal the platform's own candles. It covered EURUSD, GBPJPY, XAUUSD and BTCUSD on H1, H4, D1, W1 and MN1. 130,519 candles were compared, with 0 differences. That includes the server-midnight D1 and the Sunday W1 boundaries.
- Signals and lines: every buffer, bar by bar, equals an independent Python version of the rules. It covered 48 files (4 symbols, M15, H1, H4 and D1 charts, 3 settings) and 46,855,077 values, with 0 differences. Those files hold 249,624 arrow and mark values.
- Repaint: Strategy Tester runs with every tick (BTCUSD D1, EURUSD H1, EURUSD M15, XAUUSD H4). They checked 19,316 closed bars. 0 values changed after the bar closed, and 0 values were ever shown on the forming bar.
- Error check: Strategy Tester runs on 5 symbol and timeframe pairs, every tick, with 100 and 1,000 USD deposits. That made 10 runs with 0 error lines. Peak memory was 233 MB.
- Scanner: its cell function equals the Python rule on the platform's candles for 9616 cells. The sweeps it finds equal the chart engine's on the same candles, with 0 differences.
Not tested as a trading rule. I did not test sweeps or changes of delivery as an entry or exit system. The tester runs only check that the indicator calculates the rules correctly and never repaints.
Not tested: alerts on a live chart (the tester is silent for alerts), and the scanner on a live account with a large Market Watch.
Limits
- A sweep is a pattern on completed candles. It does not say that price will reverse.
- The arrow comes when the higher-timeframe candle is complete, so it is late by design. That is the price of not repainting.
- The higher timeframe must be above the chart's timeframe.
- Candles follow the broker's server-time periods. A symbol whose daily session does not start at server midnight can differ from candles you see elsewhere.
- It gives no stop loss, target or lot size.
- The candles depend on your broker's bars. Another broker's history gives slightly different candles and sometimes different sweeps.
- The scanner reads the platform's candles, so a symbol with no history loaded shows loading until the terminal has fetched it.
- Alerts need the terminal to be running with the chart open.
FAQ
Does it repaint? Arrows, buffers and alerts of a completed candle never change. Only the forming candle changes, and it is drawn dashed and never used for a signal.
Why does the arrow come late? A sweep needs the whole higher-timeframe candle, because its close decides it. The arrow waits for that close.
Which higher timeframe should I use? The automatic choice is a sensible start. Choose H4 or D1 over lower charts if you want a longer view. It must be above the chart's timeframe.
What happens if I change the timeframe or reload the chart? The indicator feeds the closed bars again and draws the same arrows, as long as the inputs and the history are the same. It sends no alerts for old signals.
Why do my candles differ from another platform? Candles follow your broker's bars and server time. Brokers with a different midnight or daily break give different daily candles.
Can an Expert Advisor read it? Yes. Read the buffers listed under Alerts and Expert Advisor use, from shift 1.
Can I run it on a VPS? Yes, like any indicator. It needs a terminal that is running with the chart open. It places no orders.
Is there a MetaTrader 4 version? Yes, HTF Candle Sweep Signals Pro MT4, with the same calculation and buffer numbers.
Try it first
Run the free edition, HTF Candle Sweep Signals, in the Strategy Tester in visual mode on your own symbol. It has the candles, the previous high and low and the sweep arrows. This edition adds more timeframes, change of delivery, statistics and the scanner.
Works well with
These are workflow suggestions. I have not found that any pair gives better trading results. You do not need any of them.
| Product | How to use them together | Why |
|---|---|---|
| Session Levels | Add it to the same chart. | It draws session boxes and previous day and week levels as context. It is not a signal. |
| Touch Strength Zones | Add it to the same chart. | Its support and resistance zones sit beside the previous high and low lines. |
| Risk Position Tool | Pick the trade from the chart, then drag the entry and stop lines. | It separates where you enter from how much you risk. The tool places no orders. |
Related products
- HTF Candle Sweep Signals Pro MT4: the same indicator for MetaTrader 4.
- HTF Candle Sweep Signals: the free edition, with the candles, the previous high and low and the sweep arrows.
- All my products on MQL5
Custom work
Want an EA that trades this indicator, a custom version of it, several of my indicators or EAs combined into one, an EA that trades another indicator you use (mine or another developer's), or a new indicator or EA of your own? Order it through MQL5 Freelance and choose me as the developer: order through Freelance. Send your requirements, rules and the flow or algorithm you want. The whole order, payment and delivery stay inside MQL5 Freelance.
Found a problem?
- In the inputs, set "Debug log for bug reports" to true.
- Repeat what went wrong.
- Open the Experts tab in the Toolbox. Copy the lines that start with "DBG" and paste them in a comment on this page, with the symbol and timeframe.
- Set the debug log back to false.
The debug lines never contain your account number, name, server, balance or equity.
If you find it useful, a short review on this page helps other traders find it.
Questions: use the comments on this page or send me a message on MQL5.
Trading involves risk of loss. Backtest results do not predict future results.
