Guarda come scaricare robot di trading gratuitamente
Ci trovi su Twitter!
Unisciti alla nostra fan page
Script interessante?
Pubblica il link!
lasciare che altri lo valutino
Ti è piaciuto lo script? Provalo nel Terminale MetaTrader 5
Librerie

CanvasTabs: a lightweight tab bar for MQL5 based on CCanvas - libreria per MetaTrader 5

Sayed Ali Ordibehesht
Sayed Ali Ordibehesht
EA PRO TEAM è un marchio indipendente di software per il trading, fondato da Sayed Ali Ordibehesht, trader e sviluppatore software.
Visualizzazioni:
159
Valutazioni:
(1)
Pubblicato:
\MQL5\Include\CanvasTabs\ \MQL5\Experts\CanvasTabsDemo\
Freelance MQL5 Hai bisogno di un robot o indicatore basato su questo codice? Ordinalo su Freelance Vai a 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.