Jumat, 17 Februari 2012

Data from MT4 to Amibroker & Orders from Amibroker to MT4

After learning all about MT4 and MQL language, I thought “MT4 is MT Shit”, too many limitations and I know AFL way better than MQL.  Besides that the Amibroker back tester is far superior to the MT4 back tester.  I’ll do my system up in Ami and send the order to MT4. 
Here are the steps to do this:
  1. Load historical data into Ami (See this post Forex MSN Data)
  2. Get streaming data from MT4 to Amibroker
  3. Find or make AFL and MQL files to interact between the two platforms.  I found an MQL file (on a forum) that will read a text file.  Now I just need to make the trading system AFL write the text file.  I’ll make this code as an AFL include file.
I just finished setting up the DDE feed from MT4 to Amibroker.  Here is how to set up the Amibroker DDE price feed.  One thing to watch out for is the fields, I got that part wrong initially.  See this screen shot and make sure it looks EXACTLY like this, notice the Ticker Price fields, which one comes first?  I wasn’t paying attention and spent a while figuring this out.
By the way, I’m using this on Windows 7 64 bit.
image
Notice the {Field}!{Ticker} – Field is first, when you open up this window for the first time, these fields are reversed.
image
Add the symbol to Amibroker, the same as it appears in MT4, some brokers add some stuff after the symbol, mine was only EURUSD for example.  So I added EURUSD to Amibroker.  Once you see the green box at the lower right side of Ami, add the symbol to the real time feed and watch the quotes come in. 
In MT4, you have to enable the “DDE Server”.  Go to “Tools->Options” and check the box.

To see errors, look at the MT4 "Journal" tab.  View->Terminal, then goto the new thingy that just opened and click the Journal tab.  You might see some errors that begin with "DDE......"

If you have any questions, use Google first, than ask me if your stuck.

image

image

Related Posts Plugin for WordPress, Blogger...