MQL4 - automated forex trading   /  

Code Base

Code Base  Expert Advisors  S!mple EA To post a new code, please log in or register

This Expert Advisor is for
MetaTrader 4
Download MT 4 - 5.5 Mb

Mobile trading!
Buy a license and be mobile in your trading!

Name:
S!mple EA
Author: mk77ch (2009.07.04 07:50)
Downloaded: 1017
Download:
 s!mple.zip (517 bytes)
 S!mple.mq4 (11.0 Kb) View

This is one of my current projects. The idea was to keep it simple.

To use it, you have to do the following:

  • Copy S!mple.mq4 to your experts folder
  • Open S!mple.mq4 and modify the init() function. You can define as much currencies as you like.
  • Save and Compile the EA and attach it to one of your charts (only to one).
  • Open all other charts you are trading on for data updates.
  • You have to set the variable makeTrades to true, otherwise the EA will not place any trades.
  • For better understanding, you can also use the attached template.

To check on which currencies the EA is profitable, first just attach the template file to a chart and look out for clear cuts on the two MA's.

I use it on a 5 Minute chart, if you want to use it on an other chart, you have to change the variable timeFrame to what you would like to use.


Best regards and happy trading
mike

4 comments  To post a new comment, please log in or register

I have tried this expert (S!mple) over a significant period of time, several days.


I can say that it implements the strategy as advertised, but for me at least it has not done well.


I think there are a few problems with the strategy.


Statistically there is more movement of the fast average when the value has moved some way away, so that a crossing is most likly to occur when the quantity has just moved avay from the fast average in the wrong direction. So far as opening trades go, this is one reason why the trade open point is not likely to be a good one.


Second, closing the trade also happens usually in the wrong place. Image for a moment that the slow average is the same (at least has not changed much), then the fast average will cross at the same point as it did to open the trade, but because the slope is in the oppeosite direction, its pretty much guaranteed to be the other side of the moving average! So that when there is "not much action" theis EA will certainly loose you money, doing all the wrong things. Indeed it could be better to reverse the trade direction.


The one situation where it does kind of do the right thing, is in very long gradual rises or falls, compared to the the slow average. The point is that in these situations, the slow average has time to significantly change its value. In this way the S!mple EA can follow a rise even if it doesnt quite get in and out at the right times.


Although all my testing was done with the expert as supplied, (I used some additional currencies.) I think that exponential averages would work better. This is because exponential averages emphasize the present, whilst for a linear average what happens as points move off the end is just as significant as the new points, and that cant be good.


Here is my idea for an improvement, this I have not coded yet.


Discard the slow average and use only the 50 point moving average, use exponential. Make a buy whenever the variable crosses the moving average and sell when it crosses in the other direction. Since the average moves up if the value is above it, the sell happens above the buy price so you have a profit. Sounds great, what is wrong with this? There would be too many and too frequent crossings giving noise-trades, a buy followed by an immediate sale etc. So modify the method by looking at the gradient of the moving average, only by when the value is above the MA and the gradient posative by a certain threshold. Sell as soon as the reverse crossing occurs. The short position can be done in the same way, just like S!mple, so that the expert usually has a position. Unlike S!imple, because of the requirement for a significant gradient, this expert can close one position before opening another but may not always do so.


What else might be wrong with this ? Would like to hear.


Marky.

16.08.2009 14:25 marky

tinojazz wrote



16.08.2009 12:52 marky

Hello, mk77ch, good idea with crossing 50/200 within a 5-min.-chart. I tried to backtest but I did not get any decision. May be I did not change correctly the function Init(). Can you please give me an idea?

Error showing: 2009.07.15 18:19:45 2009.07.13 23:59 S!mple EURUSD,M5: symbol name for MarketInfo function must be a string-> Now I found by myself: the correct currency-string must be shown, e.i. 'EURUSD' from 'EURUSDm'. No further advice nessesary.

Best regards, Hubex

15.07.2009 20:02 Hubexde

Hi, I cant see how its work becouse is weekend.Did work at strategy tester?


05.07.2009 13:03 tinojazz