Voir comment télécharger gratuitement des robots de trading
Retrouvez-nous sur Telegram !
Rejoignez notre page de fans
Un script intéressant ?
Poster un lien vers celui-ci -
laisser les autres l'évaluer
Vous avez aimé le script ? Essayez-le dans le terminal MetaTrader 5
Bibliothèque

CanvasTabs: a lightweight tab bar for MQL5 based on CCanvas - bibliothèque pour MetaTrader 5

Sayed Ali Ordibehesht
Sayed Ali Ordibehesht
EA PRO TEAM est une marque indépendante de logiciels de trading fondée par Sayed Ali Ordibehesht, trader et développeur de logiciels.
Vues:
190
Note:
(1)
Publié:
\MQL5\Include\CanvasTabs\ \MQL5\Experts\CanvasTabsDemo\
MQL5 Freelance Besoin d'un robot ou d'un indicateur basé sur ce code ? Commandez-le sur Freelance Aller sur Freelance

CanvasTabs draws a tab bar on a chart with the standard CCanvas class. It is a single include file with no DLLs, no trading functions and no built-in persistence. It is meant for panels that need simple tabs without a large GUI framework.

Two CanvasTabs bars on a chart

Features

  • Tab titles, an active tab and a simple hover state.
  • Selection by mouse click or by code (SetActiveTab).
  • Width changes without recreating the chart object (Resize).
  • Long titles are shortened to fit their tab, with an ellipsis when space permits.
  • Several independent instances on one chart; each has its own object and resource names.
  • Height, padding and font size are scaled once from the screen DPI.
  • Destroy() removes only the instance's own object and resource and is safe to call more than once.

Interface

Create(chart, id, x, y, width, titles)
ActiveTab()
SetActiveTab(index)
Resize(width)
OnChartEvent(id, lparam, dparam, sparam)
Destroy()

Tab indices start at zero. OnChartEvent returns true only when a click changes the selected tab; hover, clicks on the active tab and clicks outside the bar return false. Coordinates and widths are in chart pixels. The minimum width is tab_count * (2 * padding + 2). An invalid width or tab index is rejected and the current state is kept. Instance IDs may contain 1 to 16 letters, digits or underscores; an existing name is rejected and never overwritten.

Example (CanvasTabsDemo)

The demo shows two tab bars (3 and 4 tabs) with a content label under each. Keys P and O select the next tab of each bar. The demo, not the library, enables mouse-move events (and restores the previous setting on exit) and keeps the selected tabs during symbol or timeframe changes. Selected tabs are not kept after a terminal restart.

Input parameter: TestMode (default false) runs built-in checks: duplicate names, invalid input, repeated resizing, repeated destruction and resource cleanup.

Installation

CanvasTabs.mqh: MQL5\Include\CanvasTabs
CanvasTabsDemo.mq5: MQL5\Experts\CanvasTabsDemo

Tested on MetaTrader 5 build 6230 at a screen DPI of 120.

Candle Timer Countdown Candle Timer Countdown

Candle countdown timer for Gold (XAUUSD), EURUSD and any symbol: time left on the current candle next to price or in a corner, spread, color change and alert before the close. Server time, no ticks needed. Open source code.

Session Boxes Asia London New York Session Boxes Asia London New York

Draws Asia, London and New York session boxes on the chart with each session's high and low.

Awesome Oscillator Pullback EA for EURUSD, +209 Percent in a 2021-2026 Backtest Awesome Oscillator Pullback EA for EURUSD, +209 Percent in a 2021-2026 Backtest

EURUSD EA that trades both directions: when the Awesome Oscillator turns against a weighted moving average filter, it places a stop order at the daily low or high of three days ago, with an ATR stop. Self-contained, no custom indicators. Backtest on EURUSD H1, October 2021 to October 2026: +209% on a 1,000 USD deposit with a fixed 20 USD risk per trade, 15.55% maximum equity drawdown.

Spread Heatmap - typical spread for every hour and weekday, in server time or New York time Spread Heatmap - typical spread for every hour and weekday, in server time or New York time

A table on the chart: the typical spread of the symbol for every hour and weekday, read from the history of your broker. Green is cheap, red is expensive. Hours in server time, UTC or a city with the right summer time. Read-only.