KS H4 Synthetic Candle Pro
- Indicators
-
Kulvinder Singh
KULVINDER SINGH
MQL5 Developer | Python Developer | Forex Trader | Software Product Creator
📞 +91-9996327555 | ✉ Kulvinder99@gmail.com
🌐 smarttradingpip.com | advocateprosuit.in | cctvpeoplecounting.com - Version: 1.4
- Updated: 7 August 2026
- Activations: 10
KS H4 Synthetic Candle Pro is a MetaTrader 5 indicator that constructs broker-independent synthetic 4-hour candles from pairs of fully closed H2 (2-hour) bars.
Core Idea
Instead of relying on the broker’s native H4 timeframe (which can shift depending on the server’s hour offset), the indicator:
- Runs on an H2 chart.
- Completely ignores the currently forming H2 bar (shift 0).
- Takes the two most recently closed H2 bars and merges them into one synthetic 4H candle:
- Open = Open of the older H2 bar
- Close = Close of the newer H2 bar
- High = Maximum of the two highs
- Low = Minimum of the two lows
- Repeats the process for older pairs to draw multiple synthetic candles.
- Updates only when a new H2 bar closes, so the synthetic candle is never “live” or partially formed.
Because pairing is done purely by bar count (not by server clock), the resulting candle shape is identical regardless of the broker’s H4 alignment.
Visual Rendering
The synthetic candles are drawn with chart objects:
- Filled rectangles for the body
- Trend lines for the upper and lower wicks
- Optional background mask that paints over the native H2 candles so only the synthetic ones are visible
- Optional dashed marker lines for Open / Close / High / Low
- Optional debug labels showing exact body start/mid/end times
Key Input Parameters
| Parameter | Purpose |
|---|---|
| Bull / Bear / Wick colors | Appearance of the synthetic candles |
| Max Candles | How many synthetic 4H candles to display |
| Body Width % | Controls the gap between candles (lower = more spacing) |
| Show Wicks | Toggle wicks on/off |
| Show Open/Close or High/Low lines | Optional horizontal dashed markers |
| Mark Only Last Candle | Restrict marker lines to the newest synthetic candle only |
| Hide Native Candles | Mask the underlying H2 candles |
| Debug Labels | Show timing labels for verification |
| Shift Bars | Horizontally offset all synthetic candles |
Usage
Attach the indicator to any symbol on the H2 timeframe. The synthetic 4H candles will appear on the same chart and remain consistent across brokers with different server times.
