You are here

Almost there: MT4 with encog framework

I'm happy, I finally managed to get MT4 working with the encog framework:

Recipe:
- 1 MT4 terminal
- 1 C# DLL (no wrapper)
- 1 C# Console application that does all the encog framework stuff

The DLL is used for telling the Console application that data from MT4 is ready for being processed.

You can find all the info for making the C# DLL at
https://sites.google.com/site/robertgiesecke/Home/uploads/unmanagedexports

Then for the communication between the DLL and the console application, I used named pipes.
Very easy to use, for all the info:
http://msdn.microsoft.com/en-us/library/bb546085.aspx

I trained a simple crossover system with the encog framework, and then did a forward testing on non-trained data.
The results are in attachment:
- the first one is without the encog filter
- the second one is with encog filter

Seems very promising, now I can finally concentrate on building a good trading system with the encog framework. :)

AttachmentSize
nofilter.png25.54 KB
filter.png25.52 KB
Neural Network Forums: 
Dev007's picture

When you say you "trained a simple crossover system", what would your output be? Are you training the network to predict (output) a crossover or a price move based on the crossover?

I believe that is one of the most difficult thing when working with machine learning; knowing what the correct output should be.

Cheers!

protput's picture

The output is a combination of several networks.
One predicts the trend, another if it is a strong trend or weak trend.
And finally the last one is trained on the outcome of the crossover: i.e if the past signals were profitable or not.
All criteria must be met before the trade is taken.

Hope this helps.

Dev007's picture

Thank you for the reply protput! Great idea to use ensemble learning to build a better model.

Cheers!

MerlinBrasil's picture

Hi Protput,

Great idea with the 'Committee' route!

Would you mind posting your code as Jeff has done? It would be most helpful for those of us who are climbing the learning curve both with VS2010 and Encog.

Regards,
Merlin
SkypeID: merlinbrasil

protput's picture

yeah, will post an example, but give me a day or two.
My code is messy (read: a lot xD), so I have to clean it up a bit.

MerlinBrasil's picture

Looking forward to it :)

Take ten days if you need it! ;)

(sent you an email through this system also)

Jasonforex's picture

Why not just put it in GIT so we can offer contributions to it as well as study it?

MerlinBrasil's picture

Great idea, Jason. Now we just need him to return here to get his messages! :)

Jasonforex's picture


Great idea, Jason. Now we just need him to return here to get his messages! :)

I was able to get ticks exporting in real time from MT4 which may help. Here is the link

Right now it's just going into a .CSV but that can be redirected into one of the many loaders on here.

-Jason

hani's picture

So far the response from the Asian Pacific American community has been loud and clear — don’t mess with the integrity of a historic site press release distribution service

Theme by Danetsoft and Danang Probo Sayekti inspired by Maksimer