Note: Some steps in above video may be outdated, follow instructions below.
First follow the steps below to integrate your custom Expert Advisory. Also note that you need to edit the .mql4 EA file for auto trading. Download here required files for your custom EA algo setup.
Integrate your custom Expert Advisory.
- Firstly put ” Multiinstance.mqh” and “Algotrading.mqh”this file in Include folder of MT4 Data Folder.
- Then copy Paste this [ #include < Multiinstance.mqh > ] in Expert Advisor just after initialization of data variables in Expert Advisor file.
- Search “OrderSend” Function and if OrderSend function Contain “OP_BUY” then Copy & Paste ” LongEntry(Quantity,Ask); ” after “OrderSend” Function declaration.
- Again Search “OrderSend” Function and if OrderSend Function Contain “OP_SELL” then Copy & Paste ” ShortEntry (Quantity,Ask); ” after “OrderSend” Function declaration.
- Now Search “OrderClose” Function and if OrderClose Function Contain “Bid” then Copy & Paste ” else { if(K==0){ (Quantity,Ask); } } ” after “OrderClose” Function declaration.
- Again Search “OrderClose” Function and if OrderClose Function Contain “Ask” then Copy & Paste ” else { if(K==0){ (Quantity,Ask);} } ” after “OrderClose” Function declaration.
- Search “OrderModify” Function and if OrderModify Function Contain “Bid” then Copy & Paste ” else { if(K==0){ LongExit (Quantity,Ask); } } ” after “OrderModify” Function declaration.
- Search “OrderModify” Function and if OrderModify Function Contain “Ask” then Copy & Paste ” else { if(K==0){ ShortExit (Quantity,Ask); } } ” after “OrderModify” Function declaration.
Note: Some Expert advisor Doesn’t have “OrderModify” Function then just ignore 7th and 8th Point.
After this Editing..
First Compile ” Multiinstance.mqh” this file
You will get these three-external input in your strategy
Strategy tag- this should be same as symbol setting in API Bridge.
Port- If you are trading in multiple accounts of API Bridge then differentiate port number like this- “30001,30002”. And if you are trading in only one instance then leave it without change. See here more details on trading in multiple accounts.
Order type- here you can set the order type of your order Market,Limit,SLL,SLM
Do you want coding help to deploy your own strategy for live trading? Check our coding assistance.
Recent Discussion