EUR/USD EA - First Attempt Feedback Requested

 

My first post on an FX board, quite a moment. My long journey through the world of trading has led me here finally, to the world of MT4 and mechanical trading. I started researching the world of trading about a year ago. After spending many hours researching the stock market, technical analysis, and day trading, I heard about this new thing called Forex. I spent a month or two learning about Forex, and realized that the stock market is as total waste of time and FX is the way to go. So I opened my first demo account and started manual trading, applying what I knew about technical analysis, and found it very tedious and time consuming, and too slow to really learn from. So then I moved onto FX simulated trading. I purchased a simulator which let me trade FX based on historical data and let me practice trading “real time” much quicker than a demo account (http://www.forexinterbank.com/ForexSimulator.php. This was very useful, as it gave me an intuitive feel of the market, and how it reacts, but much quicker than it would have taken me to get that feel on a real time demo account. Then I discovered MT4 and the world of EAs. Talk about mind blowing, the pure power of being able to design a custom trading system to do anything I wanted, any way I wanted totally blew me away. I started reading MQL tutorials and was suddenly glad I had taken those C++ and VB classes which I thought I would never have a use for, and started to write my first EA. Three weekends, and many hours of back testing and trying different strategies (and that darn debugging of course) this is what I came up with. The code is fairly simple, the trailing stop needs some work however, it can only trail one trade at a time, and if there are two trades existing it stops trailing one of them, I need to throw it in a for loop or something. So the rules of my system.

1. Calculate pivots points based on the open time of the European markets. This is 7:00 CET, because I am back testing with 1 minute data from Alpari.

2. The open price of the day is usually between M2 and P, or P and M3. If the price goes up or down crossing two lines, assume that it is the start of an uptrend or downtrend.

3. Enter the trade short or long, placing a stop right above the support or reisistance level.

4. Only trade where the stop size is between 9 to 19 pips, and calculate position size based on risking 3% of the balance on each trade.

5. For long trades set 2:1 risk to reward ratio, and after it reaches 2 x risk, trail the stop. For short trades set a 1:1 (break even) risk to reward ratio and trail the stop after that.

If you know how to program, the code is pretty simple, so its not hard to figure out my strategy. I have it set up so you can turn on and turn off certain parts of the program. It seems like the long trades are a lot more profitable than the short trades. In fact if you disable the short trades altogether you’re still very profitable just going long (thus the 1:1 risk to reward ratio on short trades, versus the higher 2:1 risk to reward ratio on long trades). Here are my results below. Tell me what you guys think, test it on a demo, recode it, or back test it with different settings. Just let me know if you discover anything useful. I will post new versions as I come up with them.

*Back test results on one minute data, from 2005.01.01 to 2007.01.23.

*Final Balance: $24,514

Files:
 

wowwww good EA for longterm

I test in FXDD

*Back test results on one minute data, from 2005.01.01 to 2007.01.01

Files:
 

Your results are even better than mine, when you say FXDD do you mean the "FXDD Trader" platform vs. their Metatrader based platform? Or do you just mean you used historical data from FXDD on metatrader? Did you use the default settings or did you change them? I am not sure what timezone FXDD operates in, it probably does not operate in CET (Central European Time), which means that the pivot points are being calculated from a different starting point, one that seems to work better than the starting point I was using based on your results. I knew I would learn something by posting this! Someone throw it on their demo platform and see what happens

 

pivot system

good call... here is another successful pivot system that is being tested on this board. it would be very helpful if this was put into EA so that results could be generated mechanically..

https://www.mql5.com/en/forum/175972

best of luck and i will be following the thread.

Reason: