New API MetaTrader 4 AVAILABLE

To add comments, please log in or register
TradeZone
178
TradeZone  

Hi, Folks!

We developped a dll capable of handling several instances of client terminal MT4 in background, allowing login in several accounts and multiples brokers simultaneously(MAX. 32).

Mainly goal, we kept in mind, when developing this API was permit handling orders in MetaTrader brokers from anothers softwares, for example MetaStock.

This API has more than 55 functions provindg informations about:

  • Symbols and History;
  • Accounts, including support to AccountFreeMarginCheck();
  • Orders, reading historical/opened orders, sending any kind of them(buy/sell, limit/stop, ...), and changing take profit, stop loss, etc.;
  • Market Info, used mainly to retrieve Bid/Ask;
  • Errors occurred in each account;
  • and some checkup functions.

This installation is zipped and available to download at http://www.itevolution.com.br/tz/files/TZMT4API.zip

You can use it on any platform you want. There is a text inside installation(<TZAPIFolder>\Developer) describing all functions and its C's header, and also a Delphi's header too.

This API can be also used in MT4 like code sample below.

#import "tzmt4api.dll"     
   int     LogIn_MT4(int login, string password, string server, string proxyserver, string proxytype, string proxylogin, string proxypassword);
   int     LogOut_MT4(int handle);
   
   int     SymbolsTotal_MT4(int handle);
   string  SymbolGet_MT4(int handle, int index);
      
   double  AccountBalance_MT4(int handle);
   double  AccountCredit_MT4(int handle);
   string  AccountCompany_MT4(int handle);
   string  AccountCurrency_MT4(int handle);
   double  AccountEquity_MT4(int handle);
   double  AccountFreeMargin_MT4(int handle);
   double  AccountFreeMarginMode_MT4(int handle);
   int     AccountLeverage_MT4(int handle);
   double  AccountMargin_MT4(int handle);
   string  AccountName_MT4(int handle);
   int     AccountNumber_MT4(int handle);
   double  AccountProfit_MT4(int handle);
   string  AccountServer_MT4(int handle);
   int     AccountStopoutLevel_MT4(int handle);
   int     AccountStopoutMode_MT4(int handle);
   double  AccountFreeMarginCheck_MT4(int handle, string symbol, int cmd, double volume);
   
   int     OrdersTotal_MT4(int handle);
   int     OrdersHistoryTotal_MT4(int handle);
   int     OrderGet_MT4(int handle, int index, int select, int pool);
   double  OrderClosePrice_MT4(int handle, int ticket);
   int     OrderCloseTime_MT4(int handle, int ticket);
   string  OrderComment_MT4(int handle, int ticket);
   double  OrderCommission_MT4(int handle, int ticket);
   int     OrderDelete_MT4(int handle, int ticket);
   int     OrderExpiration_MT4(int handle, int ticket);
   double  OrderLots_MT4(int handle, int ticket);
   int     OrderMagicNumber_MT4(int handle, int ticket);
   double  OrderOpenPrice_MT4(int handle, int ticket);
   int     OrderOpenTime_MT4(int handle, int ticket);
   double  OrderProfit_MT4(int handle, int ticket);
   double  OrderStopLoss_MT4(int handle, int ticket);
   double  OrderSwap_MT4(int handle, int ticket);
   string  OrderSymbol_MT4(int handle, int ticket);
   double  OrderTakeProfit_MT4(int handle, int ticket);
   int     OrderType_MT4(int handle, int ticket);
   bool    OrderClose_MT4(int handle, int ticket, double lots, double price, int slippage);
   bool    OrderCloseBy_MT4(int handle, int ticket, int opposite);
   bool    OrderModify_MT4(int handle, int ticket, double price, double stoploss, double takeprofit, int expiration);
   int     OrderSend_MT4(int handle, string symbol, int cmd, double volume, double price, int slippage, double stoploss, double takeprofit, string comment, int magic, int expiration);
   
   double  MarketInfo_MT4(int handle, string  symbol, int type);
   int     GetTickCount_MT4(int handle);
   int     GetLastError_MT4(int handle);
   string  ErrorDescription_MT4(int errorcode);
   bool    IsConnected_MT4(int handle);
   bool    IsDemo_MT4(int handle);
   bool    IsTradeContextBusy_MT4(int handle);
   int     TimeCurrent_MT4(int handle);
#import

Best regards and profitable trade!

Mehmet Bastem
242
Mehmet Bastem  

delphi not installed.

function AccountCurrency_MT4(handle: integer) : pchar; external 'tzmt4api.dll';
function AccountCurrency_MT4(hanle: integer) : pchar; stdcall;

TradeZone
178
TradeZone  
Mehmet wrote >>

delphi not installed.

function AccountCurrency_MT4(handle: integer) : pchar; external 'tzmt4api.dll';
function AccountCurrency_MT4(hanle: integer) : pchar; stdcall;

Ops!

please download again.

Mehmet Bastem
242
Mehmet Bastem  

thank You.

please send me a delphi project.

Mehmet Bastem
242
Mehmet Bastem  

i have a Interbank fx demo . how do using in delphi. please a short sample.

JB PS
101
JB PS  
TradeZone wrote >>

Hi, Folks!

We developped a dll capable of handling several instances of client terminal MT4 in background, allowing login in several accounts and multiples brokers simultaneously(MAX. 32).

Mainly goal, we kept in mind, when developing this API was permit handling orders in MetaTrader brokers from anothers softwares, for example MetaStock.

This API has more than 55 functions provindg informations about:

  • Symbols and History;
  • Accounts, including support to AccountFreeMarginCheck();
  • Orders, reading historical/opened orders, sending any kind of them(buy/sell, limit/stop, ...), and changing take profit, stop loss, etc.;
  • Market Info, used mainly to retrieve Bid/Ask;
  • Errors occurred in each account;
  • and some checkup functions.

This installation is zipped and available to download at http://www.itevolution.com.br/tz/files/TZMT4API.zip

You can use it on any platform you want. There is a text inside installation(<TZAPIFolder>\Developer) describing all functions and its C's header, and also a Delphi's header too.

This API can be also used in MT4 like code sample below.

Best regards and profitable trade!

I can't get any values

after login (handle/result=1)

accountbalance returns 8 (real balance=1000)

accountcompany returns 16273773 (some number like this)

I dont undestand how to use the Dispose_MT4 function.

Anyone got this to work?

Thanks

SB

TradeZone
178
TradeZone  
Mehmet wrote >>

i have a Interbank fx demo . how do using in delphi. please a short sample.

We're building a delphi's short sample soon.

TradeZone
178
TradeZone  
forex.sb wrote >>

I can't get any values

after login (handle/result=1)

accountbalance returns 8 (real balance=1000)

accountcompany returns 16273773 (some number like this)

I dont undestand how to use the Dispose_MT4 function.

Anyone got this to work?

Thanks

SB

We'll provide a short sample in delphi and in mql4 too. Until this try to use GetLastError_MT4() and ErrorDescription_MT4() after get logged, it can give you some clues.

TradeZone
178
TradeZone  

We just finished a short delphi sample.

Here it's: http://www.itevolution.com.br/tz/files/Short_Sample_Delphi.zip

Executable is inside package above.

For a quick test:

  1. Run Sample.exe
  2. Press Login
  3. Press Account Information, Information will be displayed on right side
  4. Press Symbols, all available symbols will be displayed on right side
  5. Press Send Order, and a order will be send. To verify this order, you can log onto account using MetaTrader Client Terminal

Best regards and profitable trade!

Haitham Elnemr
428
Haitham Elnemr  
Thank you,
But what about the .SRV files, how could i change its location to my programe location ??
TradeZone
178
TradeZone  
haitham_elnemr wrote >>
Thank you,
But what about the .SRV files, how could i change its location to my programe location ??

Hi, haitham!

I think you wanna build a single installation package, Am I right?

If yes, you can copy on you own alls files, keeping folder's structure, which is inside <Program Files\TradeZone\TZMT4API> and tzmt4api.dll under <system32>.

Another thing you have to do: in register, point Folder under [HKEY_CURRENT_USER\Software\TradeZone\TZMT4API] to your program location

Sample:

[HKEY_CURRENT_USER\Software\TradeZone\TZMT4API]
"Folder"="my programe location"


kindest regards.

To add comments, please log in or register