Mikula Square of Nine Xauusd Intraday Levels
- Göstergeler
- Sürüm: 1.0
- Etkinleştirmeler: 5
Mikula Square of Nine — XAUUSD Intraday v1.0
The most complete implementation of the Gann/Mikula Square of Nine for Gold intraday trading on MetaTrader 5.
The Formula
> **Level(ring, angle) = ( √DailyOpen + ring + angle/360 )²**
Prices move in square root spirals. When price reaches a specific angular position of that spiral — especially the cardinal angles (0°, 90°, 180°, 270°) — it tends to pause, reverse, or accelerate.
Why this implementation is different
**Ring 0 always included**
Most Square of Nine tools skip ring 0 and only calculate rings ±1, ±2, etc. This indicator always includes ring 0, generating the 8 levels closest to today's Open — spaced roughly 8–17 points apart at XAU prices near 4500. These are the most actionable intraday levels.
**Historical Zones with Touch & Break Markers**
Past sessions' SoN levels drawn as time-bounded rays clipped at session end. Two marker types:
- **▲▼ Touch arrows** — price approached within threshold, level held
- **✕ Break markers** — price first closed beyond the level
Bar scan runs forward chronologically (oldest→newest) so break detection is correct. Touch events are deduplicated — no consecutive arrow spam.
**Session Statistics**
After scanning historical sessions, the panel shows touch/break ratios per angle:
ANGLE STATS (touches held / total):
0d: |||..... 9/28 held (32%)
90d: ||||.... 6/21 held (29%)
180d: ||...... 2/13 held (15%)
270d: |....... 1/11 held (9%)
```
Green ≥60%, orange 40-60%, red <40%. Tells you which angles are most reliable as S/R in your specific instrument and recent market conditions.
**Dynamic zone classification**
Every level classified in real time as % of current price:
- **[REV]** — Cardinal after ≥0.4% move from Open — high reversal probability
- **[TGT]** — Level in current direction of day's move — natural take-profit
- **[STR]** — Cardinal within 0.25% of current price — immediate attention zone
- **S/R** — Standard support/resistance
**Confluence Detection**
When 2+ levels from different bases (Daily, Weekly, PrevHigh, PrevLow) fall within 8 pts of each other, a white ★ CONF line highlights the zone with source labels. Only scans within the display window — no off-screen false positives.
**Weekly Open Base (optional)**
Adds a second layer of SoN levels from the W1 Open in hot pink. Weekly cardinals often coincide with the strongest intraday turning points.
**CSV Export (optional)**
Writes current session levels + historical touch/break events to MQL5/Files/SoN_XAUUSD_YYYYMMDD.csv for external analysis.
**Automatic D1 Open**
5-method cascade reads the daily Open reliably across all brokers. Manual override available.
**Pixel-precise panel**
Background height auto-calculated before drawing — no text overflow. Panel uses prefix-scan cleanup, resilient to indicator reloads. Throttled to 1 redraw/second on fast tick feeds.
---
Panel example
MIKULA Square of Nine | XAUUSD v9
Price: 4544.08
Day open: 4539.80 (D1 auto)
Prev H: 4552.62 L: 4453.50
Range: +4.3 pts (+0.09% from Open)
History: 10 sessions | Rings 0+/-2
──────────────────────────────────────
RESISTANCE (above):
4556.74 45d r+0 TGT +12.7
4573.71 90d r+0 TGT +29.6
4590.72 135d r+0 +46.6
──────────────────────────────────────
>> 4539.80 0d r+0 STR -4.3 pts
──────────────────────────────────────
SUPPORT (below):
4522.89 315d r-1 TGT -21.2
4505.99 270d r-1 -38.1
──────────────────────────────────────
REV=Reversal TGT=Target STR=Strong | Win 3.0%
ANGLE STATS (touches held / total):
0d: |||..... 9/28 held (32%)
90d: ||||.... 6/21 held (29%)
```
Key parameters
| Parameter | Default | Description |
|---|---|---|
| InpManualBase | 0 | 0 = D1 Open auto |
| InpRings | 4 | Extra rings above/below ring 0 |
| InpWindowPct | 3.0 | Draw levels within ±% of price |
| InpHistEnable | true | Historical zone overlay |
| InpHistDays | 10 | Past sessions (1-30) |
| InpShowStats | true | Session stats in panel |
| InpShowConfluence | true | Confluence zone detection |
| InpUseWeeklyOpen | false | Weekly Open base layer |
| InpExportCSV | false | CSV export to Files folder |
| InpAlertPct | 0.12 | Alert distance % of price |
---
Compatibility
- MetaTrader 5 (build 2700+)
- Any symbol (optimized for XAUUSD)
- Any timeframe M1 to W1
- Recommended: M5 or H1 for intraday XAUUSD
*Trading involves risk. This indicator is a decision-support tool, not a trading system.*
