工作已完成
指定
Hi,
I have EA's making potentially 100-200 trades/day on one MT4 account. I would like to have the ability to be (push-) notified only in the case that the Used Margin amount goes above a certain percentage of Margin. (And perhaps also, likewise, when Equity falls below a certain amount).
I would really prefer not to have to receive (push) notifications when trades open and close. For this reason, the product I am looking for is different from: NotifyMe for MT4, because this tool, while promising, does nothing to suppress the notifications of trades opening/closing, etc. I am looking for an EA which does similar things to NotifyMe for MT4 in terms of Margin notifications, but which can somehow suppress or stop me from receiving notifications about trades opening/closing.
Here is the link to NotifyMe for MT4, which can be used as a reference: https://www.mql5.com/en/market/product/1361#full_description
One thing I think I like about NotifyMe for MT4 is the way of calculating the free margin (quote):
Calculating Free Margin Level
As mentioned earlier, 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 4 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.
I hope you will understand how to achieve this task of making Margin-only push notifications, if it is possible.
Many thanks for reading.