Hey guys,
you don't need to re-invent the wheel...
Please read how to create Metatrades based EA using Cortex neural networks software. It's basically step-by-step instruction which is pretty easy to follow. You even don't need to use cortex, but it gives you general idea how this kind of EA should be built. I found there very similar ideas Olexandr mentioned in his contest interview (for example C++ optimization before even using MQL)... The only problem with this approach is - again as Olexandr mentioned he teaches his EA as he trades... it seems not clear how to do that with pre-defined optimized coefficients... Anyway, read and I'm sure you will get much clearer idea.
Neural Networks and Stock / Forex Trading