Heikin-Ashi
Heikin-Ashi replaces the candles rather than adding anything to the chart. Each close is that bar's four prices averaged and each open the midpoint of the candle before it, so the bars chain together and the sequence smooths itself. MetaTrader 5 ships it as a custom indicator, but MQL5 has no iHeikenAshi function — the Builder folds the two lines into the generated EA instead.
- Lines the node exposes
- 2
- Seed lookback
- 120
- Handles created
- 0
예시용 — 합성 데이터로, 실시간 호가가 아닙니다.
What Heikin-Ashi tells you
Every other indicator on this site draws something next to the chart. This one redraws the chart. The close of each candle becomes the average of its own open, high, low and close, and the open becomes the midpoint of the previous Heikin-Ashi candle — so each bar inherits from the one before it and the sequence smooths itself as it goes. Runs of one colour become longer and cleaner, and the small opposite bars that punctuate a real trend mostly disappear. What you gain in readability you pay for in fidelity: the bodies on screen are not prices the market ever traded at.
- There is no period and no smoothing constant — the chaining is the smoothing
- The colour is one comparison, which is why a flip is unambiguous
- The drawn body is a derived level, not a tradable price
- 1 HA close = this bar's open, high, low and close, averaged
- 2 HA open = the midpoint of the previous HA candle
- 3 Colour = HA close against HA open, nothing else
공식 및 계산 세부 정보 표시
Heikin-Ashi is not an overlay. It is the candles, recalculated:
- HA close = this bar’s open, high, low and close, averaged
- HA open = the midpoint of the previous Heikin-Ashi candle
- HA high / low = the furthest out of the real extreme and those two levels
Step 2 is the whole indicator. Because each open is built from the candle before it, every bar carries the previous one inside it, and the chain smooths the sequence as it goes. There is no period to choose and no smoothing constant — the chaining is the smoothing.
MetaTrader 5 ships it, and MQL5 still has no function for it. Both halves are true and they are usually conflated. Heiken_Ashi.mq5 is in MQL5\Indicators\Examples, drawing with DRAW_COLOR_CANDLES across five buffers, and you can add it from the Navigator. But an EA that calls iHeikenAshi does not compile — the identifier does not exist. Reaching the bundled indicator from code means iCustom and a file path, which makes the EA depend on that file being present wherever it runs.
The Builder takes neither route. It folds the recurrence into the generated source:
ha_close = (open + high + low + close) / 4
ha_open = (previous ha_open + previous ha_close) / 2
seeded 120 bars back and walked forward. No indicator handle is created at all — the node sits in the codegen’s no-handle list next to Price and OHLC, which is why the buffer table above is empty rather than short.
Three things follow for anyone building with it.
Colour takes two nodes. Each node returns one line, and the colour is one line against the other. A flow that wants to know whether the candle is bullish places a node on HACLOSE, a second on HAOPEN, and compares them. There is no colour output, and there could not be one — it is a comparison, not a value.
The drawn levels are not prices. A Heikin-Ashi close is an average of four numbers and an open is a midpoint of the candle before it. Neither was ever quoted, and fills still happen at the real bid and ask. This is the practical cost of the transform, and it is easy to forget precisely because the result looks like a normal chart.
The template closes before it opens, deliberately. A colour flip does two things at once: it ends the position on one side and starts one on the other. In the generated code the close runs first. Sent in the other order, a netting account nets the reversing order against the position it was meant to replace and leaves the account flat — while a hedging account behaves correctly either way, which is what makes the bug hard to see.
The seed differs from MT5’s, and only the open notices. A Heikin-Ashi close is that bar’s own four prices averaged, so it is the same number no matter where the calculation began. The open is the part that chains, and there the bundled indicator starts bar 0 at the raw open while the Builder starts its lookback back at a midpoint. Each step halves whatever the seed got wrong, which converges quickly: on synthetic series the gap is about 3e-5 of a price unit after 16 bars, 5e-10 after 32, and exactly zero in double precision by 64. The 120 the codegen uses is roughly twice what that needs.
신호
Heikin-Ashi이 제공하는 백테스트 가능한 뚜렷한 신호 — 및 각 신호에 적합한 시장 상황.
Unbroken Colour Run
Builder로 구현 가능Flat Open, No Wick
고급 로직Shrinking Bodies
고급 로직MT5 구현
MetaTrader 5가 실제로 계산하고 그리는 내용 — 이 페이지의 모든 규칙이 기준으로 삼는 사양입니다.
플랫폼 참고
가장 잘 작동하는 경우 / 주의해서 사용
어떤 지표도 보편적인 우위를 가지지 않습니다. Heikin-Ashi이 도움이 되는 곳 — 그리고 오해를 일으키는 곳.
가장 잘 작동하는 경우
- Trends you intend to hold, where the value is in not being shaken out by one bar against you
- Higher timeframes, where the chaining has bars long enough to be worth smoothing
- As a way to read a chart you already trade, rather than as a trigger on its own
- Anywhere the decision is directional rather than about an exact level
주의해서 사용
- Ranges, where the colour flips repeatedly and every flip is a full reversal for a template that trades them
- Reading an entry price off the candle — the body is an average, and fills happen at the real bid and ask
- Very short timeframes, where the one-bar lag the chaining introduces is a large share of the move
- Backtests that look unusually smooth: the equity curve is real, the candles that suggested it are not prices
Heikin-Ashi 전략 구축
신호를 진입 및 청산 규칙에 연결하고, 컴파일 가능한 MT5 EA를 내보내세요 — 코드 없이.
- Two Heikin-Ashi nodes — one reading HACLOSE, one reading HAOPEN
- Two crosses between them, one each way
- HA close crosses above HA open → Close the short, then Open Buy · SL 60 / TP 180
- HA close crosses below HA open → Close the long, then Open Sell
- The close nodes are placed ahead of the entries, and the order matters
Heikin-Ashi을 다른 지표와 결합
하나의 지표만으로는 충분하지 않습니다. 이 조합들이 Heikin-Ashi의 취약점을 보완합니다.
Heikin-Ashi + ADX
- ADX above 25
- HA close crosses above HA open
- Buy
No single-flow template pairs them. Start from Heikin-Ashi Colour Flip, add an ADX node with a Compare at 25, and join it to the existing Cross with an And gate.
Builder 열기 →Heikin-Ashi + ATR
- ATR for the stop distance
- HA close crosses above HA open
- Buy
No single-flow template combines them. Add an ATR node to Heikin-Ashi Colour Flip and use it in the money-management node rather than in the entry condition.
Builder 열기 →Heikin-Ashi + Supertrend
- Supertrend flipped up
- HA close crosses above HA open
- Buy
No single-flow template pairs them. Add a Supertrend node and a Price node into a Compare, then join that to the Heikin-Ashi Cross with an And gate.
Builder 열기 →매개변수
자신의 통화쌍과 시간 프레임에서 검증할 초기값 — 보장된 설정이 아닙니다.
| 매개변수 | 기본값 | 권장 테스트 범위 | 기능 |
|---|---|---|---|
| Line | HACLOSE | HACLOSE / HAOPEN | Which of the two lines the node returns. It is a property of one node rather than two node types, so reading the colour — which is one against the other — takes two nodes with this set differently. That is exactly what the template does, and it is the only way to get a colour out of the Builder. |
| Shift | 1 | 0–100 | How many bars back the value is read. At 1 it is the last closed bar, which is what makes a flip a finished fact. At 0 the bar still forming is read, and its Heikin-Ashi close moves with every tick — the colour can change and change back within one bar. Unlike some indicators here, 0 is not broken; it is just an unfinished reading. |
| Timeframe | Current | Current / M1–MN1 | Which timeframe's bars the candles are built from. Set it higher than the chart and the colour becomes a slower directional backdrop for entries timed on the chart's own bars, which is the usual way to use it as a filter rather than a trigger. |
초기 프리셋
시장 예시
Heikin-Ashi이 작동하는 곳, 실패하는 곳, 그리고 필터가 결과를 어떻게 바꾸는지.
A run that held
The colour flips once and then holds for a dozen bars while the real candles alternate several times inside it. The position is opened on the flip and never sees a close condition until the move is over — which is the entire case for the transform.
Two flips in three bars
A sideways stretch produces a flip, a reversal on the next bar, and a third flip after it. Each one closes a position and opens the opposite, so a quiet market is the expensive case for a template that reverses on every colour change.
The flip that was ignored
The same choppy stretch with a trend-strength filter attached. The flips still happen and the colour still changes; no order is sent, because the condition the flip is joined to was never true.
FAQ
- Does MetaTrader 5 have Heikin-Ashi?
- Yes and no, and the distinction matters for anyone building an EA. The terminal ships a Heiken Ashi custom indicator in Indicators\Examples, so you can drop it on a chart from the Navigator. But MQL5 has no iHeikenAshi function — code that calls one does not compile. Reaching the bundled indicator from an EA means iCustom and a path, which ties the EA to a file being present on whichever terminal runs it. The Builder avoids that entirely by folding the calculation into the generated source.
- What is the formula?
- The close of each candle is that bar's open, high, low and close averaged. The open is the midpoint of the previous Heikin-Ashi candle — its open and its close, averaged. The wicks, which MT5's indicator draws but the Builder's node does not publish, extend to whichever is furthest out of the real extreme and the two Heikin-Ashi levels. There is no period and no smoothing factor anywhere in it.
- How do I get the candle colour in the Builder?
- With two nodes. Colour is one line against the other, and each node returns only one of them, so the flow places a Heikin-Ashi node set to HACLOSE and a second set to HAOPEN and compares them. Close above open is bullish. The template does exactly this, and the crossing of the two is what it trades.
- Can I enter at the Heikin-Ashi price shown on the candle?
- No, and this is the most common way the indicator is misused. Those levels are averages — the close is four prices divided by four, the open is a midpoint of the candle before it. Neither was ever quoted. Orders fill at the real bid and ask, so a stop placed just under a Heikin-Ashi body is placed against a number the market does not know about.
- Why does the template close before it opens?
- Because the reverse order breaks on netting accounts. Both actions fire on the same flip, and if the new order is sent first, a netting account offsets it against the position it was meant to replace and leaves the account flat rather than reversed. Closing first makes the sequence correct on netting and hedging accounts alike. On a hedging account either order happens to work, which is precisely why it is easy to get wrong.
- Can I build a Heikin-Ashi EA without coding?
- Yes. The Heikin-Ashi Colour Flip template uses two Heikin-Ashi nodes and two crosses: the close crossing above the open closes any short and opens a long, and the reverse crossing does the opposite. The shift, the stop and target distances, the lot and the spread limit are all EA inputs, and no external indicator file is needed on the terminal that runs it.
- How should I validate settings before going live?
- Backtest on quality tick data, then demo, and read the trade list rather than only the curve. Two cautions are specific to this transform. Because a colour flip both closes and opens, the trade count is set by how often the market changes character — check that the number of reversals in the test is one you would actually have sat through. And because the candles are averages, an equity curve built from them can look smoother than the market that produced it; compare the drawdown against the real price range over the same period rather than against the chart.