Aurix Exchange

Self Optimizing EA?

playfuel

New member
My first thread! :D

I found this EA on

For a freely available EA this EA looks absolutely amazing!

Using 10% risk on a $100 account, the EA is stable enough to only suffer <20% DD and passes 4 years of backtest using Dukascopy data.



The author says its not recommended for live trading, but it certainly looks tempting.. put $100, wait 4 years, make $42 million :p

From what little I can understand of the code, it makes use of several indicators (MAs, CCI, MACD, Bears Power, Bulls Power) and works on probability of winning by adding up all the Buy signals and subtracting from the sum of the Sell signals to decide whether to Buy or Sell.

What I don't understand is when the author says "
This is an example only - how optimization results can be edited in a text editor and used by the Expert Advisor.
The signals were found by the optimizer of MT4 strategy tester, and all of these signals are used above profit factor 2."

Does it mean that the EA won't work on forward testing or live? Or that it is self optimizing?

Any comments from gurus out there on how it works? A more detailed explanation of the logic would be most appreciated..

Thanks!
 

Attachments

  • 14-8-2011 3-23-25 PM.jpg
    14-8-2011 3-23-25 PM.jpg
    15.8 KB · Views: 8

Capella

Active member
VIP Member
Self-Optimizing EA's

Self-Optimizing EA's

Well, this is not a self-optimizing EA, but an EA based on optimized settings saved from Strategy Tester.

I want to reveal something that I've been using for a couple of years now, I let my EA's optimize themselves during weekends. And I find it strange that none of the commercial EA's haven't done this yet, cause it's quite simple. I let the EA save all tic-data during the last week in a large file. This data-file is much more true than any backtest data. Even Ducascopy 99% backtest data cannot be compared with the true data that comes from the broker that your EA runs against. Once the EA stops trading on Friday evening it goes into a sleep-mode and executes an external program that works like the Strategy Tester in MetaTrader, but does not use that. It reads the data-file with the tic-data and saves the trading result in a separate file, with all combinations of settings that could effect the trading result. Finally it analyses the results and pick out the combination of settings that have the lowest drawdown in relation to the highest profit. These settings are then finally stored in a file, which the EA then reads when it starts on Sunday night. So the self-optimizing is done on a weekly basis.

For those of you who are into programming of EA's, I highly recommend this. It saves a lot of time of manual testing, since optimizing EA's is crucial. Also, the weekly tic-data files are extremely valuable, even though they take a lot of space. Because I also save the spread for every tic. So those files can be used for testing EA's during larger periods than one week.
 

condor666

Member
Well, this is not a self-optimizing EA, but an EA based on optimized settings saved from Strategy Tester.

I want to reveal something that I've been using for a couple of years now, I let my EA's optimize themselves during weekends. And I find it strange that none of the commercial EA's haven't done this yet, cause it's quite simple. I let the EA save all tic-data during the last week in a large file. This data-file is much more true than any backtest data. Even Ducascopy 99% backtest data cannot be compared with the true data that comes from the broker that your EA runs against. Once the EA stops trading on Friday evening it goes into a sleep-mode and executes an external program that works like the Strategy Tester in MetaTrader, but does not use that. It reads the data-file with the tic-data and saves the trading result in a separate file, with all combinations of settings that could effect the trading result. Finally it analyses the results and pick out the combination of settings that have the lowest drawdown in relation to the highest profit. These settings are then finally stored in a file, which the EA then reads when it starts on Sunday night. So the self-optimizing is done on a weekly basis.

For those of you who are into programming of EA's, I highly recommend this. It saves a lot of time of manual testing, since optimizing EA's is crucial. Also, the weekly tic-data files are extremely valuable, even though they take a lot of space. Because I also save the spread for every tic. So those files can be used for testing EA's during larger periods than one week.

Have you a tutorial or a manual who explains how to do this ?
 

Capella

Active member
VIP Member
Have you a tutorial or a manual who explains how to do this ?

No, but I can explain it here. This other EA that is executed during the weekend look very similar to the EA that runs during the week, except that it cannot call OrderSend, OrderModify or other functions that requires communication with the broker server. Instead it reads data from the tic-data file and simulates trades. And all such trades are stored in a file. The only thing you cannot simulate is possible requotes. But you can simulate time-delays due to latency, so it's also possible to simulate how time-critical the EA is. So you must add this time-delay to simulate the latency. This EA then loops through all combinations of external variable settings and saves the orders in a file. Finally it reads that file and compares the results to find the best combinations. And those optimial settings are then read in as a file instead of be entered manually as external variables in the EA that trades during the coming week.

I first wrote this other program in Perl, because it could handle large data-files much more efficient than MQ4, but on the other hand does not have any inbuild indicators. But now I use MQ4, even though it takes much more time. But since it runs during the weekend, it doesn't matter.
 

condor666

Member
I've no experience with file access functions, it would be fine if you would share the source code here, so that i can give it a look.
 

Capella

Active member
VIP Member
I've no experience with file access functions, it would be fine if you would share the source code here, so that i can give it a look.

I'm sorry, but I cannot do that. I can share ideas and others EA's and indicators, but not the EA's I've created myself, since I use them professionally. But you need to learn and understand file access. I understand that it's hard if you don't have any programming experience beside MQ4. As a general advice for those of you who have no programming experience - learn to program in any other high-level language, like C, C++, Java, Basic, or whatever. The language as such is not that important, but to learn all the different things in programming, which also includes file access. It's more important to find good, pedagocial learning material (tutorials).
 

condor666

Member
I learned a little bit of C but i stopped cause i had many problems to understand the pointers.
Another question that i have, is there a file to read for real tick data who is stored somewhere or must i create a little ea to do this ?
If yes, i think i must do this with something like "filewrite" to create a big csv file.
 

playfuel

New member
UPDATE:

I have put the T015 EA on a small $100 live account together with Forex Combo 2.42 & MDP1.1.1. I also put T015 on a demo with 10k. On live Combo opened two trades, but T015 did not. On the demo, T015 took a buy and made $164.

Strange that T015 traded on demo but not on real. I suspect that the Combo trades (which are still open) may have eaten away the margin to open the trades. Anyone have any idea whether the EA is set not to trade live? Can it be fixed?

Code:
http://www.myfxbook.com/members/eFX21/tester-015/148927
You must be registered for see images


 

Aurix Exchange
Top