Magic Analytics

🚀 MAGIC ANALYTICS PRO EA (v1.0) — Elite OOP Session & Magic Number Performance Dashboard (100% FREE)

Author: Sandip R. Pawar

Version: 1.00

Platform: MetaTrader 5 (MQL5)

Category: Utilities / Trade Analytics / Portfolio Management

License: 100% Free Utility

📌 Executive Summary & Overview

When running multiple automated Expert Advisors (EAs) or executing discretionary strategies simultaneously, the biggest challenge traders face is tracking which specific Magic Number is driving profits and which one is accumulating drawdowns. Default MetaTrader 5 terminal toolboxes blend all open and closed trades together, making it nearly impossible to evaluate individual strategy performance during a live trading session.

MAGIC ANALYTICS PRO EA (v1.0) is an ultra-lightweight, Object-Oriented Programming (OOP) analytics engine designed to monitor every active Magic Number (along with manual trades tagged under Magic: 0 ) in real time. Its Compact 7-Column Edition is specifically optimized for smaller screens, VPS environments, and multi-chart layouts, maintaining a completely clutter-free chart while displaying essential institutional metrics.

100% Free & Safe Utility: This tool is completely free for the trading community. On live and demo accounts, it functions strictly as a 100% Read-Only Analytics Dashboard, ensuring it never interferes with your running trades or execution logic.

✨ Key Highlights & Core Features

  • ⚡ Real-Time Event-Driven Tracking ( OnTradeTransaction ): Unlike resource-heavy indicators that scan the entire account history on every tick, this EA leverages MT5's native TRADE_TRANSACTION_DEAL_ADD event. Performance metrics update within microseconds the moment a deal is executed or closed.

  • 🎯 Strict Session-Anchored Analytics: Attaching or resetting the EA on the chart establishes a fresh Session Anchor ( START time). This filters out historical clutter, giving you a crystal-clear view of your current trading session's live performance.

  • 🖥️ Compact 7-Column UI (Optimized for VPS & Laptops): By omitting redundant columns, it presents a clean, monospace-aligned 7-column layout (M | TR | W | L | Loss($) | Total($) | Win % ), while continuously calculating live floating PnL in the background for accurate Total($) figures.

  • 💸 Dedicated Realized Loss Tracking ( Loss($) Column): Essential for effective risk management! The dedicated loss column highlights the total realized monetary loss incurred by each Magic Number during the session, allowing you to instantly identify underperforming strategies.

  • 🏦 True Net PnL Accuracy (Swap + Commission + Entry Deals): Many brokers charge commissions upon opening (DEAL_ENTRY_IN ). The built-in CPerformanceEngine accurately accounts for entry/exit commissions and swaps, while strictly evaluating Win/Loss counts on closing (DEAL_ENTRY_OUT and DEAL_ENTRY_INOUT ) deals.

  • 🧱 Pure Object-Oriented Architecture (OOP): Built using clean, decoupled class structures (CPerformanceEngine and CVisualRenderer ) to ensure zero memory leaks and minimal CPU usage.

📊 Dashboard Columns Breakdown (7-Column Compact Layout)

The dashboard renders a dedicated row for each active Magic Number, topped with a header and concluded with a grand summary footer:

Column Header Metric Name Detailed Description
M Magic ID The unique Magic Number identifier of the Expert Advisor (Manual trades are marked as 0 ).
TR Total Trades Total closed trades ( OUT / INOUT ) processed by the Magic Number during the session.
W Wins Number of trades closed with a net profit ( >= 0 ).
L Losses Number of trades closed with a net loss ( < 0 ).
Loss($) Realized Loss The total cumulative realized loss amount (in account currency) for losing trades under that Magic ID.
Total($) True Net PnL Realized closed PnL plus live floating PnL (factoring in commissions and swaps).
Win % Win Rate Realized accuracy percentage calculated as (Wins / Total Trades) * 100 .

Grand Summary Footer ( SUM_TOTAL ):

Located at the bottom of the panel, this footer aggregates the entire session's performance into a single line: Net PnL | TR | W | L | Win % . It automatically highlights in Yellow for net profits and Tomato Red for net losses.

🧠 Under the Hood: Advanced OOP Architecture

Engineered to professional MQL5 development standards, the source code is divided into three modular components:

  1. SMagicData Data Model: A lightweight struct storing closed PnL, hidden floating PnL, wins, losses, total trades, win rate, and cumulative losses per Magic ID.

  2. CPerformanceEngine (Calculation & Deal Processor):

    • FindOrCreateMagic(long magic) : Automatically detects and registers new Magic Numbers on the fly using dynamic array resizing.

    • CaptureDeal() : Filters incoming deal streams after the session anchor, factoring in commissions, swaps, and net profits.

    • RefreshFloating() : Scans active open positions to keep floating exposures updated in the background.

  3. CVisualRenderer (Clean Chart UI Engine):

    • Utilizes Consolas monospace alignment and dynamic row height calculation (145 + (total_magics * 22) ) to scale smoothly whether tracking 1 or 20 active strategies.

    • Ensures secure cleanup of chart graphical objects and dynamic pointers (delete CoreEngine , delete VisualEngine ) upon deinitialization.

⚙️ Input Parameters Guide

Customize the appearance and behavior of your dashboard directly from the MT5 input dialog:

Parameter Group Input Variable Default Value Function / Description
Visual Configuration InpTableX 20 Horizontal distance (X-Offset) from the top-left chart corner.
Visual Configuration InpTableY 40 Vertical distance (Y-Offset) from the top-left chart corner.
Visual Configuration InpPanelBG clrBlack Background color of the main dashboard panel.
Visual Configuration InpBorderColor clrSlateGray Border color surrounding the panel frame.
Visual Configuration InpOpacity 225 Panel transparency level (0–255).
Typography & Theme InpColorHeader clrCyan Text color for the main title ( MAGIC ANALYTICS ) and session start time.
Typography & Theme InpColorSub clrYellow Text color for column headers ( M, TR, W, L... ).
Typography & Theme InpColorProfit clrLimeGreen Color theme for profitable rows ( Total >= 0 ).
Typography & Theme InpColorLoss clrTomato Color theme for losing rows ( Total < 0 ).
Typography & Theme InpFontSize 10 Font size for data rows and headers.
Typography & Theme InpFontName "Consolas" Monospace font ensuring perfect column alignment.
Analytics Settings InpRefreshRate 1 Timer interval (in seconds) for UI and floating PnL updates.
Analytics Settings InpIncludeSwap true Set to true to factor overnight swap charges into the net PnL.
Analytics Settings InpIncludeComm true Set to true to factor broker commissions into the net PnL.

🛠️ How to Install & Use (Step-by-Step)

  1. Open a clean chart window (any symbol or timeframe) in your MetaTrader 5 terminal.

  2. In the Navigator window (Ctrl+N ), locate Expert Advisors, and drag-and-drop Magic Analytics Pro EA onto the chart.

  3. In the EA properties window, go to the Common tab and check "Allow Algo Trading" to enable timers and event handlers, then click OK.

  4. Zero Configuration Needed: You do not need to manually input EA Magic Numbers. As soon as your strategies open or close trades, the dashboard automatically detects and registers each Magic ID in real time.

💡 Strategy Tester Note: When running this EA in the MT5 Visual Strategy Tester, it automatically simulates sample test trades ( Magic 1001 & Magic 1002 ) to demonstrate real-time tracking even when live markets are closed. On standard Live and Demo charts, it operates strictly as a read-only analytics tool and never places orders.

👨‍💻 Author & Support

Crafted with precision by Sandip R. Pawar.

If you find this free utility valuable for your algorithmic trading setup, please consider leaving a 5-star review / rating and sharing it with fellow traders! Drop your feedback or questions in the comments below.


Plus de l'auteur
SuperTrend Hedge EA: Precision XAUUSD M1 Trend Engine with Instant Pullback Hedging & Prop-Grade Equity Protection ======================================================================== SUPERTREND HEDGE EA (v1.00) — XAUUSD M1 to any MULTI-TIMEFRAME SYSTEM ======================================================================== SuperTrend Pro Hedge EA is a precision-engineered automated trading system built specifically for Gold (XAUUSD) on the M1 timeframe. Unlike dangerous grid or martingale
FREE
RB GOLD — Institutional Session Range Breakout MT5 RB Gold is a quantitative, rule-based Session Range Breakout Expert Advisor engineered specifically for XAUUSD (Gold) and major volatility pairs. Unlike 90% of Gold EAs that rely on risky grids, martingale, or averaging schemes that eventually blow accounts, RB Gold utilizes a 100% pure, single-shot price action approach. It identifies institutional liquidity consolidation during a customizable session window (default 00:00 to 05:00 GMT ) and ca
PainLess EA
Sandip R Pawar
PainLess EA — Precision Gold Trading Without the Stress "The Power Is in the Entry. The Difference Is PainLess." PainLess EA is a specialized, institutional-grade Expert Advisor engineered specifically for Gold (XAUUSD) trading on the H2 and H1 timeframes. Most Expert Advisors on the market rely on dangerous recovery traps—hiding weak entries behind Martingale multipliers, endless Grid layers, or deep drawdown averaging. PainLess EA takes the exact opposite approach. It focuses entirely on entry
Filtrer:
Aucun avis
Répondre à l'avis