ShowPips_Edit_AI (Version 3.0 – Optimised Build)
This is a lightweight, real-time custom indicator for MetaTrader 4 that displays key information about your open market trades on the current chart symbol. TPSproTrading created it and has been significantly enhanced with an autohide feature and major performance optimisations.

Core Purpose
It gives you an instant, at-a-glance view of:
- How many trades are open
- Total floating pips
- Realised profit/loss (in money and %)
- Current spread
- Time left until the current bar closes
All data updates on every tick and is calculated **only for the symbol the indicator is attached to**.

Display Modes (choose one via `show_type`)
1. Follow the price (default) – Text object that moves with the price (like a dynamic label attached to the chart).
2. As comment – Classic `Comment()` text in the top-left corner of the chart.
3. In selected corner – Fixed label object anchored to any corner of the screen with full alignment control (left/centre/right + top/middle/bottom).

What It Displays (all configurable)
You can turn each item on/off individually:
-

Trades count – “Trades: X”
-

Total Pips – “Pips: X.X” (accurate 5/3-digit handling)
-

Profit – Account currency symbol + profit (e.g. “$123.45”)
-

Profit % – e.g. “+2.3%” or “-1.5%”
-

Spread – Current spread in points
-

Time to bar close – Countdown in MM:SS format
All elements are concatenated intelligently with spaces or “ | ” separators.
Profit and pips are shown in
profit colour (blue) or
loss colour (red) automatically. When flat, it uses the neutral text colour.

Smart Autohide Feature (the main upgrade)
- When zero trades are open on the current symbol → the indicator completely disappears from the chart.
- No text object left behind
- No Comment() spam
- No visual clutter
- As soon as even one trade opens → the indicator instantly reappears with full data.
This gives you a clean chart when you’re flat and automatic visibility the moment you enter the market.

Major Performance Optimisations (Version 3.0)
- One single loop through `OrdersTotal()` instead of the original 3–4 separate loops.
- All statistics (count + pips + profit) are now calculated together in the new `GetTradeStats()` function.
- Pip multiplier, tick size, and digits are pre-calculated once outside the loop.
- Removed redundant function calls, unused variables (`double n`), and unnecessary error checks on every tick.
- Cleaner object creation/update logic (no repeated `ObjectFind` + `ObjectCreate` overhead).
- Result: Dramatically lower CPU usage — especially noticeable with many open trades or on slower terminals.

Full List of External Parameters
- `show_type`, `corner`, `h_align`, `v_align`
- `show_profit`, `show_perc`, `show_spread`, `show_time`, `show_trades_count`, `show_pips`
- Colours: `colortext`, `ecProfit`, `ecLoss`
- Positioning: `coord_y`, `indent`, `x_offset`, `y_offset`
- Font: `text_size`, `text_font`

Technical Notes
- Works on any symbol (Forex, Indices, Metals, Crypto, etc.).
- Handles 4-digit and 5-digit brokers correctly.
- Pure MQL4 — no DLLs, no external files.
- Zero errors/warnings on compile.
- Deinit cleanly removes all objects and comments.
In short:
ShowPips_Edit_AI is now a clean, ultra-light, intelligent dashboard that stays completely invisible when you have no positions and pops up instantly with rich, colour-coded information the moment you enter the market — all while using minimal CPU resources.
Just attach it to any chart, choose your preferred display mode, and enjoy a clutter-free trading experience!
Beatle
