Ava FX - On-line Trading Center

Posts Tagged ‘EA’

Statistical Forex Systems

Wednesday, August 6th, 2008

Statistical Forex system is a system that relies on the information which was previously collected from the market and the amount of this information is proportional to the period of time, on which the market is analyzed. Common input parameters optimized over the period of time aren’t considered as the statistical information, thus not every optimized system or expert advisor is statistical. Statistics is collected into a special file in a format that is recognized by the system; optionally the system may update this statistics. Designing a statistical Forex system is a complex problem that involves market analysis, rules developing and real-time evaluator building.

If you want to build such trading system, you need to answer these questions first:

What period of time to use for statistics gathering? Intuition suggests that the longer the period the better will be statistics, but in fact there could be some problems if system collects the information from the time periods that due to some reasons are unrelated to the current market’s mechanics.

What information will get into statistics data? This is probably the most important question if you want to create your own statistical expert advisor. Will you record raw quotes, indicators values or some custom calculations? What indicators or calculation methods to use? What else should be recorded?

How will your system compare current market situation with the statistical data? You have some data that is associated with the rising market, some — with the falling market and the rest of your statistics is associated with the sideways market. What methods can you use to compare current market data with your statistics to make your next trading decision?

Will it learn or will it be taught? The statistical Forex system doesn’t have to collect statistics, but it may be designed to do so. This addition has its advantages and disadvantages.

How complex will it be? Statistical Forex EA can be a very simple program, but it can be also developed as a powerful analyzing and comparing program. It can be capable of recognizing not only price action patterns, but also correlation with the days of the week and the trading hours, as well as look into the past to see the start of the trend or the previous price patterns.

MT4 expert advisor built as statistical Forex system can be very profitable, but its creation is not a trivial task. I’ll try to elaborate more on these questions and the details of their solutions in the next posts.

New Life of Sample Expert Advisor

Tuesday, March 25th, 2008

Today’s update to the MetaTrader expert advisors on my site isn’t very original. For many people MACD Sample expert advisor was the first EA that they tried on the MT4 strategy tester. It’s a well known sample advisor from MetaQuotes, designed to show the basic Forex strategy implementation for the MQL. The one that is now freely available on my site differs slightly from the original version. I’ve decided to make some enhancements and optimized it for GBP/USD pair and H4 (4 hour) timeframe.

In a one year backward test it made about 44% of the initial deposit with 0.3 standard lot position size. The drawdown also wasn’t small, but 10% is quite good, in my opinion. Download this expert advisor and try it for yourself. If you get some interesting results with it on forward tests, don’t hesitate to contact me.

6 Digit Forex Quotes and MetaTrader Expert Advisors

Wednesday, March 19th, 2008

Many Forex brokers have started to offer 6 digit Forex quotes to via the MetaTrader 4 terminal recently. It has a lot of benefits for the scalping traders and opens up many new trading possibilities for others. But there seems to be a problem with almost all expert advisors that are applied to the MetaTrader 4 platform, which uses 6 digit Forex quotes instead of the more conventional 5 digit format. As the most expert advisors use the "Point" variable for pips to denominate stop-loss and take-profit, there are two major problems with the 6 digit quotes. First, both stop-loss and take-profit values have very strong chances to come to close to the current pair’s price and MT4 will generate an Error 130, if they are to close. Second, the whole strategy embedded into the given EA will stop working properly because all the profits and losses will probably be divided by 10.

Let’s look at the following example. With a 5 digit quote EUR/USD rate is 1.5703 and one Point in MetaTrader 4 is 0.0001 — a conventional pip for EUR/USD pair. Our expert advisor buys EUR/USD, setting stop-loss at 20 pips — 1.5683, and take profit at 40 pips — 1.5743. Everything goes fine and we win 40 pips when the rate reaches 1.5743. But for a 6 digit quote things are completely different. E.g. the rate above might have been 1.57032 and one Point in your MT4 would have been 0.00001 — ten times less than the conventional pip for EUR/USD. The same expert advisor would have set the stop-loss at 1.57012 and take-profit at 1.57072. Not only 99% of the brokers wouldn’t allow such a close stop-loss and take-profit setting, but if allowed this position wouldn’t be very rational and of course it wouldn’t be according to the initial strategy rules.

So how to correct this problem without completely rewriting the expert advisor and, of course, without changing a broker (to one with the 5 digit quotes)? First, I’d like to tell you that all MetaTrader expert advisors that are featured on my site have been already modified to work with both 5 and 6 digit quotes. Second, here is the way to make any EA to work properly with 6 digit quotes:

  1. Open the .mq4 of the expert advisor that you want to change in MQL Editor.
  2. Add a new global variable declaration (it should be in the beginning of the code, along with other variable declarations):
    double Poin;
  3. Add the following code to the init() function of the EA. This function is usually present in all EAs (it contains various initialization routines), but if it’s not there, create it and include this code:
    //Checking for unconventional Point digits number
    if (Point == 0.00001) Poin = 0.0001; //6 digits
    else if (Point == 0.001) Poin = 0.01; //3 digits (for Yen based pairs)
    else Poin = Point; //Normal
  4. Replace all further occurrences of "Point„ in the code with “Poin„ (except those in the init() function). This will change the system MT4 variable “Point„ to our declared variable “Poin", which now contains the standard 5 digit pip value.
  5. That’s all. Compile it and you are ready to run it on the 6 digit quotes in MetaTrader. Of course, it will still work with standard 5 digit quotes too.

Sunday, March 11th, 2007

Expert Advisors :.

New expert advisors are now available at www.earnforex.com. Use them wisely :)

Firebird v.63g - a complex automated trading system based on 10 days period simple moving average.
Framework - a simple EA based on CCI indicator.
Fractal ZigZag - this expert advisors uses zigzag indicator with fractals.



FXOpen - Forex at its Best