Download MetaTrader 5

Watch how to download trading robots for free

Interesting script?
So post a link to it -
let others appraise it

You liked the script? Try it in the MetaTrader 5 terminal

2015.04.10 15:45

Class СBmpButtonTransparent - library for MetaTrader 5

| English Deutsch Русский 中文 Español 日本語 Português

votes: 18 (114.03 KB)


The class and examples were developed for a competition arranged by TheXpert.

This class allows to handle the cursor hover and pressing the free form button.

The button is implemented using the standard OBJ_BITMAP_LABEL object. Images should be set for four button states (normal, hovered, pressed, hovered pressed). The button shape is determined by analyzing the default state image (normal button). A set of free form regions on an image with non-zero transparency is treated as a button. The button shape can be as complex as possible. The implementation works correctly for any anchor corner (OBJPROP_CORNER) and any chart subwindow.

Standard Library is required for compilation.

The archive contains the button class and 3 examples:

  1. Buttons on a chart without a dialog box. You can set the anchor corner and the 1st point coordinates in the settings.
  2. Buttons in an Expert Advisor dialog box.
  3. Buttons in an indicator dialog box.




  • The library is not limited to pressed buttons (as in the video). You can set the button type using the Locking() function.
  • Transparency threshold used - 250.
  • The library works with BMP images in 32-bit format (A8 R8 G8 B8). The image should be loaded as a resource (see examples).

Translated from Russian by MetaQuotes Software Corp.
Original code:

Accelerator Oscillator (AC) Accelerator Oscillator (AC)

The Acceleration/Deceleration Indicator (AC) measures acceleration and deceleration of the current driving force.

Average Directional Movement Index (ADX) Average Directional Movement Index (ADX)

The Average Directional Movement Index Indicator (ADX) helps to determine if there is a price trend.

TypeToBytes TypeToBytes

Byte-wise operation with structures and standard data types.

PriceLines PriceLines

Script for drawing a price markup.