The article is dedicated to those who encountered such a phenomenon as decompiling and looks for an effective means of protection for their trading strategy.
A little bit of theory.
Expert advisors, indicators and scripts for the Metatrader system are created using the built-in MQL language. Then, the source text code MQ4 is compiled into executable binary code EX4. File with the EX4 extension contains program logic understandable to the Metatrader interpreter only. We will not see anything using ordinary text editor. This is convenient in case if a programmer or trader provide their program for usage but doesn’t want the user to know the details of the sales strategy.
A problem.
Unfortunately, there are methods of decompiling the EX4 files back to MQ4 which allow seeing the program logic. This is a big problem for those who want to keep the details of their trading strategy confidential.
Decompiling makes it pointless to create a business that is based on sales of expert advisors or providing them for usage. The existing companies suffer great losses.
Information of the price change comes with two parameters: new price level and time of the change. There appears to be a lot of historical data and in order to reduce the volume of information used, such combinations as bars, candlesticks or recording format as per closing price are used. All these forms are alike and pursue one objective – to reduce the volume of information being processed while saving maximum useful data.
Most often, bars and Japanese candlesticks charting are used. These elements are equally informative. The difference between them is only in how they are displayed.
It is quite often that a trader is to perform a time synchronization task when expert advisor is working. Prohibition or permission for orders opening in certain time spans during 24 hours, cancellation of suspended orders after certain time, prohibition against work of the expert advisor on holidays, trade permission only at news-time etc. may be required.
Time in Metatrader 4 client is read from server and depends on the broker configuration. Normally, time on the broker server is his local time. Metatrader 4 has no means for determination or automatic adjustment of the time zone. There is a possibility at our disposal to know the server time and local time of the computer on which Metatrader 4 client is working. Accordingly, if we use such dimensions as hours, minutes or even specific dates then we have to provide correspondence between local time and time on server. This task is owned by trader, while the programmer considering the above limitations can provide only the means for configuration.
Break Even is a special case of Trailing Stop. The difference is that the Stop Loss value is set only once when the required level is reached and it does not change any more till the order is closed. Break Even allows to fix Stop Loss value at the break-even point. To make a newly opened order reach the break-even point, it has to surmount the spread which is a distance between purchase price and selling price. After this, the Stop Loss value needs to be fixed in this point. In this manner, if the price turns in the opposite direction then the order is closed with zero losses.
One of the easy and most effective methods to reduce losses when trading is Trailing Stop. Trailing Stop is an integrated algorithm and we will also need a Stop Loss value for its implementation.
Trailing Stop works as follows. Let’s denote Trailing Stop as TS, Stop Loss – SL. If the price goes up and profit level reaches the TS level, a new Stop Loss value is set at the SL pips from the current price. And it keeps on going on like this every next pip while the price continues to go up. If the price starts to go down, then the Stop Loss value is not changed, remaining fixed. This is the essence of Trailing Stop.
Standard Take Profit
Two types of Take Profit have to be distinguished. The first type is automatic, the second is or manual.
Let’s look at the automatic Take Profit. It is activated as follows: an order is opened and value of Take Profit is being set as an absolute value higher than opening price. In case if the Take Profit level is reached, the order is closed automatically.
Standard Stop Loss
Stop Loss have to be divided into two types, same as Take Profit. The first type is automatic, the second is manual. The main function of Stop Loss is to minimize losses when the price rushes in direction that is opposite to the desirable.
Let’s first look at the automatic Stop Loss. It is activated as follows: an order is opened and value of Stop Loss is being set as an absolute value lower than opening price. In case if the Stop Loss level is reached, the order is closed automatically.
Metatrader is one of the most popular trading platform among presently existing. Wide configuration and control possibilities for brokers and robust programming tool – integrated MQL language – for traders make the system handy and versatile in use at its maximum.
Using SLiM 2.0?
Get information about better functions for license validation techniques and about better place in mql code to check for license settings.
AirBionicFX Company announced the release of SLiM 2.0 software with optimized set of functions for serial number creation and management in MQL4 products.
The developers made their best to address all the shortcomings of the previous version and to make a new version of the program to maximum extent simple and understandable both for user of bundled software and for users of products that operate under protection of SLiM 2.0.
