Download MetaTrader 5

Trading Systems: Expert Advisors Based on Popular Trading Strategies and Alchemy of Trading Robot Optimization (Cont.)

To add comments, please log in or register
Share the links to products and make your profit
MetaQuotes Software Corp.
MetaQuotes Software Corp. 2008.09.15 08:29 

New article Expert Advisors Based on Popular Trading Strategies and Alchemy of Trading Robot Optimization (Cont.) has been published:

In this article, the author proposes the way of improving trading systems presented in his previous articles. The article is of interest for traders already having experiences in writing Expert Advisors.

In my previous article, I gave a detailed description of writing Expert Advisors that process the information arriving from two different timeframes. However, the matter is that this information is often insufficient to accurately enter the market. For example, if a smaller timeframe is equal to H1, then entering the market immediately at the change of a one-hour bar is not often the best solution, since the trend on the timeframe smaller than H1 and usually existing in the price noise may work against the position to be opened. In many cases, this short-term trend can be detected rather easily. In such a case, if it moves against the position to be opened, you should postpone your entering the market until this trend acting on the smallest timeframe changes its direction for an opposite one. Or, in the worst case, you can enter the market before the next one-hour bar changes. It is this task that I will try to solve in my article.

Elder's Triple Screen System

Alexander Elder is known to be the author of rather popular books on the psychology of trading and crowd behavior. It was him who invented the idea to use the charts of three timeframes in analyzing financial markets. These charts were named Elder's Triple Screen. We have already learned in my previous article how to construct a double screen. Now we have to add the third screen to it. As the examples of further code complication, we could use some ready EAs from my previous article. However, in this present article, I decided to build another EA (Exp_14.mq4) based on the same procedures, just for a change.

As the initial basis to write the code, I take Exp_12.mq4 in which I replace the alerting moving average, JFatl.nq4, with oscillator JCCIX.mq4 and the trend-following indicator MAMA_NK.mq4 consisting of two MAs with indicator StepMA_Stoch_NK.mq4 consisting of a couple of stochastic oscillators. Eventually, the initial algorithm femains the same, I just changed the calls to custom indicators, the external variables of the EA and the initialization of constants in the block of the init() function, and I also complicated the code of blocks aimed at detecting the signals to enter the market. I present the working algorithm of this EA once again using two timeframes in a very general form, as I did in my previous article. However, I do it in a bit more details this time.

For long positions, we have:

And for short positions:

Author: Nikolay Kositsin

MQL4 Comments
MQL4 Comments 2009.06.30 22:02  

I like your idea of blocking noise. It seems to me that noise is the bane of trading. Finding a pure trend is key, but often finding a trend is like seeing faces in the clouds even in live trading. How do we stay with the substantial trend, and reject the noise?

I don't want to sound flip, but isn't that what we're all trying to do?

Still, given that, there must be a scientific conclusion. After all, if the market is truly random, even that fact can be exploited for profit.

MQL4 Comments
MQL4 Comments 2009.08.05 01:04  
Pls the explainations within the codes are not in english. What can i do to change them so that I can understand them?
To add comments, please log in or register