MT4-TWS Handbook Content

Similar documents
Mt4Tws Trade Copier Handbook

FXCC MT4 Android Mobile User Guide

TECH REAL MT4 USER GUIDE

LOCQuickLinesTrader Expert Advisor user s manual.

MetaTrader 4 USER GUIDE

FXCC MetaTrader 4 User Guide

One Click Trading Level2 Plugin: General information

FXCC MetaTrader 4 User Guide

FxPro MT4 for Mac User Guide. FxPro MT4. Version 1.0

MT4 ANDROID USER GUIDE

MT4 ANDROID USER GUIDE USER GUIDE

INTERNET TRADE MIRROR - SENDER. fxbluelabs.com

MetaTrader 4 for Android. User Manual

USER GUIDE

FX-GO platform Desktop Trade Terminal - manual V

If there are multiple MT4 terminals on your computer, select all or specific terminals to install the ElementalTrader EA > click Next.

TradeManager Help - Print Version

- Return the number of pips gained or lost in a previously closed trade

MetaTrader 4 for iphone. User Manual

1/26/2017 Autochartist - MetaTrader Plugin. MetaTrader Plugin.

USERGUIDE MT4+ DESKTOP

Meta Trader 4 User Guide Android Mobile Devices

PERSONAL TRADE COPIER

PROFIT ZONES INSTALLATION GUIDE

FXCC MT4 MultiTerminal User Guide

How to setup RANGE charts on MT4 using the RangeBarChart indicator

Follow the instructions and download the MACD True from this page, which is the page you were directed to from the home page when you clicked the #2:

USER GUIDE

CONVERT OPPORTUNITIES INTO SOLUTIONS WITH A CRYPTOCURRENCY BROKER YOU CAN TRUST USER GUIDE

Introducing MahiFX on MT4

MARKET MANAGER. Page 1 of 7


Contents All rights reserved.

User Manual. Version 1.4.2

MT 5 to MT 4 Trade Copier EA Manual

Smart Trader Setup (v.2)

Meta Trader 4 User Guide

Autochartist Metatrader Plugin Installation Guide

INSTALLING & USING THE NORWOOD ALERT

BAR CHANGER INDICATOR

EA-Indicator Plug-in

JD Capital 金都匯. MT4 for Android Guide

Instruction manual for Client EA

Copyright 2013

Contents 1. INTRODUCTION OVERVIEW GETTING STARTED... 7

MT4. User Guide. Mobile for Android. for Android

MetaTrader 4 USER GUIDELINE. Updated March INFINOX Capital Ltd 20 Birchin Lane London EC3V 9DU

iphone Trader Login The 5 Main Sections - Favorites - Rates - Positions - History - More

User & Installation Guide. MTM MAX Trade Manager. for. Version 1.0

EPIC Trade Manager. Downloading and Installing:

MetaTrader 4 transaction procedure

INTERNET TRADE MIRROR - RECEIVER. fxbluelabs.com

Copyright 2012

TTFX Manager Portal for MetaTrader 4 Manager's manual V 1.0.0

Terminal MT4 MultiTerminal User Interface... 10

HYCM MT4 Client User Guide Provided by Henyep Capital Markets (UK) Limited

GSC Live! RETAIL MANUAL (DESKTOP)

PERIOD CONVERTER INDICATOR

Aggregator FX. Client s manual.

What is DealBook WEB?

MINI TERMINAL. Page 1 of 6

LION Android Trader. User Manual

CONTENT. ADAPTIVE DIVERGENCE CONVERGENCE SIGNALS for MT4. Set up & Configuration Guide

Power Package Plug-in

Walk Forward Analyzer for MetaTrader 4

Customer Activity Monitor (CAM) Users' Guide

USER GUIDE

OracleTrader User s Guide By Global Profit Systems International LLC

D.O.T.S. Method Indicator v4.2

Any symbols displayed within these pages are for illustrative purposes only, and are not intended to portray any recommendation.

forex strategy secrets Norwood Stops forex trading simplified Freedom Investment Group, Inc Version

SaxoTraderPRO Intro guide

Swissquote SQORE MT4 Advisor User Guide Version

Introduction... 2 Trading Profiles... 2 New 2 Strategies ) Order Strategies ) Strategy Builder ) Multiple Order Targets...

SaxoTraderPRO Intro guide

CTRADER QUICKFX TERMINAL

LOCTrailing Expert Advisor user s manual.


Annexure 1 [Algo Test Lab Services User Manual]

Download and Install MetaTrader

Getting Started with BarchartX

Members are requested to note the following guidelines for using the new Front-end Tradex.

ONE MT4 USER GUIDE. The following document is designed to educate you about the essential functions of the trading platform.

TenKei The Simple Rule Based Strategy

LOCTrader Expert Advisor user s manual.

Table of Contents 2 QST MOBILE APPLICATION FOR IPHONE

EA builder - Forex Robot Reviews - Mark's Blog and club

Trading equities on NanoTrader

All other trademarks are the property of their respective owners.

User Guide. for the. EA Controller

Maybank2u.com Online Stocks User Guide

QST Mobile Application for Android

KGI HK Mobile Trader (AAstocks) - iphone User Manual

GFT Mobile Users Guide

Download and Install MetaTrader

Home Charts Quotes DOM. Trade Intermediation. Programmation Create Modify Trading Tools

1. Adding an instrument and setting its properties. Open Instrument Explorer window from VQ View menu. Right click and select New Instrument.

Getting Started. Getting Started

Please read this document first

Multi Account Manager INSTALLATION GUIDE. Multi Account Manager INSTALLATION GUIDE

Transcription:

MT4-TWS Handbook Content Introduction... 1 Installation and Settings... 2 Format of Symbol... 4 Run the Software... 5 Download History Data... 9 Control Panel and Operation... 10 Expert Advisor and Programming... 12 About History Deals... 14 Copyright mt4-tws.com 2015-2016 More information, please refer to

Introduction MT4TWS is a plugin that connect Interactive Brokers with Metatrader4 (MT4) via TWS API. With MT4TWS, You can view history data real-time market data, place orders, program EAs, and so on. Main features of the software are as below: You can import history data to MT4 charts and obtain the real time market data from TWS. After that you can use the powerful function of MT4. You can place orders in MT4, and cancel, modify the pending orders. You can close positions just one click. You can drag the order line to modify the pending order, drag the position line to place Stop loss or Take profit orders. Also, you can use the mouse-cross line to locate the price on charts, and place the order. You can view the detail position deals and the complete history deals. More, you can show the complete history deals on charts. If you are a programmer, you can use the Expert Advisers (EA) of MT4 to build your Auto Trading System. 1

Installation and Settings 1. Installation First of all, unzip the software. Second, open the MT4 data folder (Click the MT4 menu: File->Open Data Folder), and then copy unzipped files to corresponding sub-folders. After these, you can see Expert Advisors mt4tws in the Navigator of MT4. 2. Turn on API in TWS In the menu Global Configuration API Setting,make Enable ActiveX and Socket Clients checked. More, you can add the IP Address 127.0.0.1 in the Table Trusted IP Address, so that you can avoid to confirm the API connection each time you connect to API. Settings as the picture below: 2

3. Turn on Allow DLL imports. Click the menu Tools->Options 4. Files Introduction Experts\mt4tws.mq4 Experts\Symbol.ini Experts\mt4tws.mqh Experts\mt4twsEA_sample.mq4 Running File Symbol configure file. You can relate your TWS Symbol with MT4 Symbol in this file. Head file Sample of EA to run Experts\mt4tws_HistoryData.ex4 Download History data from TWS to MT4 Indicators\Account.ex4 Can generate a separate window, showing positions, pending orders, account funds Experts\mt4twsfun.ex4 Function of the API Libraries\mt4tws.dll Function of the API 3

Format of Symbol When relating IB Symbol to MT4, You can relate only one IB symbol to MT4 symbol. The format is as below: [IB Symbol]-[Exchange Code]-[Security Type]-[Currency] For example, the symbol of Gold Spot Commodity is XAUUSD,trading in exchange SMART,with security type CMDTY and currency USD. The format input should be: XAUUSD-SMART-CMDTY-USD. Besides, if you are a forex trader, you can use format: CCY.CCY, such as EUR.USD. You can obtain the contract information from TWS. Right click the contract, then click Contract Info Description, you can get the contract information at the popped up dialog. For example, the symbol format for picture below is as CNU15-SGX-FUT-USD. 4

Run the Software You can obtain history data from TWS, and trade in MT4. Please follow the below steps. If do not want to use history data of TWS, but just use your MT4 account charts, please ignore the first two steps and jump to the third. 1.Login. In the login dialog, please input any number in the Login textbox and Password textbox. And fill MT4TWS in the Server textbox. Our software can only run on the offline charts of MT4, so you do not need to login to any MT4 Real or Demo Account, or the history data may conflict when the program is running. Please noted you have already copied the folder [history\mt4tws] to mt4 [data folder\history]. 2.Open Offline Charts. In File menu, click Open Offline Chart, you will see a dialog window. Select the symbol (such as XAUUSD,H1), and then click Open in the right side of the window. If you can t find the symbol you needed, please download history data first with the tool mt4tws_historydata.ex4. Please see the item Download History Data 5

3.Add Account Sub-window Attach the indicator named Account to the offline chart, a sub-window will be shown as below. 4.Attach mt4tws To Offline Chart Drag (or double click) the Expert Advisor named mt4tws to the offline chart, click the tab Input, you can see some parameters you need to input, as the below picture. Please minded, if you leave IB_Symbol blank, the software will read the file Symbol.ini to relate the symbols. Please tick to allow DLL imports and external experts. 6

Please Input the parameters: Parameters: IB Symbol Target IB Symbol. You can use Futures, Forex, Commodities, Stocks, CFDs in Interactive Brokers. Options are not support currently. 7

History Mode Data History Data Mode. Four options as below: Generating New:Import history data from TWS, replacing current data in chart. Appending: Import history data from TWS, appending to the current data in chart. No History Data:Do not use history data of TWS, but getting real-time market data from TWS and being able to place orders through control panel. Show Controls Host Port Account Index Set to Show the Control Panel. TWS API Server address, 127.0.0.1 by default. TWS API Server port, 7496 by default. Account Index. The option is used for Multi-Account-Code account, such as Financial Advisor Account. After attached to the chart and connected successfully, it will be shown as below: 8

Download History Data First of all, open the chart in mt4, and then attach mt4tws_historydata.ex4 to the chart. After you input the correct parameters, you can begin to download history data. Please minded that, due to the plugin can only run on Offline Charts, you d better restart mt4 after you finish download the history. If the software runs on a non-offline charts, the history data may not be shown properly. 9

Control Panel and Operation 1. Control Panel Introduction Introduction: : Price Crossing Line. Line-price will be shown in the Price Text when it is clicked and moved. : Click to move the control panel. : One-click Switcher : Hide or show of the control panel : : : Click to change to Period-Changing Mode. In Period-Changing Mode, you can change to Periods that can be found in File->Open Offline dialog. Show the position details of your current position. Please note that it can only show the executions that can be found in Trade Log, or executions that saved in local files. All the executions obtained by the software will be saved to local file when exiting. Show the complete history deal. Please note that it can only show the executions that can be found in Trade Log, or executions that saved in local files. All the executions obtained by the software will be saved to local file when exiting. : Show the Complete Deal Records in chart. Price Lots: Price and lots for buy or sell 10

R means to reset to the default lots S means save the default lots, it will be loaded next time the software opened. Pend Buy Sell: MKT Buy Sell: CloseAll 1/2 1/3 1/4: Limit Buy, Limit Sell Market Buy, Market Sell Close the position of current symbol in proportion. : : Cancel pending order by Order ID. This control can only cancel pending orders that generated by current Client. It cannot cancel orders that generated manually by TWS. Cancel all the pending orders, no matter how they were generated. 2. Drag to Modify Pending Orders If you want to modify the price of the pending order, you can drag it on the chart. 3.Drag Position Line To Generate Stoploss and Takeprofit Order You can drag the current position line to Generate Stoploss and Takeprofit pending orders. 11

Expert Advisor and Programming Due to the trading and position mechanism of IB API are different from that of MT4, the trading functions for this plugin are different. File mt4tws.mqh includes all the functions and structs needed. 1. structs struct IBTick: real-time market data carrier struct IBPosition:Position summary carrier struct IBPendingOrder: Pending order carrier struct IBHistTrade; History trades(executions) carrier struct SCompleteDeals:Complete Deals carriers, like MT4 history deals, it includes both opening and closing execution. 2. Introduction APIRunInit Unmissable function. Initiating API connection APIDeinit Unmissable function. Deinit API connection APIRunning Unmissable function. API Running function for every APIChartEvent APISetServer APISetAccountIndex APISetShowControls APISetLogFilePath APIGetIBSymbolLong APIGetLocalSymbol APIGetDefaultLots APIGetTickPrice loop. Unmissable function. Chart Event function Unmissable function. Setting server address. Unmissable function. Used for multi-account-code account. Unmissable function. Whether to show control panel Set the api log file path. Such as D:\\ib_log.txt. Get full format of IB Symbol. For those who use Symbol.ini to relate symbols, they can use this function to obtain the full format of IB Symbol. Get short format of IB Symbol, excluded exchange code, security type, and currency. Obtain Default lots shown in control panel which stated in Symbol.ini. Obtain bid, ask, volume, etc.. 12

APIPendOrdersTotal APIGetPendOrder APIHistTradesTotal Obtain total number of Pending orders. Obtain pending order according to the index. Obtain total number executions showed in Trade Log of TWS. APIGetHistTrade Obtain execution according to the index APIPosnSummaryTotal Obtain total number of Position Summaries. APIGetPosnSummary Obtain Position summary according to its index APIPosnDetailsTotal Obtain total number of Position Details. APIGetPosnDetail Obtain Position detail according to its index APIHistCompDealsTotal Obtain total number of History Complete Deals. APIGetHistCompDeal Obtain History Complete Deals according to its index APICancelPendingOrder Cancel Pending order with its OrderId APICancelGlobal APIPendOrderModify APIClosePosition APICloseAllPosn APIOpenPosition APINetLiquidity APICurrMargin APIAvailableFund APIServerTime Cancel All the pending order in the account Modify pending order Close Position. Parameters: If the parameter of volume is filled 0, it means all position of current symbol. If the parameter of price is filled 0, it means it s a market order. Close all position for current symbol Place an order. Parameters: Direction: can only be BUY or SELL. price:0 means market order. Getting net liquidity of the account Getting net Maintain Margin of the account Getting net Available Fund of the account Getting current time of TWS Example: mt4twsea_sample.mq4 13

About History Deals Execution: means a single execution, only a single buy or sell records. It can obtain directly from Trade Log of TWS. Complete Deals: Including both opening and closing, like History Records in MT4. Complete deals were generated by executions and current position summary. Please note that if the position was opened long time ago that was not shown in Trade Log, complete position deals will not be generated correctly, so the position details will not be matched with position summary. If this happened, you can manually edit the history execution saved in local file MQL4\Files\ IBTrades_[AccountCode].txt. This file will be generated when the plugin exit each time, and will be read to memory when the plugin started. Copyright mt4-tws.com 2015-2016 More information, please refer to 14