Documente Academic
Documente Profesional
Documente Cultură
Figure 2 MetaTrader UI
1 of 3
9/9/2009 5:45 PM
file:///C:/Users/gms/MyDocuments/ClassCoursework/Fall2009/FT_CO...
Requirements 1. 2. Matlab. The les are wri en and run on Matlab R2007a. MetaTrader Pla orm Most FX dealer will require you to open a demo account before ge ng data from their system. The process usually totally free. Either Forex.com (US) or AlpariUK is a good place to start.
Steps
File preparation
1. 2. 3. Download MetaTrader program, install & run. Make sure you can get live data by following their instruc ons. Download the our TradeFX.zip package. Extract the zip le to a folder a. Copy Trade Monitor.mq4 & Trade Monitor.ex4 to <MetaTrader>/experts/ folder b. Copy Data.txt and Order.txt to <MetaTrader>/experts/les/ folder
In MetaTrader
1. 2. 3. Run MetaTrader, bring up the EURUSD chart. To quickly see system in ac on, choose 1M (1 minute) chart. On Naviga on panel, drag and drop Trade Monitor into the chart. Conrm the ac on in dialog box. Press Expert Advisor to start running.
In Matlab
1. 2. 3. Open matlab Se ng path environment variables to extracted folder and all its subdirectories (File | Set Path | Add with Subfolders) Run spotFX.m to generate learning data for Support Vector Machine. Data given is EURUSD data from 19 January to 12 April 2009. You should replace with your new data saved from MetaTrader later. 4. Run Communica on.m to bring up the Automated trading system. 5. Press Start. Data from MetaTrader should be soon display in synchroniza on with that in MetaTrader. Trade will take place in MetaTrader automa cally.
IMPORTANT NOTICE:
2 of 3
9/9/2009 5:45 PM
file:///C:/Users/gms/MyDocuments/ClassCoursework/Fall2009/FT_CO...
1. 2.
Current version only support placing Sell orders. Given currency pair data is EURUSD. To test on other currency pair, obtain historical data of that pair (Save le from MetaTrader) and run spotFX again. 3. System will place a maximum of 10 trades at a me. 4. Trades will exit automa cally when MACD condi ons is sa sed as described in MACD Sample Expert Advisor script given my MetaTrader. Comments, sugges ons and sharing please send to Linh Vu (vuxuanlinh at gmail.com)
Acknowledgement
The following libraries and tutorial code are used in our system. [1] Mechanical trading systems: TALib func ons, h p://sourceforge.net/docman/display_doc.php?docid=47727&group_id=190150 [2] Support Vector Machine toolkit for Matlab, LibSVM [3] Interac on between MetaTrader 4 and Matlab via CSV Files, h p://ar cles.mql4.com/440
Project Report
[1] Strategy tes ng and Automated Trading for FX
3 of 3
9/9/2009 5:45 PM