<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:wfw="http://wellformedweb.org/CommentAPI/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
	xmlns:slash="http://purl.org/rss/1.0/modules/slash/"
	>

<channel>
	<title>AirBionicFX Blog</title>
	<atom:link href="http://www.airbionicfx.com/blog/feed/" rel="self" type="application/rss+xml" />
	<link>http://www.airbionicfx.com/blog</link>
	<description>MQL custom programming for Metatrader</description>
	<lastBuildDate>Mon, 29 Mar 2010 12:00:18 +0000</lastBuildDate>
	<generator>http://wordpress.org/?v=2.9.2</generator>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
			<item>
		<title>Protection from MQL decompiling</title>
		<link>http://www.airbionicfx.com/blog/article/protection-from-mql-decompiling/</link>
		<comments>http://www.airbionicfx.com/blog/article/protection-from-mql-decompiling/#comments</comments>
		<pubDate>Tue, 14 Apr 2009 20:15:09 +0000</pubDate>
		<dc:creator>admin</dc:creator>
				<category><![CDATA[Article]]></category>
		<category><![CDATA[decompiling]]></category>
		<category><![CDATA[DLL]]></category>
		<category><![CDATA[MQL]]></category>
		<category><![CDATA[mql programming]]></category>
		<category><![CDATA[MQL4]]></category>
		<category><![CDATA[protection]]></category>

		<guid isPermaLink="false">http://www.airbionicfx.com/blog/?p=41</guid>
		<description><![CDATA[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 [...]]]></description>
			<content:encoded><![CDATA[<p><em>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.</em></p>
<h3>A little bit of theory.</h3>
<p>Expert advisors, indicators and scripts for the Metatrader system are created using the built-in <strong>MQL</strong> language. Then, the source text code <strong>MQ4</strong> is compiled into executable binary code <strong>EX4</strong>. File with the <strong>EX4</strong> extension contains program logic understandable to the <strong>Metatrader</strong> 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.</p>
<h3>A problem.</h3>
<p>Unfortunately, there are methods of decompiling the <strong>EX4</strong> files back to <strong>MQ4</strong> which allow seeing the program logic. This is a big problem for those who want to keep the details of their trading strategy confidential.</p>
<p>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.</p>
<p><span id="more-41"></span></p>
<h3>Solution methods.</h3>
<p>There is an opinion that a good <strong>MQL</strong> programmer can write program in a way that would make it impossible to decompile. For example, by using licensing system. Well, unfortunately this is not the case. The strategy cannot be protected by means of <strong>MQL</strong> only.</p>
<p>Let us see several methods of protecting sales strategies. We will compare them and find out their pros and cons.</p>
<h4><em>1. Pure MQL</em></h4>
<p>As we have already said, this method does not provide protection because an <strong>EX4</strong> file can be easily decompiled. However, along with the cons, <strong>MQL</strong> programming has its pros which will be examined in comparison with the other methods.</p>
<p><strong>Pros:</strong> simple structured language that is comprehensible by traders and not only by specialists. Lowest cost level as compared to other methods.</p>
<p><strong>Cons:</strong> easily decompiled.</p>
<p><strong>Special features:</strong> applicable for personal use or for refinement of the strategies logic.</p>
<h4><em>2. DLL</em></h4>
<p><strong>MQL</strong> language has a very useful special feature. It allows the programs to link with the libraries (<strong>DLL</strong>) written in other programming languages. First of all, it essentially expands the possibilities and secondly, it allows moving <strong>MQL</strong> logic into the library which makes decompiling of an <strong>EX4</strong> file useless.</p>
<p><strong>DLL</strong> can also be decompiled however it is by no means easy and requires specific knowledge. When decompiled, the <strong>DLL</strong> code is translated into the Assembler (<strong>ASM</strong>) machine language. This procedure is called disassembly. Pay level of <strong>ASM</strong> specialists is very high, thus such expenses are unreasonable for hacking most projects.</p>
<p>Moreover, a project consists of two parts minimum: <strong>MQL+DLL</strong>, which makes the hacking job even more complicated, since it requires teamwork of two specialists.</p>
<p><strong>Pros:</strong> quite a high protection level, unlimited capacity to expand possibilities of the MQL language.</p>
<p><strong>Cons:</strong> higher development cost as compared to an MQL project. Library installation required.</p>
<p><strong>Special features:</strong> applicable for projects of average cost and popularity.</p>
<h4><em>3. Online WEB</em></h4>
<p>This method implies moving of the trade logic to <strong>WEB</strong> server. The user’s computer will have executive interface only, without the decision-making module.</p>
<p><strong>MQL</strong>, <strong>DLL</strong> and <strong>WEB</strong> are used in this architecture. <strong>MQL</strong> generates a request, <strong>DLL</strong> sends it to <strong>WEB</strong> server, and the server generates and sends a reply that gets into <strong>MQL</strong> through <strong>DLL</strong>. <strong>MQL</strong> manages the orders based on the reply.</p>
<p>There are simpler variants, when <strong>MQL</strong> only listens to / monitors the replies from WEB server.</p>
<p><strong>Pros:</strong> The highest protection. Possibility of remote updates. Possibility of remote control over access to the project.</p>
<p><strong>Cons:</strong> Delays can occur during data synchronization. High development cost.</p>
<p><strong>Special features:</strong> Applicable for major or popular projects.</p>
<h3>Comparison.</h3>
<p>The comparison was made by specialists of AirBionicFX company. Explanation of the results and comparison criteria are given below each diagram.</p>
<p><strong><em>By protection level</em></strong></p>
<p>Minimum is 0, Maximum is 10. The more, the better.</p>
<ul>
<li><strong>MQL – 1</strong></li>
<li><strong>DLL – 6</strong></li>
<li><strong>WEB – 9</strong></li>
</ul>
<p>MQL has minimal protection against hacking, but 1 point is scored considering that it is not every user who knows about decompiling and not everyone knowing it would be ready to use this method.</p>
<p>DLL has average protection level.</p>
<p>WEB has almost maximum protection level. One point is not scored because there is a probability to hack WEB server that stores the strategy logic. Such probability is very low and even if it happens, then a specialist is needed to decompile binary code and then synchronize the logic with the MQL.</p>
<p>The following factors were considered when estimating the protection level:</p>
<ul>
<li>Statistics of users’ awareness of the decompiling possibility;</li>
<li>Complexity of decompiling process for each of the methods;</li>
<li>Cost of hacking job specialists.</li>
</ul>
<p><strong><em>By development cost</em></strong></p>
<p>Minimum is 0, Maximum is 10. The less, the better.</p>
<ul>
<li><strong>MQL – 1</strong></li>
<li><strong>DLL – 4</strong></li>
<li><strong>WEB – 10</strong></li>
</ul>
<p>The results can be explained as follows. If we take any task and fulfill it using all methods, then MQL will be the most low-cost one, WEB is the most expensive, and DLL will have the cost a little less than average as per the maximum level.</p>
<p>The following factors were considered when estimating the development cost:</p>
<ul>
<li>Cost of work done by specialists in each area;</li>
<li>Complexity and time for testing a ready project.</li>
</ul>
<p><strong><em>By speed of decision-making</em></strong></p>
<p>Minimum is 0, Maximum is 10. The more, the better.</p>
<ul>
<li><strong>MQL – 10</strong></li>
<li><strong>DLL – 9-6</strong></li>
<li><strong>WEB – 6-1</strong></li>
</ul>
<p>Speed of decision-making is like the other side of a coin while the first side is protection. The more components the system has, the more problems will be there with data synchronization. Accordingly, WEB method will be the slowest. DLL will be average, and MQL – the fastest.</p>
<p>For DLL, a range of speed values is given. If DLL is used as a library for computations, then the processing speed will be practically comparable with the MQL and will have an index of 9 points. And if synchronization with the external data sources is used within DLL, then the speed index may fall to 6 points.</p>
<p>Same for WEB. If the logic is simple and it is executed fast, then the speed index will be not lower than 6 points. And if, for example, WEB server is connected with Back Office for computation of expert advisor values, then the speed index may fall to the minimal value.</p>
<p>The following factors were considered when estimating the speed of decision-making:</p>
<ul>
<li>Project architecture;</li>
<li>Connection with external data sources.</li>
</ul>
<h3>Conclusion</h3>
<p>When selecting a method of protection, you have to consider all the parameters described above. Then the facilities committed for the development will pay off over and above and the ill-wishers will be left with nothing!</p>
<p>Have a nice trade!</p>
]]></content:encoded>
			<wfw:commentRss>http://www.airbionicfx.com/blog/article/protection-from-mql-decompiling/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Metatrader. Bar</title>
		<link>http://www.airbionicfx.com/blog/article/metatrader-bar-2/</link>
		<comments>http://www.airbionicfx.com/blog/article/metatrader-bar-2/#comments</comments>
		<pubDate>Wed, 14 Jan 2009 19:39:08 +0000</pubDate>
		<dc:creator>admin</dc:creator>
				<category><![CDATA[Article]]></category>
		<category><![CDATA[Wiki]]></category>
		<category><![CDATA[Bar]]></category>
		<category><![CDATA[Candlestick]]></category>
		<category><![CDATA[Metarader]]></category>
		<category><![CDATA[MQL]]></category>
		<category><![CDATA[MQL4]]></category>

		<guid isPermaLink="false">http://www.airbionicfx.com/blog/?p=40</guid>
		<description><![CDATA[
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 [...]]]></description>
			<content:encoded><![CDATA[<p>
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.
</p>
<p>
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.
</p>
<p><span id="more-40"></span></p>
<p>
For convenience, we will consider only the bars hereafter.
</p>
<p>
Bars have the following parameters:</p>
<ul>
<li><strong>Time interval</strong> – time span, within which all the price changes are referred exactly to this bar.</li>
<li><strong>Opening price</strong> – the price as of the moment of bar formation start</li>
<li><strong>Closing price</strong> – the last price within a bar time interval</li>
<li><strong>Highest level</strong> – highest price level during bar formation</li>
<li><strong>Lowest level</strong> – lowest price level during bar formation</li>
</ul>
<p>
Metatrader time intervals:</p>
<ul>
<li><strong>1M</strong> &#8211; 1 minute;</li>
<li><strong>5M</strong> &#8211; 5 minutes;</li>
<li><strong>15M</strong> -15 minutes;</li>
<li><strong>30M</strong> &#8211; 30 minutes;</li>
<li><strong>1H</strong> &#8211; 1 hour;</li>
<li><strong>4H</strong> &#8211; 4 hours;</li>
<li><strong>1D</strong> &#8211; 1 day;</li>
<li><strong>1W</strong> &#8211; 1 week;</li>
<li><strong>1MN</strong> &#8211; 1 month.</li>
</ul>
<p>
We looked at the time intervals most frequently used, their denotations and amount of seconds within each interval. Minimal time quantum available in MT4 environment to both the trader and the programmer is a second. The price can change more frequently, but the last change within a second will be saved in the history.
</p>
<p>
<strong>Bar formation.</strong>
</p>
<p>
Initially, data for every currency have the following format:</p>
<ul>
<li>Price change date. Date detailing right up to a second</li>
<li>New price level. Detailing of this parameter depends on the broker configurations</li>
</ul>
<p>
Time line example:</p>
<ul>
<li>January 1, 2008 9:00:04 – <strong>1.4001</strong></li>
<li>January 1, 2008 9:00:05 – <strong>1.4003</strong></li>
<li>January 1, 2008 9:00:25 – <strong>1.4008</strong></li>
<li>January 1, 2008 9:00:50 – <strong>1.4005</strong></li>
<li>January 1, 2008 9:01:15 – <strong>1.4006</strong></li>
<li>January 1, 2008 9:01:28 – <strong>1.4008</strong></li>
<li>January 1, 2008 9:01:32 – <strong>1.4001</strong></li>
<li>January 1, 2008 9:01:33 – <strong>1.4002</strong></li>
<li>January 1, 2008 9:01:45 – <strong>1.4004</strong></li>
<li>January 1, 2008 9:01:52 – <strong>1.4009</strong></li>
<li>January 1, 2008 9:01:55 – <strong>1.4010</strong></li>
<li>January 1, 2008 9:02:08 – <strong>1.4018</strong></li>
<li>January 1, 2008 9:02:18 – <strong>1.4019</strong></li>
</ul>
<p>
The first, the second and the third minutes of the time span, that starts with January 1, 2008 9:00:00 appeared in this sequence.
</p>
<p>
Now, we will try to form bars from these data. We will use the time interval 1M. If the date of January 1, 2008 9:00:00 is used as the beginning of history formation, then we have three bars with the following time spans:</p>
<ul>
<li><strong>1 bar</strong> – [January 1, 2008 9:00:04 - January 1, 2008 9:00:50]</li>
<li><strong>2 bar</strong> &#8211; [January 1, 2008 9:01:15 - January 1, 2008 9:01:55]</li>
<li><strong>3 bar</strong> &#8211; [January 1, 2008 9:02:08 - January 1, 2008 9:02:18]</li>
</ul>
<p>The first price change for bar 1 was the value of 1.4001 which is the bar opening price, the last change at January 1, 2008 9:00:50 with the value of 1.4005 is the bar closing price. Then we find the highest value &#8211; 1.4008. The lowest is 1.4001.  We obtain the bar parameters:</p>
<ul>
<li><strong>Open</strong> – 1.4001</li>
<li><strong>Close</strong> – 1.4005</li>
<li><strong>High</strong> – 1.4008</li>
<li><strong>Low</strong> – 1.4001</li>
</ul>
<p>The values for remaining bars are being found analogously</p>
<p>
<strong>The formed and the current bars</strong>
</p>
<p>
Two types of bars can be distinguished in the time sequence:
</p>
<p>
<strong><em>Formed</em></strong> – current time is later than the time of bar formation completion, hence the bar is considered as formed, new data will not affect its form.
</p>
<p>
<strong><em>Current</em></strong> – current time is earlier than the time of bar formation completion, hence the bar is considered as current or the one that is being formed. The bar remains forming one till the time of its formation end, even if there will be no more price level changes. The new data can change any parameter except for opening price. Bar closing price changes with every price change until the bar becomes formed. In other words, current bar parameters are re-computed every time when the new data related to price change are coming.
</p>
<p>
You have to be very careful when using current bar because its form can totally change during the time from the start to the end of its formation. Normally, the most recent formed bar of a time sequence is used for conditions computation.
</p>
<p>
<strong>Special features of bar formation.</strong>
</p>
<p>
Bar formation process has its small peculiarities that would be useful to know.
</p>
<p>
Bar consisting of one tic mark. It might happen that during bar formation the price can change only once. For example, within a span of [January 1, 2008 9:03:00 - January 1, 2008 9:03:59] there was only one change on January 1, 2008 9:03:48 – 1.4022. In this case all parameters of the bar are equal to one value of 1.4022
</p>
<p>
Bar having no tic marks. Sometimes, no changes are happening during bar formation. E.g., there were no changes during a span of [January 1, 2008 9:04:00 - January 1, 2008 9:04:59]. In such case, this bar will not be reflected on the time sequence because there are simply no data for its formation. The time span will also be left out.
</p>
<p>
<strong>Bars indexation </strong>
</p>
<p>
Bars indexation is quite a specific concept that is mainly used by programmers. However, there are several situations when it would be useful for an MQL program user to know the specific features of bars indexation as well.
</p>
<p>
So, we have 5 bars of 1M within the time span [January 1, 2008 9:00:00 - January 1, 2008 9:04:59]. The last bar is being formed, the rest have been formed. The indexation starts with the current bar, minimal index is 0. Let’s take a look at the table:</p>
<ul>
<li><strong>4 index</strong> – [January 1, 2008 9:00:00 - January 1, 2008 9:00:59]</li>
<li><strong>3 index</strong> &#8211; [January 1, 2008 9:01:00 - January 1, 2008 9:01:59]</li>
<li><strong>2 index</strong> &#8211; [January 1, 2008 9:02:00 - January 1, 2008 9:02:59]</li>
<li><strong>1 index</strong> &#8211; [January 1, 2008 9:03:00 - January 1, 2008 9:03:59]</li>
<li><strong>0 index</strong> &#8211; [January 1, 2008 9:04:00 - January 1, 2008 9:04:59]</li>
</ul>
<p>
As soon as a new bar starts and new time span [January 1, 2008 9:05:00 - January 1, 2008 9:05:59] is opened, then all the bars on the time sequence are being indexed. The situation has the following format:</p>
<ul>
<li><strong>5 index</strong> – [January 1, 2008 9:00:00 - January 1, 2008 9:00:59]</li>
<li><strong>4 index</strong> &#8211; [January 1, 2008 9:01:00 - January 1, 2008 9:01:59]</li>
<li><strong>3 index</strong> &#8211; [January 1, 2008 9:02:00 - January 1, 2008 9:02:59]</li>
<li><strong>2 index</strong> &#8211; [January 1, 2008 9:03:00 - January 1, 2008 9:03:59]</li>
<li><strong>1 index</strong> &#8211; [January 1, 2008 9:04:00 - January 1, 2008 9:04:59]</li>
<li><strong>0 index</strong> &#8211; [January 1, 2008 9:05:00 - January 1, 2008 9:05:59]</li>
</ul>
<p>
In this manner, the bar being formed always has 0 index. This knowledge is useful for configuration of condition computation algorithm. With the help of variable, it’s possible to set – from which bar the condition computation should start. From 0 (current), 1 (formed) or any other.
</p>
<p>
<strong>When does the bar start and when does it end?</strong>
</p>
<p>
A bar starts with the first price change within a time interval. If the first time interval of 1 minute starts at 00:00:00, and the first price change occurs at 00:00:24, then it is exactly from this time we can consider that a bar started. If no price change occurred within the set time interval, then the bar is left out.
</p>
<p>
The bar ends along with the interval within which it is being formed, regardless of the time when the last price change has occured.
</p>
<p>
<strong>Bar formation level.</strong>
</p>
<p>
If the time interval within which a bar is formed is broken into equal parts then we will have several levels of bar formation. E.g., let’s take an interval of 1 minute as one and consider the flow of time in percentage ratio. Thus, 00:00:00 will be considered as 0%, and 00:00:59 will be as 100%.
</p>
<p>
Sometimes traders use trade method on the current bar, but with formation level which is more than the defined value in percentage ratio.
</p>
<p>
It’s important to keep in mind that current bar formation level can only be defined in percents during price change.  Hence, if you expect bar level of 80% and more, then a situation is possible when the last price change occurred at the level of less than 80% and the next change will occur within another time interval already.
</p>
<p>
This method should be used with great care and preferably with large time intervals.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.airbionicfx.com/blog/article/metatrader-bar-2/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Metatrader. Time Zone Shift</title>
		<link>http://www.airbionicfx.com/blog/article/metatrader-time-zone-shift/</link>
		<comments>http://www.airbionicfx.com/blog/article/metatrader-time-zone-shift/#comments</comments>
		<pubDate>Wed, 17 Dec 2008 20:26:59 +0000</pubDate>
		<dc:creator>admin</dc:creator>
				<category><![CDATA[Article]]></category>
		<category><![CDATA[Wiki]]></category>
		<category><![CDATA[Metarader]]></category>
		<category><![CDATA[MQL]]></category>
		<category><![CDATA[MQL4]]></category>
		<category><![CDATA[Time Shift]]></category>
		<category><![CDATA[Time Zone]]></category>

		<guid isPermaLink="false">http://www.airbionicfx.com/blog/?p=32</guid>
		<description><![CDATA[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 [...]]]></description>
			<content:encoded><![CDATA[<p>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. </p>
<p>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.</p>
<p><span id="more-32"></span></p>
<p>With respect to zero meridian, time can have a shift of -12 to +12 hours. I.e. within 24 hours. However, two dates fall within this span. These are the current date (from 0 to +12) and previous date (from -12 to 0).</p>
<p><a href='http://new.airbionicfx.com/blog/wp-content/uploads/2008/12/31.jpg'><img src="http://new.airbionicfx.com/blog/wp-content/uploads/2008/12/31.jpg" alt="Time Line" title="Time Line" width="500" height="203" class="alignnone size-full wp-image-38" /></a></p>
<p>Let’s take a look at an example.</p>
<p>Expert advisor has to work only during the session at NYSE. NYSE is opened at 9:30 AM and closed at 4:00 PM as per Eastern Time. If the time will be converted to Greenvich Mean Time, then we will have GMT-5. We have to configure the expert advisor to work during this time. If we are located at the GMT-0 zone, then for correct synchronization we have to know our location with respect to zero meridian as well. E.g., our time zone is GMT+1. Thus, time difference makes up 6 hours. As the reference point is time on the side of the Metatrader 4 terminal, then the relative time shift will be -6 hours.</p>
<p><a href='http://new.airbionicfx.com/blog/wp-content/uploads/2008/12/41.jpg'><img src="http://new.airbionicfx.com/blog/wp-content/uploads/2008/12/41.jpg" alt="Time correction" title="Time correction" width="500" height="203" class="alignnone size-full wp-image-39" /></a></p>
<p>Let’s move on to specific figures and computations. Local time on trader’s computer is 2:00 PM. We find the time in New York by shifting the current time 6 hours back. We get 8:00 AM. It is too early for the expert advisor to operate; the stock exchange is not opened yet. The exchange will open when the local time will be equal to 3:30 PM.</p>
<p>Let’s summarize. If the expert advisor has the TimeShift configuration, then the task of the trader is to know the difference between the local time and the time of event for which the expert advisor has to be configured. If local time precedes the required event, then the shift will have the “+” sign, and if local time follows the event, then the shift will have the “-“ sign.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.airbionicfx.com/blog/article/metatrader-time-zone-shift/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Metatrader. Break Even.</title>
		<link>http://www.airbionicfx.com/blog/article/metatrader-break-even/</link>
		<comments>http://www.airbionicfx.com/blog/article/metatrader-break-even/#comments</comments>
		<pubDate>Wed, 17 Dec 2008 20:11:51 +0000</pubDate>
		<dc:creator>admin</dc:creator>
				<category><![CDATA[Article]]></category>
		<category><![CDATA[Wiki]]></category>
		<category><![CDATA[Break Even]]></category>
		<category><![CDATA[BreakEven]]></category>
		<category><![CDATA[Metatrader]]></category>
		<category><![CDATA[MQL]]></category>
		<category><![CDATA[MQL4]]></category>
		<category><![CDATA[stop loss]]></category>
		<category><![CDATA[StopLoss]]></category>

		<guid isPermaLink="false">http://www.airbionicfx.com/blog/?p=33</guid>
		<description><![CDATA[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 [...]]]></description>
			<content:encoded><![CDATA[<p>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.</p>
<p><span id="more-33"></span></p>
<p>Break Even point can be fixed using automatic Stop Loss. This is the most reliable method, however if broker configurations do not allow fixing this value so close to the current price then the closing can be done manually.</p>
<p>You can also combine manual Stop Loss and automatic one in the logic of Break Even. I.e., to close the order at the break-even point in any case, but to set the automatic Stop Loss if possible. </p>
<p>Let’s look at example with manual Stop Loss value. Break Even=BE=5 pips. This means that the Stop Loss value will be set 5 pips higher than the break-even point. Current Bid price =1.4038, Ask=1.4040. We set a BUY order. We have the following characteristics of the opened order: opening price is 1.4040. Current profit is 2 pips. Closing point as per algorithm is set at the level of 1.4045, however we have to remember that the algorithm will start operate only when the price will surmount this level.</p>
<p>The price got up by 10 pips. Current values of the order: opening price is 1.4040,  Ask=1.4050, current profit is 8 pips. Condition for triggering of the Break even algorithm is satisfied. Now, when the price will move in the opposite direction and will pass the BE level=1.4045, the order will be closed.</p>
<p><a href='http://new.airbionicfx.com/blog/wp-content/uploads/2008/12/51.jpg'><img src="http://new.airbionicfx.com/blog/wp-content/uploads/2008/12/51.jpg" alt="Break Even" title="Break Even" width="500" height="203" class="alignnone size-full wp-image-37" /></a></p>
<p>The price lowered by 8 pips. Current values of the order: opening price is 1.4040,  Ask=1.4042, current profit is 0 pips. Condition for triggering of the Break even algorithm was satisfied earlier. Order is closed as the price surmounted the BE level in the opposite direction. In this example, we see difference between conventional and automatic method of order closing. In automatic mode (Stop Loss=1.4045), the order was closed with 5 pips of profit. In our case the order is closed with zero profit level, because the closing method was manual.</p>
<p>In fact, Break Even is a special case of Stop Loss, but individual term is used for convenience. Take Profit and Break Even can be combined in practice of Expert advisors’ development.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.airbionicfx.com/blog/article/metatrader-break-even/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Metatrader. Trailing Stop.</title>
		<link>http://www.airbionicfx.com/blog/article/metatrader-trailing-stop/</link>
		<comments>http://www.airbionicfx.com/blog/article/metatrader-trailing-stop/#comments</comments>
		<pubDate>Wed, 17 Dec 2008 20:05:17 +0000</pubDate>
		<dc:creator>admin</dc:creator>
				<category><![CDATA[Article]]></category>
		<category><![CDATA[Wiki]]></category>
		<category><![CDATA[Metatrader]]></category>
		<category><![CDATA[MQL]]></category>
		<category><![CDATA[MQL4]]></category>
		<category><![CDATA[stop loss]]></category>
		<category><![CDATA[StopLoss]]></category>
		<category><![CDATA[Trailing Stop]]></category>
		<category><![CDATA[TrailingStopm]]></category>

		<guid isPermaLink="false">http://www.airbionicfx.com/blog/?p=31</guid>
		<description><![CDATA[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 [...]]]></description>
			<content:encoded><![CDATA[<p>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.</p>
<p>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.</p>
<p><span id="more-31"></span></p>
<p>Let’s look at an example. TS=10, SL=20. Current Bid price=1.4038, Ask=1.4040. Let’s set a BUY order. We get the following characteristics of the opened order: opening price is 1.4040, SL=1.4020. Current profit is -2 pips.</p>
<p><a href='http://new.airbionicfx.com/blog/wp-content/uploads/2008/12/2_111.jpg'><img src="http://new.airbionicfx.com/blog/wp-content/uploads/2008/12/2_111.jpg" alt="Open BUY with Stop Loss" title="Open BUY with Stop Loss" width="500" height="203" class="alignnone size-full wp-image-34" /></a></p>
<p>The price raised by 10 pips. Ask=1.4050. Current profit is +8 pips. Conditions for triggering of the Trailing Stop algorithm are not satisfied.  The price raised by 3 pips more. Ask=1.4053. Current profit is +11 pips. Conditions for triggering of the Trailing Stop algorithm are satisfied. We change the Stop Loss value into new one. SL=Ask-20 pips=1.4033.</p>
<p><a href='http://new.airbionicfx.com/blog/wp-content/uploads/2008/12/211.jpg'><img src="http://new.airbionicfx.com/blog/wp-content/uploads/2008/12/211.jpg" alt="Trail UP Stop Loss" title="Trail UP Stop Loss" width="500" height="203" class="alignnone size-full wp-image-35" /></a></p>
<p>After the profit level of TS=10 pips was surmounted, the further price raise causes the SL value to change to new one all the time. However, if the new SL is lower than the current, then the value remains unchanged.</p>
<p>Let’s look at an example. After a short-term lowering, the price started moving up again. The current values of the order are: opening price is 1.4040, SL=1.4045, Ask=1.4055, current profit is 13 pips. Condition for triggering of the Trailing Stop algorithm is satisfied. New SL value=1.4035. As the previous SL value is higher than the new one, then SL doesn’t need to be changed as per the definition of the algorithm.</p>
<p><a href='http://new.airbionicfx.com/blog/wp-content/uploads/2008/12/111.jpg'><img src="http://new.airbionicfx.com/blog/wp-content/uploads/2008/12/111.jpg" alt="Price down, NO Stop Loss change" title="Price down, NO Stop Loss change" width="500" height="203" class="alignnone size-full wp-image-36" /></a></p>
<p>For the SELL case, the algorithm works in the same way but it considering the direction. </p>
<p>Let’s look at the non-standard values of TS. </p>
<p>TS=0. With such configuration the SL value will start changing at once as soon as it surmounts the zero barrier of the profit. In our example it starts from the value of current Ask price=1.4042 and higher.</p>
<p>TS=TP. From the condition we see that for such configuration the order has to use the exit condition as per Take Profit. With such configuration the Trailing Stop is disabled. In other words, in order to disable Trailing Stop function, one has to set the TS value as equal or higher than the TP. Before the Trailing Stop algorithm is triggered, an order will be automatically closed at the TP level. This configuration is convenient in a way that there is no necessity to use a separate Trailing Stop disabling algorithm.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.airbionicfx.com/blog/article/metatrader-trailing-stop/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Metatrader. Take Profit.</title>
		<link>http://www.airbionicfx.com/blog/article/metatrader-take-profit/</link>
		<comments>http://www.airbionicfx.com/blog/article/metatrader-take-profit/#comments</comments>
		<pubDate>Thu, 11 Dec 2008 13:54:54 +0000</pubDate>
		<dc:creator>admin</dc:creator>
				<category><![CDATA[Article]]></category>
		<category><![CDATA[Wiki]]></category>
		<category><![CDATA[Metatrader]]></category>
		<category><![CDATA[MQL]]></category>
		<category><![CDATA[MQL4]]></category>
		<category><![CDATA[Take Profit]]></category>
		<category><![CDATA[TakeProfit]]></category>

		<guid isPermaLink="false">http://www.airbionicfx.com/blog/?p=24</guid>
		<description><![CDATA[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 [...]]]></description>
			<content:encoded><![CDATA[<p><strong>Standard Take Profit</strong></p>
<p>Two types of Take Profit have to be distinguished. The first type is automatic, the second is or manual.</p>
<p>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.</p>
<p><span id="more-30"></span></p>
<p>Let us look at an example.</p>
<p>Ask price=1.4040, Bid=1.4038. We open a BUY order. Open price is 1.4040. Let’s set the Take Profit value=1.4060</p>
<p><a href='http://new.airbionicfx.com/blog/wp-content/uploads/2008/12/4_11.jpg'><img src="http://new.airbionicfx.com/blog/wp-content/uploads/2008/12/4_11.jpg" alt="Open BUY order with Take Profit" title="Open BUY order with Take Profit" width="500" height="203" class="alignnone size-full wp-image-25" /></a></p>
<p>The price starts to move up and reaches Ask value=1.4060, but the order is not closed as the BUY order will be closed as per the Bid level. The price keeps on going up and passes the Bid level=1.4060. The order is closed automatically. The profit is 20 pips.</p>
<p><a href='http://new.airbionicfx.com/blog/wp-content/uploads/2008/12/4_21.jpg'><img src="http://new.airbionicfx.com/blog/wp-content/uploads/2008/12/4_21.jpg" alt="Close BUY order by Take Profit" title="Close BUY order by Take Profit" width="500" height="203" class="alignnone size-full wp-image-26" /></a></p>
<p>The similar for SELL order. Ask price=1.4040, Bid=1.4038. We open a SELL order. Open price is 1.4038. Let’s set the Take Profit value=1.4018</p>
<p><a href='http://new.airbionicfx.com/blog/wp-content/uploads/2008/12/3_11.jpg'><img src="http://new.airbionicfx.com/blog/wp-content/uploads/2008/12/3_11.jpg" alt="Open SELL order with Take Profit" title="Open SELL order with Take Profit" width="500" height="203" class="alignnone size-full wp-image-27" /></a></p>
<p>Price is going down and passes the Ask level=1.4018. The order is closed automatically. The profit is 20 pips.</p>
<p><a href='http://new.airbionicfx.com/blog/wp-content/uploads/2008/12/3_21.jpg'><img src="http://new.airbionicfx.com/blog/wp-content/uploads/2008/12/3_21.jpg" alt="Close SELL order by Take Profit" title="Close SELL order by Take Profit" width="500" height="203" class="alignnone size-full wp-image-28" /></a></p>
<p>One of the features of Take Profit is that it cannot be set too close to the order opening price. Minimal distance can be different and is being set according to configurations of the broker server. Value is counted from the closing price. I.e. from the Bid price for BUY orders and from the Ask price for SELL orders.</p>
<p>During the time when the order is open, we are able to change the Take Profit value. Herein, rules for distance of a new Take Profit value are exactly the same as during the order opening. The only difference will be that current price value has to be used but not the order open price.</p>
<p>For convenience, the traders use relative values of Take Profit in the pips, e.g., for the value of TP=25 at current price of Bid=1.4038 and Ask=1.4040, absolute value of Take Profit for BUY order will be 1.4065, and for SELL order under the same conditions it will be – 1.4013. I.e., Ask price is taken as a basis for the BUY order and Bid price is taken for the SELL order. In this manner, when closing an order on Take Profit event we will receive precisely 25 pips of profit.</p>
<p><strong>
<p>Manual Take Profit.</p>
<p></strong></p>
<p>Manual method of order closing differs from the automatic one in the way that in case of reaching Take Profit level, the order is not closed automatically, and it has to be closed manually. Such method is not very effective because additional efforts are required, but there are cases when it is reasonable to use particularly manual closing. E.g. when we need to use a function of partial closure of an order under different levels of profit for one and the same order.</p>
<p>Let’s take a look at an example. We open an order with 3 lots volume. And we will close one lot at a different level of profit.  TP1=10, TP2=20, TP3=30. When reaching TP1 and TP2 parts of the order will be closed manually and closing of the part at the TP3 level will be done automatically. </p>
<p>With the Ask=1.4040, Bid price =1.4038 the parameters for BUY order will be as follows: open price=1.4040, manual Take Profit TP1=1.4050, manual Take Profit =TP2=1.4060, standard Take Profit=TP3=1.4070.</p>
<p><a href='http://new.airbionicfx.com/blog/wp-content/uploads/2008/12/22.jpg'><img src="http://new.airbionicfx.com/blog/wp-content/uploads/2008/12/22.jpg" alt="Open BUY order with standard and manual Take Profit" title="Open BUY order with standard and manual Take Profit" width="500" height="203" class="alignnone size-full wp-image-29" /></a></p>
<p>With the Ask=1.4070, Bid price =1.4068 the parameters for SELL order will be as follows: open price=1.4068, manual Take Profit TP1=1.4058, manual Take Profit =TP2=1.4048, standard Take Profit=TP3=1.4038.</p>
<p><a href='http://new.airbionicfx.com/blog/wp-content/uploads/2008/12/12.jpg'><img src="http://new.airbionicfx.com/blog/wp-content/uploads/2008/12/12.jpg" alt="Open SELL order with standard and manual Take Profit" title="Open SELL order with standard and manual Take Profit" width="500" height="203" class="alignnone size-full wp-image-30" /></a></p>
<p>Manual method of order closing as per the Take Profit level has one disadvantage minimum. If a technical deficiency suddenly occurs on the trader side, then it would be impossible to close the order timely at least. In automatic method, order will close in any case regardless of technical state of the metatrader terminal. Thus, trader is responsible for manual order closing, and broker is responsible for the automatic closing. These peculiarities have to be obligatory taken into account when choosing parameters for the order being opened.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.airbionicfx.com/blog/article/metatrader-take-profit/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Metatrader. Stop Loss.</title>
		<link>http://www.airbionicfx.com/blog/article/metatrader-stop-loss/</link>
		<comments>http://www.airbionicfx.com/blog/article/metatrader-stop-loss/#comments</comments>
		<pubDate>Mon, 08 Dec 2008 20:51:02 +0000</pubDate>
		<dc:creator>admin</dc:creator>
				<category><![CDATA[Article]]></category>
		<category><![CDATA[Wiki]]></category>
		<category><![CDATA[Metatrader]]></category>
		<category><![CDATA[MQL]]></category>
		<category><![CDATA[MQL4]]></category>
		<category><![CDATA[stop loss]]></category>
		<category><![CDATA[StopLoss]]></category>

		<guid isPermaLink="false">http://www.airbionicfx.com/blog/?p=15</guid>
		<description><![CDATA[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 [...]]]></description>
			<content:encoded><![CDATA[<p><strong>Standard Stop Loss</strong></p>
<p>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.</p>
<p>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.</p>
<p><span id="more-15"></span></p>
<p>Let us look at an examples.</p>
<p>Ask price=1.4040, Bid=1.4038. We open a BUY order. Opening price is 1.4040. Let’s set Stop Loss=1.4020</p>
<p><a href='http://new.airbionicfx.com/blog/wp-content/uploads/2008/12/2_12.jpg'><img src="http://new.airbionicfx.com/blog/wp-content/uploads/2008/12/2_12.jpg" alt="Open BUY order with Stop Loss" title="Open BUY order with Stop Loss" width="500" height="203" class="alignnone size-full wp-image-16" /></a></p>
<p>Price ticks down and passes the level Bid=1.4020. The order is closed automatically. The loss is 20 pips.</p>
<p><a href='http://new.airbionicfx.com/blog/wp-content/uploads/2008/12/2_21.jpg'><img src="http://new.airbionicfx.com/blog/wp-content/uploads/2008/12/2_21.jpg" alt="Order BUY close by Stop Loss" title="Order BUY close by Stop Loss" width="500" height="203" class="alignnone size-full wp-image-17" /></a></p>
<p>The similar situation for SELL order</p>
<p>Ask price=1.4040, Bid=1.4038. We open a BUY order. Opening price is 1.4038. Let’s set Stop Loss=1.4063</p>
<p><a href='http://new.airbionicfx.com/blog/wp-content/uploads/2008/12/1_11.jpg'><img src="http://new.airbionicfx.com/blog/wp-content/uploads/2008/12/1_11.jpg" alt="Open SELL order with StopLoss" title="Open SELL order with StopLoss" width="500" height="203" class="alignnone size-full wp-image-18" /></a></p>
<p>Price goes upward and passes the level Ask=1.4063. The order is closed automatically. The loss is 20 pips.</p>
<p><a href='http://new.airbionicfx.com/blog/wp-content/uploads/2008/12/1_21.jpg'><img src="http://new.airbionicfx.com/blog/wp-content/uploads/2008/12/1_21.jpg" alt="Close SELL by Stop Loss" title="Close SELL by Stop Loss" width="500" height="203" class="alignnone size-full wp-image-23" /></a></p>
<p>One of the features of Stop Loss is that it cannot be set too close to the order opening price. Minimal distance can be different and is being set according to configurations of the broker server. Value is counted from the opening price. I.e. from the Ask price for BUY orders and from the Bid price for SELL orders.</p>
<p>During the time when the order is open, we are able to change the Stop Loss value. Herein, rules for distance of a new Stop Loss value are exactly the same as during the order opening. The only difference will be that current price value has to be used but not the order opening price.</p>
<p>For convenience, the traders use relative values of Stop Loss in the pips, e.g., for the value of  SL=25 at current price of Bid=1.4038 and Ask=1.4040, absolute value of Stop Loss for BUY order will be 1.4015, and for SELL order under the same conditions it will be 1.4063. I.e., Ask price is taken as a basis for the BUY order and Bid price is taken for the SELL order. In this manner, when closing an order on Stop Loss event we will receive precisely 25 pips of loss.</p>
<p><strong>
<p>Manual Stop Loss.</p>
<p></strong></p>
<p>Manual method of order closing differs from the automatic one in the way that in case of reaching Stop Loss level, the order is not closed automatically, and it has to be closed manually. Such method is not very effective because additional efforts are required, but there are cases when it is reasonable to use particularly manual closing. E.g., when we need to use a function of partial closure of an order under different levels of loss for one and the same order.</p>
<p>Let’s take a look at an example. We open an order with 3 lots volume. And we will close one lot at a different level of loss.  SL1=10, SL2=20, SL3=30. When reaching SL1 and SL2, parts of the order will be closed manually and closing of the part at the SL3 level will be done automatically. </p>
<p>In this manner, with the Bid price =1.4038, Ask=1.4040, the parameters:</p>
<p>For BUY order will be as follows: open price=1.4040, manual Stop Loss SL1=1.4030, manual Stop Loss=SL2=1.4020, standard Stop Loss=SL3=1.4010. </p>
<p><a href='http://new.airbionicfx.com/blog/wp-content/uploads/2008/12/2_31.jpg'><img src="http://new.airbionicfx.com/blog/wp-content/uploads/2008/12/2_31.jpg" alt="Standard and manual StopLoss for BUY order" title="Standard and manual StopLoss for BUY order" width="500" height="203" class="alignnone size-full wp-image-22" /></a></p>
<p>For SELL: open price=1.4008, manual Stop Loss SL1=1.4018, manual Stop Loss=SL2=1.4028, standard Stop Loss=SL3=1.4038. </p>
<p><a href='http://new.airbionicfx.com/blog/wp-content/uploads/2008/12/1_311.jpg'><img src="http://new.airbionicfx.com/blog/wp-content/uploads/2008/12/1_311.jpg" alt="Standard and manual Stop Loss for SELL order" title="Standard and manual Stop Loss for SELL order" width="500" height="203" class="alignnone size-full wp-image-21" /></a></p>
<p>Manual method of order closing as per the Stop Loss level has one disadvantage minimum. If a technical deficiency suddenly occurs on the trader side, then it would be impossible to close the order timely at least. In automatic method, order will close in any case regardless of technical state of the metatrader terminal. Thus, trader is responsible for manual order closing, and broker is responsible for the automatic closing. These peculiarities have to be obligatory taken into account when choosing parameters for the order being opened.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.airbionicfx.com/blog/article/metatrader-stop-loss/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Metatrader Programming Overview</title>
		<link>http://www.airbionicfx.com/blog/wiki/metatrader-programming/</link>
		<comments>http://www.airbionicfx.com/blog/wiki/metatrader-programming/#comments</comments>
		<pubDate>Wed, 05 Nov 2008 21:03:19 +0000</pubDate>
		<dc:creator>admin</dc:creator>
				<category><![CDATA[Wiki]]></category>
		<category><![CDATA[custom indicator]]></category>
		<category><![CDATA[dll library]]></category>
		<category><![CDATA[expert advisor]]></category>
		<category><![CDATA[Library]]></category>
		<category><![CDATA[Metatrader]]></category>
		<category><![CDATA[metatrader programming]]></category>
		<category><![CDATA[script]]></category>

		<guid isPermaLink="false">http://www.airbionicfx.com/blog/?p=14</guid>
		<description><![CDATA[Metatrader is one of the most popular trading platform among presently existing. Wide configuration and control possibilities for brokers and robust programming tool &#8211; integrated MQL language &#8211; for traders make the system handy and versatile in use at its maximum.

MQL integrated programming language is a C++ like language. Its concepts and syntax are familiar [...]]]></description>
			<content:encoded><![CDATA[<p>Metatrader is one of the most popular trading platform among presently existing. Wide configuration and control possibilities for brokers and robust programming tool &#8211; integrated MQL language &#8211; for traders make the system handy and versatile in use at its maximum.</p>
<p><span id="more-14"></span></p>
<p>MQL integrated programming language is a C++ like language. Its concepts and syntax are familiar to a majority of programmers and this allows to conserve time resources during the learning phase. It is enough to grasp syntax and basic idea of Metatrader trading platform to start programming in MQL language.</p>
<p>By means of MQL language it is possible to create several program types:</p>
<p><strong>Expert Advisor.</strong> The main goal for Expert Advisors is to carry trading operations in automatic mode following prescribed rules and by that freeing trader from the routine work. Expert Advisors can use in its work Custom Indicators and Libraries. Back Test Strategy Tester allows to conduct strategy profitability testing on historical data which shortens development terms dramatically.</p>
<p><strong>Custom Indicator.</strong> Classical indicators posses visual constituent as well as internal buffers to be able to be used in Expert Advisors. Non standard approaches are also possible though such as object usage, audio announcement systems and others.</p>
<p><strong>Script.</strong> In distinction from Custom Indicators and Expert Advisors scripts allow to execute some code once. This is useful for semiautomatic operation execution by trader. For example, open order with definite parameters or set Stop Loss Level to a new value. For each of new scripts it is possible to assign hot key, which makes script usage process fast and practical. It is worth noting also one of the advantages of scripts &#8211; instant execution. Custom Indicators and Expert Advisors execute code only on price change on current currency pair.</p>
<p><strong>Library.</strong> Repeatedly used functions and code pieces can be grouped into libraries. It is possible to use libraries written in MQL or in any other language. Using interface for linking external libraries provides traders with unlimited possibilities in their ideas implementation.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.airbionicfx.com/blog/wiki/metatrader-programming/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>SLiM API Optimization Tips. Part 1.</title>
		<link>http://www.airbionicfx.com/blog/article/slim-20-mql-api-optimization-tips-local-or-current-time-init-or-start/</link>
		<comments>http://www.airbionicfx.com/blog/article/slim-20-mql-api-optimization-tips-local-or-current-time-init-or-start/#comments</comments>
		<pubDate>Tue, 14 Oct 2008 17:12:12 +0000</pubDate>
		<dc:creator>admin</dc:creator>
				<category><![CDATA[Article]]></category>
		<category><![CDATA[SLiM]]></category>
		<category><![CDATA[metatrader programming]]></category>
		<category><![CDATA[MQL]]></category>
		<category><![CDATA[mql programming]]></category>
		<category><![CDATA[MQL4]]></category>
		<category><![CDATA[slim api]]></category>

		<guid isPermaLink="false">http://www.airbionicfx.com/blog/?p=13</guid>
		<description><![CDATA[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.

Preface
This article related to Metatrader programming and AirBionicFX SLiM 2.0 MQL API programming.
Product homepage: http://www.airbionicfx.com/slim/
SLiM 2.0 is License Management Software for Metatrader platform based programs such as Custom Indicators, Expert Advisors, Scripts and [...]]]></description>
			<content:encoded><![CDATA[<p>Using SLiM 2.0?</p>
<p>Get information about better functions for license validation techniques and about better place in mql code to check for license settings.</p>
<p><span id="more-13"></span></p>
<h2>Preface</h2>
<p>This article related to Metatrader programming and AirBionicFX SLiM 2.0 MQL API programming.<br />
Product homepage: <a href="http://www.airbionicfx.com/slim/">http://www.airbionicfx.com/slim/</a></p>
<p>SLiM 2.0 is License Management Software for Metatrader platform based programs such as Custom Indicators, Expert Advisors, Scripts and Libraries. SLiM 2.0 allows to protect and control programs by serial number.</p>
<h2>What needed before start?</h2>
<ol>
<li>Download Metatrader Terminal from the official site (<a href="http://www.metaquotes.net">www.metaquotes.net</a>) and install in.</li>
<li>Download SLiM 2.0 library (<a href="http://www.airbionicfx.com/downloads/SLiM.ex4">http://www.airbionicfx.com/downloads/SLiM.ex4</a>) and place it to Metatrader/experts/libraries/</li>
</ol>
<h2>Local time or Current time?</h2>
<p>There are two methods to determine time in Metatrader system.</p>
<p><em><strong>datetime TimeCurrent()</strong></em> &#8211; returns the last known server time.<br />
<em><strong>datetime TimeLocal()</strong></em> &#8211; returns local computer time.</p>
<p>Time taken from broker&#8217;s server (<strong><em>TimeCurrent()</em></strong>) by far not always matches the current local time (<strong><em>TimeLocal()</em></strong>). However local time is easy to change while broker&#8217;s side time will continue its even flow untouched.</p>
<p>Therefore, if license is time limited, one must use <strong><em>TimeCurrent()</em></strong> function.</p>
<p>Take a look at the following example.</p>
<pre><code>
#property copyright "AirBionicFX"
#property link      "http://www.airbionicfx.com/"

// SLiM 2.0 API Functions Declaration
#import "SLiM.ex4"
   bool      SLiM_ApplyLicense(string SN, string Key, string ProductTitle);
   int       SLiM_GetProductId();
   int       SLiM_GetMajorProductVersion();
   int       SLiM_GetMinorProductVersion();
   int       SLiM_GetLicenseType();
   bool      SLiM_GetLockedByTime();
   bool      SLiM_GetLockedByAccountNumber();
   int       SLiM_GetAccNum();
   datetime  SLiM_GetExpirationDate();
#import

// SLiM 2.0 License Information Section
extern string License_SerialNumber="";
       string License_Key="slimtestkey";
       string License_ProductTitle="slimtestea1";

int init()
{
   return(0);
}

int start()
{
   bool ApplyResult=SLiM_ApplyLicense(License_SerialNumber,License_Key,License_ProductTitle);
   if (!ApplyResult)
      Alert("FAILED");
   else
   {
      if (SLiM_GetLockedByTime())
         if (TimeCurrent()&gt;SLiM_GetExpirationDate())
            Alert("License has expired!");
         else
            Alert("SUCCEED");
   }
   return(0);
}

int deinit()
{
   return(0);
}

</code></pre>
<p>Start function takes the following steps:</p>
<ol>
<li>Checks the serial number for match</li>
<li>Checks if license is time limited</li>
<li>If license is time limited checks whether usage duration is ended or not. It is imperative to use TimeCurrent() function while checking time limits.</li>
</ol>
<h2>Init() or Start()?</h2>
<p>Any program written in MQL contains three predefined functions <em><strong>Init()</strong></em>, <em>Start()</em>, <em><strong>Deinit()</strong></em></p>
<p><em><strong>Init()</strong></em> – is called by framework in the start of the program.<br />
<em><strong>Deinit()</strong></em> – is called in the end of the program.<br />
<em><strong>Start()</strong></em> – is the main function called multiple times whenever current currency pair price is changed.</p>
<p>We can use <em><strong>Init()</strong></em> function for license validation. In this case program will do the check once in the beginning of its executions. If license is not time limited it is the most optimal to put license check in <em><strong>Init()</strong></em> function.</p>
<p>But if the license is time limited, it makes sense to put that check in <em><strong>Start()</strong></em> function. In this way the check will be performed every time current currency pair price is changed and if license runs out of time during program execution the logic will be stopped at once.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.airbionicfx.com/blog/article/slim-20-mql-api-optimization-tips-local-or-current-time-init-or-start/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>AirBionicFX released SLiM 2.0</title>
		<link>http://www.airbionicfx.com/blog/news/airbionicfx-released-slim-20/</link>
		<comments>http://www.airbionicfx.com/blog/news/airbionicfx-released-slim-20/#comments</comments>
		<pubDate>Tue, 09 Sep 2008 19:14:09 +0000</pubDate>
		<dc:creator>admin</dc:creator>
				<category><![CDATA[News]]></category>
		<category><![CDATA[Press Release]]></category>
		<category><![CDATA[SLiM]]></category>
		<category><![CDATA[Forex]]></category>
		<category><![CDATA[Library]]></category>
		<category><![CDATA[Metatrader]]></category>
		<category><![CDATA[MQL]]></category>
		<category><![CDATA[MQL4]]></category>

		<guid isPermaLink="false">http://www.airbionicfx.com/blog/?p=12</guid>
		<description><![CDATA[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 [...]]]></description>
			<content:encoded><![CDATA[<p>AirBionicFX Company announced the release of SLiM 2.0 software with optimized set of functions for serial number creation and management in MQL4 products.</p>
<p>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.</p>
<p><span id="more-12"></span></p>
<p>The list of new features and improvements over the previous version:</p>
<ul>
<li>License is generated in the form of a Serial Number in contrary to a key file approach (as it happened previously). This essentially simplifies applying the license by end user.</li>
<li>No more personal and contact information about the customer is encoded within the serial number, only the product code and access rights-related information.</li>
<li>Editable e-mail template for sending a serial number. With this option you can flexibly configure a message to be sent to a customer. Around 10 predefined template values are available, such as Serial Number, Customer Name, Product Name etc.</li>
<li>Visual indication of correct information entry. Enables user to quickly find the item entered with a mistake or not as per format.</li>
<li>Open MQL4 API. Now the system user can incorporate SLiM into his projects himself without applying for professional programming services.</li>
<li>No limitation imposed on the number of projects.</li>
<li>Simplified system of applying a license in MQL product. The system generates a license file based on the information entered and there’s no need to recurrently enter the serial number.</li>
<li>License generation routine now uses new more reliable and secure algorithm.</li>
<li>The program database keeps all the information in an encoded form.</li>
<li>Guarantee period is extended to 12 months.</li>
</ul>
<p>As for the price policy, the cost of SLiM 2.0 is essentially lowered and equals to $299, which is half the price of the previous version. The license price also includes free modification of one MQL4 project by programmers of AirBionicFX.</p>
<p>To evaluate the features of SLiM 2.0, a 14-days trial version of the program is offered and can be downloaded from the official site of the company.</p>
<h3>About the company</h3>
<p>AirBionicFX Company exists at the market since year 2007. Our main field of activity is services in software development under Metatrader system and creation of solutions and products for optimizing trade processes at the Forex market. Company staff consists of high-qualified specialists in software development who have many years of experience in developing programs for trade systems and Metatrader system in particular.</p>
<h3>Product Link</h3>
<p><a href="http://www.airbionicfx.com/slim/">http://www.airbionicfx.com/slim/</a></p>
]]></content:encoded>
			<wfw:commentRss>http://www.airbionicfx.com/blog/news/airbionicfx-released-slim-20/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>
<!-- WP Super Cache is installed but broken. The path to wp-cache-phase1.php in wp-content/advanced-cache.php must be fixed! -->