A forex expert advisor (EA) follows a pre-programmed pattern to place orders. EAs are most of the times programmed using the MQL4 language that is dependent on the C language with lots of custom functions thrown in to place orders or trigger stop losses and take profits. On some platforms like the JForex by Dukascopy, it’s enough that one is adept with the Java programming language. So in short, an EA is a piece of software programmed to give trade signals or make trade decisions by itself automatically, hence earning them their alternate names “Forex Robots”.
Usually experienced traders collaborate with coders to come out with an EA. To create your own robot or advisor you have to know some programming and understand how loops, arrays among others work, in addition to of course coming up with a tested strategy that you believe works. Because these advisors are programmed to follow specific patterns, they tend to be profitable only for a short period of time and the die out. The reason is obvious: A constantly changing market and economy versus a statically programmed algorithm. You know what the outcome will be. The EAs fail after a short period of time, if at all, with graceful successes .
Forex expert advisors are just written codes of decision trees. They are just conditions that order the platform to place orders when certain signals from indicators are delivered or simply when some conditions are met. A sample code with buy and sell functions look like the following:
This code with other snippets that the programmer and/or the trader writes are what is executed. These are what make the decisions to buy or sell a currency pair and hopefully make profits while you sleep. The code compiles to an executable .ex4 that you can run on your MT4 platform to see the expert advisor in action.