G-LABS SOFTWARE

Magic Lines v5

Complete User Guide — Cycle Detection, Entry System, Magic Line Targets, Scanner, Helper & Alerts

MetaTrader 5 Indicator • Version 5.6

✨ v5.6 — Improved scanner alerts, trade helper scores, performance updates & bug fixes

📊 Indicator Overview

Magic Lines v5 is a complete BTMM (Beat The Market Maker) trading system for MetaTrader 5, rebuilt from scratch with clean code and enhanced features.

Heiken Ashi Candles

Volume-weighted 6-colour HA candles. Dark red/Red/Orange for bears, Dark blue/Blue/Light blue for bulls. Volume intensity shows conviction.

VWAP (Auto-Anchor)

Volume Weighted Average Price that auto-adjusts its anchor period based on your chart timeframe. Daily on M1-M15, Weekly on M30-H1, Monthly on H1-H4.

EMA 62

Colour-coded trend line — blue when price is above (bullish), red when below (bearish). The key level for cycle detection alongside VWAP.

Triple ZigZag

Large (150/24), Medium (34/6), and Small (14/3) ZigZag levels shown as semafor dots. Visual reference only — not used in signal logic.

Smart Entry System

Entry at HA midpoint with ADR-based SL and Magic Line TP targets. Each label shows pip distance, R:R ratio, and partial close suggestions.

Multi-Pair Scanner

9-column live scanner showing cycle direction, ADR%, EMA touch status, re-entry signals, and confluence score across up to 8 pairs.

🔧 Installation & Setup

Getting Magic Lines v5 running on your MetaTrader 5 charts.

  1. Copy the file G_Labs_Magic_Lines_v5.mq5 into your MT5 MQL5\Indicators\ folder.
  2. Open MetaEditor (press F4 in MT5) and find the file in the Navigator under Indicators.
  3. Compile by pressing F7. Ensure zero errors in the output log.
  4. Drag the indicator onto any chart. Recommended timeframes: M5 M15 H1
  5. Configure inputs — adjust scanner pairs, ADR period, session times to match your broker's server time.
KEY SETTING

The Scanner Pairs input accepts comma-separated symbols: EURUSD,GBPUSD,USDJPY,AUDUSD,USDCAD,NZDUSD,USDCHF,EURGBP. If your broker uses suffixes (e.g. EURUSD.m), the indicator auto-detects them.

🔄 Cycle Detection

How v5 identifies bull and bear cycles — the foundation of the entire entry system.

The "Clean Candle" Concept

A clean bearish HA candle has its entire body below BOTH the VWAP and the EMA 62, with no upper wick (haHigh equals haOpen). This means sellers completely dominated with zero retracement.

A clean bullish HA candle is the mirror — entire body above both lines, no lower wick.

APH Trigger (Bear Cycle Starts)

APH — Average Price High

When 2 consecutive clean bearish HA candles appear below both VWAP and EMA, after price was previously bullish or neutral, the indicator records the highest high reached during the previous bull run as the APH level. A SELL cycle begins.

APL Trigger (Bull Cycle Starts)

APL — Average Price Low

When 2 consecutive clean bullish HA candles appear above both VWAP and EMA, after price was previously bearish or neutral, the indicator records the lowest low as the APL level. A BUY cycle begins.

Why Two Candles?

A single clean candle can be noise. Two consecutive candles on the same side of both VWAP and EMA confirms a genuine shift in market structure. The NOT isTCls[2] condition ensures we only fire once at the transition, not on every subsequent candle.

🎯 Entry System

When a cycle change fires, the full entry system draws automatically on the chart.

Entry Price

The entry is placed at the HA candle midpoint: (haOpen + haClose) / 2. This is more reliable than the close price because it represents the average commitment level of that candle.

Lines Drawn on Chart

LineColourDescription
EntryGoldHA midpoint + BUY/SELL label + signal quality (STRONG/WEAK based on volume)
APH / APLBlue / RedStructural level (highest high or lowest low of previous cycle) + age in days
Stop LossRedEntry ± ADR × SL Multiplier, with pip distance label
TP1 (ML 1)GreenEntry ± 1×ADR — "TP1 (50%) | XXp | 1:X.X"
TP2 (ML 2)Bright GreenEntry ± 2×ADR — "TP2 (30%) | XXp | 1:X.X"
TP3 (ML 3)GoldEntry ± 3×ADR — "TP3 (20%) | XXp | 1:X.X"
BreakevenGrey dottedAppears at entry price when TP1 is hit — "BE (move SL here)"

Signal Quality Rating

Each entry is rated based on volume at the trigger candle:

Partial Close Strategy

RECOMMENDED

Close 50% at TP1, move SL to breakeven. Close 30% at TP2, move SL to ML1. Let the remaining 20% run to TP3. This locks in profit while allowing for extension moves.

Understanding ADR-Based Targets

Magic Lines are not traditional support/resistance. They are ADR-projected price targets measured from the entry. The ADR (Average Daily Range) is calculated over the last 15 days by default. If a pair's ADR is 80 pips, then ML1 is 80 pips from entry, ML2 is 160 pips, ML3 is 240 pips. This scales dynamically with volatility.

Understanding Magic Lines

The core concept that gives the indicator its name.

What Are Magic Lines?

Magic Lines are ADR-based take-profit targets projected from the entry price when a new cycle starts. They represent where price is statistically likely to reach based on average daily volatility.

Buy Cycle (APL)

  • ML 1 = Entry + 1×ADR (first target)
  • ML 2 = Entry + 2×ADR (extension)
  • ML 3 = Entry + 3×ADR (full extension)
  • SL = Entry − ADR × SL multiplier

Sell Cycle (APH)

  • ML 1 = Entry − 1×ADR (first target)
  • ML 2 = Entry − 2×ADR (extension)
  • ML 3 = Entry − 3×ADR (full extension)
  • SL = Entry + ADR × SL multiplier

ADR Multiplier Inputs

InputDefaultPurpose
ADR Period15Number of days used to calculate average daily range
ADR Multiplier (TP)1.0Scales target distances. Set to 0.8 for tighter targets, 1.2 for wider
ADR Multiplier (SL)1.0Scales stop loss distance. Set to 0.5 for tighter stops
Number of Lines4Total lines: 1 SL + (N-1) ML targets. Default = 1 SL + 3 TPs
Line Extension150How far right (in bars) the lines extend

🔁 Re-Entry Signals

Catching the second (and third) wave within an existing cycle.

How Re-Entry Works

After an APL or APH sets the cycle direction, price may retrace before continuing. The re-entry system catches these pullbacks:

  1. Cycle is active — An APL (bull) or APH (bear) has already fired.
  2. Pullback detected — Price crosses to the opposite side of both VWAP and EMA. This "arms" the re-entry trigger.
  3. Resumption confirmed — 2 consecutive clean HA candles appear back on the correct side of VWAP+EMA. The re-entry fires.

What Appears on the Chart

IMPORTANT

Re-entry lines and labels are automatically cleared when a new cycle starts (new APH or APL). Each cycle tracks its own re-entry count from zero.

📋 Multi-Pair Scanner

Live dashboard showing the state of up to 8 pairs at a glance.

MAGIC LINES v5 LDN NY
PAIRDIRHTFADR%EMARECFADRRNG
EURUSDBUYBULL42%YES-47833
GBPUSDSELBEAR81%-SEL311291
USDJPYBUYBULL67%--29564

Column Descriptions

ColumnWhat It Shows
PAIRSymbol name (click to switch chart). Current chart pair is highlighted in orange.
DIRCurrent cycle direction: BUY or SEL
HTFHigher timeframe bias (default H1): BULL / BEAR
ADR%Today's range as % of the average daily range. White <50%, Blue <75%, Orange <100%, Red ≥100% (extended)
EMAYES if price is touching the EMA 62 zone, otherwise
RERe-entry signal active: BUY / SEL or if none
CFScanner confluence score 0–5 (see below). 4–5 = Strong, 3 = Moderate, 2 = Building
ADRAverage Daily Range in pips for that pair
RNGToday's actual range so far in pips

Scanner Confluence (CF) Column — What Goes Into It?

The CF column scores each pair from 0 to 5. Each of the following conditions adds one point:

Condition CheckedPoints
Current direction (DIR) matches the higher timeframe bias (HTF) — aligned trend+1
Price is on the correct side of VWAP for the current cycle direction+1
EMA touch is active (price near the EMA — potential pullback entry zone)+1
Less than 75% of the average daily range has been used (room to move)+1
A re-entry signal is active in the direction of the cycle+1
CF vs TRADE HELPER CONFLUENCE

The scanner CF column and the Trade Helper Confluence score are two separate calculations. The scanner CF gives a quick overview for pairs you are not on the chart with. The Trade Helper confluence is more detailed and also factors in Magic Line proximity using full chart data. Use the scanner to shortlist pairs, then open the chart and check the helper for a deeper read.

PERFORMANCE

The scanner loads instantly when the indicator is added to a chart — no waiting. Data refreshes every 2.5 seconds. It uses lightweight calculations per pair to keep CPU usage minimal even with 8 pairs running.

💡 Trade Helper Window

Real-time trade assistant in the bottom-left corner of your chart. Updates every 2.5 seconds with live market data.

Helper Fields

FieldDescription
CycleCurrent confirmed cycle: BULL (APL), BEAR (APH), or FLAT
VWAP DistDistance from VWAP in pips. Positive = above (blue), Negative = below (red)
EMA DistDistance from EMA 62 in pips. Green when within 15 pips (touch zone)
ADR UsedPercentage of the average daily range already used today
Nearest MLDistance in pips to the closest Magic Line target. Orange when within 20 pips
QualitySignal quality rating in stars (1–5) — see full breakdown below
Trail SLSuggested stop management action based on which TP levels have been hit
ConfluenceLive score out of 5 based on current market conditions — see full breakdown below
ActionTrading suggestion based on the confluence score
WarningCaution message when conditions are unfavourable

⭐ Signal Quality Stars (1–5)

Rates the strength of the entry signal at the moment it fired. This score is fixed until a new entry triggers — it does not change as the market moves.

Condition at Time of EntryPoints
Entry volume was significantly above average — strong market participation+2 ⭐⭐
Entry volume was at a normal level+1 ⭐
Less than 70% of the average daily range had been used+1 ⭐
Price was within 30 pips of VWAP when the entry fired+1 ⭐
A confirmed cycle direction (BULL or BEAR) was active+1 ⭐
IDEAL ENTRY

A 5-star entry means the signal fired with high volume, early in the day, close to VWAP, with a confirmed cycle — all conditions aligned. A 1–2 star entry should be treated with caution.

Confluence Score (0–5)

A live reading of current market conditions that updates every 2.5 seconds. Unlike the quality stars, this changes as price moves.

Current ConditionPoints
Cycle is confirmed as BULL or BEAR (not flat)+1
Price is on the correct side of VWAP for the current cycle direction+1
Price is near the EMA 62 (within 20 pips)+1
Less than 80% of the average daily range has been used today+1
Price is within 30 pips of the nearest Magic Line target+1

What the Confluence Score Means

ScoreAction LabelWhat to Do
4 – 5STRONG BUY / STRONG SELLAll factors aligned — high conviction setup
3WATCH ENTRYSetup is building — stay alert, don't rush in
2BUILDING...Too early — wait for more factors to align
0 – 1NO SETUPConditions not favourable — stay out

Trailing Stop Suggestions

MessageMeaning
SL at original levelTP1 not yet hit — keep your stop where it was placed
Move SL to BreakevenTP1 has been hit — move stop to your entry price
Move SL to ML1TP2 has been hit — trail stop up to the TP1 level
No active tradeNo entry is currently active on this pair

Warning Messages

WarningWhat It Means
ADR EXHAUSTED — NO ENTRIESOver 90% of the daily range has been used. Very high risk of reversal — avoid new entries
ADR 75%+ cautionGetting extended. Be cautious and wait for a pullback before entering
EMA touch zone!Price is very close to the EMA 62 — watch for a reaction at this level
Wait for clean setupNo specific concern but conditions are not ideal — patience required

🎛 Toggle Buttons

Clickable toolbar at the top of the chart for toggling features on and off.

ButtonTogglesDefault
HAHeiken Ashi candle overlayON
VWAPVWAP lineON
EMAEMA 62 colour lineON
ZZAll three ZigZag levelsON
MLEntry lines, SL, and Magic Line TP targetsON
SESSSession vertical markers (London, NY, Asian)ON
SIGAPH/APL signal arrows and re-entry arrowsON
SCANMulti-pair scanner dashboardON
HELPTrade helper windowON

Buttons glow blue when active and go dark when disabled. Click the button or its label text to toggle. All toggles are instant — no need to reopen settings.

🔔 Alert System

Never miss a cycle change, re-entry, or VWAP cross — on your chart pair or any pair in the scanner.

Alert Types

Alert MessageFires When
Buy Entry (APL) at ...New bull cycle starts — entry price included in the message
Sell Entry (APH) at ...New bear cycle starts — entry price included in the message
Bull Re-Entry Entry #NRe-entry signal in a bull cycle — number counts up per cycle
Bear Re-Entry Entry #NRe-entry signal in a bear cycle
VWAP Cross UPPrice closes above VWAP after being below
VWAP Cross DOWNPrice closes below VWAP after being above

Alert Message Format

Every alert follows a consistent format so you always know exactly what fired and where:

ML v5 | Buy Entry (APL) at 1.08542 | EURUSD M15
ML v5 | Sell Entry (APH) at 151.234 | USDJPY M15
ML v5 | Bull Re-Entry Entry #2 | GBPUSD H1
ML v5 | VWAP Cross UP | EURUSD M15

Scanner Alerts — All Pairs

NEW IN v5.5+

With Scanner Alerts enabled, every pair in your scanner list can fire the same alert types — not just the pair on your chart. Each pair is checked independently and has its own deduplication, so one pair firing does not affect others. Scanner alerts continue to work even when the scanner panel is hidden.

Delivery Methods

4 Delivery Options

  • MT5 Alert Popup — Standard alert dialog (default: ON)
  • Sound — Plays alert.wav (default: ON)
  • Push Notification — To your phone via MetaTrader app (default: OFF)
  • Email — To configured SMTP in MT5 (default: OFF)

Alert Settings (Inputs)

  • Alert Popup — ON / OFF
  • Sound — ON / OFF
  • Push — ON / OFF
  • Email — ON / OFF
  • Scanner Alerts (all pairs) — ON / OFF
DEDUPLICATION

Each alert type tracks the last bar it fired on per symbol. The same alert will not fire twice on the same bar, preventing spam during fast-moving markets. Deduplication resets cleanly when the indicator is reloaded.

Session Markers

Thin dotted vertical lines mark session open and close times.

SessionDefault TimesColour
London08:00 – 17:00 (server time) Dark green
New York13:00 – 22:00 Dark orange
Asian00:00 – 09:00 Dark purple

Session markers use vertical dotted lines instead of filled rectangles. This keeps the chart clean and doesn't obscure price action. Adjust session times in the inputs to match your broker's server timezone.

Frequently Asked Questions

Common questions about Magic Lines v5.

Why aren't any entry lines showing?

Entry lines only appear after a cycle change (APH or APL) has fired. If the market hasn't had a clear transition with 2 clean HA candles crossing both VWAP and EMA, no entry will trigger. Try a lower timeframe (M5/M15) for more frequent signals.

What's the difference between Magic Lines and traditional S/R?

Magic Lines are forward-projected targets based on ADR, not historical support/resistance. They represent where price is likely to travel based on average volatility, measured from the entry point. Think of them as statistical price targets.

How does the VWAP auto-anchor work?

The VWAP resets at different intervals depending on your chart timeframe: Daily for M1-M15, Weekly for M30-H1, Monthly for H1-H4. This ensures VWAP is always relevant to the timeframe you're analysing.

Can I adjust the signal sensitivity?

The "clean candle" requirement is strict by design — it filters out noise. To get more signals, lower your chart timeframe. The ADR multipliers control target/SL distances but not signal frequency.

Why is the scanner showing different data than my chart?

The scanner uses a simplified cycle detection (close vs EMA) for remote pairs, while the chart uses the full HA + VWAP + EMA system. This is by design for performance — running full calculations across 8 pairs would be too heavy.

What's the difference between Signal Quality Stars and Confluence Score?

Quality Stars are fixed at the moment an entry fires — they rate how good that specific signal was at that point in time (volume, ADR space, VWAP position). The Confluence Score is live and updates continuously, showing how well current market conditions support a new entry right now. Use both together: a high-star signal that still shows strong confluence is the ideal scenario.

Does this indicator repaint?

Signals only fire on confirmed bars (when the clean candle conditions are fully met). The ZigZag semafor dots are visual reference only and do not affect signals. Entry lines are drawn at the point of signal confirmation and do not move.