Somente usuários que compraram ou alugaram o produto podem deixar comentários
Denis Zyatkevich  

Русский текст ниже


Expert Advisor's Input Parameters

  • Push Notification Trade Events - select what trade events you want to be notified to the mobile terminal ("No notifications" - notifications disabled, "Only Open/Close position notifications" - notifying only of opening/closing positions, "All notifications" - notifying of all trade events);
  • Push Notification Balance - enabling and disabling notifications to the mobile terminal about the trading account balance changes ("Off" - disabled, "On" - enabled);
  • Push Notification Leverage - enabling and disabling notifications to the mobile terminal about the trading account leverage changes ("Off" - disabled, "On" - enabled);
  • Push Notification Critical Equity Level - minimum Equity on a trading account in the deposit currency. When this value is reached, the notification is sent to the mobile terminal;
  • Push Notification Critical Margin Level - minimum Free Margin level compared to Margin in percentage values. When the level is reached, the notification is sent to the mobile terminal;
  • Critical Event Push Notify Interval - minimum time interval (in seconds) between adding information about Equity or Free Margin reaching a critical level to push messages.
  • Push Notification Interval - minimum time interval (in seconds) between messages sent to the mobile terminal;
  • Push Message Maximum Length - maximum length of a message sent to the mobile terminal;
  • Mail Notification Trade Events - select what events you want to be notified of via e-mail ("No notifications" - notifications disabled, "Only Open/Close position notifications" - notifying only of opening/closing positions, "All notifications" - notifying of all trade events);
  • Mail Notification Balance - enabling and disabling notifications via e-mail about the trading account balance changes ("Off" - disabled, "On" - enabled);
  • Mail Notification Leverage - enabling and disabling notifications via e-mail about the trading account leverage changes ("Off" - disabled, "On" - enabled);
  • Mail Notification Critical Equity Level - minimum Equity on a trading account in the deposit currency. When this value is reached, the notification is sent via e-mail;
  • Mail Notification Critical Margin Level - minimum Free Margin level compared to Margin in percentage values. When the level is reached the notification is sent via e-mail;
  • Critical Event Mail Notify Interval - minimum time interval (in seconds) between adding information about Equity or Free Margin reaching a critical level to an email;
  • Mail Notification Interval - minimum time interval (in seconds) between notifications sent via e-mail;
  • Sound Notification Trade Events - select what events you want to be notified of by a sound alarm ("No notifications" - notifications disabled, "Only Open/Close position notifications" - notifying only of opening/closing positions, "All notifications" - notifying of all trade events);
  • Sound Notification Balance - enabling and disabling the sound notifications about the trading account balance changes ("Off" - disabled, "On" - enabled);
  • Sound Notification Leverage - enabling and disabling the sound notifications about the trading account leverage changes ("Off" - disabled, "On" - enabled);
  • Sound Notification Critical Equity Level - minimum Equity on a trading account in the deposit currency. When this value is reached, a sound notification is played;
  • Sound Notification Critical Margin Level - minimum Free Margin level compared to Margin in percentage values. When the level is reached, a sound notification is played;
  • Critical Event Sound Notify Interval - minimum time interval (in seconds) between sound alarms indicating Equity or Free Margin reaching a critical level;
  • Sound Notification Interval - minimum time interval (in seconds) between sound notifications;
  • Sound File Name - name of the sound file played activated an event occurs;
  • Magic Number - orders and positions identifier ("-1" - notifications for all orders and positions);
  • Use time in messages - time specified in messages sent to the mobile terminal or via e-mail ("Server Time" - trade server time, "Local Time" - time of the PC the Expert Advisor is running at);
  • Screen Information - show or hide information about the server time, local time and the settings and conditions of triggering of notifications.


Calculating Free Margin Level

The Expert Advisor can notify of decreasing Free Margin compared to Margin. Let's examine calculation of Free Margin level in more details. In most cases (including MetaTrader 5 trading terminal), Margin value is defined considering Leverage provided by a broker. But the broker can change the leverage value at any time, and the Margin value also changes subsequently. Most often, the leverage value is not so critical for trading (unless trading is conducted in a risky manner using the maximum possible position volume). Therefore, this Expert Advisor calculates the Margin value without regard to the leverage. Free Margin level is defined as a ratio of Free Margin to Margin in percentage value.

Let's consider the following example. Suppose that 1 lot equals to 100 000 units of the base currency. Position at EURUSD is opened having the volume of 0.10 lots at the price of 1.3 USD per 1 EUR. For buying or selling 0.10 * 100 000 = 10 000 EUR, we will need 13 000 USD. This value is considered to be the Margin for the present Expert Advisor (though in most cases, a leverage is applied to that value, for example, if leverage is 1:100, then we will have 130 USD of Margin). If the deposit is equal to 1000 USD, Free Margin will be equal to 1000 - 130 = 870 USD after opening a position, while the Margin level will be calculated as 870 / 13 000 = 0.0669 or 6.69%. If we set the Margin limit, at which notification is delivered, to 5%, the notification will be sent in case of Free Margin being equal to 0.05 * 13 000 = 650 USD or Equity comprising 650 + 130 = 780 USD.

Despite the apparent complexity of defining the Free Margin level, this method provided the most informative results in actual practice.


Sending Notifications to the Mobile Terminal

First of all, you should have mobile version of MetaTrader 4 or MetaTrader 5 terminal installed on your iOS or Android powered device to receive notifications.

You should allow sending push notifications in MetaTrader 5 trading terminal, on which the Expert Advisor is to be launched. To do this, enter "Tools" – "Options" – "Notifications" tab and turn "Enable Push Notifications" parameter on. You should also specify your MetaQuotes_ID on this tab. It can be found on "Messages" tab of the mobile terminal.


Sending Notifications Via E-Mail

To receive notifications via e-mail, you should allow sending emails in the settings of MetaTrader 5 trading terminal, at which the Expert Advisor is launched. To do this, enter "Tools" – "Options" – "Email" tab, turn "Enable" parameter on and specify your e-mail account and SMTP e-mail server parameters.

Messages sent by the Expert Advisor via e-mail have subject "Account <account_number> notification".


Sound Notifications

"Sound File Name" input parameter allows you to set an audio file to be activated when a notification arrives. A file in ".wav" format should be located in "terminal_folder/sounds" or its subdirectory.

Denis Zyatkevich  

Входные параметры советника

  • Push Notification Trade Events - выбор событий, уведомления о которых будут отправляться на мобильный терминал ("No notifications" - выключены уведомления, "Only Open/Close position notifications" - уведомления об открытии и закрытии позиций, "All notifications" - уведомления обо всех торговых событиях);
  • Push Notification Balance - включение и выключение уведомлений на мобильный терминал об изменении баланса торгового счета ("Off" - выключены, "On" - включены);
  • Push Notification Leverage - включение и выключение уведомлений на мобильный терминал об изменении плеча торгового счета ("Off" - выключены, "On" - включены);
  • Push Notification Critical Equity Level - минимальная величина собственных средств (Equity) на торговом счете в валюте депозита, при достижении которой будет отправлено уведомление на мобильный терминал;
  • Push Notification Critical Margin Level - минимальный уровень свободных средств (Free Margin) по сравнению с залоговыми средствами (Margin) в процентах, при достижении которого будет отправлено уведомление на мобильный терминал;
  • Critical Event Push Notify Interval - минимальный промежуток времени (в секундах) между добавлением в Push-сообщения информации о достижении критического уровня собственными средствами (Equity) или свободными средствами (Free Margin).
  • Push Notification Interval - минимальный промежуток времени (в секундах) между отправкой сообщений на мобильный терминал;
  • Push Message Maximum Length - максимальная длина сообщения, отправляемого на мобильный терминал;
  • Mail Notification Trade Events - выбор событий, уведомления о которых будут отправляться по электронной почте ("No notifications" - выключены уведомления, "Only Open/Close position notifications" - уведомления об открытии и закрытии позиций, "All notifications" - уведомления обо всех торговых событиях);
  • Mail Notification Balance - включение и выключение уведомлений по электронной почте об изменении баланса торгового счета ("Off" - выключены, "On" - включены);
  • Mail Notification Leverage - включение и выключение уведомлений по электронной почте об изменении плеча торгового счета ("Off" - выключены, "On" - включены);
  • Mail Notification Critical Equity Level - минимальная величина собственных средств (Equity) на торговом счете в валюте депозита, при достижении которой будет отправлено уведомление по электронной почте;
  • Mail Notification Critical Margin Level - минимальный уровень свободных средств (Free Margin) по сравнению с залоговыми средствами (Margin) в процентах, при достижении которого будет отправлено уведомление по электронной почте;
  • Critical Event Mail Notify Interval - минимальный промежуток времени (в секундах) между добавлением в письма информации о достижении критического уровня собственными средствами (Equity) или свободными средствами (Free Margin);
  • Mail Notification Interval - минимальный промежуток времени (в секундах) между отправкой писем по электронной почте;
  • Sound Notification Trade Events - выбор событий, уведомления о которых будут осуществляться звуковым сигналом ("No notifications" - выключены уведомления, "Only Open/Close position notifications" - уведомления об открытии и закрытии позиций, "All notifications" - уведомления обо всех торговых событиях);
  • Sound Notification Balance - включение и выключение уведомлений в виде звукового сигнала об изменении баланса торгового счета ("Off" - выключены, "On" - включены);
  • Sound Notification Leverage - включение и выключение уведомлений в виде звукового сигнала об изменении плеча торгового счета ("Off" - выключены, "On" - включены);
  • Sound Notification Critical Equity Level - минимальная величина собственных средств (Equity) на торговом счете в валюте депозита, при достижении которой будет подано уведомление в виде звукового сигнала;
  • Sound Notification Critical Margin Level - минимальный уровень свободных средств (Free Margin) по сравнению с залоговыми средствами (Margin) в процентах, при достижении которого будет подано уведомление в виде звукового сигнала;
  • Critical Event Sound Notify Interval - минимальный промежуток времени (в секундах) между уведомлениями звуковым сигналом о достижении критического уровня собственными средствами (Equity) или свободными средствами (Free Margin);
  • Sound Notification Interval - минимальный промежуток времени (в секундах) между звуковыми сигналами;
  • Sound File Name - имя звукового файла, который проигрывается в качестве уведомления;
  • Magic Number - идентификатор ордеров и позиций, по которым будут поступать уведомления ("-1" - по всем);
  • Use time in messages - выбор времени, которое указывается в сообщениях, поступающих на мобильный терминал и по электронной почте ("Server Time" - время торгового сервера, "Local Time" - локальное время компьютера, на котором запущен советник);
  • Screen Information - выводить на экран информацию о серверном и локальном времени, а также настройках уведомлений ("Show" - выводить, "Hide" - не выводить).


Вычисление уровня свободных средств

Советник позволяет сообщать об уменьшении уровня свободных средств (Free Margin) по сравнению с залоговыми средствами (Margin). В большинстве случаев (в том числе, и в торговом терминале MetaTrader 5) величина залоговых средств (Margin) определяется с учетом кредитного плеча (Leverage), предоставляемого брокером. Но брокер может в любой момент изменить кредитное плечо, вследствие чего изменится и величина залоговых средств. В большинстве случаев для торговли не так важна величина кредитного плеча (если только торговля не ведется с максимальными рисками, используя максимально возможный объем позиций). Поэтому, в данном советнике величина залоговых средств вычисляется без учета кредитного плеча. Уровень свободных средств определяется как отношение свободных средств к залоговым средствам, выраженное в процентах.

Рассмотрим пример. Пусть 1 лот равен 100 000 единиц базовой валюты. Открывается позиция по EURUSD объемом 0.10 лота по цене 1.3 USD за 1 EUR. Для покупки или продажи 0.10 * 100 000 = 10 000 EUR потребуется 13 000 USD. Это и будет считаться залоговыми средствами в рамках данного советника (хотя, в большинстве случаев к этой величине будет применено кредитное плечо, и, например, при плече 1:100 получим 130 USD залоговых средств). При величине депозита 1000 USD, после открытия позиции свободные средства будут составлять 1000 - 130 = 870 USD, а уровень залоговых средств будет вычислен как 870 / 13 000 = 0.0669 или 6.69 %. Если установить предел залоговых средств, при котором будет подано уведомление, равным 5 %, уведомление будет подано при величине свободных средств 0.05 * 13 000 = 650 USD или величине средств (Equity), равной 650 + 130 = 780 USD.

Несмотря на кажущуюся сложность определения уровня свободных средств, такой способ на практике показал наиболее информативные результаты.


Отправка уведомлений на мобильный терминал

Для получения уведомлений на мобильный терминал, имеющий операционную систему iOS или Android, необходимо, чтобы на нем была установлена мобильная версия торгового терминала MetaTrader 4 или MetaTrader 5.

Для отправки уведомлений на мобильный терминал необходимо разрешить отправку Push-уведомлений в параметрах торгового терминала MetaTrader 5, в котором будет запущен советник. Это можно сделать, зайдя в меню "Сервис" ("Tools"), подменю "Настройки" ("Options"), вкладку "Уведомления" ("Notifications") и включив параметр "Разрешить Push-уведомления" ("Enable Push Notifications"). На этой вкладке также следует указать MetaQuotes ID, который можно узнать из вкладки "Сообщения" ("Messages") мобильного терминала.


Отправка уведомлений по электронной почте

Для получения уведомлений по электронной почте необходимо в параметрах торгового терминала MetaTrader 5, в котором будет запущен советник, разрешить отправку электронных писем. Это можно сделать, зайдя в меню "Сервис" ("Tools"), подменю "Настройки" ("Options"), вкладку "Email" ("Почта") и включив параметр "Разрешить" ("Enable"). На этой вкладке также следует указать параметры учетной записи почты и почтового сервера SMTP.

Письма, отправляемые советником по электронной почте, имеют тему (Subject) "Account <номер_счета> notification".


Уведомления с помощью звукового сигнала

При помощи входного параметра "Sound File Name" указывается имя звукового файла, который будет проигрываться при уведомлениях. Файл должен быть в формате "wav" и располагаться в каталоге "каталог_терминала/sounds" или его подкаталоге.


Вывод информации на экран

Если входной параметр "Screen Information" имеет значение "Show", в левый верхний угол графика будет выводиться информация о серверном и локальном времени, а также условиях для каждого типа уведомления.