Manager API
Manager API
Manager API
Principles of Applications
In the work of applications, there are the following main steps:
• With the MetaTrader 5 Manager API, you can develop 32- and 64-bit applications using the appropriate DLLs included into the installation package.
• Applications are only developed for Windows. Manager API DLLs are not suitable for developing applications for Linux or other operating systems.
Application Requirements
When developing applications, it is necessary to meet the following requirements:
file:///C:/Users/Administrator/AppData/Local/Temp/~hh4BC4.htm 7/17/2025
Manager API Page 2 of 464
• Any *Add, *Update, *Delete and *Clear methods of these interfaces only affect the appropriate local object. To send changes to a server, you should call the corresponding
*Add or *Update method of the Manager API. For example, the IMTConGroup::SymbolUpdate method only updates a symbol configuration in the group object. To send these
changes to a server, you should call the IMTAdminAPI::GroupUpdate method.
If the \ (slash) character is not followed by special characters listed above, then it is processed as is.
The table below shows examples of processing escaped characters on a trading server.
• Creating an account
• Configure access to symbols
• Manager configuration
• Configuring the Access Server
Creating an account
To create an account, navigate to the relevant MetaTrader 5 Administrator section and click "Add". The account must be created in the Managers group.
Operation with the debug server version always uses password "Manager" regardless of the password actually set for the account.
file:///C:/Users/Administrator/AppData/Local/Temp/~hh4BC4.htm 7/17/2025
Manager API Page 3 of 464
Manager configuration
When creating an account in the Managers group, MetaTrader 5 Administrator immediately creates a manager configuration based on this account. This is a special account add-on
over extending account permissions.
Open this configuration under the "Clients and accounts \ Managers" section. The configuration can be found by the account number or by name.
On the Common tab, specify groups with which the Manager API client can work. In fact, they define access to accounts and trading operations.
On the Permissions tab, configure access restrictions for the Manager API client.
file:///C:/Users/Administrator/AppData/Local/Temp/~hh4BC4.htm 7/17/2025
Manager API Page 4 of 464
The manager account used for the Manager API client has the following permissions:
• Connect using MetaTrader 5 Administrator — allows administrator connection to the trading server, used in the Manager API.
• Connect using MetaTrader 5 Manager — allows manager connection to the trading server, used in the Manager API. The permission must be enabled.
• Configuration setup — determines the type of configurations which can be changed via the Manager API.
• Send email — allows the account to send emails via the internal mail system.
• Send news — allows the account to send newsletters.
• Accountant — enables access to perform balance operations on client account.
• Access accounts — permission to request account information (without access to personal data).
• Access account personal details — permission to view the following personal details of accounts:
• Name
• Bank Account
• Phone Password
• Country
• City
• State
• Zip/Postal code
• Address
• Phone
• Email
• Comments
• ID
• Status
• API User Data
• Trading account numbers in external systems
• Change accounts — permission to add and edit accounts.
• Delete accounts — permission to delete accounts.
• Access orders and positions — permission to view client orders, deals and positions.
• Edit orders, positions and deals — permission to edit the relevant trading operations.
• Delete orders, positions and deals — permission to edit the relevant trading operations.
• Back Office — access to the client database.
• Subscriptions — access to the subscriptions service.
On the "List of allowed IP addresses" tab, you can further restrict the Manager API client connection by IP addresses.
file:///C:/Users/Administrator/AppData/Local/Temp/~hh4BC4.htm 7/17/2025
Manager API Page 5 of 464
Ready-made Examples
The installation package of the MetaTrader 5 Manager API includes several ready-made examples of applications represented as source code. Analysis of the examples allows a
programmer to quickly get acquainted with peculiarities of working with the Manager API and start developing their own applications.
The examples are located in the /Examples folder of the MetaTrader 5 Manager API installation directory.
• BalanceExample — an example of performing the balance operations on user accounts, such as deposit and withdrawal, credit operations, etc.;
• DealerExample — a GUI application that demonstrates operation of the dealer functions of the Manager API: start and stop dealing, get another trade request, answer a
request (confirm or reject);
• SimpleDealer — a console application that demonstrates operation of the dealer functions of the Manager API: start and stop dealing, get another trade request, answer a
request (confirm or reject);
• SimpleManager — an example that demonstrates how to create the Manager API interfaces and work with them: allocation of a new account, requesting an account,
withdrawing or depositing money, opening a position, sending an email or a custom command.
• ManagerAPIExtension — example showing implementation of sending custom commands to the server. APIExtension plugin must be installed on the server for handling these
commands. The plugin in source codes is included as an example in MetaTrader 5 Server API package.
Aside from DLLs, the package includes examples BalanceExample.NET and DealerExample.NET. They are available in [Manager API installation folder]\Examples.
• .NET Framework 4.7.2 or newer and all Visual C++ Redistributable for Visual Studio packages starting from 2015 are required to develop applications.
• .NET implementation is a wrapper over the main Manager API C++ library. Therefore, the MT5APIManager(64).dll file is also required.
Basic Terms
A short glossary of the terms used:
• Managed — code, method, class running in the .NET CLI environment with the so called garbage collection management via the GC class. The class controls the system
garbage collector — the service that automatically releases unused memory.
• Native — the native code, method, class running directly in the operating system environment.
• Native code or API — classes and interfaces of API.
• Managed wrapper — a .NET class providing an interface of the native API without inheritance.
• Unsafe code — code in C# or any other managed language that can access pointers, low-level memory management, etc.
Use the reference of the native Manager API for the .NET wrapper — almost all functions and methods are identical
All managed wrappers are identical to their native interfaces except for the methods that use arrays. For example:
// Native API:
MTAPIRES NotificationsSend(const UINT64* logins,const UINT logins_total,LPCWSTR message)...
// Managed API C#
MTRetCode NotificationsSend(UInt64[] logins,string message)...
// Managed API C++
MTRetCode NotificationsSend(array<UInt64>^ logins,String^ message)...
file:///C:/Users/Administrator/AppData/Local/Temp/~hh4BC4.htm 7/17/2025
Manager API Page 6 of 464
No Exceptions
Managed wrappers do not generate exceptions. If any library calls generate exceptions, the wrapped code will not let them out.
In the above example, the 'user' object and its native resources will be released once code execution exits the 'using' block. Without using the "using" operator, it is unknown when
and under what circumstances the object will be deleted.
To explicitly release resources, you can also use the 'Release' and 'Dispose' methods of managed wrappers. These methods are similar.
• No element copying is performed during ToArray call. Elements in the new array refer to the elements of the original array. Therefore, when an element is destroyed by
calling Dispose or Release in one array, the appropriate element becomes invalid (destroyed) on the other array. Do not call Dispose/Release methods for the []ToArray array
elements.
• Use the Detach method to detach an element from the array object (CIMT*Array).
• If the source array does not have elements, ToArray returns an empty array, not nullptr.
Memory Management
Memory in .NET implementation is managed by the programmer. The programmer must explicitly call the Dispose or Release methods for the created objects in the required places
of the application. In .NET finalizers memory is not released automatically: if a .NET wrapper object is not released through Dispose, it will lead to memory and native API object
leaks.
When working with the .NET implementation, a situation may occur where two or more wrappers refer to the same native object. For example, this may occur when using the
aforementioned ToArray methods. In this case, the programmer must control the lifetime of the objects and avoid access to already released objects.
Dispose and Release perform the same function, i.e. they release the previously created object. Dispose is designed to match the .NET style and enable the use of the 'using'
construct.
Operation Speed
The speed of calling wrapped methods is much slower than calling its native analogue. This is connected with the check of the to native pointer, managed arguments, etc.
Speed of calls of some wrapped methods that return arrays, particularly arrays of structures, can slow down performance significantly. Example — creating a copy of the array:
file:///C:/Users/Administrator/AppData/Local/Temp/~hh4BC4.htm 7/17/2025
Manager API Page 7 of 464
file:///C:/Users/Administrator/AppData/Local/Temp/~hh4BC4.htm 7/17/2025
Manager API Page 8 of 464
namespace SomeClientNamespace
{
using MetaQuotes.MT5CommonAPI;
using MetaQuotes.MT5ManagerAPI;
using System;
...
class CSomeClientClass
{
//--- Manager API
public CIMTManagerAPI m_manager=null;
...
public MTRetCode Initialize()
{
MTRetCode res=MTRetCode.MT_RET_ERROR;
//--- Initialize the factory
if((res=SMTManagerAPIFactory.Initialize())!=MTRetCode.MT_RET_OK)
{
LogOutFormat("SMTManagerAPIFactory.Initialize failed - {0}",res);
return(res);
}
//--- Receive the API version
uint version=0;
if((res=SMTManagerAPIFactory.GetVersion(out version))!=MTRetCode.MT_RET_OK)
{
LogOut("SMTManagerAPIFactory.GetVersion failed - {0}",res);
return(res);
}
//--- Compare the obtained version with the library one
if(version!=SMTManagerAPIFactory.ManagerAPIVersion)
{
LogOutFormat("Manager API version mismatch - {0}!={1}",version,SMTManagerAPIFactory.ManagerAPIVersion);
return(MTRetCode.MT_RET_ERROR);
}
//--- Create an instance
m_manager=SMTManagerAPIFactory.CreateManager(SMTManagerAPIFactory.ManagerAPIVersion,out res);
if(res!=MTRetCode.MT_RET_OK)
{
LogOut("SMTManagerAPIFactory.CreateManager failed - {0}",res);
return(res);
}
//--- For some reasons, the creation method returned OK and the null pointer
if(m_manager==null)
{
LogOut("SMTManagerAPIFactory.CreateManager was ok, but ManagerAPI is null");
return(MTRetCode.MT_RET_ERR_MEM);
}
//--- All is well
LogOutFormat("Using ManagerAPI v. {0}", version);
return (res);
}
...
public MTRetCode Connect(string server,UInt64 login,string password,uint timeout)
{
MTRetCode res=MTRetCode.MT_RET_ERROR;
if(m_manager==null)
{
LogOut(EnMTLogCode.MTLogErr,server,"Connection to {0} failed: .NET Manager API is NULL",server);
return(res);
}
//---
res=m_manager.Connect(server,login,password,null,CIMTManagerAPI.EnPumpModes.PUMP_MODE_FULL,timeout);
if(res!=MTRetCode.MT_RET_OK)
{
LogOut(EnMTLogCode.MTLogErr,server,"Connection by Managed API to {0} failed: {1}",server,res);
return (res);
}
//---
LogOut("Connected");
return(res);
}
...
//+------------------------------------------------------------------+
//| API call example |
//+------------------------------------------------------------------+
private void OnRequestServerLogs(EnMTLogRequestMode requestMode,
EnMTLogType logType,
Int64 from,
Int64 to,
string filter=null)
{
if(m_manager==null)
{
LogOut("ERROR: Manager was not created");
return;
}
//---
LogOut(EnMTLogCode.MTLogAtt,"LogTests",CAPITester.LOGSEPARATOR);
try
{
MTRetCode result=MTRetCode.MT_RET_ERROR;
//---
MTLogRecord[] records=m_manager.LoggerServerRequest(requestMode,logType,from,to,filter,out result);
//---
LogOutFormat("LoggerServerRequest {0} ==> [{1}] return {2} record(s)",
(result==MTRetCode.MT_RET_OK ? "ok" : "failed"),
result,(records!=null ? records.Length : 0));
//---
if((result==MTRetCode.MT_RET_OK) && (records!=null))
{
foreach(MTLogRecord rec in records)
LogOut(rec);
}
}
catch(Exception ex)
{
...
}
}
...
}
}
file:///C:/Users/Administrator/AppData/Local/Temp/~hh4BC4.htm 7/17/2025
Manager API Page 9 of 464
Installation
To install the MT5Manager package, use the pip utility:
E:\work\samples>pip install MT5Manager
Collecting MT5Manager
Obtaining dependency information for MT5Manager from https://files.pythonhosted.org/packages/31/ad/3d86480fb30221ebb6af58c37ea2a2edfa864f472f5744f412249f4b9d62/MT5Mana
Downloading MT5Manager-5.0.3906-cp310-cp310-win_amd64.whl.metadata (2.1 kB)
Collecting numpy>=1.7 (from MT5Manager)
Obtaining dependency information for numpy>=1.7 from https://files.pythonhosted.org/packages/b7/db/4d37359e2c9cf8bf071c08b8a6f7374648a5ab2e76e2e22e3b808f81d507/numpy-1
Downloading numpy-1.25.2-cp310-cp310-win_amd64.whl.metadata (5.7 kB)
Using cached MT5Manager-5.0.3906-cp310-cp310-win_amd64.whl (3.8 MB)
Using cached numpy-1.25.2-cp310-cp310-win_amd64.whl (15.6 MB)
Installing collected packages: numpy, MT5Manager
Successfully installed MT5Manager-5.0.3906 numpy-1.25.2
Since this package provides the functionality of the native Manager API in its pure form, you need to perform the same preparatory steps.
Sample usage
Let's look at a simple example of using MT5Manager. We are going to receive a list of managers and display their number:
# include the library
import MT5Manager
Upon successful execution of the script, you should receive the following line:
There are 5 managers on server
Let's look at the example in more detail. After connecting the library and creating the ManagerAPI interface, connect to the server at 192.168.1.100:443, with manager login 1001
and password 1234Qwe!:
if manager.Connect("192.168.1.100:443", 1001, "1234Qwe!",
MT5Manager.ManagerAPI.EnPumpModes.PUMP_MODE_USERS, 120000):
ManagerAPI.Connect function parameters fully correspond to the IManagerAPI::Connect function parameters of the native ManagerAPI: server address, manager login and password,
pumping mode and timeout in milliseconds. If the connection to the server fails, the ManagerAPI.Connect function returns False. Error details can be obtained by calling the
LastError function.
Next, we get a list of users by group mask:
managers = manager.UserGetByGroup("managers\\*")
If successful, the UserGetByGroup function returns the list of MT5Manager.MTUser objects. The object properties correspond to the methods of the native Manager API IMTUser
object.
By default, Manager API stores its data in the directory from which it is launched. There may be situations where the data directory must be overridden. For example, this may be
needed to avoid access conflicts to local databases when using several scripts in parallel. To override the data directory for a specific copy of the script, specify the directory when
creating the Manager API interface:
# create manager interface
manager = MT5Manager.ManagerAPI("C:\\API\\DataFolder1")
In case you need to pass multiple values from a function, the MT5Manager methods return a tuple of values.
MT5Manager module objects have properties that fully correspond to the methods of the native ManagerAPI interfaces. For example, the IMTUser interface features the
IMTUser::Name method to read the user name and the same-name overload for writing the name. In the MT5Manager module, the MTUser object has a corresponding Name
property. The following code demonstrates how to read and write the object name:
user = manager.UserGet(1400)
print(user.Name) # reading the Name field of the MTUser type 'user' variable
user.Name = "Alisa" # writing the Name field of the MTUser type 'user' variable
file:///C:/Users/Administrator/AppData/Local/Temp/~hh4BC4.htm 7/17/2025
Manager API Page 10 of 464
In the native Manager API, objects are created through the Create methods of the IMTManagerAPI or IMTAdminAPI interface. In MT5Manager, objects are created in the classic
Python format, but for correct creation, you should always specify an existing object of the ManagerAPI or AdminAPI classes in the parameters:
manager = MT5Manager.ManagerAPI()
user = MT5Manager.MTUser(manager) # creating the object
user.Name = "Alisa"
Functions that return arrays in the native ManagerAPI have counterparts in MT5Manager that return lists.
Receiving sample values from the databases into the NumPy array and CSV string
The MT5Manager module allows us to query data in object, NumPy array and CSV string formats from trading and user databases. For NumPy arrays and CSV strings, it is possible to
obtain sample record values.
Let's have a look at a user base:
managers = manager.UserGetByGroup("managers\\*")
In this case, the 'managers' object will be a list of objects of MT5Manager.MTUser type. When trying to display a list item:
print(managers[0])
we receive:
<MT5Manager.MTUser object at 0x00000295675F9530>
Reading and writing data for this object are available through properties similar to the native ManagerAPI IMTUser methods.
The functions for obtaining data in NumPy array format have the NumPy postfix. For example, let's get the same list of managers in NumPy array format and display the first
element:
managers = manager.UserGetByGroupNumPy("managers\\*")
print(managers[0])
As a result we get:
(1130, b'managers\\administrators', 0, 16385, 1675247009, 1693568566, b'192.168.1.100', b'Jasmine Robert Garrison', b'Test', b'', b'', 0,
b'', b'', b'', b'', b'+35700000000',b'Jasmine.Garrison@test.manager.net', b'', b'', b'Changed', 0, b'', 1000, 0, 10986.19, 13.76, 0., 0.,
0., 0., 0., 45.13, 45.13, 0.6, -35.3, 1688477602, b'0', b'', b'', 25191, b'Jasmine', b'Garrison', b'Robert', b'', 0, 0.)
The 'managers' object in this case is a NumPy array with the data from the user database. This object can be directly passed into both machine learning models and countless other
data processing packages that work with NumPy.
Similarly, functions for obtaining data in CSV string format have the CSV postfix. Let's receive and display the same list in CSV format:
managers = manager.UserGetByGroupCSV("managers\\*")
print(managers)
The resulting string has the following format: entry fields are separated by tabs, each entry is separated from the next by a string break.
In order to display in NumPy array and CSV string formats, it is possible to request only selected fields of an entry through the optional last string 'fields' parameter. For example,
consider this code:
managers = manager.UserGetByGroupNumPy("managers\\*","Login,Name,Group")
print(managers[0])
Here, a NumPy array with manager data is written to the 'managers' variable. Only the login, name and group of each manager is written. The execution result will look as follows:
(1130, b'Jasmine Robert Garrison', b'managers\\administrators')
The names of the fields that can be queried fully corresponds to the names of the object properties. The order in which the fields are displayed corresponds to the order of the
fields in the 'fields' parameter. The format of the 'fields' string should strictly correspond to the format in the example: extra spaces, commas and other characters are not allowed.
Duplicate fields are not allowed, field names are case sensitive.
Event notifications
To subscribe to events in the native ManagerAPI, we should implement a class that provides the appropriate subscriber interface. Thanks to duck typing in Python, there is no need
to inherit from the subscriber interface. It is sufficient to implement subscriber methods in the class that match in name and signature, and subscribe the object of the class via the
corresponding Subscribe method.
Let's look at the example of subscribing to changes in the user database. Suppose that we need to monitor the removal of users from the database. The native ManagerAPI features
the IMTUserSink interface, whose descendant needs to be implemented in this situation. Since we only need to monitor deletion, we are only interested in one method in this
interface:
virtual void IMTUserSink::OnUserDelete(
const IMTUser* user // pointer to deleted entry
)
If the subscription is successful, a corresponding message is displayed when a user is removed from the database.
Please note the following when subscribing:
• if the object does not have any implementations of subscriber methods at the time of subscription, the function returns an error
• repeated subscriptions of the same objects to the same event are allowed - methods will be called as many times for each event as they were subscribed to
Error processing
file:///C:/Users/Administrator/AppData/Local/Temp/~hh4BC4.htm 7/17/2025
Manager API Page 11 of 464
Functions and methods of MT5Manager module objects do not generate exceptions. Most functions return False instead of the expected value in case of an error. In case False may
be in the list of expected values, None is returned in case of an error. To find out information about an error that occurred, call the LastError function. It returns a tuple with data
about the error: internal MT5Manager error code, native Manager API error code from the EnMTAPIRetcode enumeration and a string with a brief error description. For example, if
the connection to the server fails, LastError may return the following value:
(-1, <EnMTAPIRetcode.MT_RET_ERR_NETWORK: 7>, 'Network error')
where:
• -1 is the MT5Manager error code indicating an error when calling the native Manager API function
• <EnMTAPIRetcode.MT_RET_ERR_NETWORK: 7> is the error code from the native Manager API
• 'Network error' is the error string description
Real-case examples
Scripts examples in this section will help you master the Manager API package for Python. Each example is provided with comments.
Creating a manager and connecting to the server have already been considered above. In this example, there is no need to synchronize data with the server, so the pumping mode
is set to 0, that is, without synchronization, for connection speed.
Let's move on to creating a user. According to the documentation for the native Manager API, we are interested in the ManagerAPI.UserAdd function. Create a user, while specifying
the correct manager in the parameters:
# create a user
user = MT5Manager.MTUser(manager)
Let's enter the necessary fields according to the native API documentation:
file:///C:/Users/Administrator/AppData/Local/Temp/~hh4BC4.htm 7/17/2025
Manager API Page 12 of 464
# fill in the required fields: group, leverage, first and last name
user.Group = "demo\\example"
user.Leverage = 100
user.FirstName = "John"
user.LastName = "Smith"
Now we can add a user to the server using the UserAdd method:
# add a user to the server
if not manager.UserAdd(user,"1Ar#pqkj","1Ar#pqkj"):
# adding failed with an error
error = MT5Manager.LastError()
# no more logins
if error[1] == MT5Manager.EnMTAPIRetcode.MT_RET_USR_LOGIN_EXHAUSTED:
print("No free logins on server")
# add a user to another server
elif error[1] == MT5Manager.EnMTAPIRetcode.MT_RET_USR_LOGIN_PROHIBITED:
print("Can't add user for non current server")
# such a user already exists
elif error[1] == MT5Manager.EnMTAPIRetcode.MT_RET_USR_LOGIN_EXIST:
print("User with same login already exists")
# another error
else:
print(f"User was not added: {MT5Manager.LastError()}")
Make sure to add error checks: MT5Manager does not use exceptions and if the user has not been added to the server, the program will continue running.
When calling UserAdd, the fields of the added user in the user variable will be updated by the server. In particular, the Login of the added user will be set to be used for further
operations.
Let's deposit the user balance using the DealerBalance function:
deal_id = manager.DealerBalance(user.Login,100.,MT5Manager.MTDeal.EnDealAction.DEAL_BALANCE,"Start deposit")
if deal_id is False:
# depositing ended with error
error = MT5Manager.LastError()
# too much deposit amount
if error[1] == MT5Manager.EnMTAPIRetcode.MT_RET_TRADE_MAX_MONEY:
print("Money limit")
# insufficient money on the account
elif error[1] == MT5Manager.EnMTAPIRetcode.MT_RET_REQUEST_NO_MONEY:
print("Not enough money")
# another error
else:
print(f"Balance operation failed {MT5Manager.LastError()}")
The user has been created and the balance has been deposited. Let's check if everything went well by requesting user data from the server:
# make sure the balance deposited
user = manager.UserRequest(user.Login)
# user not found
if user == False:
print(f"Failed to request user: {MT5Manager.LastError()}")
else:
# display user balance
print(f"Found user {user.Login}, balance: {user.Balance}")
Since we set the pumping mode to 0 during connection, user data will not be synchronized. In this case, the UserGet function is not suitable, we need to use UserRequest instead.
If everything went well, assign the correct rights to the user:
# update user rights
user.Rights = MT5Manager.MTUser.EnUsersRights.USER_RIGHT_ENABLED | \
MT5Manager.MTUser.EnUsersRights.USER_RIGHT_PASSWORD | \
MT5Manager.MTUser.EnUsersRights.USER_RIGHT_EXPERT
# update user on server
if not manager.UserUpdate(user):
print(f"Failed to update user: {MT5Manager.LastError()}")
To do this, write the rights to the user variable via the Rights property and send the update to the server via the UserUpdate function while checking the result for errors.
Next, change the user password using the UserPasswordChange function:
# change user password
if not manager.UserPasswordChange(MT5Manager.MTUser.EnUsersPasswords.USER_PASS_MAIN,
user.Login, "2Ar#pqkj"):
print(f"Failed to update user password: {MT5Manager.LastError()}")
file:///C:/Users/Administrator/AppData/Local/Temp/~hh4BC4.htm 7/17/2025
Manager API Page 13 of 464
This example uses the datetime module to specify a period of time to receive historical data:
# include library for handling dates
import datetime
Request data on transactions for the last 100 days. To do this, create two variables with time now and 100 days ago:
# request deal history up to the current moment
date_to = datetime.datetime.now()
# request deal history for last 100 days
date_from = date_to - datetime.timedelta(days=100)
Request deal history for last 100 days using the DealRequest method for a user with login 1065:
# request deal history
deals = manager.DealRequest(1065, date_from, date_to)
if deals == False:
# request failed with error
print(f"Failed to request deals: {MT5Manager.LastError()}")
In case of a failure, DealRequest returns False. Use this to check whether the function completed successfully. If executed successfully, we receive a list with transactions in
variables of the MTDeal type. The resulting list can be used like any other list in Python. For example, let's check all deals and display a short description for balance transactions:
for deal in deals:
if deal.Action == MT5Manager.MTDeal.EnDealAction.DEAL_BALANCE:
print(deal.Print())
As a result of executing the script, we receive the following output if the requested user has balance deals:
Got 125 deals
#86 balance 100.00 [Deposit]
#92 balance -100.00 [Withdrawal]
#111 balance 10.00 [Deposit]
#115 balance -9.72 [Withdrawal]
#116 balance 1.00 [Deposit]
#119 balance 100.00 [Deposit]
Let's take a closer look. We need to set MT5Manager.ManagerAPI.EnPumpModes.PUMP_MODE_POSITIONS pumping mode to receive position data when connecting to the server.
Create the PositionSink class to track position changes:
file:///C:/Users/Administrator/AppData/Local/Temp/~hh4BC4.htm 7/17/2025
Manager API Page 14 of 464
Add the OnPositionAdd and OnPositionUpdate functions. Signatures and names should strictly match the methods of the IMTPositionSink class.
Let's create a variable of the PositionSink type and subscribe to manager changes using the PositionSubscribe method:
# create class to track positions
sink = PositionSink()
# subscribe to position changes
if not manager.PositionSubscribe(sink):
print(f"Failed to subscribe: {MT5Manager.LastError()}")
Next, connect to the server and wait for position changes within one minute. Position updates come from another thread, but there is no need to use thread synchronization
primitives since all Python code runs under GIL (Global Interpreter Lock). To understand when tracking positions began, we will display a message about a successful connection to
the server. Let's display "." once every 10 seconds to make sure the program runs:
# connect the server
if manager.Connect("192.168.1.100:443", 1002, "1Ar#pqkj",
MT5Manager.ManagerAPI.EnPumpModes.PUMP_MODE_POSITIONS,
300000):
# connected to the server
print("Connected to server")
# watch position changes within 60 seconds
for s in range(6):
time.sleep(10)
print(".")
# disconnect from the server
manager.Disconnect()
As a result of executing the script, we will get the following output if, while waiting, we add and change positions through the manager or client terminal:
Connected to server
Position added: #13111682 sell 0.0019 EURUSD 1.06567
Position updated: #13111682 sell 0.0019 EURUSD 1.06567
Position added: #13111684 buy 0.0019 EURUSD 1.06563
Position updated: #13111684 buy 0.0019 EURUSD 1.06563
Position updated: #13111684 buy 0.0038 EURUSD 1.065635
Position added: #13111687 sell 0.0057 EURUSD 1.06562
Position updated: #13111687 sell 0.0057 EURUSD 1.06562
.
Position added: #13111695 sell 0.0016 EURUSD 1.06563
Position updated: #13111695 sell 0.0016 EURUSD 1.06563
.
Position added: #13111697 buy 0.0016 EURUSD 1.06563
Position updated: #13111697 buy 0.0016 EURUSD 1.06563
.
.
.
.
Keep in mind that according to the documentation of the native ManagerAPI, all methods of the event processing interfaces (in this case OnPositionAdd and OnPositionUpdate) are
called from the network thread. Therefore, any methods of the same manager or administrator interface, which send commands to the trade server (such as *Request, *Update,
*Delete, *Send, etc.) are prohibited in these interfaces. Only methods working with local data (*Get, *Next, *Total, etc.) can be called from event handlers.
Receiving ticks
Receiving ticks is completely similar to subscribing to position updates provided above.
# include the library
import MT5Manager
# include module to use delays
import time
# include module for handling dates
import datetime
# create class to track quotes
class TickSink:
# new quote
def OnTick(self, symbol, tick : MT5Manager.MTTickShort):
print(f"tick: {symbol} \t {tick.bid:.5f} \t {tick.ask:.5f}")
# update statistical data on prices
def OnTickStat(self, stat : MT5Manager.MTTickStat):
print(f"stat: {datetime.datetime.fromtimestamp(stat.datetime)} \t "
f"{stat.bid_high} \t {stat.bid_low} \t {stat.ask_high} \t {stat.ask_low}")
# create manager interface
manager = MT5Manager.ManagerAPI()
# create class to track quotes
sink = TickSink()
# subscribe to quote changes
if not manager.TickSubscribe(sink):
print(f"Failed to subscribe: {MT5Manager.LastError()}")
else:
# connect the server
# enable pumping of symbols, this will allow to add EURUSD to the list of selected symbols
if manager.Connect("192.168.1.100:443", 1002, "1Ar#pqkj", MT5Manager.ManagerAPI.EnPumpModes.PUMP_MODE_SYMBOLS):
# connected to the server
print("Connected to server")
# Add "EURUSD" to the list of selected symbols in order to receive the quotes
if not manager.SelectedAdd("EURUSD"):
print(f"Failed to select symbol: {MT5Manager.LastError()}")
# expect data within a minute
time.sleep(60)
# disconnect from the server
manager.Disconnect()
else:
# failed to connect to the server
print(f"Failed to connect to server: {MT5Manager.LastError()}")
# unsubscribe from changes
if not manager.TickUnsubscribe(sink):
print(f"Failed to unsubscribe: {MT5Manager.LastError()}")
There is no need to enable pumping mode here. Just like in the native Manager API, data is received only for the selected symbols.
As a result of executing the script, we get the following output:
file:///C:/Users/Administrator/AppData/Local/Temp/~hh4BC4.htm 7/17/2025
Manager API Page 15 of 464
Connected to server
stat: 2023-09-22 12:55:07 0.86648 0.86313 0.8666 0.86342
tick: AUDCAD 0.86642 0.86653
stat: 2023-09-22 12:55:06 1.0668 1.06149 1.0668 1.0615
tick: EURUSD 1.06484 1.06484
stat: 2023-09-22 12:55:07 1.22941 1.22509 1.22956 1.22511
tick: GBPUSD 1.22677 1.22681
stat: 2023-09-22 12:54:55 148.383 147.47 148.413 147.5
tick: USDJPY 148.21400 148.244
stat: 2023-09-22 02:59:50 0.64512 0.6387 0.64542 0.639
tick: AUDUSD 0.64130 0.64160
stat: 2023-09-22 12:55:07 1.34824 1.34584 1.34864 1.34623
tick: USDCAD 1.34679 1.34719
tick: USDCAD 1.34678 1.34718
tick: USDCAD 1.34679 1.34719
tick: AUDCAD 0.86641 0.86652
tick: USDCAD 1.34678 1.34718
tick: USDCAD 1.34679 1.34719
tick: AUDCAD 0.86641 0.86653
tick: USDCAD 1.34680 1.34720
tick: GBPUSD 1.22676 1.22681
tick: AUDCAD 0.86641 0.86654
tick: AUDCAD 0.86641 0.86653
tick: USDCAD 1.34679 1.34719
tick: GBPUSD 1.22676 1.22680
tick: EURUSD 1.06483 1.06483
tick: AUDCAD 0.86642 0.86654
Exported Functions
The MT5APIManager.dll library (as well as its 64-bit version), which is used for implementing interaction between the application and the MetaTrader 5 trading platform, exports
several functions:
Function Purpose
MTManagerVersion Returns the version of the Manager API library.
MTManagerCreate Creates a new object of the IMTManagerAPI interface and returns a pointer to it.
MTManagerCreateExt Creates a new object of the IMTManagerAPI interface and returns a pointer to it. The directory where Manager API is to store its data is additionally
specified.
MTAdminCreate Creates a new object of the IMTAdminAPI interface and returns a pointer to it.
MTAdminCreateExt Creates a new object of the IMTAdminAPI interface and returns a pointer to it. The directory where Manager API is to store its data is additionally
specified.
MTManagerVersion
The exported function MTManagerVersion returns the version of the Manager API library.
MTAPIRES MTManagerVersion(
UINT& version // Reference to the version of the Manager API
)
Parameters
version
[in] A reference to the version of the Manager API library.
Return Value
An indication of successful completion is the MT_RET_OK response code. Otherwise, an error has occurred that corresponds to the response code.
MTManagerCreate
The MTManagerCreate exported function creates a new instance of the IMTManagerAPI interface and returns a pointer to it.
MTAPIRES MTManagerCreate(
UINT api_version // API version
IMTManagerAPI** manager // A pointer to the pointer to the interface
)
Parameters
api_version
[out] The current version of Manager API supported by the server is passed in this parameter.
manager
[out] A pointer to the pointer of the created IMTManagerAPI interface.
Return Value
An indication of successful completion is the MT_RET_OK response code. Otherwise, an error has occurred that corresponds to the response code.
Note
The Manager API application can use separate data directories for each manager and administrator interface (to store the local data cache). However, the application log is
always written to only one data directory, which is specified during creation of the first interface (no matter whether it is a manager or an administrator interface).
For example, the first interface is created via MTManagerCreate. The path to the data directory is not specified in this function, so the application log will be stored in the
default directory, i.e. in the Logs folder of the directory, in which MT5APIManager.dll is located. The log storage location will not be changed even if you explicitly specify a
custom data directory when creating the second interface via MTAdminCreateExt.
Calling MTMangerCreate is equivalent to calling MTMangerCreateExt with the parameter datapath=NULL.
file:///C:/Users/Administrator/AppData/Local/Temp/~hh4BC4.htm 7/17/2025
Manager API Page 16 of 464
MTManagerCreateExt
The MTManagerCreateExt exported function creates a new IMTManagerAPI interface instance and returns a pointer to it. The directory where Manager API is to store its data is
additionally specified.
MTAPIRES MTManagerCreateExt(
UINT api_version // API version
LPCWSTR datapath, // data folder
IMTManagerAPI** manager // pointer to the pointer to the interface
)
Parameters
api_version
[out] The current version of Manager API supported by the server is passed in this parameter.
datapath
[in] The absolute path to the directory where Manager API is to store its data (local cache, journals, etc.) is additionally specified. If NULL, the application stores data in the
directory it is launched from.
manager
[out] A pointer to the pointer to the created IMTManagerAPI interface.
Return Value
An indication of successful completion is the MT_RET_OK response code. Otherwise, an error has occurred that corresponds to the response code.
Note
By default, Manager API stores its data in the directory it is launched from. In some cases, the need arises to re-define the data folder, for example, if the application is installed
to Program Files of MS Windows Vista or higher. By default, applications installed to Program Files are not allowed to write their data to the installation folder in these systems.
In this case, use a special directory in [system disk letter]:\Users\[account name in OS]\AppData\Roaming\[application data folder], for example,
C:\Users\JohnSmith\AppData\Roaming\ManagerAPIApp.
The Manager API application can use separate data directories for each manager and administrator interface (to store the local data cache). However, the application log is
always written to only one data directory, which is specified during creation of the first interface (no matter whether it is a manager or an administrator interface).
For example, the first interface is created via MTManagerCreate. The path to the data directory is not specified in this function, so the application log will be stored in the
default directory, i.e. in the Logs folder of the directory, in which MT5APIManager.dll is located. The log storage location will not be changed even if you explicitly specify a
custom data directory when creating the second interface via MTAdminCreateExt.
MTAdminCreate
The MTAdminCreate exported function creates a new instance of the IMTAdminAPI interface and returns a pointer to it.
MTAPIRES MTAdminCreate(
UINT api_version // API version
IMTAdminAPI** admin // A pointer to the pointer to the interface
)
Parameters
api_version
[out] The current version of Manager API supported by the server is passed in this parameter.
admin
[out] A pointer to the pointer of the created IMTAdminAPI interface.
Return Value
An indication of successful completion is the MT_RET_OK response code. Otherwise, an error has occurred that corresponds to the response code.
Note
The Manager API application can use separate data directories for each manager and administrator interface (to store the local data cache). However, the application log is
always written to only one data directory, which is specified during creation of the first interface (no matter whether it is a manager or an administrator interface).
For example, the first interface is created via MTManagerCreate. The path to the data directory is not specified in this function, so the application log will be stored in the
default directory, i.e. in the Logs folder of the directory, in which MT5APIManager.dll is located. The log storage location will not be changed even if you explicitly specify a
custom data directory when creating the second interface via MTAdminCreateExt.
Calling MTAdminCreate is equivalent to calling MTAdminCreateExt with the parameter datapath=NULL.
MTAdminCreateExt
The MTAdminCreateExt exported function creates a new IMTAdminAPI interface instance and returns a pointer to it. The directory where Manager API is to store its data is
additionally specified.
MTAPIRES MTAdminCreateExt(
UINT api_version // API version
LPCWSTR datapath, // data folder
IMTAdminAPI** admin // pointer to the pointer to the API interface
)
Parameters
api_version
[out] The current version of Manager API supported by the server is passed in this parameter.
datapath
[in] The absolute path to the directory where Manager API is to store its data (local cache, journals, etc.) is additionally specified. If NULL, the application stores data in the
directory it is launched from.
file:///C:/Users/Administrator/AppData/Local/Temp/~hh4BC4.htm 7/17/2025
Manager API Page 17 of 464
admin
[out] A pointer to the pointer to the created IMTAdminAPI interface.
Return Value
An indication of successful completion is the MT_RET_OK response code. Otherwise, an error has occurred that corresponds to the response code.
Note
By default, Manager API stores its data in the directory it is launched from. In some cases, the need arises to re-define the data folder, for example, if the application is installed
to Program Files of MS Windows Vista or higher. By default, applications installed to Program Files are not allowed to write their data to the installation folder in these systems.
In this case, use a special directory in [system disk letter]:\Users\[account name in OS]\AppData\Roaming\[application data folder], for example,
C:\Users\JohnSmith\AppData\Roaming\ManagerAPIApp.
The Manager API application can use separate data directories for each manager and administrator interface (to store the local data cache). However, the application log is
always written to only one data directory, which is specified during creation of the first interface (no matter whether it is a manager or an administrator interface).
For example, the first interface is created via MTManagerCreate. The path to the data directory is not specified in this function, so the application log will be stored in the
default directory, i.e. in the Logs folder of the directory, in which MT5APIManager.dll is located. The log storage location will not be changed even if you explicitly specify a
custom data directory when creating the second interface via MTAdminCreateExt.
CMTManagerAPIFactory
For easy access to the IMTManagerAPI interface, a factory of interfaces is implemented in the MT5Manager.h file. The factory automatically loads the appropriate library (32/64-
bit) Manager API and provides access to exported functions.
The Manager API factory performs the basic functions of applications — initialization and deinitialization, as well as creation of interfaces of the Manager API. It contains the
following methods:
Method Purpose
Initialize Initialize the Manager API.
Shutdown Unload DLL from the Manager API.
CreateManager Create the manager interface.
CreateAdmin Create the administrator interface.
Version Get the version of the Manager Manager API.
LicenseCheckAdmin Check whether the Manager API application use is authorized.
LicenseCheckManager Check whether the Manager API application use is authorized.
Using factories in application development is optional. You can use your own implementation of corresponding functions.
CMTManagerAPIFactory::Initialize
Initialize the Manager API.
C++
MTAPIRES CMTManagerAPIFactory::Initialize(
LPCWSTR dll_path=NULL // Path to DLL library of the API
)
.NET
MTRetCode SMTManagerAPIFactory.Initialize(
string dll_path=NULL // Path to DLL library of the API
)
Parameters
dll_path
[in] Full path to DLL library of the Manager API. An optional parameter. If the path is not specified, the method will try to find a library in the following order:
Return Value
An indication of successful completion is the MT_RET_OK response code. Otherwise, a corresponding error code will be returned.
Note
The method loads the DLL of the Manager API and gets addresses of exported functions. Depending on the application architecture, the 32-bit or 64-bit version of DLL is loaded.
CMTManagerAPIFactory::Shutdown
Unload DLL from the Manager API.
C++
MTAPIRES CMTManagerAPIFactory::Shutdown()
.NET
MTRetCode SMTManagerAPIFactory.Shutdown()
Return Value
An indication of successful completion is the MT_RET_OK response code. Otherwise, an error code will be returned.
file:///C:/Users/Administrator/AppData/Local/Temp/~hh4BC4.htm 7/17/2025
Manager API Page 18 of 464
CMTManagerAPIFactory::CreateManager
Create the manager interface IMTManagerAPI.
C++
MTAPIRES CMTManagerAPIFactory::CreateManager(
UINT version, // Version
IMTManagerAPI** manager // A pointer to the manager interface
)
.NET
CIMTManagerAPI SMTManagerAPIFactory.CreateManager(
uint version, // Version
out MTRetCode res // Response code
)
Parameters
version
[in] Version of the MT5APIManager.h header file
manager
[out] A pointer to the manager interface IMTManagerAPI.
Return Value
An indication of successful completion is the MT_RET_OK response code. Otherwise, an error code will be returned.
Note
The Manager API application can use separate data directories for each manager and administrator interface (to store the local data cache). However, the application log is
always written to only one data directory, which is specified during creation of the first interface (no matter whether it is a manager or an administrator interface).
For example, the first interface is created through the first version of CMTManagerAPIFactory::CreateManager, in which the path to the data directory is not specified. The
application log will be stored in the default directory, i.e. in the Logs folder of the directory, in which MT5APIManager.dll is located. The log storage location will not be changed
even if you explicitly specify a custom data directory when creating the second interface.
CMTManagerAPIFactory::CreateManager
Creating the IMTManagerAPI manager interface specifying the directory where Manager API application data are to be stored.
C++
MTAPIRES CMTManagerAPIFactory::CreateManager(
UINT version, // version
LPCWSTR datapath, // data folder
IMTManagerAPI** manager // pointer to the manager interface
)
.NET
CIMTManagerAPI SMTManagerAPIFactory.CreateManager(
uint version, // version
string datapath, // data folder
out MTRetCode res // response code
)
Parameters
version
[in] Version of the MT5APIManager.h header file.
datapath
[in] The absolute path to the directory where Manager API is to store its data (local cache, journals, etc.) is additionally specified. If NULL, the application stores data in the
directory it is launched from.
manager
[out] A pointer to the manager interface IMTManagerAPI.
Return Value
An indication of successful completion is the MT_RET_OK response code. Otherwise, an error code will be returned.
Note
By default, Manager API stores its data in the directory it is launched from. In some cases, the need arises to re-define the data folder, for example, if the application is installed
to Program Files of MS Windows Vista or higher. By default, applications installed to Program Files are not allowed to write their data to the installation folder in these systems.
In this case, use a special directory in [system disk letter]:\Users\[account name in OS]\AppData\Roaming\[application data folder], for example,
C:\Users\JohnSmith\AppData\Roaming\ManagerAPIApp.
The Manager API application can use separate data directories for each manager and administrator interface (to store the local data cache). However, the application log is
always written to only one data directory, which is specified during creation of the first interface (no matter whether it is a manager or an administrator interface).
For example, the first interface is created through the first version of CMTManagerAPIFactory::CreateManager, in which the path to the data directory is not specified. The
application log will be stored in the default directory, i.e. in the Logs folder of the directory, in which MT5APIManager.dll is located. The log storage location will not be changed
even if you explicitly specify a custom data directory when creating the second interface.
CMTManagerAPIFactory::CreateAdmin
Create the administrator interface IMTAdminAPI.
C++
file:///C:/Users/Administrator/AppData/Local/Temp/~hh4BC4.htm 7/17/2025
Manager API Page 19 of 464
MTAPIRES CMTManagerAPIFactory::CreateAdmin(
UINT version, // Version
IMTAdminAPI** admin // A pointer to the administrator interface
)
.NET
CIMTAdminAPI SMTManagerAPIFactory.CreateAdmin(
uint version, // Version
out MTRetCode res // Response code
)
Parameters
version
[in] Version of the MT5APIManager.h header file
admin
[out] A pointer to the administrator interface IMTAdminAPI.
Return Value
An indication of successful completion is the MT_RET_OK response code. Otherwise, an error code will be returned.
Note
The Manager API application can use separate data directories for each manager and administrator interface (to store the local data cache). However, the application log is
always written to only one data directory, which is specified during creation of the first interface (no matter whether it is a manager or an administrator interface).
For example, the first interface is created through the first version of CMTManagerAPIFactory::CreateAdmin, in which the path to the data directory is not specified. The
application log will be stored in the default directory, i.e. in the Logs folder of the directory, in which MT5APIManager.dll is located. The log storage location will not be changed
even if you explicitly specify a custom data directory when creating the second interface.
CMTManagerAPIFactory::CreateAdmin
Creating the IMTAdminAPI administrator interface specifying the directory where Manager API application data are to be stored.
C++
MTAPIRES CMTManagerAPIFactory::CreateAdmin(
UINT version, // version
LPCWSTR datapath, // data folder
IMTAdminAPI** admin // pointer to the administrator interface
)
.NET
CIMTAdminAPI SMTManagerAPIFactory.CreateAdmin(
uint version, // version
string datapath, // data folder
out MTRetCode res // response code
)
Parameters
version
[in] Version of the MT5APIManager.h header file
datapath
[in] The absolute path to the directory where Manager API is to store its data (local cache, journals, etc.) is additionally specified. If NULL, the application stores data in the
directory it is launched from.
admin
[out] A pointer to the administrator interface IMTAdminAPI.
Return Value
An indication of successful completion is the MT_RET_OK response code. Otherwise, an error code will be returned.
Note
By default, Manager API stores its data in the directory it is launched from. In some cases, the need arises to re-define the data folder, for example, if the application is installed
to Program Files of MS Windows Vista or higher. By default, applications installed to Program Files are not allowed to write their data to the installation folder in these systems.
In this case, use a special directory in [system disk letter]:\Users\[account name in OS]\AppData\Roaming\[application data folder], for example,
C:\Users\JohnSmith\AppData\Roaming\ManagerAPIApp.
The Manager API application can use separate data directories for each manager and administrator interface (to store the local data cache). However, the application log is
always written to only one data directory, which is specified during creation of the first interface (no matter whether it is a manager or an administrator interface).
For example, the first interface is created through the first version of CMTManagerAPIFactory::CreateAdmin, in which the path to the data directory is not specified. The
application log will be stored in the default directory, i.e. in the Logs folder of the directory, in which MT5APIManager.dll is located. The log storage location will not be changed
even if you explicitly specify a custom data directory when creating the second interface.
CMTManagerAPIFactory::Version
Get the version of the Manager Manager API.
C++
MTAPIRES CMTManagerAPIFactory::Version(
UINT& version // Version
)
.NET
MTRetCode SMTManagerAPIFactory.GetVersion(
out uint version // Version
)
Parameters
&version
[out] The version of the Manager API library.
Return Value
file:///C:/Users/Administrator/AppData/Local/Temp/~hh4BC4.htm 7/17/2025
Manager API Page 20 of 464
An indication of successful completion is the MT_RET_OK response code. Otherwise, an error code will be returned.
CMTManagerAPIFactory::LicenseCheckAdmin
Check whether the Manager API application use is authorized.
C++
static MTAPIRES CMTManagerAPIFactory::LicenseCheckAdmin(
IMTAdminAPI* admin, // A pointer to the IMTAdminAPI interface
LPCWSTR name // Module name
)
.NET
static MTRetCode SMTManagerAPIFactory.LicenseCheckAdmin(
CIMTAdmin admin, // The IMTAdminAPI object
string name // Module name
)
Program Parameters
admin
[in] A pointer to the IMTAdminAPI interface, using which the authorization to use Manager API is checked in the license.
name
[in] The name of the Manager API application, for which the license is checked. A unique module name must be defined in advanced in the program code.
Return Value
An indication of a successful verification is the MT_RET_OK response code. Otherwise, an error has occurred, which corresponds to the response code.
Further Note
This factory method is provided for an easier license verification. The full description of the verification algorithm is provided in the section related to the
IMTAdminAPI::LicenseCheck function.
License verification can only be performed after connection to a server, otherwise the method will return the MT_RET_ERR_DATA error.
CMTManagerAPIFactory::LicenseCheckManager
Check whether the Manager API application use is authorized.
C++
static MTAPIRES CMTManagerAPIFactory::LicenseCheckManager(
IMTManagerAPI* manager, // A pointer to the IMTManagerAPI interface
LPCWSTR name // Module name
)
.NET
static MTRetCode SMTManagerAPIFactory.LicenseCheckManager(
CIMTManager manager, // IMTManagerAPI object
string name // Module name
)
Program Parameters
manager
[in] A pointer to the IMTManagerAPI interface, using which the authorization to use Manager API is checked in the license.
name
[in] The name of the Manager API application, for which the license is checked. A unique module name must be defined in advanced in the program code.
Return Value
An indication of a successful verification is the MT_RET_OK response code. Otherwise, an error has occurred, which corresponds to the response code.
Further Note
This factory method is provided for an easier license verification. The full description of the verification algorithm is provided in the section related to the
IMTManagerAPI::LicenseCheck function.
License verification can only be performed after connection to a server, otherwise the method will return the MT_RET_ERR_DATA error.
To be able to use the IMTAdminAPI interface, a manager account that is used for connecting to the server must have the "Connect using MetaTrader 5 Administrator" permission
(IMTConManager::RIGHT_ADMIN).
Description of functions of the administrator interface is divided into the following sections:
• Common Functions
• Connection to the Server
• Operations with Connection
• Server Management
• Configuration Databases
• Clients
file:///C:/Users/Administrator/AppData/Local/Temp/~hh4BC4.htm 7/17/2025
Manager API Page 21 of 464
• Users
• Trade Databases
• Mail Database
• News Database
• History Data
• Tick Data
• Settings Files
• Subscriptions
• Custom Functions
• ECN
• Geo Services
Common Functions
The common functions of the IMTAdminAPI interface include general purpose functions that do not control any of the platform configurations or information on the server, but are
required for developing applications.
Memory Management
The MetaTrader 5 Manager API allows managing the memory used by applications.
Function Purpose
Allocate Memory allocation by an application.
Free Free memory allocated previously using the Allocate method.
Journal
The MetaTrader 5 Manager API provides access to server logs. The API includes functions for working with the logs. The IMTAdminAPI interface allows to output messages in the log,
as well as to request logs of the server, data feeds and gateways.
Function Purpose
LoggerOut Log messages.
LoggerOutString Fast output method which prints unformatted logs to the Administrator API local journal.
LoggerFlush Flush the file buffer of the server journal to a disk.
LoggerServerRequest Request the server logs.
LoggerGatewayRequest Request the gateway logs.
LoggerFeederRequest Request the logs of data feeds.
The MetaTrader 5 Manager API contains a number of constants for working with logs. They are described in a separate section.
Service Functions
The following additional functions are available in the MetaTrader 5 Manager API:
Function Purpose
Release Delete the IMTAdminAPI object.
LicenseCheck Check the application license.
PasswordChange Change password of an account that is used to connect the application to the server.
IMTAdminAPI::Allocate
Memory allocation by an application. This is a pair method to IMTAdminAPI::Free.
void* IMTAdminAPI::Allocate(
const UINT bytes // Amount of allocated memory
)
Parameters
bytes
[in] Amount of allocated memory in bytes.
Return Value
If successful, it returns a pointer to the allocated memory block, otherwise it returns NULL.
IMTAdminAPI::Free
Free memory allocated earlier by IMTAdminAPI::Allocate method. It is used to free memory allocated by the functions and interfaces of the MetaTrader 5 Manager API.
void IMTAdminAPI::Free(
void* ptr // Pointer to a memory block
)
Parameters
ptr
file:///C:/Users/Administrator/AppData/Local/Temp/~hh4BC4.htm 7/17/2025
Manager API Page 22 of 464
IMTAdminAPI::LoggerOut
Add messages to the local journal of the administrator interface.
C++
MTAPIRES IMTAdminAPI::LoggerOut(
const UINT code, // Message code
LPCWSTR format, // Message string
... // Optional arguments
)
.NET
MTRetCode CIMTAdminAPI.LoggerOut(
EnMTLogCode code, // Message code
string format, // Message string
params object[] args // Optional arguments
)
Python
AdminAPI.LoggerOut(
code, # Message code
msg # Message string
)
Parameters
code
[in] Message code that is passed using the EnMTLogCode enumeration.
format
[in] A message string with optional arguments.
Return Value
An indication of successful completion is the MT_RET_OK response code. Otherwise, an error has occurred that corresponds to the response code.
Note
Each string is limited to 16KB without the standard string header.
The requirements for the format string are the same as applied in C++: http://www.cplusplus.com/reference/cstdio/printf/
Do not use the line feed characters \r and \n as it leads to an incorrect calculation of the check sum of the log.
IMTAdminAPI::LoggerOutString
Fast output method which prints unformatted logs to the Administrator API local journal.
C++
MTAPIRES IMTAdminAPI::LoggerOutString(
const UINT code, // log code
LPCWSTR string // log string
)
.NET
MTRetCode CIMTAdminAPI.LoggerOutString(
EnMTLogCode code, // log code
string string // log string
)
Parameters
code
[in] Log code which is passed using the EnMTLogCode enumerations.
string
[in] Log string with optional arguments.
Return Value
An indication of a successful execution is the MT_RET_OK response code. Otherwise, an error has occurred, which corresponds to the response code.
Note
Compared to IMTAdminAPI::LoggerOut which formats the output, this method consumes less resources.
Each string is limited to 16KB, not including the standard string header.
Do not use the newline characters \r and \n, as this will lead to incorrect calculation of the checksum for the log lines.
IMTAdminAPI::LoggerFlush
Flush the file buffer of the local journal of the administrator interface to a disk.
C++
void IMTAdminAPI::LoggerFlush()
.NET
void CIMTAdminAPI.LoggerFlush()
file:///C:/Users/Administrator/AppData/Local/Temp/~hh4BC4.htm 7/17/2025
Manager API Page 23 of 464
Python
AdminAPI.LoggerFlush()
IMTAdminAPI::LoggerServerRequest
Request the journal of a trade server to which an application is connected.
C++
MTAPIRES IMTAdminAPI::LoggerServerRequest(
const UINT64 server_id, // Server ID
const UINT mode, // Request mode
const UINT type, // Event type
const INT64 from, // Start date
const INT64 to, // End date
LPCWSTR filter, // Keyword
MTLogRecord*& records, // Array of entries
UINT& records_total // The number of received entries
)
.NET
MTLogRecord[] CIMTAdminAPI.LoggerServerRequest(
ulong server_id, // Server ID
EnMTLogRequestMode mode, // Request mode
EnMTLogType type, // Event type
long from, // Start date
long to, // End date
string filter, // Keyword
out MTRetCode res // Response code
)
Python
AdminAPI.LoggerServerRequest(
server_id, # Server ID
mode, # Request mode
type, # Event type
from_date, # Start date
to_date, # End date
filter # Keyword
)
Parameters
server_id
[in] The ID of the server, for which the journal is requested. The IMTConServer::Id value is used as the identifier.
mode
[in] The mode of journal requesting. To pass the mode, the EnMTLogRequestMode enumeration is used.
type
[in] Type of events that should be requested from the server journal. To pass the type of events, the EnMTLogType enumeration is used.
from
[in] The start date for requesting logs. The date is specified in seconds that have elapsed since 01.01.1970. Only the date is taken into account, while the exact time is
ignored.
to
[in] The end date for requesting logs. The date is specified in seconds that have elapsed since 01.01.1970. Only the date is taken into account, while the exact time is ignored.
filter
[in] A key word for searching logs.
records
[out] A reference to the array of structures that describe logs (MTLogRecord).
records_total
[out] The total number of received journal entries.
Return Value
An indication of successful completion is the MT_RET_OK response code. Otherwise, a corresponding error code will be returned.
Note
After using, the records array must be released using the IMTAdminAPI::Free method.
This method cannot be called from event handlers (any methods of IMT*Sink classes).
IMTAdminAPI::LoggerGatewayRequest
Request the journal of gateways.
C++
MTAPIRES IMTAdminAPI::LoggerGatewayRequest(
const UINT gateway_pos, // Position of a gateway
const INT64 from, // Start date of the request
const INT64 to, // End date of the request
LPCWSTR filter, // Keyword
MTLogRecord*& records, // Array of entries
UINT& records_total // The number of received entries
)
.NET
file:///C:/Users/Administrator/AppData/Local/Temp/~hh4BC4.htm 7/17/2025
Manager API Page 24 of 464
MTLogRecord[] CIMTAdminAPI.LoggerGatewayRequest(
uint gateway_pos, // Position of a gateway
long from, // Start date of the request
long to, // End date of the request
string filter, // Keyword
out MTRetCode res // Array of entries
)
Python
AdminAPI.LoggerGatewayRequest(
feeder_pos, # Position of a gateway
from, # Start date of the request
to, # End date of the request
filter # Keyword
)
Parameters
gateway_pos
[in] The gateway position in the list of configurations, ranging from 0.
from
[in] The start date for requesting logs. The date is specified in seconds that have elapsed since 01.01.1970.
to
[in] The end date for requesting logs. The date is specified in seconds that have elapsed since 01.01.1970.
filter
[in] A key word for searching logs.
records
[out] A reference to the array of structures that describe logs (MTLogRecord).
records_total
[out] The total number of received journal entries.
Return Value
An indication of successful completion is the MT_RET_OK response code. Otherwise, an error code will be returned.
Note
After using, the records array must be released using the IMTAdminAPI::Free method.
This method cannot be called from event handlers (any methods of IMT*Sink classes).
IMTAdminAPI::LoggerFeederRequest
Request the logs of data feeds.
C++
MTAPIRES IMTAdminAPI::LoggerFeederRequest(
const UINT feeder_pos, // Position of a data feed
const INT64 from, // Start date of the request
const INT64 to, // End date of the request
LPCWSTR filter, // Keyword
MTLogRecord*& records, // Array of entries
UINT& records_total // The number of received entries
)
.NET
MTLogRecord[] CIMTAdminAPI.LoggerFeederRequest(
uint feeder_pos, // Position of a data feed
long from, // Start date of the request
long to, // End date of the request
string filter, // Keyword
out MTRetCode res // Response code
)
Python
AdminAPI.LoggerFeederRequest(
feeder_pos, # Position of a data feed
from, # Start date of the request
to, # End date of the request
filter # Keyword
)
Parameters
feeder_pos
[in] The position of a data feed in the list of configurations, ranging from 0.
from
[in] The start date for requesting logs. The date is specified in seconds that have elapsed since 01.01.1970.
to
[in] The end date for requesting logs. The date is specified in seconds that have elapsed since 01.01.1970.
filter
[in] A key word for searching logs.
records
[out] A reference to the array of structures that describe logs (MTLogRecord).
records_total
[out] The total number of received journal entries.
Return Value
An indication of successful completion is the MT_RET_OK response code. Otherwise, an error code will be returned.
Note
file:///C:/Users/Administrator/AppData/Local/Temp/~hh4BC4.htm 7/17/2025
Manager API Page 25 of 464
After using, the records array must be released using the IMTAdminAPI::Free method.
This method cannot be called from event handlers (any methods of IMT*Sink classes).
IMTAdminAPI::Release
A standard method for deleting the IMTAdminAPI object. After the method call, the object cannot be accessed, because it has been deleted.
C++
void IMTAdminAPI::Release()
.NET
void CIMTAdminAPI.Release()
IMTAdminAPI::LicenseCheck
Check the application license.
C++
MTAPIRES IMTAdminAPI::LicenseCheck(
MTLicenseCheck& check // Name of the license module
)
.NET
MTRetCode CIMTAdminAPI.LicenseCheck(
ref MTLicenseCheck check // Name of the license module
)
Parameters
check
[in] A reference to the MTLicenseCheck structure that describes the license.
Return Value
An indication of successful completion is the MT_RET_OK response code. Otherwise, an error has occurred, which corresponds to the response code.
Note
License verification can only be performed after connection to a server, otherwise the method will return the MT_RET_ERR_DATA error.
For easier license check, the Manager API factory provides a special CMTManagerAPIFactory::LicenseCheckAdmin method. The main steps of the above license verification
algorithm are already implemented in that method. When using the factory method, a programmer only needs to pass a pointer to the Manager API and the application name to
it.
IMTAdminAPI::PasswordChange
Change password of an account that is used to connect the application to the server.
C++
MTAPIRES IMTAdminAPI::PasswordChange(
const UINT type, // Type of password
LPCWSTR password // New password
)
.NET
MTRetCode CIMTAdminAPI.PasswordChange(
uint type, // Type of password
string password // New password
)
file:///C:/Users/Administrator/AppData/Local/Temp/~hh4BC4.htm 7/17/2025
Manager API Page 26 of 464
Python
AdminAPI.PasswordChange(
type, # Type of password
password # New password
)
Parameters
type
[in] The type of a password to change is specified using the IMTUSer::EnUsersPasswords enumeration.
password
[in] A new password.
Return Value
An indication of successful completion is the MT_RET_OK response code. Otherwise, an error code will be returned.
Note
The password must contain at least two of three types of characters (lower case, upper case and digits) and meet the minimum length requirements set for the group
(IMTConGroup::AuthPasswordMin).
Method Purpose
Connect Connect to the trading platform.
Disconnect Disconnect from the trading platform.
Subscribe Subscribe to common events of the IMTAdminAPI.
Unsubscribe Unsubscribe from common events of the IMTAdminAPI.
ProxySet Set parameters of connection to the trading platform through a proxy server.
Pumping Mode
Enabled pumping mode means that the application will synchronize the appropriate server database with a locally created database. Possible pumping modes are enumerated in
IMTAdminAPI::EnPumpModes. The pumping mode in which we want to connect is specified in the pump_mode parameter of the IMTAdminAPI::Connect method.
ID Value Description
PUMP_MODE_MAIL 0x00000004 Mail pumping.
PUMP_MODE_NEWS 0x00000020 News pumping.
PUMP_MODE_FULL 0xffffffff News and mail pumping.
The pumping mode does not affect the operation of those methods, which request data directly from the server (such as IMTAdminAPI::UserRequest,
IMTAdminAPI::OrderRequest etc.). Such methods can be used in any pumping mode.
IMTAdminAPI::Connect
Connect to the trading platform.
C++
virtual MTAPIRES IMTAdminAPI::Connect(
LPCWSTR server, // Server address
UINT64 login, // Login
LPCWSTR password, // Password
LPCWSTR password_cert, // Certificate password
UINT64 pump_mode, // Pumping mode
UINT timeout=INFINITE // Timeout
)
.NET
MTRetCode CIMTAdminAPI.Connect(
sring server, // Server address
ulong login, // Login
string password, // Password
string password_cert, // Certificate password
CIMTAdminAPI.EnPumpModes pump_mode, // Pumping mode
uint timeout // Timeout
)
Python
AdminAPI.Connect(
str server, # Server address
int login, # Login
str password, # Password
AdminAPI.EnPumpModes pump_mode, # Pumping mode
int timeout # Timeout
)
Parameters
file:///C:/Users/Administrator/AppData/Local/Temp/~hh4BC4.htm 7/17/2025
Manager API Page 27 of 464
server
[in] Address and port of the Access server of the platform to which you are connecting. The values should be separated by a colon, for example: 192.168.0.1:443.
login
[in] The login of the manager for connection.
password
[in] The password of the manager for connection.
password_cert
[in] Certificate password. It is only used in the advanced server authentication mode. In this case, the certificate for the administrator account should be copied to [Manager
API data directory]\bases\[server name]\certificates\.
pump_mode
[in] The pumping mode, in which connection will be established. To pass the pumping mode, the IMTAdminAPI::EnPumpModes enumeration is used.
timeout=INFINITE
[in] Server connection timeout in milliseconds. If the application fails to connect to a server within this time, attempts will be terminated. By default there is no time limit.
Return Value
An indication of successful completion is the MT_RET_OK response code. Otherwise, a corresponding error code will be returned.
The IMTAdminAPI::Connect methods is synchronous; when connecting to the server local data bases (use of which depends on the enabled modes of pumping) are synchronized
with data bases of the server. After a successful connection, local data base will contain actual information.
The MT_RET_AUTH_RESET_PASSWORD response code means that the master password (IMTUser::USER_PASS_MAIN) of the account that is used to connect to the server must be
changed. In this case, change the password using the IMTAdminAPI::PasswordChange method and connect again with the new password.
To be able to use the IMTAdminAPI interface, a manager account that is used for connecting to the server must have the "Connect using MetaTrader 5 Administrator" permission
(IMTConManager::RIGHT_ADMIN).
Note
After establishing a connection to the server, Manager API will automatically keep it up. No additional actions are required to keep the connection up.
After a successful connection using the address specified in the 'server' parameter, the application can switch to a more suitable access point (if such points are configured for
the platform). The best access point is selected automatically based on server priority settings. An application can only reconnect to public access points. If you manually
connect to a hidden point (for example, for testing), and the application loses connection, it will not be able to reconnect to that point but will try to connect to public access
servers.
To obtain the events of databases synchronization with the On*Sync trade server (for example, IMTConGroupSink::OnGroupSync), subscribe to these events before calling the
IMTAdminAPI::Connect method.
IMTAdminAPI::Disconnect
Disconnect from the trading platform.
C++
virtual void IMTAdminAPI::Disconnect()
C++
void CIMTAdminAPI.Disconnect()
Python
AdminAPI.Disconnect()
IMTAdminAPI::Subscribe
Subscribe to common events of the IMTAdminAPI.
C++
MTAPIRES IMTAdminAPI::Subscribe(
IMTManagerSink* sink // A pointer to the IMTManagerSink object
)
.NET
MTRetCode CIMTAdminAPI.Subscribe(
CIMTManagerSink sink // CIMTManagerSink object
)
Parameters
sink
[in] A pointer to the object that implements the IMTManagerSink interface.
Return Value
An indication of successful completion is the MT_RET_OK response code. Otherwise, an error has occurred that corresponds to the response code.
Note
Subscribing to events is thread safe. One and the same interface IMTManagerSink cannot subscribe to an event twice - in this case the response code MT_RET_ERR_DUPLICATE is
returned.
The object at which sink points, must remain in the memory (must not be removed) until the call of IMTAdminAPI::Unsubscribe or until the administrator interface is deleted
using the IMTAdminAPI::Release method.
IMTAdminAPI::Unsubscribe
Unsubscribe from common events of the IMTAdminAPI.
file:///C:/Users/Administrator/AppData/Local/Temp/~hh4BC4.htm 7/17/2025
Manager API Page 28 of 464
C++
MTAPIRES IMTAdminAPI::Unsubscribe(
IMTManagerSink* sink // A pointer to the IMTManagerSink object
)
.NET
MTRetCode CIMTAdminAPI.Unsubscribe(
CIMTManagerSink sink // CIMTManagerSink object
)
Parameters
sink
[in] A pointer to the object that implements the IMTManagerSink interface.
Return Value
An indication of successful completion is the MT_RET_OK response code. Otherwise, an error code will be returned.
Note
This is a pair method to IMTAdminAPI::Subscribe. If an attempt is made to unsubscribe from the interface to which it has not subscribed, MT_RET_ERR_NOTFOUND error is
returned.
IMTAdminAPI::ProxySet
Set parameters of connection to the trading platform through a proxy server.
C++
void IMTAdminAPI::ProxySet(
const MTProxyInfo& proxy // Proxy server
)
.NET
void CIMTAdminAPI.ProxySet(
MTProxyInfo proxy // Proxy server
)
Parameters
proxy
[in] A reference to the MTProxyInfo structure that contains information about the parameters of connection via a proxy server.
Method Purpose
NetworkRescan Forced launch of scanning for access points and receiving the scanning results.
NetworkBytesSent Receive the number of bytes sent to the server via Manager API.
NetworkBytesRead Receive the number of bytes accepted from the server via Manager API.
NetworkServer Receive the name of the server Manager API is currently connected to.
NetworkAddress Receive IP address of the server Manager API is currently connected to.
IMTAdminAPI::NetworkRescan
Forced launch of scanning for access points and receiving the scanning results. Scanning includes obtaining a complete map of the network with the data on the access servers'
workload, as well as measuring ping to each access point. After obtaining the data, decision is made on whether the access point better than the current one is found.
C++
MTAPIRES IMTAdminAPI::NetworkRescan(
const UINT flags // Flags (for future use)
const UINT timeout // Timeout of waiting for scanning
)
.NET
MTRetCode CIMTAdminAPI.NetworkRescan(
uint flags // Flags (for future use)
uint timeout // Timeout of waiting for scanning
)
Python
AdminAPI.NetworkRescan(
int flags # Flags (for future use)
int timeout # Timeout of waiting for scanning
)
Parameters
flags
[in] Flags. This parameter is not used at the moment.
timeout
file:///C:/Users/Administrator/AppData/Local/Temp/~hh4BC4.htm 7/17/2025
Manager API Page 29 of 464
[in] Time to wait for the completion of scanning in milliseconds. If scanning is not finished within the specified time, the check for the best access point is performed
nonetheless. If it is present, the method returns MT_RET_OK value. In order to check the availability of the best access point without waiting, this method can be called with
timeout parameter equal to 0.
Return Value
The method reports on scanning results using the following response codes:
• MT_RET_OK - the best access point found. To connect to it, IMTAdminAPI::Disconnectmethod can be called. It is followed by IMTAdminAPI::Connect passing the name of
the server, connection to which is to be performed The server name can be received using IMTAdminAPI::NetworkServer method.
• MT_RET_NOTFOUND - the best access point not found.
• MT_RET_FREQUENT - too frequent requests. Requests can be made no more frequently than once per half an hour.
Note
In order to arrange selection of the best access point for connecting Manager API, the name of the server for connection instead of an IP address should be specified in
IMTAdminAPI::Connect method. The server name can be received using IMTAdminAPI::NetworkServer method.
IMTAdminAPI::NetworkBytesSent
Receive the number of bytes sent to the server via Manager API. All copies of IMTAdminAPI and IMTManagerAPI in the current process are considered.
C++
UINT64 IMTAdminAPI::NetworkBytesSent()
.NET
ulong CIMTAdminAPI.NetworkBytesSent()
Python
AdminAPI.NetworkBytesSent()
Return Value
Number of bytes sent to the server via Manager API. All copies of IMTAdminAPI and IMTManagerAPI in the current process are considered.
IMTAdminAPI::NetworkBytesRead
Receive the number of bytes accepted from the server via Manager API. All copies of IMTAdminAPI and IMTManagerAPI in the current process are considered.
C++
UINT64 IMTAdminAPI::NetworkBytesRead()
.NET
ulong CIMTAdminAPI.NetworkBytesRead()
Python
AdminAPI.NetworkBytesRead()
Return Value
Number of bytes accepted from the server via Manager API. All copies of IMTAdminAPI and IMTManagerAPI in the current process are considered.
IMTAdminAPI::NetworkServer
Receive the name of the server Manager API is currently connected to.
MTAPIRES IMTAdminAPI::NetworkServer(
MTAPISTR& server // server name
)
.NET
MTRetCode CIMTAdminAPI.NetworkServer(
out string server // server name
)
Python
AdminAPI.NetworkServer()
Parameters
server
[out] A reference to the name of the server Manager API is connected to.
Return Value
An indication of successful completion is the MT_RET_OK response code. Otherwise, an error code will be returned.
IMTAdminAPI::NetworkAddress
Receive IP address of the server Manager API is currently connected to.
file:///C:/Users/Administrator/AppData/Local/Temp/~hh4BC4.htm 7/17/2025
Manager API Page 30 of 464
C++
MTAPIRES IMTAdminAPI::NetworkAddress(
MTAPISTR& address // Server address
)
.NET
MTRetCode CIMTAdminAPI.NetworkAddress(
out sting address // Server address
)
Python
AdminAPI.NetworkAddress()
Parameters
address
[out] A reference to the IP address of the server Manager API is connected to.
Return Value
An indication of successful completion is the MT_RET_OK response code. Otherwise, an error code will be returned.
Server Management
This section describes functions for working with servers of the trading platform.
Function Purpose
ServerActivate Request activation of a trading platform license.
ServerLiveUpdate Start the update of the trading platform components.
IMTAdminAPI::ServerActivate
Request activation of a trading platform license.
C++
MTAPIRES IMTAdminAPI::ServerActivate()
.NET
MTRetCode CIMTAdminAPI.ServerActivate()
Python
AdminAPI.ServerActivate()
Return Value
An indication of successful completion is the MT_RET_OK response code. Otherwise, an error code will be returned.
Note
A non-activated license for the platform has a number of limitations (number of users, groups, trade operations, etc.).
The following actions are performed during activation:
IMTAdminAPI::ServerLiveUpdate
Start the update of the trading platform components.
C++
MTAPIRES IMTAdminAPI::ServerLiveUpdate()
.NET
MTRetCode CIMTAdminAPI.ServerLiveUpdate()
Python
AdminAPI.ServerLiveUpdate()
Return Value
An indication of successful completion is the MT_RET_OK response code. Otherwise, an error code will be returned.
Configuration Databases
file:///C:/Users/Administrator/AppData/Local/Temp/~hh4BC4.htm 7/17/2025
Manager API Page 31 of 464
The functions described in this section provide access to all settings of a trading platform. The allow receiving the current state of settings, changing them and handle events
associated with their change. Configuration databases are divided based on their purpose:
• Common
• Network
• Plugins
• Data Feeds
• Time
• Holidays
• Firewall
• Symbols
• Spreads
• Groups
• Floating Margin
• Managers
• History Synchronization
• Gateways
• Routing
• Reports
• Mail Servers
• Messengers
• Automation
• VPS
• KYC
• Subscriptions
Common Configuration
Use these functions to manage the common platform configuration, as well to subscribe and unsubscribe from events associated with it change.
The following functions are available:
Function Purpose
CommonCreate Create a common platform configuration object.
CommonCreateAllocation Create an account allocation configuration object.
CommonCreateAgreement Create an agreement object for an account allocation configuration.
CommonSubscribe Subscribe to events associated with the common configuration of the platform.
CommonUnsubscribe Unsubscribe from events associated with the common configuration of the platform.
CommonGet Get the common platform configuration.
CommonSet Set the common platform configuration.
IMTAdminAPI::CommonCreate
Create an object of the common platform configuration.
C++
IMTConCommon* IMTAdminAPI::CommonCreate()
.NET
CIMTConCommon CIMTAdminAPI.CommonCreate()
Return Value
It returns a pointer to the created object that implements the IMTConCommon interface. In case of failure, it returns NULL.
Note
The created object must be deleted by calling the IMTConCommon::Release method of this object.
IMTAdminAPI::CommonCreateAllocation
Create an account allocation configuration object.
C++
IMTConAccountAllocation* IMTAdminAPI::CommonCreateAllocation()
.NET
CIMTConAccountAllocation CIMTAdminAPI.CommonCreateAllocation()
Return Value
Returns a pointer to the created object that implements the IMTConAccountAllocation interface. On failure, NULL is returned.
Note
The created object must be destroyed by calling the IMTConAccountAllocation::Release method of this object.
file:///C:/Users/Administrator/AppData/Local/Temp/~hh4BC4.htm 7/17/2025
Manager API Page 32 of 464
IMTAdminAPI::CommonCreate
Create an agreement object for an account allocation configuration.
C++
IMTConAccountAgreement* IMTAdminAPI::CommonCreate()
.NET
CIMTConAccountAgreement CIMTAdminAPI.CommonCreate()
Return Value
Returns a pointer to the created object that implements the IMTConAccountAgreement interface. On failure, NULL is returned.
Note
The created object must be destroyed by calling the IMTConAccountAgreement::Release method of this object.
IMTAdminAPI::CommonSubscribe
Subscribe to events associated with the common configuration of the platform.
C++
MTAPIRES IMTAdminAPI::CommonSubscribe(
IMTConCommonSink* sink // A pointer to the IMTConCommonSink object
)
.NET
MTRetCode CIMTAdminAPI.CommonSubscribe(
CIMTConCommonSink sink // CIMTConCommonSink object
)
Python
AdminAPI.CommonSubscribe(
sink # IMTConCommonSink object
)
Parameters
sink
[in] A pointer to the object that implements the IMTConCommonSink interface.
Return Value
An indication of successful completion is the MT_RET_OK response code. Otherwise, an error has occurred that corresponds to the response code.
Note
Subscribing to events is thread safe. One and the same IMTConCommonSink interface cannot subscribe to an event twice - in this case the response code MT_RET_ERR_DUPLICATE
is returned.
To receive IMTConCommonSink::OnCommonSync events, subscribe before calling the IMTAdminAPI::Connect method.
The object at which sink points, must remain in the memory (must not be removed) until the call of IMTAdminAPI::CommonUnsubscribe or until the administrator interface is
deleted using the IMTAdminAPI::Release method.
IMTAdminAPI::CommonUnsubscribe
Unsubscribe from events associated with the common configuration of the platform.
C++
MTAPIRES IMTAdminAPI::CommonUnsubscribe(
IMTConCommonSink* sink // A pointer to the IMTConCommonSink object
)
.NET
MTRetCode CIMTAdminAPI.CommonUnsubscribe(
CIMTConCommonSink sink // CIMTConCommonSink object
)
Python
AdminAPI.CommonUnsubscribe(
sink # IMTConCommonSink object
)
Parameters
sink
[in] A pointer to the object that implements the IMTConCommonSink interface.
Return Value
An indication of successful completion is the MT_RET_OK response code. Otherwise, an error code will be returned.
Note
This is a pair method to IMTAdminAPI::CommonSubscribe. If an attempt is made to unsubscribe from the interface to which it has not subscribed, MT_RET_ERR_NOTFOUND error
is returned.
file:///C:/Users/Administrator/AppData/Local/Temp/~hh4BC4.htm 7/17/2025
Manager API Page 33 of 464
IMTAdminAPI::CommonGet
Gets the common platform configuration.
C++
MTAPIRES IMTAdminAPI::CommonGet(
IMTConCommon* common // IMTConCommon object
)
.NET
MTRetCode CIMTAdminAPI.CommonGet(
CIMTConCommon common // CIMTConCommon object
)
Python
AdminAPI.CommonGet()
Parameters
common
[out] An object of the common configuration. The object must first be created using the IMTAdminAPI::CommonCreate method.
Return Value
An indication of successful completion is the MT_RET_OK response code. Otherwise, an error code will be returned.
IMTAdminAPI::CommonSet
Sets the common platform configuration.
C++
MTAPIRES IMTAdminAPI::CommonSet(
const IMTConCommon* common // IMTConCommon object
)
.NET
MTRetCode CIMTAdminAPI.CommonSet(
CIMTConCommon common // CIMTConCommon object
)
Python
AdminAPI.CommonSet(
common # IMTConCommon object
)
Parameters
common
[in] An object of the common configuration.
Return Value
An indication of successful completion is the MT_RET_OK response code. Otherwise, an error code will be returned.
Network Configuration
The functions manage platform component configurations, as well subscribe to and unsubscribe from events associated with configuration changes.
To manage the configuration of components, the following functions are available:
Function Purpose
NetServerCreate Create an object of the network configuration.
NetServerRangeCreate Create an object of the range of orders, deals or accounts.
NetServerAddressRangeCreate Create an object of the range of IP addresses.
NetServerClusterStateCreate Create a network connection status object.
NetServerBackupFolderCreate Create an object describing the user directory to back up.
NetServerSubscribe Subscribe to events associated with the network configuration.
NetServerUnsubscribe Unsubscribe from events associated with the network configuration.
NetServerRestart Restart a server by an ID.
NetServerUpdate Add and update a server configuration.
NetServerUpdateBatch Add or edit multiple server configurations.
NetServerDelete Delete a server configuration by the index.
NetServerDeleteBatch Delete multiple server configurations.
NetServerShift Change the position of a server configuration in the list.
NetServerTotal The total number of server configurations available in the platform.
NetServerNext Get a server configuration by the index.
NetServerGet Get a server configuration by the ID.
file:///C:/Users/Administrator/AppData/Local/Temp/~hh4BC4.htm 7/17/2025
Manager API Page 34 of 464
Function Purpose
TLSCertificateUpdate Add or update an SSL certificate on access servers.
TLSCertificateDelete Delete an SSL certificate from access servers by position.
TLSCertificateShift Change the position of an SSL certificate in the list.
TLSCertificateTotal The total number of certificates installed for access servers.
TLSCertificateNext Get the data of a certificate installed for access servers, by index.
IMTAdminAPI::NetServerCreate
Create an object of configuration of the platform components.
C++
IMTConServer* IMTAdminAPI::NetServerCreate()
.NET
CIMTConServer CIMTAdminAPI.NetServerCreate()
Return Value
It returns a pointer to the created object that implements the IMTConServer interface. In case of failure, it returns Null.
Note
The created object must be deleted by calling the IMTConServer::Release method of this object.
IMTAdminAPI::NetServerRangeCreate
Create an object of the range of orders, deals or accounts.
C++
IMTConServerRange* IMTAdminAPI::NetServerRangeCreate()
.NET
CIMTConServerRange CIMTAdminAPI.NetServerRangeCreate()
Return Value
It returns a pointer to the created object that implements the IMTConServerRange interface. In case of failure, it returns Null.
Note
The created object must be deleted by calling the IMTConServerRange::Release method of this object.
IMTAdminAPI::NetServerAddressRangeCreate
Create an object of the range of IP addresses. These objects are used for configuring the Anti-DDoS Proxy Server component which enables the use of external Anti-DDoS service
providers.
C++
IMTConServerAddressRange* IMTAdminAPI::NetServerAddressRangeCreate()
.NET
CIMTConServerAddressRange CIMTAdminAPI.NetServerAddressRangeCreate()
Return Value
It returns a pointer to the created object that implements the IMTConServerAddressRange interface. In case of failure, it returns NULL.
Note
The created object must be destroyed by calling the IMTConServerAddressRange::Release method of this object.
IMTAdminAPI::NetServerClusterStateCreate
Create a network connection status object.
C++
IMTConClusterState* IMTAdminAPI::NetServerClusterStateCreate()
.NET
CIMTConClusterState CIMTAdminAPI.NetServerClusterStateCreate()
Return Value
Returns a pointer to the created object which implements the IMTConClusterState interface. Returns NULL on failure.
Note
The created object must be destroyed by calling the IMTConClusterState::Release method of this object.
file:///C:/Users/Administrator/AppData/Local/Temp/~hh4BC4.htm 7/17/2025
Manager API Page 35 of 464
IMTAdminAPI::NetServerBackupFolderCreate
Create an object describing the user directory to back up.
C++
IMTConBackupFolder* IMTAdminAPI::NetServerBackupFolderCreate()
.NET
CIMTConBackupFolder CIMTAdminAPI::NetServerBackupFolderCreate()
Return Value
Returns a pointer to the created object that implements the IMTConBackupFolder interface. Null is returned in case of failure.
Note
The created object must be destroyed by calling the IMTConBackupFolder::Release method of this object.
IMTAdminAPI::NetServerSubscribe
Subscribe to events associated with the configuration of the platform components.
C++
MTAPIRES IMTAdminAPI::NetServerSubscribe(
IMTConServerSink* sink // A pointer to the IMTConServerSink object
)
.NET
MTRetCode CIMTAdminAPI.NetServerSubscribe(
CIMTConServerSink sink // CIMTConServerSink object
)
Python
AdminAPI.NetServerSubscribe(
sink # IMTConServerSink object
)
Parameters
sink
[in] A pointer to the object that implements the IMTConServerSink interface.
Return Value
An indication of successful completion is the MT_RET_OK response code. Otherwise, an error has occurred that corresponds to the response code.
Note
Subscribing to events is thread safe. One and the same interface IMTConServerSink cannot subscribe to an event twice - in this case the response code MT_RET_ERR_DUPLICATE is
returned.
To receive IMTConServerSink::OnConServerSync events, subscribe before calling the IMTAdminAPI::Connect method.
The object at which sink points, must remain in the memory (must not be removed) until the call of IMTAdminAPI::NetServerUnsubscribe or until the administrator interface is
deleted using the IMTAdminAPI::Release method.
IMTAdminAPI::NetServerUnsubscribe
Unsubscribe from events associated with the configuration of the platform components.
C++
MTAPIRES IMTAdminAPI::NetServerUnsubscribe(
IMTConServerSink* sink // A pointer to the IMTConServerSink object
)
.NET
MTRetCode CIMTAdminAPI.NetServerUnsubscribe(
CIMTConServerSink sink // CIMTConServerSink object
)
Python
AdminAPI.NetServerUnsubscribe(
sink # IMTConServerSink object
)
Parameters
sink
[in] A pointer to the object that implements the IMTConServerSink interface.
Return Value
An indication of successful completion is the MT_RET_OK response code. Otherwise, an error code will be returned.
Note
This is a pair method to IMTAdminAPI::NetServerSubscribe. If an attempt is made to unsubscribe from the interface to which it has not subscribed, MT_RET_ERR_NOTFOUND error
is returned.
file:///C:/Users/Administrator/AppData/Local/Temp/~hh4BC4.htm 7/17/2025
Manager API Page 36 of 464
IMTAdminAPI::NetServerRestart
Restart a server by an ID.
C++
MTAPIRES IMTAdminAPI::NetServerRestart(
const UINT64 id // Server ID
)
.NET
MTRetCode CIMTAdminAPI.NetServerRestart(
ulong id // Server ID
)
Python
AdminAPI.NetServerRestart(
id # Server ID
)
Parameters
id
[in] The identifier of the server that should be restarted. The IMTConServer::Id value is used as the identifier.
Return Value
An indication of successful completion is the MT_RET_OK response code. Otherwise, an error code will be returned.
Note
Restart servers only on weekends and holidays or at night when the trading activity is minimal. Restarting the server may take several seconds (up to a minute), during this time
connection to the server is impossible.
IMTAdminAPI::NetServerUpdate
Add and update a server configuration.
C++
MTAPIRES IMTAdminAPI::NetServerUpdate(
IMTConServer* config // Server configuration object
)
.NET
MTRetCode CIMTAdminAPI.NetServerUpdate(
CIMTConServer config // Server configuration object
)
Python
AdminAPI.NetServerUpdate(
server # Server configuration object
)
Parameters
config
[in] The server configuration object.
Return Value
An indication of successful completion is the MT_RET_OK response code. Otherwise, an error code will be returned.
Note
A configuration can be added or updated only from the applications that run on the main server. For all other applications the response code MT_RET_ERR_NOTMAIN will be
returned.
Before adding, the correctness of the record is checked. If the record is incorrect, the error code MT_RET_ERR_PARAMS is returned.
IMTAdminAPI::NetServerUpdateBatch
Add or edit multiple server configurations.
C++
MTAPIRES IMTAdminAPI::NetServerUpdateBatch(
IMTConServer** configs, // An array of configurations
const UINT config_total, // The number of configurations in the array
MTAPIRES* results // An array of results
)
.NET
MTRetCode CIMTAdminAPI.NetServerUpdateBatch(
CIMTConServer[] configs, // An array of configurations
MTRetCode[] results // An array of results
)
Parameters
configs
[in] A pointer to an array of configurations which you want to add/update.
config_total
file:///C:/Users/Administrator/AppData/Local/Temp/~hh4BC4.htm 7/17/2025
Manager API Page 37 of 464
IMTAdminAPI::NetServerDelete
Delete a server configuration by the index.
C++
MTAPIRES IMTAdminAPI::NetServerDelete(
const UINT pos // Position of the configuration
)
.NET
MTRetCodes CIMTAdminAPI.NetServerDelete(
uint pos // Position of the configuration
)
Python
AdminAPI.NetServerDelete(
pos # Position of the configuration
)
Parameters
pos
[in] Position of the configuration, starting with 0.
Return Value
An indication of successful completion is the MT_RET_OK response code. Otherwise, an error code will be returned.
Note
A configuration can be deleted only from the applications that run on the main server. For all other applications the response code MT_RET_ERR_NOTMAIN will be returned. If the
object is not found, the response code MT_RET_ERR_NOTFOUND will be returned.
IMTAdminAPI::NetServerDeleteBatch
Delete multiple server configurations.
C++
MTAPIRES IMTAdminAPI::NetServerDeleteBatch(
IMTConServer** configs, // An array of configurations
const UINT config_total, // The number of configurations in the array
MTAPIRES* results // An array of results
)
.NET
MTRetCode CIMTAdminAPI.NetServerDeleteBatch(
CIMTConServer[] configs, // An array of configurations
MTRetCode[] results // An array of results
)
Parameters
configs
[in] A pointer to an array of configurations which you want to delete.
config_total
[in] The number of configurations in the 'configs' array.
results
[out] An array with the results of deletion of each configuration on the server.
Return Value
An indication of successful completion is the MT_RET_OK response code. Otherwise, an error code will be returned.
Further Note
A configuration can only be deleted from the applications that run on the main server. For all other applications, the response code MT_RET_ERR_NOTMAIN is returned. If the
object is not found, the MT_RET_ERR_PARAMS error code is added to the 'results' array of this object.
IMTAdminAPI::NetServerShift
Change the position of a server configuration in the list.
C++
file:///C:/Users/Administrator/AppData/Local/Temp/~hh4BC4.htm 7/17/2025
Manager API Page 38 of 464
MTAPIRES IMTAdminAPI::NetServerShift(
const UINT pos, // Position of the configuration
const int shift // Shift
)
.NET
MTRetCode CIMTAdminAPI.NetServerShift(
uint pos, // Position of the configuration
int shift // Shift
)
Python
AdminAPI.NetServerShift(
pos, # Position of the configuration
shift # Shift
)
Parameters
pos
[in] Position of the configuration, starting with 0.
shift
[in] Shift of the configuration relative to its current position. A negative value means the shift to the top of the list, a positive value - to its end.
Return Value
An indication of successful completion is the MT_RET_OK response code. Otherwise, an error code will be returned.
Note
The position of a configuration can be changed only from the applications that run on the main server. For all other applications the response code MT_RET_ERR_NOTMAIN will be
returned.
IMTAdminAPI::NetServerTotal
The total number of server configurations available in the platform.
C++
UINT IMTAdminAPI::NetServerTotal()
.NET
uint CIMTAdminAPI.NetServerTotal()
Python
AdminAPI.NetServerTotal()
Return Value
The number of server configurations in the trading platform.
IMTAdminAPI::NetServerNext
Get a server configuration by the index.
C++
MTAPIRES IMTAdminAPI::NetServerNext(
const UINT pos, // Position of the configuration
IMTConServer* config // Configuration object
)
.NET
MTRetCode CIMTAdminAPI.NetServerNext(
uint pos, // Position of the configuration
CIMTConServer config // Configuration object
)
Python
AdminAPI.NetServerNext(
pos # Position of the configuration
)
Parameters
pos
[in] Position of the configuration, starting with 0.
config
[out] The server configuration object. The config object must first be created using the IMTAdminAPI::NetServerCreate method.
Return Value
An indication of successful completion is the MT_RET_OK response code. Otherwise, an error code will be returned.
Note
This method copies the configuration data of a server with a specified index to the config object.
file:///C:/Users/Administrator/AppData/Local/Temp/~hh4BC4.htm 7/17/2025
Manager API Page 39 of 464
IMTAdminAPI::NetServerGet
Get a server configuration by the ID.
C++
MTAPIRES IMTAdminAPI::NetServerGet(
const UINT64 id, // ID
IMTConServer* config // Comment
)
.NET
MTRetCode CIMTAdminAPI.NetServerGet(
ulong id, // ID
CIMTConServer config // Comment
)
Python
AdminAPI.NetServerGet(
id # ID
)
Parameters
id
[in] Server ID.
config
[out] The server configuration object. The config object must first be created using the IMTAdminAPI::NetServerCreate method.
Return Value
An indication of successful completion is the MT_RET_OK response code. Otherwise, an error code will be returned.
Note
The IMTConServer::Id() value is used as the ID.
IMTAdminAPI::TLSCertificateUpdate
Add or update an SSL certificate on access servers.
C++
MTAPIRES IMTAdminAPI::TLSCertificateUpdate(
const void* pfx_certificate, // Certificate
const UINT pfx_certificate_size, // Certificate size
LPCWSTR password // Certificate password
)
.NET
MTRetCode CIMTAdminAPI::TLSCertificateUpdate(
byte[] pfx_certificate, // Certificate
string password // Certificate password
)
Parameters
pfx_certificate
[in] A pointer to a file containing a certificate with a private key. If the file contains multiple certificates (for example a chain), only the first of them will be installed.
pfx_certificate_size
[in] Certificate size in bytes.
password
[in] The certificate cane be protected by a password. In this case, pass it in the 'password' parameter. Otherwise the certificate will not be installed and the method will return
the MT_RET_AUTH_CERTIFICATE_BAD error.
Return Value
An indication of successful completion is the MT_RET_OK response code. Otherwise, an error code will be returned.
Note
When you call the method, the existence of the certificate to be added is checked. If it exists, the certificate is updated. Otherwise a new certificate is installed. The check is
based on the "Thumbprint" certificate field.
A certificate can only be added or updated from the applications that run on the main server. For all other plugins, the response code MT_RET_ERR_NOTMAIN will be returned.
The certificate is installed for all access servers within the cluster.
Certificates are required for connection to access servers using the HTTPS protocol. This enables sending of Web API commands to a server as ordinary GET and POST requests.
For details please visit the "Requests via HTTPS" section.
IMTAdminAPI::TLSCertificateDelete
Delete an SSL certificate from access servers by position.
C++
MTAPIRES IMTAdminAPI::TLSCertificateDelete(
const UINT pos // Certificate position
)
.NET
file:///C:/Users/Administrator/AppData/Local/Temp/~hh4BC4.htm 7/17/2025
Manager API Page 40 of 464
MTRetCode CIMTAdminAPI::TLSCertificateDelete(
uint pos // Certificate position
)
Parameters
pos
[in] Certificate position starting with 0.
Return Value
An indication of successful completion is the MT_RET_OK response code. Otherwise, an error code will be returned.
Note
Certificates can only be deleted from applications running on the main server. For all other plugins, the response code MT_RET_ERR_NOTMAIN will be returned.
Certificates are required for connection to access servers using the HTTPS protocol. This enables sending of Web API commands to a server as ordinary GET and POST requests.
For details please visit the "Requests via HTTPS" section.
IMTAdminAPI::TLSCertificateShift
Change the position of an SSL certificate in the list.
C++
MTAPIRES IMTAdminAPI::TLSCertificateShift(
const UINT pos, // Certificate position
const int shift // Shift
)
.NET
MTRetCode CIMTAdminAPI::TLSCertificateShift(
uint pos, // Certificate position
int shift // Shift
)
Parameters
pos
[in] Certificate position starting with 0.
shift
[in] Shift of the certificate relative to the current position. A negative value means shift towards the top of the list, a positive value shifts towards the end.
Return Value
An indication of successful completion is the MT_RET_OK response code. Otherwise, an error code will be returned.
Note
The certificate position can only be changed from the applications running on the main server. For all other plugins, the response code MT_RET_ERR_NOTMAIN will be returned.
Certificates are required for connection to access servers using the HTTPS protocol. This enables sending of Web API commands to a server as ordinary GET and POST requests.
For details please visit the "Requests via HTTPS" section.
IMTAdminAPI::TLSCertificateTotal
The total number of certificates installed for access servers.
C++
UINT IMTAdminAPI::TLSCertificateTotal()
.NET
uint CIMTAdminAPI::TLSCertificateTotal()
Return Value
The number of installed certificates.
Note
Certificates are required for connection to access servers using the HTTPS protocol. This enables sending of Web API commands to a server as ordinary GET and POST requests.
For details please visit the "Requests via HTTPS" section.
IMTAdminAPI::TLSCertificateNext
Get the data of a certificate installed for access servers, by index.
C++
MTAPIRES IMTAdminAPI::TLSCertificateNext(
const UINT pos, // Certificate position
MTAPISTR& name, // Name
MTAPISTR& thumbprint // Thumbprint
)
.NET
MTRetCode CIMTAdminAPI::TLSCertificateNext(
uint pos, // Certificate position
0 out string name, // Name
out string thumbprint // Thumbprint
)
file:///C:/Users/Administrator/AppData/Local/Temp/~hh4BC4.htm 7/17/2025
Manager API Page 41 of 464
pos
[in] Certificate position starting with 0.
name
[out] certificate name. Here the "Common Name" certificate field is passed. In this field, the domain for which the certificate is issued, is indicated.
thumbprint
[out] Certificate thumbprint — the "Thumbprint" field.
Return Value
An indication of successful completion is the MT_RET_OK response code. Otherwise, an error code will be returned.
Note
Certificates are required for connection to access servers using the HTTPS protocol. This enables sending of Web API commands to a server as ordinary GET and POST requests.
For details please visit the "Requests via HTTPS" section.
Configuration of Plugins
Functions allow managing plugin configurations, as well subscribe and unsubscribe from events associated with their change.
The following functions for managing plugins are available:
Function Purpose
PluginCreate Create an object of the plugin configuration.
PluginModuleCreate Create an object of the plugin module configuration.
PluginParamCreate Create an object of the plugin parameter.
PluginSubscribe Subscribe to events associated with the configuration of plugins.
PluginUnsubscribe Unsubscribe from events associated with the configuration of plugins.
PluginUpdate Add and update a plugin configuration.
PluginUpdateBatch Add or edit multiple plugin configurations.
PluginDelete Delete a plugin configuration by the name or index.
PluginDeleteBatch Delete multiple plugin configurations.
PluginShift Changes the position of a plugin configuration in the list.
PluginTotal The total number of plugin configurations available in the platform.
PluginNext Get the plugin configuration by the index.
PluginGet Get the plugin configuration by the name.
PluginModuleTotal The total number of configurations of plugin modules (DLL files) available in the platform.
PluginModuleNext Get a plugin module by the index.
PluginModuleGet Get the plugin module configuration by the name.
When working via the manager interface (IMTManagerAPI) the application only has access to the plugins, in which the "Configurable by managers" option is enabled
(IMTConPlugin::PLUGIN_FLAG_MAN_CONFIG). In addition:
• When connecting to the main trade server, the application only has access to the plugins, which are installed on the same server or on the history server
(IMTConPlugin::Server).
• When connecting to a regular trading server, the application can only access the plugins which are installed in the same server.
During operation via the administrator interface (IMTAdminAPI), the following plugins are available to the application:
• When connected to the main trade server: all plugins within the platform.
• When connected to a regular trading server: all plugins installed in the same server or on the history server.
In order to be able to manage plugin configurations, the IMTConManager::RIGHT_CFG_PLUGINS permission must be enabled for the manager account which is used by the
Manager API application.
IMTAdminAPI::PluginCreate
Create an object of the plugin configuration.
C++
IMTConPlugin* IMTAdminAPI::PluginCreate()
.NET
CIMTConPlugin CIMTAdminAPI.PluginCreate()
Return Value
It returns a pointer to the created object that implements the IMTConPlugin interface. In case of failure, it returns NULL.
Note
The created object must be deleted by calling the IMTConPlugin::Release method of this object.
IMTAdminAPI::PluginModuleCreate
file:///C:/Users/Administrator/AppData/Local/Temp/~hh4BC4.htm 7/17/2025
Manager API Page 42 of 464
.NET
CIMTConPluginModule CIMTAdminAPI.PluginModuleCreate()
Return Value
It returns a pointer to the created object that implements the IMTConPluginModule interface. In case of failure, it returns NULL.
Note
The created object must be deleted by calling the IMTConPluginModule::Release of this object.
IMTAdminAPI::PluginParamCreate
Create an object of the plugin parameter.
C++
IMTConParam* IMTAdminAPI::PluginParamCreate()
.NET
CIMTConParam CIMTAdminAPI.PluginParamCreate()
Return Value
It returns a pointer to the created object that implements the IMTConParam interface. In case of failure, it returns NULL.
Note
The created object must be destroyed by calling the IMTConParam::Release method of this object.
IMTAdminAPI::PluginSubscribe
Subscribe to events associated with the configuration of plugins.
C++
MTAPIRES IMTAdminAPI::PluginSubscribe(
IMTConPluginSink* sink // A pointer to the IMTConPluginSink object
)
.NET
MTRetCode CIMTAdminAPI.PluginSubscribe(
CIMTConPluginSink sink // CIMTConPluginSink object
)
Python
AdminAPI.PluginSubscribe(
sink # IMTConPluginSink object
)
Parameters
sink
[in] A pointer to the object that implements the IMTConPluginSink interface.
Return Value
An indication of successful completion is the MT_RET_OK response code. Otherwise, an error has occurred that corresponds to the response code.
Note
Subscribing to events is thread safe. One and the same interface IMTConPluginSink cannot subscribe to an event twice - in this case the response code MT_RET_ERR_DUPLICATE is
returned.
To receive IMTConPluginSink::OnPluginSync events, subscribe before calling the IMTAdminAPI::Connect method.
The object at which sink points, must remain in the memory (must not be removed) until the call of IMTAdminAPI::PluginUnsubscribe or until the administrator interface is
deleted using the IMTAdminAPI::Release method.
IMTAdminAPI::PluginUnsubscribe
Unsubscribe from events associated with the configuration of plugins.
C++
MTAPIRES IMTAdminAPI::PluginUnsubscribe(
IMTConPluginSink* sink // A pointer to the IMTConPluginSink object
)
.NET
MTRetCode CIMTAdminAPI.PluginUnsubscribe(
CIMTConPluginSink sink // CIMTConPluginSink object
)
Python
file:///C:/Users/Administrator/AppData/Local/Temp/~hh4BC4.htm 7/17/2025
Manager API Page 43 of 464
AdminAPI.PluginUnsubscribe(
sink # IMTConPluginSink object
)
Parameters
sink
[in] A pointer to the object that implements the IMTConPluginSink interface.
Return Value
An indication of successful completion is the MT_RET_OK response code. Otherwise, an error code will be returned.
Note
This is a pair method to IMTAdminAPI::PluginSubscribe. If an attempt is made to unsubscribe from the interface to which it has not subscribed, MT_RET_ERR_NOTFOUND error is
returned.
IMTAdminAPI::PluginUpdate
Add and update a plugin configuration.
C++
MTAPIRES IMTAdminAPI::PluginUpdate(
IMTConPlugin* plugin // An object of a plugin configuration
)
.NET
MTRetCode CIMTAdminAPI.PluginUpdate(
CIMTConPlugin plugin // An object of a plugin configuration
)
Python
AdminAPI.PluginUpdate(
plugin # An object of a plugin configuration
)
Parameters
plugin
[in] An object of plugin configuration.
Return Value
An indication of successful completion is the MT_RET_OK response code. Otherwise, an error code will be returned.
Note
A configuration can be added or updated only from the applications that run on the main server. For all other applications the response code MT_RET_ERR_NOTMAIN will be
returned.
Before adding, the correctness of the record is checked. If the record is incorrect, the error code MT_RET_ERR_PARAMS is returned.
IMTAdminAPI::PluginUpdateBatch
Add or edit multiple plugin configurations.
C++
MTAPIRES IMTAdminAPI::PluginUpdateBatch(
IMTConPlugin** configs, // An array of configurations
const UINT config_total, // The number of configurations in the array
MTAPIRES* results // An array of results
)
.NET
MTRetCode CIMTAdminAPI.PluginUpdateBatch(
CIMTConPlugin[] configs, // An array of configurations
MTRetCode[] results // An array of results
)
Python
AdminAPI.PluginUpdateBatch(
plugins # An array of configurations
)
Parameters
configs
[in] A pointer to an array of configurations which you want to add/update.
config_total
[in] The number of configurations in the 'configs' array.
results
[out] An array with the results of applying of each configuration change on the server.
Return Value
An indication of successful completion is the MT_RET_OK response code. Otherwise, an error code is returned. The MT_RET_OK response code is an indication of successful
sending of changes to a server; results of applying the changes are passed in the 'results' parameter.
Further Note
A configuration can only be added or updated from the applications that run on the main server. For all other applications, the response code MT_RET_ERR_NOTMAIN is returned.
Before adding an entry, its correctness is checked. If an entry is incorrect, the MT_RET_ERR_PARAMS error code is added to the 'results' array of this entry.
file:///C:/Users/Administrator/AppData/Local/Temp/~hh4BC4.htm 7/17/2025
Manager API Page 44 of 464
IMTAdminAPI::PluginDelete
Delete a plugin configuration by the name.
C++
MTAPIRES IMTAdminAPI::PluginDelete(
const UINT64 server_id, // Server ID
LPCWSTR name // Plugin configuration name
)
.NET
MTRetCode CIMTAdminAPI.PluginDelete(
ulong server_id, // Server ID
string name // Plugin configuration name
)
Python
AdminAPI.PluginDelete(
server_id, # Server ID
name # Plugin configuration name
)
Parameters
server_id
[in] The identifier of the server for which we delete the plugin configuration. The IMTConServer::Id value is used as the identifier.
name
[in] Name of the plugin configuration. The IMTConPlugin::Name value is used as the name.
Return Value
An indication of successful completion is the MT_RET_OK response code. Otherwise, an error code will be returned.
Note
A configuration can be deleted only when connecting to the main server. In all other cases the response code MT_RET_ERR_NOTMAIN will be returned. If the object is not found,
the response code MT_RET_ERR_NOTFOUND will be returned.
IMTAdminAPI::PluginDelete
Deleting a plugin configuration by the index.
C++
MTAPIRES IMTAdminAPI::PluginDelete(
const UINT pos // Position of the configuration
)
.NET
MTRetCode CIMTAdminAPI.PluginDelete(
uint pos // Position of the configuration
)
Python
AdminAPI.PluginDelete(
pos # Position of the configuration
)
Parameters
pos
[in] Position of the configuration, starting with 0.
Return Value
An indication of successful completion is the MT_RET_OK response code. Otherwise, an error code will be returned.
Note
A configuration can be deleted only from the applications that run on the main server. For all other applications the response code MT_RET_ERR_NOTMAIN will be returned. If the
object is not found, the response code MT_RET_ERR_NOTFOUND will be returned.
IMTAdminAPI::PluginDelete
Delete multiple plugin configurations.
C++
MTAPIRES IMTAdminAPI::PluginDeleteBatch(
IMTConPlugin** configs, // An array of configurations
const UINT config_total, // The number of configurations in the array
MTAPIRES* results // An array of results
)
.NET
MTRetCode CIMTAdminAPI.PluginDeleteBatch(
CIMTConPlugin[] configs, // An array of configurations
MTRetCode[] results // An array of results
)
Python
file:///C:/Users/Administrator/AppData/Local/Temp/~hh4BC4.htm 7/17/2025
Manager API Page 45 of 464
AdminAPI.PluginDeleteBatch(
plugins # An array of configurations
)
Parameters
configs
[in] A pointer to an array of configurations which you want to delete.
config_total
[in] The number of configurations in the 'configs' array.
results
[out] An array with the results of deletion of each configuration on the server.
Return Value
An indication of successful completion is the MT_RET_OK response code. Otherwise, an error code is returned. The MT_RET_OK response code is an indication of successful
sending of changes to a server; results of applying the changes are passed in the 'results' parameter.
Further Note
Configurations can only be deleted when connected to the main trade server. In all other cases, the MT_RET_ERR_NOTMAIN response code is returned. If the object is not found,
the MT_RET_ERR_PARAMS error code is added to the 'results' array of this object.
IMTAdminAPI::PluginShift
Changes the position of a plugin configuration in the list.
C++
MTAPIRES IMTAdminAPI::PluginShift(
const UINT pos, // Position of the configuration
const int shift // Shift
)
.NET
MTRetCode CIMTAdminAPI.PluginShift(
uint pos, // Position of the configuration
int shift // Shift
)
Python
AdminAPI.PluginShift(
pos, # Position of the configuration
shift # Shift
)
Parameters
pos
[in] Position of the configuration, starting with 0.
shift
[in] Shift of the configuration relative to its current position. A negative value means the shift to the top of the list, a positive value - to its end.
Return Value
An indication of successful completion is the MT_RET_OK response code. Otherwise, an error code will be returned.
Note
The position of a configuration can be changed only from the applications that run on the main server. For all other applications the response code MT_RET_ERR_NOTMAIN will be
returned.
IMTAdminAPI::PluginTotal
The total number of plugin configurations available in the platform.
C++
UINT IMTAdminAPI::PluginTotal()
.NET
uint CIMTAdminAPI.PluginTotal()
Python
AdminAPI.PluginTotal()
Return Value
The number of plugin configurations in the trading platform.
IMTAdminAPI::PluginNext
Get the plugin configuration by the index.
C++
file:///C:/Users/Administrator/AppData/Local/Temp/~hh4BC4.htm 7/17/2025
Manager API Page 46 of 464
MTAPIRES IMTAdminAPI::PluginNext(
const UINT pos, // Position of the configuration
IMTConPlugin* plugin // An object of a plugin configuration
)
.NET
MTRetCode CIMTAdminAPI.PluginNext(
uint pos, // Position of the configuration
CIMTConPlugin plugin // An object of a plugin configuration
)
Python
AdminAPI.PluginNext(
pos # Position of the configuration
)
Parameters
pos
[in] Position of the configuration, starting with 0.
plugin
[out] An object of plugin configuration. The plugin object must be first created using the IMTAdminAPI::PluginCreate method.
Return Value
An indication of successful completion is the MT_RET_OK response code. Otherwise, an error code will be returned.
Note
This method copies the configuration data of a plugin with a specified index to the plugin object.
IMTAdminAPI::PluginGet
Get the plugin configuration by the name.
C++
MTAPIRES IMTAdminAPI::PluginGet(
const UINT64 server_id, // Server ID
LPCWSTR name, // Plugin configuration name
IMTConPlugin* plugin // An object of a plugin configuration
)
.NET
MTRetCode CIMTAdminAPI.PluginGet(
ulong server_id, // Server ID
string name, // Plugin configuration name
CIMTConPlugin plugin // An object of a plugin configuration
)
Python
AdminAPI.PluginGet(
server_id, # Server ID
name # Plugin configuration name
)
Parameters
server_id
[in] The identifier of the server for which we get the plugin configuration. The IMTConServer::Id value is used as the identifier.
name
[in] Name of the plugin configuration. The IMTConPlugin::Name value is used as the name.
plugin
[out] An object of plugin configuration. The object must first be created using the IMTAdminAPI::PluginCreate method.
Return Value
An indication of successful completion is the MT_RET_OK response code. Otherwise, an error code will be returned.
Note
This method copies parameters of the specified plugin configuration to the plugin object.
IMTAdminAPI::PluginModuleTotal
The total number of configurations of plugin modules available in the platform.
C++
UINT IMTAdminAPI::PluginModuleTotal()
.NET
uint CIMTAdminAPI.PluginModuleTotal()
Python
AdminAPI.PluginModuleTotal()
Return Value
The number of configurations of plugin modules in the trading platform.
file:///C:/Users/Administrator/AppData/Local/Temp/~hh4BC4.htm 7/17/2025
Manager API Page 47 of 464
IMTAdminAPI::PluginModuleNext
Get a plugin module by the index.
C++
MTAPIRES IMTAdminAPI::PluginModuleNext(
const UINT pos, // Position of the configuration
IMTConPluginModule* module // An object of the plugin module configuration
)
.NET
MTRetCode CIMTAdminAPI.PluginModuleNext(
uint pos, // Position of the configuration
CIMTConPluginModule module // An object of the plugin module configuration
)
Python
AdminAPI.PluginModuleNext(
pos # Position of the configuration
)
Parameters
pos
[in] Position of the configuration, starting with 0.
module
[out] The plugin module configuration object. The module object must be first created using the IMTAdminAPI::PluginModuleCreate method.
Return Value
An indication of successful completion is the MT_RET_OK response code. Otherwise, an error code will be returned.
Note
This method copies a plugin configuration with a specified index to the module object.
IMTAdminAPI::PluginModuleGet
Get the plugin module configuration by the name.
C++
MTAPIRES IMTAdminAPI::PluginModuleGet(
const UINT64 server_id, // Plugin ID
LPCWSTR name, // The name of the plugin module
IMTConPluginModule* module // An object of a plugin configuration
)
.NET
MTRetCode CIMTAdminAPI.PluginModuleGet(
ulong server_id, // Plugin ID
string name, // The name of the plugin module
CIMTConPluginModule module // An object of a plugin configuration
)
Python
AdminAPI.PluginModuleGet(
server_id, # Plugin ID
name # The name of the plugin module
)
Parameters
server_id
[in] The identifier of the server for which we get the plugin module configuration. The IMTConServer::Id value is used as the identifier.
name
[in] Name of the plugin module. The IMTConPluginModule::Module() value is used as the name..
module
[out] The plugin module configuration object. The module object must be first created using the IMTAdminAPI::PluginModuleCreate method.
Return Value
An indication of successful completion is the MT_RET_OK response code. Otherwise, an error code will be returned.
Function Purpose
FeederCreate Create an object of the data feed configuration.
FeederModuleCreate Create an object of configuration of the data feed module.
FeederParamCreate Create an object of the parameter of the data feeds.
FeederTranslateCreate Create an object of setup of converting the information transmitted from a data feed.
file:///C:/Users/Administrator/AppData/Local/Temp/~hh4BC4.htm 7/17/2025
Manager API Page 48 of 464
Function Purpose
FeederSubscribe Subscribe to events associated with the configuration of data feeds.
FeederUnsubscribe Unsubscribe from events associated with the configuration of data feeds.
FeederRestart Restart data feeds.
FeederUpdate Add and update a data feed configuration.
FeederUpdateBatch Add and edit multiple data feed configurations.
FeederDelete Delete a data feed configuration by name and by index
FeederDeleteBatch Delete multiple data feed configurations.
FeederShift Change the position of the data feed configuration in the list.
FeederTotal The total number of data feed configurations available in the platform.
FeederNext Gets a data feed configuration based on its index.
FeederGet Gets the data feed configuration based on its name.
FeederModuleTotal The total number of configurations of data feed modules (EXE files) available in the platform.
FeederModuleNext Get the configuration of the data feed module by the index.
FeederModuleGet Get the configuration of the data feed module by the name.
IMTAdminAPI::FeederCreate
Create an object of the data feed configuration.
C++
IMTConFeeder* IMTAdminAPI::FeederCreate()
.NET
CIMTConFeeder CIMTAdminAPI.FeederCreate()
Return Value
It returns a pointer to the created object that implements the IMTConFeeder interface. In case of failure, it returns NULL.
Note
The created object must be destroyed by calling the IMTConFeeder::Release method of this object.
IMTAdminAPI::FeederModuleCreate
Create an object of configuration of the data feed module.
C++
IMTConFeederModule* IMTAdminAPI::FeederModuleCreate()
.NET
CIMTConFeederModule CIMTAdminAPI.FeederModuleCreate()
Return Value
It returns a pointer to the created object that implements the IMTConFeederModule interface. In case of failure, it returns NULL.
Note
The created object must be deleted by calling the IMTConFeederModule::Release method of this object.
IMTAdminAPI::FeederParamCreate
Create an object of the parameter of the data feeds.
C++
IMTConParam* IMTAdminAPI::FeederParamCreate()
.NET
CIMTConParam CIMTAdminAPI.FeederParamCreate()
Return Value
It returns a pointer to the created object that implements the IMTConParam interface. In case of failure, it returns NULL.
Note
The created object must be destroyed by calling the IMTConParam::Release method of this object.
file:///C:/Users/Administrator/AppData/Local/Temp/~hh4BC4.htm 7/17/2025
Manager API Page 49 of 464
IMTAdminAPI::FeederTranslateCreate
Create an object of setup of converting the information transmitted from a data feed.
C++
IMTConFeederTranslate* IMTAdminAPI::FeederTranslateCreate()
.NET
CIMTConFeederTranslate CIMTAdminAPI.FeederTranslateCreate()
Return Value
It returns a pointer to the created object that implements the IMTConFeederTranslate interface. In case of failure, it returns NULL.
Note
The created object must be destroyed by calling the IMTConFeederTranslate::Release method of this object.
IMTAdminAPI::FeederSubscribe
Subscribe to events associated with the configuration of data feeds.
C++
MTAPIRES IMTAdminAPI::FeederSubscribe(
IMTConFeederSink* sink // A pointer to the IMTConFeederSink object
)
.NET
MTRetCode CIMTAdminAPI.FeederSubscribe(
CIMTConFeederSink sink // CIMTConFeederSink object
)
Python
AdminAPI.FeederSubscribe(
sink # IMTConFeederSink object
)
Parameters
sink
[in] A pointer to the object that implements the IMTConFeederSink interface.
Return Value
An indication of successful completion is the MT_RET_OK response code. Otherwise, an error has occurred that corresponds to the response code.
Note
Subscribing to events is thread safe. One and the same interface IMTConFeederSink cannot subscribe to an event twice - in this case the response code MT_RET_ERR_DUPLICATE
is returned.
To receive IMTConFeederSink::OnFeederSync events, subscribe before calling the IMTAdminAPI::Connect method.
The object at which sink points, must remain in the memory (must not be removed) until the call of IMTAdminAPI::FeederUnsubscribe or until the administrator interface is
deleted using the IMTAdminAPI::Release method.
IMTAdminAPI::FeederUnsubscribe
Unsubscribe from events associated with the configuration of data feeds.
C++
MTAPIRES IMTAdminAPI::FeederUnsubscribe(
IMTConFeederSink* sink // A pointer to the IMTConFeederSink object
)
.NET
MTRetCode CIMTAdminAPI.FeederUnsubscribe(
CIMTConFeederSink sink // CIMTConFeederSink object
)
Python
AdminAPI.FeederUnsubscribe(
sink # IMTConFeederSink object
)
Parameters
sink
[in] A pointer to the object that implements the IMTConFeederSink interface.
Return Value
An indication of successful completion is the MT_RET_OK response code. Otherwise, an error code will be returned.
Note
This is a pair method to IMTAdminAPI::FeederSubscribe. If an attempt is made to unsubscribe from the interface to which it has not subscribed, MT_RET_ERR_NOTFOUND error is
returned.
file:///C:/Users/Administrator/AppData/Local/Temp/~hh4BC4.htm 7/17/2025
Manager API Page 50 of 464
IMTAdminAPI::FeederRestart
Restart data feeds.
C++
MTAPIRES IMTAdminAPI::FeederRestart()
.NET
MTRetCode CIMTAdminAPI.FeederRestart()
Python
AdminAPI.FeederRestart()
Return Value
An indication of successful completion is the MT_RET_OK response code. Otherwise, an error code will be returned.
Note
This command restarts all data feeds.
IMTAdminAPI::FeederUpdate
Add and update a data feed configuration.
C++
MTAPIRES IMTAdminAPI::FeederUpdate(
IMTConFeeder* feeder // The object of data feed configuration
)
.NET
MTRetCode CIMTAdminAPI.FeederUpdate(
CIMTConFeeder feeder // The object of data feed configuration
)
Python
AdminAPI.FeederUpdate(
feeder # The object of data feed configuration
)
Parameters
feeder
[in] The object of data feed configuration.
Return Value
An indication of successful completion is the MT_RET_OK response code. Otherwise, an error code will be returned.
Note
A configuration can be added or updated only from the applications that run on the main server. For all other applications the response code MT_RET_ERR_NOTMAIN will be
returned.
Before adding, the correctness of the record is checked. If the record is incorrect, the error code MT_RET_ERR_PARAMS is returned.
IMTAdminAPI::FeederUpdateBatch
Add and edit multiple data feed configurations.
C++
MTAPIRES IMTAdminAPI::FeederUpdateBatch(
IMTConFeeder** configs, // An array of configurations
const UINT config_total, // The number of configurations in the array
MTAPIRES* results // An array of results
)
.NET
MTRetCode CIMTAdminAPI.FeederUpdateBatch(
CIMTConFeeder[] configs, // An array of configurations
MTRetCode[] results // An array of results
)
Python
AdminAPI.FeederUpdateBatch(
feeders # An array of configurations
)
Parameters
configs
[in] A pointer to an array of configurations which you want to add/update.
config_total
[in] The number of configurations in the 'configs' array.
results
[out] An array with the results of applying of each configuration change on the server.
Return Value
file:///C:/Users/Administrator/AppData/Local/Temp/~hh4BC4.htm 7/17/2025
Manager API Page 51 of 464
An indication of successful completion is the MT_RET_OK response code. Otherwise, an error code is returned. The MT_RET_OK response code is an indication of successful
sending of changes to a server; results of applying the changes are passed in the 'results' parameter.
Further Note
A configuration can only be added or updated from the applications that run on the main server. For all other applications, the response code MT_RET_ERR_NOTMAIN is returned.
Before adding an entry, its correctness is checked. If an entry is incorrect, the MT_RET_ERR_PARAMS error code is added to the 'results' array of this entry.
IMTAdminAPI::FeederDelete
Delete a configuration of a data feed by its name.
C++
MTAPIRES IMTAdminAPI::FeederDelete(
LPCWSTR name // Name of the configuration
)
.NET
MTRetCode CIMTAdminAPI.FeederDelete(
string name // Name of the configuration
)
Python
AdminAPI.FeederDelete(
name # Name of the configuration
)
Parameters
name
[in] The name of the configuration to delete.
Return Value
An indication of successful completion is the MT_RET_OK response code. Otherwise, an error code will be returned.
Note
A configuration can be deleted only from the applications that run on the main server. For all other applications the response code MT_RET_ERR_NOTMAIN will be returned. If the
object is not found, the response code MT_RET_ERR_NOTFOUND will be returned.
IMTAdminAPI::FeederDelete
Delete a configuration of a data feed by its index.
C++
MTAPIRES IMTAdminAPI::FeederDelete(
const UINT pos // Position of the configuration
)
.NET
MTRetCode CIMTAdminAPI.FeederDelete(
uint pos // Position of the configuration
)
Python
AdminAPI.FeederDelete(
pos # Position of the configuration
)
Parameters
pos
[in] Position of the configuration, starting with 0.
Return Value
An indication of successful completion is the MT_RET_OK response code. Otherwise, an error code will be returned.
Note
A configuration can be deleted only from the applications that run on the main server. For all other applications the response code MT_RET_ERR_NOTMAIN will be returned. If the
object is not found, the response code MT_RET_ERR_NOTFOUND will be returned.
IMTAdminAPI::FeederDeleteBatch
Delete multiple data feed configurations.
C++
MTAPIRES IMTAdminAPI::FeederDeleteBatch(
IMTConPlugin** configs, // An array of configurations
const UINT config_total, // The number of configurations in the array
MTAPIRES* results // An array of results
)
.NET
MTRetCode CIMTAdminAPI.FeederDeleteBatch(
CIMTConPlugin[] configs, // An array of configurations
MTRetCode[] results // An array of results
)
Python
file:///C:/Users/Administrator/AppData/Local/Temp/~hh4BC4.htm 7/17/2025
Manager API Page 52 of 464
AdminAPI.FeederDeleteBatch(
feeders # An array of configurations
)
Parameters
configs
[in] A pointer to an array of configurations which you want to delete.
config_total
[in] The number of configurations in the 'configs' array.
results
[out] An array with the results of deletion of each configuration on the server.
Return Value
An indication of successful completion is the MT_RET_OK response code. Otherwise, an error code is returned. The MT_RET_OK response code is an indication of successful
sending of changes to a server; results of applying the changes are passed in the 'results' parameter.
Further Note
A configuration can only be deleted from the applications that run on the main server. For all other applications, the response code MT_RET_ERR_NOTMAIN is returned. If the
object is not found, the MT_RET_ERR_PARAMS error code is added to the 'results' array of this object.
IMTAdminAPI::FeederShift
Change the position of the data feed configuration in the list.
C++
MTAPIRES IMTAdminAPI::FeederShift(
const UINT pos, // Position of the configuration
const int shift // Shift
)
.NET
MTRetCode CIMTAdminAPI.FeederShift(
uint pos, // Position of the configuration
int shift // Shift
)
Python
AdminAPI.FeederShift(
pos, # Position of the configuration
shift # Shift
)
Parameters
pos
[in] Position of the configuration, starting with 0.
shift
[in] Shift of the configuration relative to its current position. A negative value means the shift to the top of the list, a positive value - to its end.
Return Value
An indication of successful completion is the MT_RET_OK response code. Otherwise, an error code will be returned.
Note
The position of a configuration can be changed only from the applications that run on the main server. For all other applications the response code MT_RET_ERR_NOTMAIN will be
returned.
IMTAdminAPI::FeederTotal
The total number of data feed configurations available in the platform.
C++
UINT IMTAdminAPI::FeederTotal()
.NET
uint CIMTAdminAPI.FeederTotal()
Python
AdminAPI.FeederTotal()
Return Value
The number of configurations of data feeds in the trading platform.
IMTAdminAPI::FeederNext
Gets a data feed configuration based on its index.
C++
file:///C:/Users/Administrator/AppData/Local/Temp/~hh4BC4.htm 7/17/2025
Manager API Page 53 of 464
MTAPIRES IMTAdminAPI::FeederNext(
const UINT pos, // Position of the configuration
IMTConFeeder* feeder // The object of data feed configuration
)
.NET
MTRetCode CIMTAdminAPI.FeederNext(
uint pos, // Position of the configuration
CIMTConFeeder feeder // Position of the configuration
)
Python
AdminAPI.FeederNext(
pos # Position of the configuration
)
Parameters
pos
[in] Position of the configuration, starting with 0.
feeder
[out] The object of configuration of a data feed. The feeder object must be first created using the IMTAdminAPI::FeederCreate method.
Return Value
An indication of successful completion is the MT_RET_OK response code. Otherwise, an error code will be returned.
Note
This method copies the configuration data of a feed with a specified index to the feeder object.
IMTAdminAPI::FeederGet
Gets the data feed configuration based on its name.
C++
MTAPIRES IMTAdminAPI::FeederGet(
LPCWSTR name, // Name of the configuration
IMTConFeeder* feeder // The object of data feed configuration
)
.NET
MTRetCode CIMTAdminAPI.FeederGet(
string name, // Name of the configuration
CIMTConFeeder feeder // The object of data feed configuration
)
Python
AdminAPI.FeederGet(
name # Name of the configuration
)
Parameters
name
[in] The name of the configuration.
feeder
[out] The object of configuration of a data feed. The feeder object must be first created using the IMTAdminAPI::FeederCreate method.
Return Value
An indication of successful completion is the MT_RET_OK response code. Otherwise, an error code will be returned.
Note
The IMTConFeeder::Name() value is used as the name.
IMTAdminAPI::FeederModuleTotal
The total number of configurations of data feed modules available in the platform.
C++
UINT IMTAdminAPI::FeederModuleTotal()
.NET
uint CIMTAdminAPI.FeederModuleTotal()
Python
AdminAPI.FeederModuleTotal()
Return Value
The number of configurations of data feed modules in the trading platform.
IMTAdminAPI::FeederModuleNext
file:///C:/Users/Administrator/AppData/Local/Temp/~hh4BC4.htm 7/17/2025
Manager API Page 54 of 464
.NET
MTRetCode CIMTAdminAPI.FeederModuleNext(
uint pos, // Position of the configuration
CIMTConFeederModule module // The object of data feed configuration
)
Python
AdminAPI.FeederModuleNext(
pos # Position of the configuration
)
Parameters
pos
[in] Position of the configuration, starting with 0.
module
[out] The object of configuration of a data feed. The module object must be first created using the IMTAdminAPI::FeederModuleCreate method.
Return Value
An indication of successful completion is the MT_RET_OK response code. Otherwise, an error code will be returned.
Note
This method copies the configuration of a data feed module with a specified index to the module object.
IMTAdminAPI::FeederModuleGet
Get the configuration of the data feed module by the name.
C++
MTAPIRES IMTAdminAPI::FeederModuleGet(
LPCWSTR name, // Name of the configuration
IMTConFeederModule* module // Object of configuration of a data feed module
)
.NET
MTRetCode CIMTAdminAPI.FeederModuleGet(
string name, // Name of the configuration
CIMTConFeederModule module // Object of configuration of a data feed module
)
Python
AdminAPI.FeederModuleGet(
name # Name of the configuration
)
Parameters
name
[in] The name of the configuration.
module
[out] The object of configuration of the data feed module. The module object must be first created using the IMTAdminAPI::FeederModuleCreate method.
Return Value
An indication of successful completion is the MT_RET_OK response code. Otherwise, an error code will be returned.
Note
The IMTConFeederModule::Module() value is used as the name.
Time Configuration
Functions allow managing the time configurations of the platform, as well subscribe and unsubscribe from events associated with its change.
The following functions for managing time are available:
Function Purpose
TimeCreate Create an object of the time configuration.
TimeSubscribe Subscribe to events associated with time configuration.
TimeUnsubscribe Unsubscribe from events associated with time configuration.
TimeGet Get the time configuration.
TimeSet Set the time configuration.
TimeServer Get the calculated current time of the trading server.
TimeServerRequest Get the current time of the trading server.
file:///C:/Users/Administrator/AppData/Local/Temp/~hh4BC4.htm 7/17/2025
Manager API Page 55 of 464
IMTAdminAPI::TimeCreate
Create an object of the time configuration.
C++
IMTConTime* IMTAdminAPI::TimeCreate()
.NET
CIMTConTime CIMTAdminAPI.TimeCreate()
Return Value
It returns a pointer to the created object that implements the IMTConTime interface. In case of failure, it returns NULL.
Note
The created object must be destroyed by calling the IMTConTime::Release method of this object.
IMTAdminAPI::TimeSubscribe
Subscribe to events associated with time configuration.
C++
MTAPIRES IMTAdminAPI::TimeSubscribe(
IMTConTimeSink* sink // A pointer to the IMTConTimeSink object
)
.NET
MTRetCode CIMTAdminAPI.TimeSubscribe(
CIMTConTimeSink sink // CIMTConTimeSink object
)
Python
AdminAPI.TimeSubscribe(
sink # IMTConTimeSink object
)
Parameters
sink
[in] A pointer to the object that implements the IMTConTimeSink interface.
Return Value
An indication of successful completion is the MT_RET_OK response code. Otherwise, an error has occurred that corresponds to the response code.
Note
Subscribing to events is thread safe. One and the same interface IMTConTimeSink cannot subscribe to an event twice - in this case the response code MT_RET_ERR_DUPLICATE is
returned.
To receive IMTConTimeSink::OnTimeSync events, subscribe before calling the IMTAdminAPI::Connect method.
The object at which sink points, must remain in the memory (must not be removed) until the call of IMTAdminAPI::TimeUnsubscribe or until the administrator interface is deleted
using the IMTAdminAPI::Release method.
IMTAdminAPI::TimeUnsubscribe
Unsubscribe from events associated with time configuration.
C++
MTAPIRES IMTAdminAPI::TimeUnsubscribe(
IMTConTimeSink* sink // A pointer to the IMTConTimeSink object
)
.NT
MTRetCode CIMTAdminAPI.TimeUnsubscribe(
CIMTConTimeSink sink // CIMTConTimeSink object
)
Python
AdminAPI.TimeUnsubscribe(
sink # IMTConTimeSink object
)
Parameters
sink
[in] A pointer to the object that implements the IMTConTimeSink interface.
Return Value
An indication of successful completion is the MT_RET_OK response code. Otherwise, an error code will be returned.
Note
This is a pair method to IMTAdminAPI::TimeSubscribe. If an attempt is made to unsubscribe from the interface to which it has not subscribed, MT_RET_ERR_NOTFOUND error is
returned.
file:///C:/Users/Administrator/AppData/Local/Temp/~hh4BC4.htm 7/17/2025
Manager API Page 56 of 464
IMTAdminAPI::TimeGet
Get the time configuration.
C++
MTAPIRES IMTAdminAPI::TimeGet(
IMTConTime* config // An object of time configuration
)
.NET
MTRetCode CIMTAdminAPI.TimeGet(
CIMTConTime config // An object of time configuration
)
Python
AdminAPI.TimeGet()
Parameters
config
[out] An object of the time configuration. The config object must first be created using the IMTAdminAPI::TimeCreate method.
Return Value
An indication of successful completion is the MT_RET_OK response code. Otherwise, an error code will be returned.
IMTAdminAPI::TimeSet
Set the time configuration.
C++
MTAPIRES IMTAdminAPI::TimeSet(
const IMTConTime* config // An object of time configuration
)
.NET
MTRetCode CIMTAdminAPI.TimeSet(
CIMTConTime config // An object of time configuration
)
Python
AdminAPI.TimeSet(
config # An object of time configuration
)
Parameters
config
[in] An object of time configuration.
Return Value
An indication of successful completion is the MT_RET_OK response code. Otherwise, an error code will be returned.
IMTAdminAPI::TimeServer
Get the calculated current time of the trading server.
C++
INT64 IMTAdminAPI::TimeServer()
.NET
long CIMTAdminAPI.TimeServer()
Python
AdminAPI.TimeServer()
Return Value
The current trading time of the platform in the number of seconds elapsed since 01.01.1970.
Note
Unlike the TimeServerRequest function, the trading time is calculated on the Manager API application side: the current local computer time is adjusted in accordance with the
server time zone.
In all configurations, databases and logs, the platform trading time is used, except where explicitly stated otherwise.
IMTAdminAPI::TimeServerRequest
Get the current time of the trading server.
C++
file:///C:/Users/Administrator/AppData/Local/Temp/~hh4BC4.htm 7/17/2025
Manager API Page 57 of 464
MTAPIRES IMTAdminAPI::TimeServerRequest(
INT64& time_msc // server time
)
.NET
MTRetCode CIMTAdminAPI.TimeServerRequest(
out long time_msc // server time
)
Python
AdminAPI.TimeServerRequest()
Parameters
time_msc
[out] The current trading time of the platform in the number of milliseconds elapsed since 01.01.1970.
Return Value
An indication of successful completion is the MT_RET_OK response code. Otherwise, an error code will be returned.
Note
Unlike TimeServer, the TimeServerRequest section directly requests time from the trading server rather than calculating it.
In all configurations, databases and logs, the platform trading time is used, except where explicitly stated otherwise.
Holiday Configuration
Functions allow managing the holidays configuration, as well subscribe and unsubscribe from events associated with its change.
The following functions for configuring holidays are available:
Function Purpose
HolidayCreate Create an object of the configuration of holidays.
HolidaySubscribe Subscribe to events associated with the configuration of holidays.
HolidayUnsubscribe Unsubscribe from events associated with the configuration of holidays.
HolidayUpdate Add or update a holiday configuration.
HolidayUpdateBatch Add or edit multiple holiday configurations.
HolidayDelete Delete a holiday configuration by the index.
HolidayDeleteBatch Delete multiple holiday configurations.
HolidayShift Changes the position of a holiday configuration in the list.
HolidayTotal The total number of configurations of holidays available in the platform.
HolidayNext Gets a holiday configuration with the specified index.
IMTAdminAPI::HolidayCreate
Create an object of the configuration of holidays.
C++
IMTConHoliday* IMTAdminAPI::HolidayCreate()
.NET
CIMTConHoliday CIMTAdminAPI.HolidayCreate()
Return Value
It returns a pointer to the created object that implements the IMTConHoliday interface. In case of failure, it returns NULL.
Note
The created object must be deleted by calling the IMTConHoliday::Release method of this object.
IMTAdminAPI::HolidaySubscribe
Subscribe to events associated with the configuration of holidays.
C++
MTAPIRES IMTAdminAPI::HolidaySubscribe(
IMTConHolidaySink* sink // A pointer to the IMTConHolidaySink object
)
.NET
MTRetCode CIMTAdminAPI.HolidaySubscribe(
CIMTConHolidaySink sink // CIMTConHolidaySink object
)
Python
file:///C:/Users/Administrator/AppData/Local/Temp/~hh4BC4.htm 7/17/2025
Manager API Page 58 of 464
AdminAPI.HolidaySubscribe(
sink # IMTConHolidaySink object
)
Parameters
sink
[in] A pointer to the object that implements the IMTConHolidaySink interface.
Return Value
An indication of successful completion is the MT_RET_OK response code. Otherwise, an error has occurred that corresponds to the response code.
Note
Subscribing to events is thread safe. One and the same interface IMTConHolidaySink cannot subscribe to events twice - in this case the response code MT_RET_ERR_DUPLICATE is
returned.
To receive IMTConHolidaySink::OnHolidaySync events, subscribe before calling the IMTAdminAPI::Connect method.
The object at which sink points, must remain in the memory (must not be removed) until the call of IMTAdminAPI::HolidayUnsubscribe or until the administrator interface is
deleted using the IMTAdminAPI::Release method.
IMTAdminAPI::HolidayUnsubscribe
Unsubscribe from events associated with the configuration of holidays.
C++
MTAPIRES IMTAdminAPI::HolidayUnsubscribe(
IMTConHolidaySink* sink // A pointer to the IMTConHolidaySink object
)
.NET
MTRetCode CIMTAdminAPI.HolidayUnsubscribe(
CIMTConHolidaySink sink // CIMTConHolidaySink object
)
Python
AdminAPI.HolidayUnsubscribe(
sink # IMTConHolidaySink object
)
Parameters
sink
[in] A pointer to the object that implements the IMTConHolidaySink interface.
Return Value
An indication of successful completion is the MT_RET_OK response code. Otherwise, an error code will be returned.
Note
This is a pair method to IMTAdminAPI::HolidaySubscribe. If an attempt is made to unsubscribe from the interface to which it has not subscribed, MT_RET_ERR_NOTFOUND error is
returned.
IMTAdminAPI::HolidayUpdate
Add or update a holiday configuration.
C++
MTAPIRES IMTAdminAPI::HolidayUpdate(
IMTConHoliday* config // Holiday configuration object
)
.NET
MTRetCode CIMTAdminAPI.HolidayUpdate(
CIMTConHoliday config // Holiday configuration object
)
Python
AdminAPI.HolidayUpdate(
holiday # Holiday configuration object
)
Parameters
config
[in] An object of a holiday configuration.
Return Value
An indication of successful completion is the MT_RET_OK response code. Otherwise, an error code will be returned.
Note
When calling the method, a check is made whether the entry already exists. If the entry already exists, it is updated, otherwise a new entry is added. The key fields for
comparison are the date (IMTConHoliday::Year, IMTConHoliday::Month, IMTConHoliday::Day), time (IMTConHoliday::WorkFrom, IMTConHoliday::WorkTo) and description
(IMTConHoliday::Description). When you try to add a completely identical record, no changes are made, and therefore the IMTConHolidaySink::OnHolidayUpdate notification
method is not called.
A configuration can be added or updated only from the applications that run on the main server. For all other applications the response code MT_RET_ERR_NOTMAIN will be
returned.
Before adding, the correctness of the record is checked. If the record is incorrect, the error code MT_RET_ERR_PARAMS is returned.
file:///C:/Users/Administrator/AppData/Local/Temp/~hh4BC4.htm 7/17/2025
Manager API Page 59 of 464
IMTAdminAPI::HolidayUpdateBatch
Add or edit multiple holiday configurations.
C++
MTAPIRES IMTAdminAPI::HolidayUpdateBatch(
IMTConHoliday** configs, // An array of configurations
const UINT config_total, // The number of configurations in the array
MTAPIRES* results // An array of results
)
.NET
MTRetCode CIMTAdminAPI.HolidayUpdateBatch(
CIMTConHoliday[] configs, // An array of configurations
MTRetCode[] results // An array of results
)
Python.NET
AdminAPI.HolidayUpdateBatch(
holidays # An array of configurations
)
Parameters
configs
[in] A pointer to an array of configurations which you want to add/delete.
config_total
[in] The number of configurations in the 'configs' array.
results
[out] An array with the results of applying of each configuration change on the server.
Return Value
An indication of successful completion is the MT_RET_OK response code. Otherwise, an error code is returned. The MT_RET_OK response code is an indication of successful
sending of changes to a server; results of applying the changes are passed in the 'results' parameter.
Further Note
When calling the method, a check is made whether the entry already exists. If the entry already exists, it is updated, otherwise a new entry is added. The key fields for
comparison are the date (IMTConHoliday::Year, IMTConHoliday::Month, IMTConHoliday::Day), time (IMTConHoliday::WorkFrom, IMTConHoliday::WorkTo) and description
(IMTConHoliday::Description). When you try to add a completely identical record, no changes are made, and therefore the IMTConHolidaySink::OnHolidayUpdate notification
method is not called.
A configuration can only be added or updated from the applications that run on the main server. For all other applications, the response code MT_RET_ERR_NOTMAIN is returned.
Before adding an entry, its correctness is checked. If an entry is incorrect, the MT_RET_ERR_PARAMS error code is added to the 'results' array of this entry.
IMTAdminAPI::HolidayDelete
Delete a holiday configuration by the index.
C++
MTAPIRES IMTAdminAPI::HolidayDelete(
const UINT pos // Position of the configuration
)
.NET
MTRetCode CIMTAdminAPI.HolidayDelete(
uint pos // Position of the configuration
)
Python
AdminAPI.HolidayDelete(
pos # Position of the configuration
)
Parameters
pos
[in] Position of the configuration, starting with 0.
Return Value
An indication of successful completion is the MT_RET_OK response code. Otherwise, an error code will be returned.
Note
A configuration can be deleted only from the applications that run on the main server. For all other applications the response code MT_RET_ERR_NOTMAIN will be returned. If the
object is not found, the response code MT_RET_ERR_NOTFOUND will be returned.
IMTAdminAPI::HolidayDeleteBatch
Delete multiple holiday configurations.
C++
file:///C:/Users/Administrator/AppData/Local/Temp/~hh4BC4.htm 7/17/2025
Manager API Page 60 of 464
MTAPIRES IMTAdminAPI::HolidayDeleteBatch(
IMTConHoliday** configs, // An array of configurations
const UINT config_total, // The number of configurations in the array
MTAPIRES* results // An array of results
)
.NET
MTRetCode CIMTAdminAPI.HolidayDeleteBatch(
CIMTConHoliday[] configs, // An array of configurations
MTRetCode[] results // An array of results
)
Python
AdminAPI.HolidayDeleteBatch(
holidays # An array of configurations
)
Parameters
configs
[in] A pointer to an array of configurations which you want to delete.
config_total
[in] The number of configurations in the 'configs' array.
results
[out] An array with the results of deletion of each configuration on the server.
Return Value
An indication of successful completion is the MT_RET_OK response code. Otherwise, an error code is returned. The MT_RET_OK response code is an indication of successful
sending of changes to a server; results of applying the changes are passed in the 'results' parameter.
Further Note
A configuration can only be deleted from the applications that run on the main server. For all other applications, the response code MT_RET_ERR_NOTMAIN is returned. If the
object is not found, the MT_RET_ERR_PARAMS error code is added to the 'results' array of this object.
The key fields for searching for removed entries are date (IMTConHoliday::Year, IMTConHoliday::Month, IMTConHoliday::Day), time (IMTConHoliday::WorkFrom,
IMTConHoliday::WorkTo) and description (IMTConHoliday::Description).
IMTAdminAPI::HolidayShift
Changes the position of a holiday configuration in the list.
C++
MTAPIRES IMTAdminAPI::HolidayShift(
const UINT pos, // Position of the configuration
const int shift // Shift
)
.NET
MTRetCode CIMTAdminAPI.HolidayShift(
uint pos, // Position of the configuration
int shift // Shift
)
Python
AdminAPI.HolidayShift(
pos, # Position of the configuration
shift # Shift
)
Parameters
pos
[in] Position of the configuration, starting with 0.
shift
[in] Shift of the configuration relative to its current position. A negative value means the shift to the top of the list, a positive value - to its end.
Return Value
An indication of successful completion is the MT_RET_OK response code. Otherwise, an error code will be returned.
Note
The position of a configuration can be changed only from the applications that run on the main server. For all other applications the response code MT_RET_ERR_NOTMAIN will be
returned.
IMTAdminAPI::HolidayTotal
The total number of configurations of holidays available in the platform.
C++
UINT IMTAdminAPI::HolidayTotal()
.NET
uint CIMTAdminAPI.HolidayTotal()
Python
AdminAPI.HolidayTotal()
file:///C:/Users/Administrator/AppData/Local/Temp/~hh4BC4.htm 7/17/2025
Manager API Page 61 of 464
Return Value
The number of configurations of holidays in the trading platform.
IMTAdminAPI::HolidayNext
Gets a holiday configuration with the specified index.
C++
MTAPIRES IMTAdminAPI::HolidayNext(
const UINT pos, // Position of the configuration
IMTConHoliday* config // Holiday configuration object
)
.NET
MTRetCode CIMTAdminAPI.HolidayNext(
uint pos, // Position of the configuration
CIMTConHoliday obj // Holiday configuration object
)
Python
AdminAPI.HolidayNext(
pos # Position of the configuration
)
Parameters
pos
[in] Position of the configuration, starting with 0.
config
[out] An object of holiday configuration. The config object must first be created using the IMTAdminAPI::HolidayCreate method.
Return Value
An indication of successful completion is the MT_RET_OK response code. Otherwise, an error code will be returned.
Note
This method copies the configuration data of a holiday with a specified index to the config object.
Firewall Configuration
Functions allow managing the firewall configuration, as well subscribe and unsubscribe from events associated with its change.
To configure a firewall provides the configuring the firewall:
Function Purpose
FirewallCreate Create an object of the firewall configuration.
FirewallSubscribe Subscribe to events associated with the firewall configuration.
FirewallUnsubscribe Unsubscribe from events associated with the firewall configuration.
FirewallUpdate Add or update a firewall configuration.
FirewallUpdateBatch Add or edit multiple firewall configurations.
FirewallDelete Delete a configuration of a data feed by its index.
FirewallDeleteBatch Delete multiple firewall configurations.
FirewallShift Change the position of a firewall configuration in the list.
FirewallTotal The total number of firewall configurations available in the platform.
FirewallNex Get the firewall configuration by the index.
IMTAdminAPI::FirewallCreate
Create an object of the firewall configuration.
C++
IMTConFirewall* IMTAdminAPI::FirewallCreate()
.NET
CIMTConFirewall CIMTAdminAPI.FirewallCreate()
Return Value
It returns a pointer to the created object that implements the IMTConFirewall interface. In case of failure, it returns NULL.
Note
The created object must be deleted by calling the IMTConFirewall::Release method of this object.
file:///C:/Users/Administrator/AppData/Local/Temp/~hh4BC4.htm 7/17/2025
Manager API Page 62 of 464
IMTAdminAPI::FirewallSubscribe
Subscribe to events associated with the firewall configuration.
C++
MTAPIRES IMTAdminAPI::FirewallSubscribe(
IMTConFirewallSink* sink // A pointer to the IMTConFirewallSink object
)
.NET
MTRetCode CIMTAdminAPI.FirewallSubscribe(
CIMTConFirewallSink sink // CIMTConFirewallSink object
)
Python
AdminAPI.FirewallSubscribe(
sink # IMTConFirewallSink object
)
Parameters
sink
[in] A pointer to the object that implements the IMTConFirewallSink interface.
Return Value
An indication of successful completion is the MT_RET_OK response code. Otherwise, an error has occurred that corresponds to the response code.
Note
Subscribing to events is thread safe. One and the same interface IMTConFirewallSink cannot subscribe to an event twice - in this case the response code MT_RET_ERR_DUPLICATE
is returned.
To receive IMTConFirewallSink::OnFirewallSync events, subscribe before calling the IMTAdminAPI::Connect method.
The object at which sink points, must remain in the memory (must not be removed) until the call of IMTAdminAPI::FirewallUnsubscribe or until the administrator interface is
deleted using the IMTAdminAPI::Release method.
IMTAdminAPI::FirewallUnsubscribe
Unsubscribe from events associated with the firewall configuration.
C++
MTAPIRES IMTAdminAPI::FirewallUnsubscribe(
IMTConFirewallSink* sink // A pointer to the IMTConFirewallSink object
)
.NET
MTRetCode CIMTAdminAPI.FirewallUnsubscribe(
CIMTConFirewallSink sink // CIMTConFirewallSink object
)
Python
AdminAPI.FirewallUnsubscribe(
sink # IMTConFirewallSink object
)
Parameters
sink
[in] A pointer to the object that implements the IMTConFirewallSink interface.
Return Value
An indication of successful completion is the MT_RET_OK response code. Otherwise, an error code will be returned.
Note
This is a pair method to IMTAdminAPI::FirewallSubscribe. If an attempt is made to unsubscribe from the interface to which it has not subscribed, MT_RET_ERR_NOTFOUND error is
returned.
IMTAdminAPI::FirewallUpdate
Add or update a firewall configuration.
C++
MTAPIRES IMTAdminAPI::FirewallUpdate(
IMTConFirewall* config // Firewall configuration object
)
.NET
MTRetCode CIMTAdminAPI.FirewallUpdate(
CIMTConFirewall config // Firewall configuration object
)
Python
AdminAPI.FirewallUpdate(
config # Firewall configuration object
)
Parameters
config
file:///C:/Users/Administrator/AppData/Local/Temp/~hh4BC4.htm 7/17/2025
Manager API Page 63 of 464
IMTAdminAPI::FirewallUpdateBatch
Add or edit multiple firewall configurations.
C++
MTAPIRES IMTAdminAPI::FirewallUpdateBatch(
IMTConFirewall** configs, // An array of configurations
const UINT config_total, // The number of configurations in the array
MTAPIRES* results // An array of results
)
.NET
MTRetCode CIMTAdminAPI.FirewallUpdateBatch(
CIMTConFirewall[] configs, // An array of configurations
MTRetCode[] results // An array of results
)
Python
AdminAPI.FirewallUpdateBatch(
configs # An array of configurations
)
Parameters
configs
[in] A pointer to an array of configurations which you want to add/update.
config_total
[in] The number of configurations in the 'configs' array.
results
[out] An array with the results of applying of each configuration change on the server.
Return Value
An indication of successful completion is the MT_RET_OK response code. Otherwise, an error code is returned. The MT_RET_OK response code is an indication of successful
sending of changes to a server; results of applying the changes are passed in the 'results' parameter.
Further Note
A configuration can only be added or updated from the applications that run on the main server. For all other applications, the response code MT_RET_ERR_NOTMAIN is returned.
Before adding an entry, its correctness is checked. If an entry is incorrect, the MT_RET_ERR_PARAMS error code is added to the 'results' array of this entry.
IMTAdminAPI::FirewallDelete
Delete a firewall configuration by the index.
C++
MTAPIRES IMTAdminAPI::FirewallDelete(
const UINT pos // Position of the configuration
)
.NET
MTRetCode CIMTAdminAPI.FirewallDelete(
uint pos // Position of the configuration
)
Python
AdminAPI.FirewallDelete(
pos # Position of the configuration
)
Parameters
pos
[in] Position of the configuration, starting with 0.
Return Value
An indication of successful completion is the MT_RET_OK response code. Otherwise, an error code will be returned.
Note
A configuration can be deleted only from the applications that run on the main server. For all other applications the response code MT_RET_ERR_NOTMAIN will be returned. If the
object is not found, the response code MT_RET_ERR_NOTFOUND will be returned.
file:///C:/Users/Administrator/AppData/Local/Temp/~hh4BC4.htm 7/17/2025
Manager API Page 64 of 464
IMTAdminAPI::FirewallDeleteBatch
Delete multiple firewall configurations.
C++
MTAPIRES IMTAdminAPI::FirewallDeleteBatch(
IMTConFirewall** configs, // An array of configurations
const UINT config_total, // The number of configurations in the array
MTAPIRES* results // An array of results
)
.NET
MTRetCode CIMTAdminAPI.FirewallDeleteBatch(
CIMTConFirewall[] configs, // An array of configurations
MTRetCode[] results // An array of results
)
Python
AdminAPI.FirewallDeleteBatch(
configs # An array of configurations
)
Parameters
configs
[in] A pointer to an array of configurations which you want to delete.
config_total
[in] The number of configurations in the 'configs' array.
results
[out] An array with the results of deletion of each configuration on the server.
Return Value
An indication of successful completion is the MT_RET_OK response code. Otherwise, an error code is returned. The MT_RET_OK response code is an indication of successful
sending of changes to a server; results of applying the changes are passed in the 'results' parameter.
Further Note
A configuration can only be deleted from the applications that run on the main server. For all other applications, the response code MT_RET_ERR_NOTMAIN is returned. If the
object is not found, the MT_RET_ERR_PARAMS error code is added to the 'results' array of this object.
IMTAdminAPI::FirewallShift
Change the position of a firewall configuration in the list.
C++
MTAPIRES IMTAdminAPI::FirewallShift(
const UINT pos, // Position of the configuration
const int shift // Shift
)
.NET
MTRetCode CIMTAdminAPI.FirewallShift(
uint pos, // Position of the configuration
int shift // Shift
)
Python
AdminAPI.FirewallShift(
pos, # Position of the configuration
shift # Shift
)
Parameters
pos
[in] Position of the configuration, starting with 0.
shift
[in] Shift of the configuration relative to its current position. A negative value means the shift to the top of the list, a positive value - to its end.
Return Value
An indication of successful completion is the MT_RET_OK response code. Otherwise, an error code will be returned.
Note
The position of a configuration can be changed only from the applications that run on the main server. For all other applications the response code MT_RET_ERR_NOTMAIN will be
returned.
IMTAdminAPI::FirewallTotal
The total number of firewall configurations available in the platform.
C++
UINT IMTAdminAPI::FirewallTotal()
.NET
uint CIMTAdminAPI.FirewallTotal()
Python
file:///C:/Users/Administrator/AppData/Local/Temp/~hh4BC4.htm 7/17/2025
Manager API Page 65 of 464
AdminAPI.FirewallTotal()
Return Value
The number of firewall configurations in the trading platform.
IMTAdminAPI::FirewallNext
Get the firewall configuration by the index.
C++
MTAPIRES IMTAdminAPI::FirewallNext(
const UINT pos, // Position of the configuration
IMTConFirewall* config // Configuration
)
.NET
MTRetCode CIMTAdminAPI.FirewallNext(
uint pos, // Position of the configuration
CIMTConFirewall config // Configuration
)
Python
AdminAPI.FirewallNext(
pos # Position of the configuration
)
Parameters
pos
[in] Position of the configuration, starting with 0.
config
[out] An object of the firewall configuration. The config object must first be created using the IMTAdminAPI::FirewallCreate method.
Return Value
An indication of successful completion is the MT_RET_OK response code. Otherwise, an error code will be returned.
Note
This method copies the firewall configuration entry with a specified index to the config object.
Configuration of Symbols
Functions allow to manage symbols, as well subscribe and unsubscribe from events associated with their change.
The following functions for managing symbols are available:
Function Purpose
SymbolCreate Create an object of the symbol configuration.
SymbolSessionCreate Create an object of configuration of a trading or quoting session of the symbol.
SymbolSubscribe Subscribe to events associated with the configuration of symbols.
SymbolUnsubscribe Unsubscribe from events associated with the configuration of symbols.
SymbolUpdate Add or update a symbol configuration.
SymbolUpdateBatch Add or edit multiple symbol configurations.
SymbolDelete Delete a symbol configuration by the index or name.
SymbolDeleteBatch Delete multiple symbol configurations.
SymbolShift Change the position of a symbol configuration in the list.
SymbolTotal The total number of symbol configurations available in the platform.
SymbolNext Get the symbol configuration by the index.
SymbolGet Get a symbol configuration or an individual configuration of a symbol for a group by the name of the symbol.
SymbolExist Check the availability of a symbol for a specified group of clients.
SymbolGroupAdd Add a subgroup of symbols.
SymbolGroupDelete Remove a subgroup of symbols by name.
SymbolGroupShift Change the position of a subgroup of symbols in a list.
SymbolGroupTotal Get the total number of symbol subgroups existing in the platform.
SymbolGroupNext Get the name of a subgroup of symbols by index.
SymbolGroupExist Check the presence of a subgroup of symbols on the trading server.
IMTAdminAPI::SymbolCreate
Create an object of the symbol configuration.
file:///C:/Users/Administrator/AppData/Local/Temp/~hh4BC4.htm 7/17/2025
Manager API Page 66 of 464
C++
IMTConSymbol* IMTAdminAPI::SymbolCreate()
.NET
CIMTConSymbol CIMTAdminAPI.SymbolCreate()
Return Value
It returns a pointer to the created object that implements the IMTConSymbol interface. In case of failure, it returns NULL.
Note
The created object must be destroyed by calling the IMTConSymbol::Release method of this object.
IMTAdminAPI::SymbolSessionCreate
Create an object of configuration of a trading or quoting session of the symbol.
C++
IMTConSymbolSession* IMTAdminAPI::SymbolSessionCreate()
.NET
CIMTConSymbolSession CIMTAdminAPI.SymbolSessionCreate()
Return Value
It returns a pointer to the created object that implements the IMTConSymbolSession interface. In case of failure, it returns NULL.
Note
The created object must be destroyed by calling the IMTConSymbolSession::Release method of this object.
IMTAdminAPI::SymbolSubscribe
Subscribe to events associated with the configuration of symbols.
C++
MTAPIRES IMTAdminAPI::SymbolSubscribe(
IMTConSymbolSink* sink // A pointer to the IMTConSymbolSink object
)
.NET
MTRetCode CIMTAdminAPI.SymbolSubscribe(
CIMTConSymbolSink sink // CIMTConSymbolSink object
)
Python
AdminAPI.SymbolSubscribe(
sink # IMTConSymbolSink object
)
Parameters
sink
[in] Pointer to the object that implements IMTConSymbolSink interface.
Return Value
An indication of successful completion is the MT_RET_OK response code. Otherwise, an error has occurred that corresponds to the response code.
Note
Subscribing to events is thread safe. One and the same interface IMTConSymbolSink cannot subscribe to an event twice - in this case the response code MT_RET_ERR_DUPLICATE
is returned.
To receive IMTConSymbolSink::OnSymbolSync events, subscribe before calling the IMTAdminAPI::Connect method.
The object at which sink points, must remain in the memory (must not be removed) until the call of IMTAdminAPI::SymbolUnsubscribe or until the administrator interface is
deleted using the IMTAdminAPI::Release method.
IMTAdminAPI::SymbolUnsubscribe
Unsubscribe from events associated with the configuration of symbols.
C++
MTAPIRES IMTAdminAPI::SymbolUnsubscribe(
IMTConSymbolSink* sink // A pointer to the IMTConSymbolSink object
)
.NET
MTRetCode CIMTAdminAPI.SymbolUnsubscribe(
CIMTConSymbolSink sink // CIMTConSymbolSink object
)
Python
file:///C:/Users/Administrator/AppData/Local/Temp/~hh4BC4.htm 7/17/2025
Manager API Page 67 of 464
AdminAPI.SymbolUnsubscribe(
sink # IMTConSymbolSink object
)
Parameters
sink
[in] Pointer to the object that implements IMTConSymbolSink interface.
Return Value
An indication of successful completion is the MT_RET_OK response code. Otherwise, an error code will be returned.
Note
This is a pair method to IMTAdminAPI::SymbolSubscribe. If an attempt is made to unsubscribe from the interface to which it has not subscribed, MT_RET_ERR_NOTFOUND error is
returned.
IMTAdminAPI::SymbolUpdate
Add or update a symbol configuration.
C++
MTAPIRES IMTAdminAPI::SymbolUpdate(
IMTConSymbol* symbol // An object of the symbol configuration
)
.NET
MTRetCode CIMTAdminAPI.SymbolUpdate(
CIMTConSymbol symbol // An object of the symbol configuration
)
Python
AdminAPI.SymbolUpdate(
symbol # An object of the symbol configuration
)
Parameters
symbol
[in] An object of the symbol configuration.
Return Value
An indication of successful completion is the MT_RET_OK response code. Otherwise, an error code will be returned.
Note
A configuration can be added or updated only from the applications that run on the main server. For all other applications the response code MT_RET_ERR_NOTMAIN will be
returned.
Before adding, the correctness of the record is checked. If the record is incorrect, the error code MT_RET_ERR_PARAMS is returned.
IMTAdminAPI::SymbolUpdateBatch
Add or edit multiple symbol configurations.
C++
MTAPIRES IMTAdminAPI::SymbolUpdateBatch(
IMTConSymbol** configs, // An array of configurations
const UINT config_total, // The number of configurations in the array
MTAPIRES* results // An array of results
)
.NET
MTRetCode CIMTAdminAPI.SymbolUpdateBatch(
CIMTConSymbol[] configs, // An array of configurations
MTRetCode[] results // An array of results
)
Python
AdminAPI.SymbolUpdateBatch(
configs # An array of configurations
)
Parameters
configs
[in] A pointer to an array of configurations which you want to add/update.
config_total
[in] The number of configurations in the 'configs' array.
results
[out] An array with the results of applying of each configuration change on the server.
Return Value
An indication of successful completion is the MT_RET_OK response code. Otherwise, an error code is returned. The MT_RET_OK response code is an indication of successful
sending of changes to a server; results of applying the changes are passed in the 'results' parameter.
Further Note
A configuration can only be added or updated from the applications that run on the main server. For all other applications, the response code MT_RET_ERR_NOTMAIN is returned.
Before adding an entry, its correctness is checked. If an entry is incorrect, the MT_RET_ERR_PARAMS error code is added to the 'results' array of this entry.
file:///C:/Users/Administrator/AppData/Local/Temp/~hh4BC4.htm 7/17/2025
Manager API Page 68 of 464
C++ Example
//+------------------------------------------------------------------+
//| Update multiple symbols |
//+------------------------------------------------------------------+
MTAPIRES MarginLimitUpdateBatch(double new_rate, IMTAdminAPI* manager)
{
UINT symbols_prepared=0,total;
IMTConSymbol *symbol;
MTAPIRES res=MT_RET_OK;
//--- checks
if(!manager || (total=manager->SymbolTotal())<1)
return(MT_RET_ERR_PARAMS);
//--- allocate arrays
IMTConSymbol **symbols=new IMTConSymbol*[total];
MTAPIRES *results=new MTAPIRES[total];
//--- go through all symbols and save them in an array
for(UINT i=0;i<total; i++)
{
symbol=manager->SymbolCreate();
//--- get a symbol
if(res=manager->SymbolNext(i,symbol)==MT_RET_OK)
{
//--- if successful, write to the array
symbols[i]=symbol;
wprintf_s(L"Symbol %s loaded\n",symbol->Symbol());
//--- change margin rate in own array
if(res=symbols[i]->MarginRateInitial(IMTConSymbol::MARGIN_RATE_BUY_LIMIT,new_rate)==MT_RET_OK)
{
wprintf_s(L"Symbol %s updated\n",symbols[i]->Symbol());
symbols_prepared++;
}
}
else
symbol->Release();
}
//--- send changes
if(res=manager->SymbolUpdateBatch(symbols,symbols_prepared,results)==MT_RET_OK)
{
for(UINT i=0;i<symbols_prepared;i++)
wprintf_s(L"%s update result - %u\n",symbols[i]->Symbol(),results[i]);
}
//--- release objects
for(UINT i=0;i<symbols_prepared;i++)
symbols[i]->Release();
delete[] symbols;
delete[] results;
//--- return result
return(res);
}
.NET Example
//+------------------------------------------------------------------+
//| Batch update of tick value in symbol configuration |
//+------------------------------------------------------------------+
static MTRetCode TickValueUpdateBatch(double new_tick_value, CIMTAdminAPI admin)
{
uint symbols_prepared=0;
uint symbols_total =0;
CIMTConSymbol symbol =null;
MTRetCode res =MTRetCode.MT_RET_OK;
//--- Checking
if(admin==null)
return(MTRetCode.MT_RET_ERR_PARAMS);
//--- Get the number of symbols
symbols_total=admin.SymbolTotal();
if(symbols_total<1)
return(MTRetCode.MT_RET_ERR_PARAMS);
//--- Output the number of symbols to journal
Console.WriteLine("Total symbols to update = {0}", symbols_total);
//--- Create arrays
. CIMTConSymbol[] symbols=new CIMTConSymbol[symbols_total];
MTRetCode[] results=new MTRetCode[symbols_total];
//--- Check all symbols and save them to array
for(uint i=0;i<symbols_total;i++)
{
symbol=admin.SymbolCreate();
//--- Get the symbol
res=admin.SymbolNext(i,symbol);
if(res==MTRetCode.MT_RET_OK)
{
//--- If successful, write to array
symbols[i]=symbol;
Console.WriteLine("Symbol {0} loaded", symbol.Symbol());
//--- Update tick value in our array
res=symbols[i].TickValue(new_tick_value);
if(res==MTRetCode.MT_RET_OK)
{
Console.WriteLine("Updated \a symbol \a {0}", symbols[i].Symbol());
symbols_prepared++;
}
}
else
{
symbol.Release();
}
}
//--- Send changes
res=admin.SymbolUpdateBatch(symbols,results);
if(res==MTRetCode.MT_RET_OK)
{
for(uint i=0; i<results.Length; i++)
Console.WriteLine("{0} update result - {1}", symbols[i].Symbol(),results[i]);
}
//--- Free memory
for(uint i=0; i<symbols_prepared; i++)
symbols[i].Release();
//--- Return the result
return(res);
}
file:///C:/Users/Administrator/AppData/Local/Temp/~hh4BC4.htm 7/17/2025
Manager API Page 69 of 464
IMTAdminAPI::SymbolDelete
Delete a symbol configuration by the index.
C++
MTAPIRES IMTAdminAPI::SymbolDelete(
const UINT pos // Position of the configuration
)
.NET
MTRetCode CIMTAdminAPI.SymbolDelete(
uint pos // Position of the configuration
)
Python
AdminAPI.SymbolDelete(
int pos # Position of the configuration
)
Parameters
pos
[in] Position of the configuration, starting with 0.
Return Value
An indication of successful completion is the MT_RET_OK response code. Otherwise, an error code will be returned.
Note
A configuration can be deleted only from the applications that run on the main server. For all other applications the response code MT_RET_ERR_NOTMAIN will be returned. If the
object is not found, the response code MT_RET_ERR_NOTFOUND will be returned.
IMTAdminAPI::SymbolDelete
Delete a symbol configuration by the index or name.
C++
MTAPIRES IMTAdminAPI::SymbolDelete(
LPCWSTR name // Symbol name
)
.NET
MTRetCode CIMTAdminAPI.SymbolDelete(
string name // Symbol name
)
Python
AdminAPI.SymbolDelete(
str name # Symbol name
)
Parameters
name
[in] Symbol name.
Return Value
An indication of successful completion is the MT_RET_OK response code. Otherwise, an error code will be returned.
Note
A configuration can be deleted only from the applications that run on the main server. For all other applications the response code MT_RET_ERR_NOTMAIN will be returned. If the
object is not found, the response code MT_RET_ERR_NOTFOUND will be returned.
IMTAdminAPI::SymbolDeleteBatch
Delete multiple symbol configurations.
C++
MTAPIRES IMTAdminAPI::SymbolDeleteBatch(
IMTConSymbol** configs, // An array of configurations
const UINT config_total, // The number of configurations in the array
MTAPIRES* results // An array of results
)
.NET
MTRetCode CIMTAdminAPI.SymbolDeleteBatch(
CIMTConSymbol[] configs, // An array of configurations
MTRetCode[] results // An array of results
)
Python
AdminAPI.SymbolDeleteBatch(
symbols # An array of configurations
)
Parameters
configs
[in] A pointer to an array of configurations which you want to delete.
config_total
[in] The number of configurations in the 'configs' array.
file:///C:/Users/Administrator/AppData/Local/Temp/~hh4BC4.htm 7/17/2025
Manager API Page 70 of 464
results
[out] An array with the results of deletion of each configuration on the server.
Return Value
An indication of successful completion is the MT_RET_OK response code. Otherwise, an error code is returned. The MT_RET_OK response code is an indication of successful
sending of changes to a server; results of applying the changes are passed in the 'results' parameter.
Further Note
A configuration can only be deleted from the applications that run on the main server. For all other applications, the response code MT_RET_ERR_NOTMAIN is returned. If the
object is not found, the MT_RET_ERR_PARAMS error code is added to the 'results' array of this object.
IMTAdminAPI::SymbolShift
Changes the position of a symbol configuration in the list.
C++
MTAPIRES IMTAdminAPI::SymbolShift(
const UINT pos, // Position of the configuration
const int shift // Shift
)
.NET
MTRetCode CIMTAdminAPI.SymbolShift(
uint pos, // Position of the configuration
int shift // Shift
)
Python
AdminAPI.SymbolShift(
pos, # Position of the configuration
shift # Shift
)
Parameters
pos
[in] Position of the configuration, starting with 0.
shift
[in] Shift of the configuration relative to its current position. A negative value means the shift to the top of the list, a positive value - to its end.
Return Value
An indication of successful completion is the MT_RET_OK response code. Otherwise, an error code will be returned.
Note
The position of a configuration can be changed only from the applications that run on the main server. For all other applications the response code MT_RET_ERR_NOTMAIN will be
returned.
IMTAdminAPI::SymbolTotal
The total number of symbol configurations available in the platform.
C++
UINT IMTAdminAPI::SymbolTotal()
.NET
uint CIMTAdminAPI.SymbolTotal()
Python
AdminAPI.SymbolTotal()
Return Value
The number of symbol configurations in the trading platform.
IMTAdminAPI::SymbolNext
Get the symbol configuration by the index.
C++
MTAPIRES IMTAdminAPI::SymbolNext(
const UINT pos, // Position of the configuration
IMTConSymbol* symbol // An object of the symbol configuration
)
.NET
MTRetCode CIMTAdminAPI.SymbolNext(
uint pos, // Position of the configuration
CIMTConSymbol symbol // An object of the symbol configuration
)
Python
file:///C:/Users/Administrator/AppData/Local/Temp/~hh4BC4.htm 7/17/2025
Manager API Page 71 of 464
AdminAPI.SymbolNext(
pos, # Position of the configuration
symbol # An object of the symbol configuration
)
Parameters
pos
[in] Position of the configuration, starting with 0.
symbol
[out] An object of the symbol configuration. The symbol object must be first created using the IMTAdminAPI::SymbolCreate method.
Return Value
An indication of successful completion is the MT_RET_OK response code. Otherwise, an error code will be returned.
Note
This method copies the configuration data of a symbol with a specified index to the symbol object.
IMTAdminAPI::SymbolGet
Gets the symbol configuration by the name.
C++
MTAPIRES IMTAdminAPI::SymbolGet(
LPCWSTR name, // Name of the configuration
IMTConSymbol* symbol // An object of the symbol configuration
)
.NET
MTRetCode CIMTAdminAPI.SymbolGet(
string name, // Name of the configuration
CIMTConSymbol symbol // An object of the symbol configuration
)
Python
AdminAPI.SymbolGet(
str name # Name of the configuration
)
Parameters
name
[in] The name of the configuration.
symbol
[out] An object of the symbol configuration. The symbol object must be first created using the IMTAdminAPI::SymbolCreate method.
Return Value
An indication of successful completion is the MT_RET_OK response code. Otherwise, an error code will be returned.
Note
The IMTConSymbol::Symbol() value is used as the name. This method returns a symbol configuration with default trade settings.
IMTAdminAPI::SymbolExist
Check the availability of a symbol for a specified group of clients.
C++
MTAPIRES IMTAdminAPI::SymbolExist(
const IMTConSymbol* symbol, // An object of the symbol configuration
const IMTConGroup* group // An object of the group configuration
)
.NET
MTRetCode CIMTAdminAPI.SymbolExist(
CIMTConSymbol symbol, // An object of the symbol configuration
CIMTConGroup group // An object of the group configuration
)
Python
AdminAPI.SymbolExist(
symbol, # An object of the symbol configuration
group # object of the group configuration
)
Parameters
symbol
[in] An object of the symbol configuration.
group
[in] An object of the group configuration.
Return Value
An indication of successful completion is the MT_RET_OK response code. Otherwise, an error code will be returned.
Note
This method checks whether the parameters of a client group allow working with a specified symbol.
file:///C:/Users/Administrator/AppData/Local/Temp/~hh4BC4.htm 7/17/2025
Manager API Page 72 of 464
IMTAdminAPI::SymbolGroupAdd
Add a subgroup of symbols.
C++
MTAPIRES IMTAdminAPI::SymbolGroupAdd(
LPCWSTR name // the name of the symbol subgroup
)
.NET
MTRetCode CIMTAdminAPI.SymbolGroupAdd(
string name // the name of the symbol subgroup
)
Python
AdminAPI.SymbolGroupAdd(
str name # the name of the symbol subgroup
)
Parameters
name
[in] The name of the subgroup of symbols, with the path.
Return Value
An indication of a successful performance is the MT_RET_OK response code. Otherwise, an error code will be returned.
Note
A subgroup can only be added from applications running on the main server. For all other applications, the response code MT_RET_ERR_NOTMAIN is returned. If the object is not
found, the response code MT_RET_ERR_NOTFOUND is returned.
IMTAdminAPI::SymbolGroupDelete
Remove a subgroup of symbols by name.
C++
MTAPIRES IMTAdminAPI::SymbolGroupDelete(
LPCWSTR name // the name of the subgroup of symbols
)
.NET
MTRetCode CIMTAdminAPI.SymbolGroupDelete(
string name // the name of the subgroup of symbols
)
Python
AdminAPI.SymbolGroupDelete(
str name # the name of the symbol subgroup
)
Parameters
name
[in] The name of the symbol subgroup.
Return Value
An indication of successful completion is the MT_RET_OK response code. Otherwise, an error code will be returned.
Note
The subgroup is deleted along with all the symbols it contains.
A subgroup can only be deleted from applications running on the main server. For all other applications, the response code MT_RET_ERR_NOTMAIN is returned. If the object is not
found, the response code MT_RET_ERR_NOTFOUND is returned.
IMTAdminAPI::SymbolGroupShift
Change the position of a subgroup of symbols in a list.
C++
MTAPIRES IMTAdminAPI::SymbolGroupShift(
const UINT pos, // the position of the symbol subgroup
const int shift // shift
)
.NET
MTRetCode CIMTAdminAPI.SymbolGroupShift(
uint pos, // the position of the symbol subgroup
int shift // shift
)
Python
AdminAPI.SymbolGroupShift(
int pos, # the position of the symbol subgroup
int shift # shift
)
file:///C:/Users/Administrator/AppData/Local/Temp/~hh4BC4.htm 7/17/2025
Manager API Page 73 of 464
Parameters
pos
[in] Position of the symbol subgroup, starting from 0.
shift
[in] The shift of the subgroup relative to its current position. A negative value means shift towards the top of the list, a positive value shifts the subgroup towards the end.
Return Value
An indication of successful completion is the MT_RET_OK response code. Otherwise, an error code will be returned.
Note
The subgroup position can only be changed from the applications running on the main server. For all other applications, the response code MT_RET_ERR_NOTMAIN is returned.
IMTAdminAPI::SymbolGroupTotal
Get the total number of symbol subgroups existing in the platform.
C++
UINT IMTAdminAPI::SymbolGroupTotal()
.NET
uint CIMTAdminAPI.SymbolGroupTotal()
Python
AdminAPI.SymbolGroupTotal()
Return Value
The number of symbol subgroups in the trading platform.
IMTAdminAPI::SymbolGroupNext
Get the name of a subgroup of symbols by index.
C++
MTAPIRES IMTAdminAPI::SymbolGroupNext(
const UINT pos, // the position of the symbol subgroup
MTAPISTR& name // the name of the symbol subgroup
)
.NET
MTRetCode CIMTAdminAPI.SymbolGroupNext(
uint pos, // the position of the symbol subgroup
string name // the name of the symbol subgroup
)
Python
str AdminAPI.SymbolGroupNext(
int pos # the position of the symbol subgroup
)
Parameters
pos
[in] Position of the symbol subgroup, starting from 0.
name
[out] The name of the symbol subgroup.
Return Value
An indication of successful completion is the MT_RET_OK response code. Otherwise, an error code will be returned.
IMTAdminAPI::SymbolGroupExist
Check the presence of a subgroup of symbols on the trading server.
C++
MTAPIRES IMTAdminAPI::SymbolGroupExist(
LPCWSTR name // the name of the subgroup of symbols
)
.NET
MTRetCode CIMTAdminAPI.SymbolGroupExist(
string name // the name of the subgroup of symbols
)
Python
AdminAPI.SymbolGroupExist(
str name # the name of the subgroup of symbols
)
Parameters
name
[in] The name of the symbol subgroup.
file:///C:/Users/Administrator/AppData/Local/Temp/~hh4BC4.htm 7/17/2025
Manager API Page 74 of 464
Return Value
An indication of successful completion is the MT_RET_OK response code. Otherwise, an error code will be returned.
Configuration of Spreads
Functions allow managing spreads, as well subscribe and unsubscribe from events associated with their change.
The following functions for managing spreads are available:
Function Purpose
SpreadCreate Create an object of the configuration of a spread.
SpreadLegCreate Create an object of the configuration of a spread leg.
SpreadSubscribe Subscribe to events and hooks associated with the configuration of spreads.
SpreadUnsubscribe Unsubscribe from events and hooks associated with spread configuration.
SpreadUpdate Add or update a spread configuration.
SpreadUpdateBatch Add or edit multiple spread configurations.
SpreadDelete Deleting a spread configuration by the index.
SpreadDeleteBatch Delete multiple spread configurations.
SpreadShift Change the position of a spread configuration in the list.
SpreadTotal The total number of spread configurations available in the platform.
SpreadNext Receiving a spread configuration by the index.
IMTAdminAPI::SpreadCreate
Create an object of the configuration of a spread.
C++
IMTConSpread* IMTAdminAPI::SpreadCreate()
.NET
CIMTConSpread CIMTAdminAPI.SpreadCreate()
Return Value
It returns a pointer to the created object that implements IMTConSpread interface. In case of failure, it returns NULL.
Note
The created object must be destroyed by calling IMTConSpread::Release method of this object.
IMTAdminAPI::SpreadLegCreate
Create an object of the configuration of a spread leg.
C++
IMTConSpreadLeg* IMTAdminAPI::SpreadLegCreate()
.NET
CIMTConSpreadLeg CIMTAdminAPI.SpreadLegCreate()
Return Value
It returns a pointer to the created object that implements IMTConSpreadLeg interface. In case of failure, it returns NULL.
Note
The created object must be destroyed by calling IMTConSpreadLeg::Release method of this object.
IMTAdminAPI::SpreadSubscribe
Subscribe to events and hooks associated with the configuration of spreads.
C++
MTAPIRES IMTAdminAPI::SpreadSubscribe(
IMTConSpreadSink* sink // pointer to IMTConSpreadSink object
)
.NET
MTRetCode CIMTAdminAPI.SpreadSubscribe(
CIMTConSpreadSink sink // CIMTConSpreadSink object
)
Python
file:///C:/Users/Administrator/AppData/Local/Temp/~hh4BC4.htm 7/17/2025
Manager API Page 75 of 464
AdminAPI.SpreadSubscribe(
sink # IMTConSpreadSink object
)
Parameters
sink
[in] Pointer to the object that implements IMTConSpreadSink interface.
Return Value
An indication of successful completion is the MT_RET_OK response code. Otherwise, an error has occurred that corresponds to the response code.
Note
Subscribing to events is thread safe. One and the same IMTConSpreadSink interface cannot subscribe to an event twice - in this case, MT_RET_ERR_DUPLICATE response code is
returned.
To receive IMTConSpreadSink::OnSpreadSync events, subscribe before calling the IMTAdminAPI::Connect method.
The object at which sink points, must remain in the memory (must not be removed) until the call of IMTAdminAPI::SpreadUnsubscribe or until the administrator interface is
deleted using the IMTAdminAPI::Release method.
IMTAdminAPI::SpreadUnsubscribe
Unsubscribe from events and hooks associated with spread configuration.
C++
MTAPIRES IMTAdminAPI::SpreadUnsubscribe(
IMTConSpreadSink* sink // pointer to IMTConSpreadSink object
)
.NET
MTRetCode CIMTAdminAPI.SpreadUnsubscribe(
CIMTConSpreadSink sink // CIMTConSpreadSink object
)
Python
AdminAPI.SpreadSubscribe(
sink # IMTConSpreadSink object
)
Parameters
sink
[in] Pointer to the object that implements IMTConSymbolSink interface.
Return Value
An indication of successful completion is the MT_RET_OK response code. Otherwise, an error code will be returned.
Note
This is a pair method to IMTAdminAPI::SpreadSubscribe. If an attempt is made to unsubscribe from the interface to which it has not subscribed, MT_RET_ERR_NOTFOUND error is
returned.
IMTAdminAPI::SpreadUpdate
Add or update a spread configuration.
C++
MTAPIRES IMTAdminAPI::SpreadUpdate(
IMTSpreadSymbol* spread // Spread configuration object
)
.NET
MTRetCode CIMTAdminAPI.SpreadUpdate(
CIMTSpreadSymbol spread // Spread configuration object
)
Python
AdminAPI.SpreadUpdate(
spread # Spread configuration object
)
Parameters
spread
[in] Spread configuration object.
Return Value
An indication of successful completion is the MT_RET_OK response code. Otherwise, an error code will be returned.
Note
A configuration can be added or updated only from the plugins that run on the main server. For all other plugins the response code MT_RET_ERR_NOTMAIN will be returned.
Before adding, the correctness of the record is checked. If the record is incorrect, the error code MT_RET_ERR_PARAMS is returned.
IMTAdminAPI::SpreadUpdateBatch
file:///C:/Users/Administrator/AppData/Local/Temp/~hh4BC4.htm 7/17/2025
Manager API Page 76 of 464
.NET
MTRetCode CIMTAdminAPI.SpreadUpdateBatch(
CIMTConSpread[] configs, // An array of configurations
MTRetCode[] results // An array of results
)
Python.NET
AdminAPI.SpreadUpdateBatch(
configs # An array of configurations
)
Parameters
configs
[in] A pointer to an array of configurations which you want to add/update.
config_total
[in] The number of configurations in the 'configs' array.
results
[out] An array with the results of applying of each configuration change on the server.
Return Value
An indication of successful completion is the MT_RET_OK response code. Otherwise, an error code is returned. The MT_RET_OK response code is an indication of successful
sending of changes to a server; results of applying the changes are passed in the 'results' parameter.
Further Note
A configuration can be added or updated only from the plugins that run on the main server. For all other plugins the response code MT_RET_ERR_NOTMAIN will be returned.
Before adding an entry, its correctness is checked. If an entry is incorrect, the MT_RET_ERR_PARAMS error code is added to the 'results' array of this entry.
IMTAdminAPI::SpreadDelete
Deleting a spread configuration by the index.
C++
MTAPIRES IMTAdminAPI::SpreadDelete(
const UINT pos // Position of the configuration
)
.NET
MTRetCode CIMTAdminAPI.SpreadDelete(
uint pos // Position of the configuration
)
Python
AdminAPI.SpreadDelete(
pos # Position of the configuration
)
Parameters
pos
[in] Position of the configuration, starting with 0.
Return Value
An indication of successful completion is the MT_RET_OK response code. Otherwise, an error code will be returned.
Note
A configuration can be deleted only from the plugins that run on the main server. For all other plugins the response code MT_RET_ERR_NOTMAIN will be returned. If the object is
not found, the response code MT_RET_ERR_NOTFOUND will be returned.
IMTAdminAPI::SpreadDelete
Delete multiple spread configurations.
C++
MTAPIRES IMTAdminAPI::SpreadDeleteBatch(
IMTConSpread** configs, // An array of configurations
const UINT config_total, // The number of configurations in the array
MTAPIRES* results // An array of results
)
.NET
MTRetCode CIMTAdminAPI.SpreadDeleteBatch(
CIMTConSpread[] configs, // An array of configurations
MTRetCode[] results // An array of results
)
Python
file:///C:/Users/Administrator/AppData/Local/Temp/~hh4BC4.htm 7/17/2025
Manager API Page 77 of 464
AdminAPI.SpreadDeleteBatch(
configs # An array of configurations
)
Parameters
configs
[in] A pointer to an array of configurations which you want to delete.
config_total
[in] The number of configurations in the 'configs' array.
results
[out] An array with the results of deletion of each configuration on the server.
Return Value
An indication of successful completion is the MT_RET_OK response code. Otherwise, an error code is returned. The MT_RET_OK response code is an indication of successful
sending of changes to a server; results of applying the changes are passed in the 'results' parameter.
Further Note
A configuration can be deleted only from the applications that run on the main server. For all other plugins the response code MT_RET_ERR_NOTMAIN will be returned. If the
object is not found, the MT_RET_ERR_PARAMS error code is added to the 'results' array of this object.
IMTAdminAPI::SpreadShift
Change the position of a spread configuration in the list.
C++
MTAPIRES IMTAdminAPI::SpreadShift(
const UINT pos, // Position of the configuration
const int shift // Shift
)
.NET
MTRetCode CIMTAdminAPI.SpreadShift(
uint pos, // Position of the configuration
int shift // Shift
)
Python
AdminAPI.SpreadShift(
pos, # Position of the configuration
shift # Shift
)
Parameters
pos
[in] Position of the configuration, starting with 0.
shift
[in] Shift of the configuration relative to its current position. A negative value means the shift to the top of the list, a positive value - to its end.
Return Value
An indication of successful completion is the MT_RET_OK response code. Otherwise, an error code will be returned.
Note
The position of a configuration can be changed only from the plugins that run on the main server. For all other plugins the response code MT_RET_ERR_NOTMAIN will be returned.
IMTAdminAPI::SpreadTotal
The total number of spread configurations available in the platform.
C++
UINT IMTAdminAPI::SpreadTotal()
.NET
uint CIMTAdminAPI.SpreadTotal()
Python
AdminAPI.SpreadTotal()
Return Value
The number of configurations of spreads in the trading platform.
IMTAdminAPI::SpreadNext
Receiving a spread configuration by the index.
C++
file:///C:/Users/Administrator/AppData/Local/Temp/~hh4BC4.htm 7/17/2025
Manager API Page 78 of 464
MTAPIRES IMTAdminAPI::SpreadNext(
const UINT pos, // Position of the configuration
IMTConSymbol* spread // Spread configuration object
)
.NET
MTRetCode CIMTAdminAPI.SpreadNext(
uint pos, // Position of the configuration
CIMTConSymbol spread // Spread configuration object
)
Python
AdminAPI.SpreadNext(
pos, # Position of the configuration
spread # Spread configuration object
)
Parameters
pos
[in] Position of the configuration, starting with 0.
spread
[out] Spread configuration object. The spread object must be first created using IMTAdminAPI::SpreadCreate method.
Return Value
An indication of successful completion is the MT_RET_OK response code. Otherwise, an error code will be returned.
Note
This method copies the configuration data of a spread with a specified index to spread object.
Configuration of Groups
Functions allow to manage groups, as well subscribe and unsubscribe from events associated with their change.
The following functions for managing groups are available:
Function Purpose
GroupCreate Create an object of the group configuration.
GroupSymbolCreate Create an object of symbol configuration for a group.
GroupCommissionCreate Create an object of commission configuration for a group.
GroupTierCreate Create an object of commission range configuration for a group.
GroupSubscribe Subscribe to events associated with the configuration of groups.
GroupUnsubscribe Unsubscribe from events associated with the configuration of groups.
GroupUpdate Adds or updates a group configuration.
GroupUpdateBatch Add or edit multiple group configurations.
GroupDelete Delete a group configuration by the name or index
GroupDeleteBatch Delete multiple group configurations.
GroupShift Changes the position of a group configuration in the list.
GroupTotal The total number of group configurations available in the platform.
GroupNext Get the group configuration by the index.
GroupGet Get the group configuration by the name.
IMTAdminAPI::GroupCreate
Create an object of the group configuration.
C++
IMTConGroup* IMTAdminAPI::GroupCreate()
.NET
CIMTConGroup CIMTAdminAPI.GroupCreate()
Return Value
It returns a pointer to the created object that implements the IMTConGroup interface. In case of failure, it returns NULL.
Note
The created object must be destroyed by calling the IMTConGroup::Release method of this object.
IMTAdminAPI::GroupSymbolCreate
Create an object of symbol configuration for a group.
file:///C:/Users/Administrator/AppData/Local/Temp/~hh4BC4.htm 7/17/2025
Manager API Page 79 of 464
C++
IMTConGroupSymbol* IMTAdminAPI::GroupSymbolCreate()
.NET
CIMTConGroupSymbol CIMTAdminAPI.GroupSymbolCreate()
Return Value
It returns a pointer to the created object that implements the IMTConGroupSymbol interface. In case of failure, it returns NULL.
Note
The created object must be destroyed by calling the IMTConGroupSymbol::Release method of this object.
IMTAdminAPI::GroupCommissionCreate
Create an object of commission configuration for a group.
C++
IMTConCommission* IMTAdminAPI::GroupCommissionCreate()
.NET
CIMTConCommission CIMTAdminAPI.GroupCommissionCreate()
Return Value
It returns a pointer to the created object that implements the IMTConCommission interface. In case of failure, it returns NULL.
Note
The created object must be destroyed by calling the IMTConCommission::Release method of this object.
IMTAdminAPI::GroupTierCreate
Create an object of commission range configuration for a group.
C++
IMTConCommTier* IMTAdminAPI::GroupTierCreate()
.NET
CIMTConCommTier CIMTAdminAPI.GroupTierCreate()
Return Value
It returns a pointer to the created object that implements the IMTConCommTier interface. In case of failure, it returns NULL.
Note
The created object must be destroyed by calling the IMTConCommTier::Release method of this object.
IMTAdminAPI::GroupSubscribe
Subscribe to events associated with the configuration of groups.
C++
MTAPIRES IMTAdminAPI::GroupSubscribe(
IMTConGroupSink* sink // A pointer to the IMTConGroupSink object
)
.NET
MTRetCode CIMTAdminAPI.GroupSubscribe(
CIMTConGroupSink sink // CIMTConGroupSink object
)
Python
AdminAPI.GroupSubscribe(
sink # IMTConGroupSink object
)
Parameters
sink
[in] A pointer to the object that implements the IMTConGroupSink interface.
Return Value
An indication of successful completion is the MT_RET_OK response code. Otherwise, an error has occurred that corresponds to the response code.
Note
Subscribing to events is thread safe. One and the same interface IMTConGroupSink cannot subscribe to an event twice - in this case the response code MT_RET_ERR_DUPLICATE is
returned.
To receive IMTConGroupSink::OnGroupSync events, subscribe before calling the IMTAdminAPI::Connect method.
The object at which sink points, must remain in the memory (must not be removed) until the call of IMTAdminAPI::GroupUnsubscribe or until the administrator interface is
deleted using the IMTAdminAPI::Release method.
file:///C:/Users/Administrator/AppData/Local/Temp/~hh4BC4.htm 7/17/2025
Manager API Page 80 of 464
IMTAdminAPI::GroupUnsubscribe
Unsubscribe from events associated with the configuration of groups.
C++
MTAPIRES IMTAdminAPI::GroupUnsubscribe(
IMTConGroupSink* sink // A pointer to the IMTConGroupSink object
)
.NET
MTRetCode CIMTAdminAPI.GroupUnsubscribe(
CIMTConGroupSink sink // CIMTConGroupSink object
)
Python
AdminAPI.GroupUnsubscribe(
sink # IMTConGroupSink object
)
Parameters
sink
[in] A pointer to the object that implements the IMTConGroupSink interface.
Return Value
An indication of successful completion is the MT_RET_OK response code. Otherwise, an error code will be returned.
Note
This is a pair method to IMTAdminAPI::GroupSubscribe. If an attempt is made to unsubscribe from the interface to which it has not subscribed, MT_RET_ERR_NOTFOUND error is
returned.
IMTAdminAPI::GroupUpdate
Adds or updates a group configuration.
C++
MTAPIRES IMTAdminAPI::GroupUpdate(
IMTConGroup* group // Group configuration object
)
.NET
MTRetCode CIMTAdminAPI.GroupUpdate(
CIMTConGroup group // Group configuration object
)
Python
AdminAPI.GroupUpdate(
group # Group configuration object
)
Parameters
group
[in] An object of group configuration.
Return Value
An indication of successful completion is the MT_RET_OK response code. Otherwise, an error code will be returned.
Note
A configuration can be added or updated only from the applications that run on the main server. For all other applications the response code MT_RET_ERR_NOTMAIN will be
returned.
Before adding, the correctness of the record is checked. If the record is incorrect, the error code MT_RET_ERR_PARAMS is returned.
IMTAdminAPI::GroupUpdateBatch
Add or edit multiple group configurations.
C++
MTAPIRES IMTAdminAPI::GroupUpdateBatch(
IMTConGroup** configs, // An array of configurations
const UINT config_total, // The number of configurations in the array
MTAPIRES* results // An array of results
)
.NET
MTRetCode CIMTAdminAPI.GroupUpdateBatch(
CIMTConGroup[] configs, // An array of configurations
MTRetCode[] results // An array of results
)
Python
file:///C:/Users/Administrator/AppData/Local/Temp/~hh4BC4.htm 7/17/2025
Manager API Page 81 of 464
AdminAPI.GroupUpdateBatch(
configs # An array of configurations
)
Parameters
configs
[in] A pointer to an array of configurations which you want to add/update.
config_total
[in] The number of configurations in the 'configs' array.
results
[out] An array with the results of applying of each configuration change on the server.
Return Value
An indication of successful completion is the MT_RET_OK response code. Otherwise, an error code is returned. The MT_RET_OK response code is an indication of successful
sending of changes to a server; results of applying the changes are passed in the 'results' parameter.
Further Note
A configuration can only be added or updated from the applications that run on the main server. For all other applications, the response code MT_RET_ERR_NOTMAIN is returned.
Before adding an entry, its correctness is checked. If an entry is incorrect, the MT_RET_ERR_PARAMS error code is added to the 'results' array of this entry.
IMTAdminAPI::GroupDelete
Delete a group configuration by the name.
C++
MTAPIRES IMTAdminAPI::GroupDelete(
LPCWSTR name // Name of the configuration
)
.NET
MTRetCode CIMTAdminAPI.GroupDelete(
string name // Name of the configuration
)
Python
AdminAPI.GroupDelete(
name # Name of the configuration
)
Parameters
name
[in] The name of the configuration to delete.
Return Value
An indication of successful completion is the MT_RET_OK response code. Otherwise, an error code will be returned.
Note
A configuration can be deleted only from the applications that run on the main server. For all other applications the response code MT_RET_ERR_NOTMAIN will be returned. If the
object is not found, the response code MT_RET_ERR_NOTFOUND will be returned.
IMTAdminAPI::GroupDelete
Deletes a group configuration by the index.
C++
MTAPIRES IMTAdminAPI::GroupDelete(
const UINT pos // Position of the configuration
)
.NET
MTRetCode CIMTAdminAPI.GroupDelete(
uint pos // Position of the configuration
)
Python
AdminAPI.GroupDelete(
pos # Position of the configuration
)
Parameters
pos
[in] Position of the configuration, starting with 0.
Return Value
An indication of successful completion is the MT_RET_OK response code. Otherwise, an error code will be returned.
Note
A configuration can be deleted only from the applications that run on the main server. For all other applications the response code MT_RET_ERR_NOTMAIN will be returned. If the
object is not found, the response code MT_RET_ERR_NOTFOUND will be returned.
IMTAdminAPI::GroupDeleteBatch
Delete multiple group configurations.
file:///C:/Users/Administrator/AppData/Local/Temp/~hh4BC4.htm 7/17/2025
Manager API Page 82 of 464
C++
MTAPIRES IMTAdminAPI::GroupDeleteBatch(
IMTConGroup** configs, // An array of configurations
const UINT config_total, // The number of configurations in the array
MTAPIRES* results // An array of results
)
.NET
MTRetCode CIMTAdminAPI.GroupDeleteBatch(
CIMTConGroup[] configs, // An array of configurations
MTRetCode[] results // An array of results
)
Python
AdminAPI.GroupDeleteBatch(
configs # An array of configurations
)
Parameters
configs
[in] A pointer to an array of configurations which you want to delete.
config_total
[in] The number of configurations in the 'configs' array.
results
[out] An array with the results of deletion of each configuration on the server.
Return Value
An indication of successful completion is the MT_RET_OK response code. Otherwise, an error code is returned. The MT_RET_OK response code is an indication of successful
sending of changes to a server; results of applying the changes are passed in the 'results' parameter.
Further Note
A configuration can only be deleted from the applications that run on the main server. For all other applications, the response code MT_RET_ERR_NOTMAIN is returned. If the
object is not found, the MT_RET_ERR_PARAMS error code is added to the 'results' array of this object.
IMTAdminAPI::GroupShift
Changes the position of a group configuration in the list.
C++
MTAPIRES IMTAdminAPI::GroupShift(
const UINT pos, // Position of the configuration
const int shift // Shift
)
.NET
MTRetCode CIMTAdminAPI.GroupShift(
uint pos, // Position of the configuration
int shift // Shift
)
Python
AdminAPI.GroupShift(
pos, # Position of the configuration
shift # Shift
)
Parameters
pos
[in] Position of the configuration, starting with 0.
shift
[in] Shift of the configuration relative to its current position. A negative value means the shift to the top of the list, a positive value - to its end.
Return Value
An indication of successful completion is the MT_RET_OK response code. Otherwise, an error code will be returned.
Note
The position of a configuration can be changed only from the applications that run on the main server. For all other applications the response code MT_RET_ERR_NOTMAIN will be
returned.
IMTAdminAPI::GroupTotal
The total number of group configurations available in the platform.
C++
UINT IMTAdminAPI::GroupTotal()
.NET
uint CIMTAdminAPI.GroupTotal()
Python
AdminAPI.GroupTotal()
Return Value
file:///C:/Users/Administrator/AppData/Local/Temp/~hh4BC4.htm 7/17/2025
Manager API Page 83 of 464
IMTAdminAPI::GroupNext
Get the group configuration by the index.
C++
MTAPIRES IMTAdminAPI::GroupNext(
const UINT pos, // Position of the configuration
IMTConGroup* group // Group configuration object
)
.NET
MTRetCode CIMTAdminAPI.GroupNext(
uint pos, // Position of the configuration
CIMTConGroup group // Group configuration object
)
Python
AdminAPI.GroupNext(
pos # Position of the configuration
)
Parameters
pos
[in] Position of the configuration, starting with 0.
group
[out] An object of group configuration. The group object must be first created using the IMTAdminAPI::GroupCreate method.
Return Value
An indication of successful completion is the MT_RET_OK response code. Otherwise, an error code will be returned.
Note
This method copies the configuration data of a group with a specified index to the group object.
IMTAdminAPI::GroupGet
Get the group configuration by the name.
C++
MTAPIRES IMTAdminAPI::GroupGet(
LPCWSTR name, // Name of the configuration
IMTConGroup* group // Group configuration object
)
.NET
MTRetCode CIMTAdminAPI.GroupGet(
string name, // Name of the configuration
CIMTConGroup group // Group configuration object
)
Python
AdminAPI.GroupGet(
name # Name of the configuration
)
Parameters
name
[in] The name of the configuration.
group
[out] An object of group configuration. The group object must be first created using the IMTAdminAPI::GroupCreate method.
Return Value
An indication of successful completion is the MT_RET_OK response code. Otherwise, an error code will be returned.
Note
The IMTConGroup::Group() value is used as the name.
Floating Margin
In this section, you can configure a list of rules for quick adjustments of client leverages/margin. You can create several profiles and quickly switch between them in the group
settings. Thus, the platform enables the implementation of a dynamic leverage, often referred to as a floating leverage, which adjusts based on different conditions. For example,
leverage and margin values may vary depending on the volume of positions on the client account, on the day of the week or other conditions. For further details, please see
MetaTrader 5 Administrator documentation.
The functions described in this section enable the management of floating margin configurations:
Function Purpose
LeverageCreate Create a floating margin configuration object.
LeverageRuleCreate Create an object for a floating margin configuration rule.
file:///C:/Users/Administrator/AppData/Local/Temp/~hh4BC4.htm 7/17/2025
Manager API Page 84 of 464
Function Purpose
IMTAdminAPI::LeverageCreate
Create a floating margin configuration object.
C++
IMTConLeverage* IMTAdminAPI::LeverageCreate()
.NET
CIMTConLeverage CIMTAdminAPI.LeverageCreate()
Return Value
Returns a pointer to the created object that implements the IMTConLeverage interface. In case of failure, NULL is returned.
Note
The created object must be destroyed by calling the IMTConLeverage::Release method of this object.
IMTAdminAPI::LeverageRuleCreate
Create an object for a floating margin configuration rule.
C++
IMTConLeverageRule* IMTAdminAPI::LeverageRuleCreate()
.NET
CIMTConLeverageRule CIMTAdminAPI.LeverageRuleCreate()
Return Value
Returns a pointer to the created object that implements the IMTConLeverageRule interface. In case of failure, NULL is returned.
Note
The created object must be destroyed by calling the IMTConLeverageRule::Release method of this object.
IMTAdminAPI::LeverageTierCreate
Create an object for a floating margin rule rule.
C++
IMTConLeverageTier* IMTAdminAPI::LeverageTierCreate()
.NET
CIMTConLeverageTier CIMTAdminAPI.LeverageTierCreate()
Return Value
Returns a pointer to the created object that implements the IMTConLeverageTier interface. In case of failure, NULL is returned.
Note
The created object must be destroyed by calling the IMTConLeverageTier::Release method of this object.
IMTAdminAPI::LeverageSubscribe
Subscribe to events and hooks related to a floating margin configuration.
C++
MTAPIRES IMTAdminAPI::LeverageSubscribe(
IMTConLeverageSink* sink // Pointer to the IMTConLeverageSink object
)
file:///C:/Users/Administrator/AppData/Local/Temp/~hh4BC4.htm 7/17/2025
Manager API Page 85 of 464
.NET
MTRetCode CIMTAdminAPI.LeverageSubscribe(
CIMTConLeverageSink sink // The CIMTConLeverageSink object
)
Python
AdminAPI.LeverageSubscribe(
sink # The IMTConLeverageSink object
)
Parameters
sink
[in] Pointer to the object that implements the IMTConLeverageSink interface.
Return Value
An indication of a successful completion is the MT_RET_OK response code. Otherwise, an error has occurred that corresponds to the response code.
Note
Subscribing to events is implemented in a thread-safe manner. The same IMTConLeverageSink interface cannot be subscribed to an event twice; in this case the response code
MT_RET_ERR_DUPLICATE is returned.
The object pointed by 'sink' must remain in memory (must not be removed) until IMTAdminAPI::LeverageUnsubscribe is called or until the administrator interface is deleted using
the IMTAdminAPI::Release method.
IMTAdminAPI::LeverageUnsubscribe
Unsubscribe from events and hooks related to a floating margin configuration.
C++
MTAPIRES IMTAdminAPI::LeverageUnsubscribe(
IMTConLeverageSink* sink // Pointer to the IMTConLeverageSink object
)
.NET
MTRetCode CIMTAdminAPI.LeverageUnsubscribe(
CIMTConLeverageSink sink // The CIMTConLeverageSink object
)
Python
AdminAPI.LeverageUnsubscribe(
sink # The IMTConLeverageSink object
)
Parameters
sink
[in] Pointer to the object that implements the IMTConLeverageSink interface.
Return Value
An indication of a successful completion is the MT_RET_OK response code. Otherwise, the code of the encountered error is returned.
Note
This method is a counterpart to the IMTAdminAPI::LeverageSubscribe method. When attempting to unsubscribe from an interface that was not previously subscribed, the error
MT_RET_ERR_NOTFOUND is returned.
IMTAdminAPI::LeverageUpdate
Add or update a floating margin configuration.
C++
MTAPIRES IMTAdminAPI::LeverageUpdate(
IMTConLeverage* config // Configuration object
)
.NET
MTRetCode CIMTAdminAPI.LeverageUpdate(
CIMTConLeverage config // Configuration object
)
Python
AdminAPI.LeverageUpdate(
MTConLeverage config // Configuration object
)
Parameters
config
[in] Floating margin configuration object IMTConLeverage.
Return Value
An indication of a successful completion is the MT_RET_OK response code. Otherwise, the code of the encountered error is returned.
Note
When the method is called, the system checks whether the record being added already exists. If the record is found, the system updates it. Otherwise, a new entry is added. The
comparison is based on the configuration name field IMTConLeverage::Name. If an attempt is made to add a completely identical record, no changes are made, and
consequently, the notification method IMTConLeverageSink::OnLeverageUpdate is not called.
A configuration can only be added or updated from the applications running on the main server. For all other applications, the response code MT_RET_ERR_NOTMAIN is returned.
A record is validated before being added. If the record is incorrect, the error code MT_RET_ERR_PARAMS is returned.
file:///C:/Users/Administrator/AppData/Local/Temp/~hh4BC4.htm 7/17/2025
Manager API Page 86 of 464
IMTAdminAPI::LeverageUpdateBatch
Add or update a batch of floating margin configurations.
C++
MTAPIRES IMTAdminAPI::LeverageUpdateBatch(
IMTConLeverage** configs, // Array of configurations
const UINT config_total, // Number of configurations in the array
MTAPIRES* results // Array of results
)
.NET
MTRetCode CIMTAdminAPI.LeverageUpdateBatch(
CIMTConLeverage[] configs, // Array of configurations
MTRetCode[] results // Array of results
)
Python
AdminAPI.LeverageUpdateBatch(
list[MTConLeverage] configs # Array of configurations
)
Parameters
configs
[in] Pointer to the array of configurations which should be added/updated.
config_total
[in] Number of configurations in the 'configs' array.
results
[out] Array with the results of applying each configuration on the server.
Return Value
An indication of a successful completion is the MT_RET_OK response code. Otherwise, the code of the encountered error is returned. The response code MT_RET_OK indicates
successful submission of changes to the server. The result of applying these changes are passed in the 'results' parameter.
Note
A configuration can only be added or updated from the applications running on the main server. For all other applications, the response code MT_RET_ERR_NOTMAIN is returned.
A record is validated before being added. If the record is incorrect, the error code MT_RET_ERR_PARAMS is returned.
IMTAdminAPI::LeverageDelete
Delete a floating margin configuration by name.
C++
MTAPIRES IMTAdminAPI::LeverageDelete(
LPCWSTR name // Configuration name
)
.NET
MTRetCode CIMTAdminAPI.LeverageDelete(
string name // Configuration name
)
Python
AdminAPI.LeverageDelete(
str name # Configuration name
)
Parameters
name
[in] The name of the configuration to delete. The IMTConLeverage::Name value is used for the configuration name.
Return Value
An indication of a successful completion is the MT_RET_OK response code. Otherwise, the code of the encountered error is returned.
Note
A configuration can only be deleted from the applications running on the main server. For all other applications, the response code MT_RET_ERR_NOTMAIN is returned. If the
object is not found, the response code MT_RET_ERR_NOTFOUND is returned.
IMTAdminAPI::LeverageDelete
Delete a floating margin configuration by index.
C++
MTAPIRES IMTAdminAPI::LeverageDelete(
const UINT pos // Configuration position
)
.NET
MTRetCode CIMTAdminAPI.LeverageDelete(
uint pos // Configuration position
)
Python
AdminAPI.LeverageDelete(
int pos # Configuration position
)
file:///C:/Users/Administrator/AppData/Local/Temp/~hh4BC4.htm 7/17/2025
Manager API Page 87 of 464
Parameters
pos
[in] Configuration position starting from 0.
Return Value
An indication of a successful completion is the MT_RET_OK response code. Otherwise, the code of the encountered error is returned.
Note
A configuration can only be deleted from the applications running on the main server. For all other applications, the response code MT_RET_ERR_NOTMAIN is returned. If the
object is not found, the response code MT_RET_ERR_NOTFOUND is returned.
IMTAdminAPI::LeverageDeleteBatch
Delete a batch of floating margin configurations.
C++
MTAPIRES IMTAdminAPI::LeverageDeleteBatch(
IMTConLeverage** configs, // Array of settings
const UINT config_total, // Number of settings in the array
MTAPIRES* results // Array of results
)
.NET
MTRetCode CIMTAdminAPI.LeverageDeleteBatch(
CIMTConLeverage[] configs, // Array of settings
MTRetCode[] results // Array of results
)
Python
AdminAPI.LeverageDeleteBatch(
list[MTConLeverage] configs # Array of settings
)
Parameters
configs
[in] Pointer to an array of configurations which should be deleted.
config_total
[in] Number of configurations in the 'configs' array.
results
[out] Array with the results of deleting each configuration on the server.
Return Value
An indication of a successful completion is the MT_RET_OK response code. Otherwise, the code of the encountered error is returned. The response code MT_RET_OK indicates
successful submission of changes to the server. The result of applying these changes are passed in the 'results' parameter.
Note
Configurations can only be deleted when connected to the main trade server. In all other cases, the MT_RET_ERR_NOTMAIN response code is returned. If the object is not found,
the MT_RET_ERR_PARAMS error code is added to the 'results' array of this object.
IMTAdminAPI::LeverageShift
Change the position of a floating margin configuration in the list.
C++
MTAPIRES IMTAdminAPI::LeverageShift(
const UINT pos, // Configuration position
const int shift // Shift
)
.NET
MTRetCode CIMTAdminAPI.LeverageShift(
uint pos, // Position configuration
int shift // Shift
)
Python
AdminAPI.LeverageShift(
int pos, # Position configuration
int shift # Shift
)
Parameters
pos
[in] Configuration position starting from 0.
shift
[in] Configuration shift relative to its current position. A negative value means shift towards the top of the list, while a positive value shifts the item towards the end.
Return Value
An indication of a successful completion is the MT_RET_OK response code. Otherwise, the code of the encountered error is returned.
Note
The position of a configuration can only be changed from the plugins running on the main server. For all other plugins, the response code MT_RET_ERR_NOTMAIN is returned.
file:///C:/Users/Administrator/AppData/Local/Temp/~hh4BC4.htm 7/17/2025
Manager API Page 88 of 464
IMTAdminAPI::LeverageTotal
Get the total number of floating margin configurations present in the platform.
C++
UINT IMTAdminAPI::LeverageTotal()
.NET
uint CIMTAdminAPI.LeverageTotal()
Python
AdminAPI.LeverageTotal()
Return Value
The number of floating margin configurations in the trading platform.
IMTAdminAPI::LeverageNext
Get a floating margin configuration by index.
C++
MTAPIRES IMTAdminAPI::LeverageNext(
const UINT pos, // Configuration position
IMTConLeverage* config // Configuration object
)
.NET
MTRetCode CIMTAdminAPI.LeverageNext(
uint pos, // Configuration position
CIMTConLeverage config // Configuration object
)
Python
AdminAPI.LeverageNext(
int pos # Configuration position
)
Parameters
pos
[in] Configuration position starting from 0.
config
[out] Configuration object. The config object must be previously created using the IMTAdminAPI::LeverageCreate method.
Return Value
An indication of a successful completion is the MT_RET_OK response code. Otherwise, the code of the encountered error is returned.
Note
This method copies the floating margin configuration with a specified index to the 'config' object.
IMTAdminAPI::LeverageGet
Get a floating margin configuration by name.
C++
MTAPIRES IMTAdminAPI::LeverageGet(
LPCWSTR name, // Configuration name
IMTConLeverage* config // Configuration object
)
.NET
MTRetCode CIMTAdminAPI.LeverageGet(
string name, // Configuration name
CIMTConLeverage config // Configuration object
)
Python
AdminAPI.LeverageGet(
str name # Configuration name
)
Parameters
name
[in] Configuration name. The IMTConLeverage::Name value is used for the configuration name.
config
[out] Configuration object. The config object must be previously created using the IMTAdminAPI::LeverageCreate method.
Return Value
An indication of a successful completion is the MT_RET_OK response code. Otherwise, the code of the encountered error is returned.
Configuration of Managers
Functions allow managing the configurations of managers, as well subscribe and unsubscribe from events associated with their change.
The following functions for configuring mangers are available:
file:///C:/Users/Administrator/AppData/Local/Temp/~hh4BC4.htm 7/17/2025
Manager API Page 89 of 464
Function Purpose
ManagerCreate Create a manager configuration object.
ManagerAccessCreate Create an object of configuration of an access list by IP addresses for a manager.
ManagerReportCreate Create an object for the manager's permission to access the report.
ManagerSubscribe Subscribe to events associated with the configuration of managers.
ManagerUnsubscribe Unsubscribe from events associated with the configuration of managers.
ManagerUpdate Add or update a manager configuration.
ManagerUpdateBatch Add or edit multiple manager configurations.
ManagerDelete Deletes a manager configuration by the index.
ManagerDeleteBatch Delete multiple manager configurations.
ManagerShift Change the position of a manager configuration in the list.
ManagerTotal The total number of manager configurations available in the platform.
ManagerNext Get a manager configuration with the specified index.
ManagerGet Get a manager configuration with the specified login.
ManagerCurrent Get the configuration of the current manager account.
IMTAdminAPI::ManagerCreate
Create an object of manager configuration.
C++
IMTConManager* IMTAdminAPI::ManagerCreate()
.NET
CIMTConManager CIMTAdminAPI.ManagerCreate()
Return Value
It returns a pointer to the created object that implements the IMTConManager interface. In case of failure, it returns NULL.
Note
The created object must be deleted by calling the IMTConManager::Release method of this object.
IMTAdminAPI::ManagerAccessCreate
Create an object of configuration of an access list by IP addresses for a manager.
C++
IMTConManagerAccess* IMTAdminAPI::ManagerAccessCreate()
.NET
CIMTConManagerAccess CIMTAdminAPI.ManagerAccessCreate()
Return Value
It returns a pointer to the created object that implements the IMTConManagerAccess interface. In case of failure, it returns NULL.
Note
The created object must be deleted by calling the IMTConManagerAccess::Release method of this object.
IMTAdminAPI::ManagerReportCreate
Create an object for the manager's permission to access the report.
C++
IMTConManagerReport* IMTAdminAPI::ManagerReportCreate()
.NET
CIMTConManagerReport CIMTAdminAPI.ManagerReportCreate()
Return Value
Returns a pointer to the created object that implements the IMTConManagerReport interface. In case of failure, NULL is returned.
Note
The created object must be destroyed by calling the IMTConManagerReport::Release method of this object.
IMTAdminAPI::ManagerSubscribe
file:///C:/Users/Administrator/AppData/Local/Temp/~hh4BC4.htm 7/17/2025
Manager API Page 90 of 464
.NET
MTRetCode CIMTAdminAPI.ManagerSubscribe(
CIMTConManagerSink sink // CIMTConManagerSink object
)
Python
AdminAPI.ManagerSubscribe(
sink # IMTConManagerSink object
)
Parameters
sink
[in] A pointer to the object that implements the IMTConManagerSink interface.
Return Value
An indication of successful completion is the MT_RET_OK response code. Otherwise, an error has occurred that corresponds to the response code.
Note
Subscribing to events is thread safe. One and the same interface IMTConManagerSink cannot subscribe to an event twice - in this case the response code MT_RET_ERR_DUPLICATE
is returned.
To receive IMTConManagerSink::OnManagerSync events, subscribe before calling the IMTAdminAPI::Connect method.
The object at which sink points, must remain in the memory (must not be removed) until the call of IMTAdminAPI::ManagerUnsubscribe or until the administrator interface is
deleted using the IMTAdminAPI::Release method.
IMTAdminAPI::ManagerUnsubscribe
Unsubscribe from events associated with the configuration of managers.
C++
MTAPIRES IMTAdminAPI::ManagerUnsubscribe(
IMTConManagerSink* sink // A pointer to the IMTConManagerSink object
)
.NET
MTRetCode CIMTAdminAPI.ManagerUnsubscribe(
CIMTConManagerSink sink // CIMTConManagerSink object
)
Python
AdminAPI.ManagerUnsubscribe(
sink # IMTConManagerSink object
)
Parameters
sink
[in] A pointer to the object that implements the IMTConManagerSink interface.
Return Value
An indication of successful completion is the MT_RET_OK response code. Otherwise, an error code will be returned.
Note
This is a pair method to IMTAdminAPI::ManagerSubscribe. If an attempt is made to unsubscribe from the interface to which it has not subscribed, MT_RET_ERR_NOTFOUND error is
returned.
IMTAdminAPI::ManagerUpdate
Adds or updates a manager configuration.
C++
MTAPIRES IMTAdminAPI::ManagerUpdate(
IMTConManager* manager // An object of manager configuration
)
.NET
MTRetCode CIMTAdminAPI.ManagerUpdate(
CIMTConManager manager // An object of manager configuration
)
Python
AdminAPI.ManagerUpdate(
manager # An object of manager configuration
)
Parameters
manager
[in] An object of manager configuration.
file:///C:/Users/Administrator/AppData/Local/Temp/~hh4BC4.htm 7/17/2025
Manager API Page 91 of 464
Return Value
An indication of successful completion is the MT_RET_OK response code. Otherwise, an error code will be returned.
Note
A configuration can be added or updated only from the applications that run on the main server. For all other applications the response code MT_RET_ERR_NOTMAIN will be
returned.
Before adding, the correctness of the record is checked. If the record is incorrect, the error code MT_RET_ERR_PARAMS is returned.
IMTAdminAPI::ManagerUpdateBatch
Add or edit multiple manager configurations.
C++
MTAPIRES IMTAdminAPI::ManagerUpdateBatch(
IMTConManager** configs, // An array of configurations
const UINT config_total, // The number of configurations in the array
MTAPIRES* results // An array of results
)
.NET
MTRetCode CIMTAdminAPI.ManagerUpdateBatch(
CIMTConManager[] configs, // An array of configurations
MTRetCode[] results // An array of results
)
Python
AdminAPI.ManagerUpdateBatch(
configs # An array of configurations
)
Parameters
configs
[in] A pointer to an array of configurations which you want to add/update.
config_total
[in] The number of configurations in the 'configs' array.
results
[out] An array with the results of applying of each configuration change on the server.
Return Value
An indication of successful completion is the MT_RET_OK response code. Otherwise, an error code is returned. The MT_RET_OK response code is an indication of successful
sending of changes to a server; results of applying the changes are passed in the 'results' parameter.
Further Note
A configuration can only be added or updated from the applications that run on the main server. For all other applications, the response code MT_RET_ERR_NOTMAIN is returned.
Before adding an entry, its correctness is checked. If an entry is incorrect, the MT_RET_ERR_PARAMS error code is added to the 'results' array of this entry.
IMTAdminAPI::ManagerDelete
Deletes a manager configuration by the index.
C++
MTAPIRES IMTAdminAPI::ManagerDelete(
const UINT pos // Position of the configuration
)
.NET
MTRetCode CIMTAdminAPI.ManagerDelete(
uint pos // Position of the configuration
)
Python
AdminAPI.ManagerDelete(
pos # Position of the configuration
)
Parameters
pos
[in] Position of the configuration, starting with 0.
Return Value
An indication of successful completion is the MT_RET_OK response code. Otherwise, an error code will be returned.
Note
A configuration can be deleted only from the applications that run on the main server. For all other applications the response code MT_RET_ERR_NOTMAIN will be returned. If the
object is not found, the response code MT_RET_ERR_NOTFOUND will be returned.
IMTAdminAPI::ManagerDeleteBatch
file:///C:/Users/Administrator/AppData/Local/Temp/~hh4BC4.htm 7/17/2025
Manager API Page 92 of 464
.NET
MTRetCode CIMTAdminAPI.ManagerDeleteBatch(
CIMTConManager[] configs, // An array of configurations
MTRetCode[] results // An array of results
)
Python
AdminAPI.ManagerDeleteBatch(
configs # An array of configurations
)
Parameters
configs
[in] A pointer to an array of configurations which you want to delete.
config_total
[in] The number of configurations in the 'configs' array.
results
[out] An array with the results of deletion of each configuration on the server.
Return Value
An indication of successful completion is the MT_RET_OK response code. Otherwise, an error code is returned. The MT_RET_OK response code is an indication of successful
sending of changes to a server; results of applying the changes are passed in the 'results' parameter.
Further Note
A configuration can only be deleted from the applications that run on the main server. For all other applications, the response code MT_RET_ERR_NOTMAIN is returned. If the
object is not found, the MT_RET_ERR_PARAMS error code is added to the 'results' array of this object.
IMTAdminAPI::ManagerShift
Change the position of a manager configuration in the list.
C++
MTAPIRES IMTAdminAPI::ManagerShift(
const UINT pos, // Position of the configuration
const int shift // Shift
)
.NET
MTRetCode CIMTAdminAPI.ManagerShift(
uint pos, // Position of the configuration
int shift // Shift
)
Python
AdminAPI.ManagerShift(
pos, # Position of the configuration
shift # Shift
)
Parameters
pos
[in] Position of the configuration, starting with 0.
shift
[in] Shift of the configuration relative to its current position. A negative value means the shift to the top of the list, a positive value - to its end.
Return Value
An indication of successful completion is the MT_RET_OK response code. Otherwise, an error code will be returned.
Note
The position of a configuration can be changed only from the applications that run on the main server. For all other applications the response code MT_RET_ERR_NOTMAIN will be
returned.
IMTAdminAPI::ManagerTotal
The total number of configurations of managers available in the platform.
C++
UINT IMTAdminAPI::ManagerTotal()
.NET
uint CIMTAdminAPI.ManagerTotal()
Python
AdminAPI.ManagerTotal()
file:///C:/Users/Administrator/AppData/Local/Temp/~hh4BC4.htm 7/17/2025
Manager API Page 93 of 464
Return Value
The number of configurations of managers available in the trading platform.
IMTAdminAPI::ManagerNext
Gets a manager configuration with the specified index.
C++
MTAPIRES IMTAdminAPI::ManagerNext(
const UINT pos, // Position of the configuration
IMTConManager* manager // An object of manager configuration
)
.NET
MTRetCode CIMTAdminAPI.ManagerNext(
uint pos, // Position of the configuration
CIMTConManager manager // An object of manager configuration
)
Python
AdminAPI.ManagerNext(
pos # Position of the configuration
)
Parameters
pos
[in] Position of the configuration, starting with 0.
manager
[out] An object of manager configuration. The manager object must be first created using the IMTAdminAPI::ManagerCreate method.
Return Value
An indication of successful completion is the MT_RET_OK response code. Otherwise, an error code will be returned.
Note
This method copies the configuration data of a manager with a specified index to the manager object.
IMTAdminAPI::ManagerGet
Gets a manager configuration with the specified login.
C++
MTAPIRES IMTAdminAPI::ManagerGet(
const UINT64 login, // Login of a manager
IMTConManager* manager // An object of manager configuration
)
.NET
MTRetCode CIMTAdminAPI.ManagerGet(
ulong login, // Login of a manager
CIMTConManager manager // An object of manager configuration
)
Python
AdminAPI.ManagerGet(
login # Login of a manager
)
Parameters
login
[in] The login of a manager.
manager
[out] An object of manager configuration. The manager object must be first created using the IMTAdminAPI::ManagerCreate method.
Return Value
An indication of successful completion is the MT_RET_OK response code. Otherwise, an error code will be returned.
Note
The IMTConManager::Login() value is used as the login.
IMTAdminAPI::ManagerCurrent
Get the configuration of the current manager account.
C++
MTAPIRES IMTAdminAPI::ManagerCurrent(
IMTConManager* manager // Manager configuration object
)
.NET
file:///C:/Users/Administrator/AppData/Local/Temp/~hh4BC4.htm 7/17/2025
Manager API Page 94 of 464
MTRetCode CIMTAdminAPI.ManagerCurrent(
CIMTConManager manager // Manager configuration object
)
Python
AdminAPI.ManagerCurrent(
manager # Manager configuration object
)
Parameters
manager
[out] An object of manager configuration. The 'manager' object must be previously created using the IMTAdminAPI::ManagerCreate method.
Return Value
An indication of successful completion is the MT_RET_OK response code. Otherwise, an error code will be returned.
Note
The method returns the description of the manager account using which the Manager API application is currently connected to the server.
Function Purpose
HistorySyncCreate Create an object of configuration of price data synchronization.
HistorySyncSubscribe Subscribe to events associated with the configuration of price data synchronization.
HistorySyncUnsubscribe Unsubscribe from events associated with the configuration of price data synchronization.
HistorySyncStart Start synchronization of historical data.
HistorySyncUpdate Add or update of a configuration of price data synchronization.
HistorySyncUpdateBatch Add and edit multiple configurations of price data synchronization.
HistorySyncDelete Delete a configuration of price data synchronization by its index.
HistorySyncDeleteBatch Delete multiple configurations of price data synchronization.
HistorySyncShift Change the position of the configuration of price data synchronization in the list.
HistorySyncTotal The total number of configurations of price data synchronization available in the platform.
HistorySyncNext Get a configuration of price data synchronization based on its index.
IMTAdminAPI::HistorySyncCreate
Create an object of configuration of price data synchronization.
C++
IMTConHistorySync* IMTAdminAPI::HistorySyncCreate()
.NET
CIMTConHistorySync CIMTAdminAPI.HistorySyncCreate()
Return Value
It returns a pointer to the created object that implements the IMTConHistorySync interface. In case of failure, it returns NULL.
Note
The created object must be deleted by calling the IMTConHistorySync::Release method of this object.
IMTAdminAPI::HistorySyncSubscribe
Subscribe to events associated with the configuration of price data synchronization.
C++
MTAPIRES IMTAdminAPI::HistorySyncSubscribe(
IMTConHistorySyncSink* sink // A pointer to the IMTConHistorySyncSink object
)
.NET
MTRetCode CIMTAdminAPI.HistorySyncSubscribe(
CIMTConHistorySyncSink sink // CIMTConHistorySyncSink object
)
Python
AdminAPI.HistorySyncSubscribe(
sink # IMTConHistorySyncSink object
)
file:///C:/Users/Administrator/AppData/Local/Temp/~hh4BC4.htm 7/17/2025
Manager API Page 95 of 464
Parameters
sink
[in] A pointer to the object that implements the IMTConHistorySyncSink interface.
Return Value
An indication of successful completion is the MT_RET_OK response code. Otherwise, an error has occurred that corresponds to the response code.
Note
Subscribing to events is thread safe. One and the same interface IMTConHistorySyncSink cannot subscribe to events twice - in this case the response code
MT_RET_ERR_DUPLICATE is returned.
To receive IMTConHistorySyncSink::OnHistorySyncSync events, subscribe before calling the IMTAdminAPI::Connect method.
The object at which sink points, must remain in the memory (must not be removed) until the call of IMTAdminAPI::HistorySyncUnsubscribe or until the administrator interface is
deleted using the IMTAdminAPI::Release method.
IMTAdminAPI::HistorySyncUnsubscribe
Unsubscribe from events associated with the configuration of price data synchronization.
C++
MTAPIRES IMTAdminAPI::HistorySyncUnsubscribe(
IMTConHistorySyncSink* sink // A pointer to the IMTConHistorySyncSink object
)
.NET
MTRetCode CIMTAdminAPI.HistorySyncUnsubscribe(
CIMTConHistorySyncSink sink // CIMTConHistorySyncSink object
)
Python
AdminAPI.HistorySyncUnsubscribe(
sink # IMTConHistorySyncSink object
)
Parameters
sink
[in] A pointer to the object that implements the IMTConHistorySyncSink interface.
Return Value
An indication of successful completion is the MT_RET_OK response code. Otherwise, an error code will be returned.
Note
This is a pair method to IMTAdminAPI::HistorySyncSubscribe. If an attempt is made to unsubscribe from the interface to which it has not subscribed, MT_RET_ERR_NOTFOUND
error is returned.
IMTAdminAPI::HistorySyncStart
Start synchronization of historical data.
C++
MTAPIRES IMTAdminAPI::HistorySyncStart()
.NET
MTRetCode CIMTAdminAPI.HistorySyncStart()
Python
AdminAPI.HistorySyncStart()
Return Value
An indication of successful completion is the MT_RET_OK response code. Otherwise, an error code will be returned.
IMTAdminAPI::HistorySyncUpdate
Add or update of a configuration of price data synchronization.
C++
MTAPIRES IMTAdminAPI::HistorySyncUpdate(
IMTConHistorySync* config // An object of configuration of price data synchronization
)
.NET
MTRetCode CIMTAdminAPI.HistorySyncUpdate(
CIMTConHistorySync config // An object of configuration of price data synchronization
)
Python
AdminAPI.HistorySyncUpdate(
config # An object of configuration of price data synchronization
)
file:///C:/Users/Administrator/AppData/Local/Temp/~hh4BC4.htm 7/17/2025
Manager API Page 96 of 464
Parameters
config
[in] An object of configuration of price data synchronization.
Return Value
An indication of successful completion is the MT_RET_OK response code. Otherwise, an error code will be returned.
Note
A configuration can be added or updated only from the applications that run on the main server. For all other applications the response code MT_RET_ERR_NOTMAIN will be
returned.
Before adding, the correctness of the record is checked. If the record is incorrect, the error code MT_RET_ERR_PARAMS is returned.
IMTAdminAPI::HistorySyncUpdateBatch
Add and edit multiple configurations of price data synchronization.
C++
MTAPIRES IMTAdminAPI::HistorySyncUpdateBatch(
IMTConHistorySync** configs, // An array of configurations
const UINT config_total, // The number of configurations in the array
MTAPIRES* results // An array of results
)
.NET
MTRetCode CIMTAdminAPI.HistorySyncUpdateBatch(
CIMTConHistorySync[] configs, // An array of configurations
MTRetCode[] results // An array of results
)
Python
AdminAPI.HistorySyncUpdateBatch(
configs # An array of configurations
)
Parameters
configs
[in] A pointer to an array of configurations which you want to add/update.
config_total
[in] The number of configurations in the 'configs' array.
results
[out] An array with the results of applying of each configuration change on the server.
Return Value
An indication of successful completion is the MT_RET_OK response code. Otherwise, an error code is returned. The MT_RET_OK response code is an indication of successful
sending of changes to a server; results of applying the changes are passed in the 'results' parameter.
Further Note
A configuration can only be added or updated from the applications that run on the main server. For all other applications, the response code MT_RET_ERR_NOTMAIN is returned.
Before adding an entry, its correctness is checked. If an entry is incorrect, the MT_RET_ERR_PARAMS error code is added to the 'results' array of this entry.
IMTAdminAPI::HistorySyncDelete
Delete a configuration of price data synchronization by its index.
C++
MTAPIRES IMTAdminAPI::HistorySyncDelete(
const UINT pos // Position of the configuration
)
.NET
MTRetCode CIMTAdminAPI.HistorySyncDelete(
uint pos // Position of the configuration
)
Python
AdminAPI.HistorySyncDelete(
pos # Position of the configuration
)
Parameters
pos
[in] Position of the configuration, starting with 0.
Return Value
An indication of successful completion is the MT_RET_OK response code. Otherwise, an error code will be returned.
Note
A configuration can be deleted only from the applications that run on the main server. For all other applications the response code MT_RET_ERR_NOTMAIN will be returned. If the
object is not found, the response code MT_RET_ERR_NOTFOUND will be returned.
file:///C:/Users/Administrator/AppData/Local/Temp/~hh4BC4.htm 7/17/2025
Manager API Page 97 of 464
IMTAdminAPI::HistorySyncDeleteBatch
Delete multiple configurations of price data synchronization.
C++
MTAPIRES IMTAdminAPI::HistorySyncDeleteBatch(
IMTConHistorySync** configs, // An array of configurations
const UINT config_total, // The number of configurations in the array
MTAPIRES* results // An array of results
)
.NET
MTRetCode CIMTAdminAPI.HistorySyncDeleteBatch(
CIMTConHistorySync[] configs, // An array of configurations
MTRetCode[] results // An array of results
)
Python
AdminAPI.HistorySyncDeleteBatch(
configs # An array of configurations
)
Parameters
configs
[in] A pointer to an array of configurations which you want to delete.
config_total
[in] The number of configurations in the 'configs' array.
results
[out] An array with the results of deletion of each configuration on the server.
Return Value
An indication of successful completion is the MT_RET_OK response code. Otherwise, an error code is returned. The MT_RET_OK response code is an indication of successful
sending of changes to a server; results of applying the changes are passed in the 'results' parameter.
Further Note
A configuration can only be deleted from the applications that run on the main server. For all other applications, the response code MT_RET_ERR_NOTMAIN is returned. If the
object is not found, the MT_RET_ERR_PARAMS error code is added to the 'results' array of this object.
IMTAdminAPI::HistorySyncShift
Change the position of the configuration of price data synchronization in the list.
C++
MTAPIRES IMTAdminAPI::HistorySyncShift(
const UINT pos, // Position of the configuration
const int shift // Shift
)
.NET
MTRetCode CIMTAdminAPI.HistorySyncShift(
uint pos, // Position of the configuration
int shift // Shift
)
Python
AdminAPI.HistorySyncShift(
pos, # Position of the configuration
shift # Shift
)
Parameters
pos
[in] Position of the configuration, starting with 0.
shift
[in] Shift of the configuration relative to its current position. A negative value means the shift to the top of the list, a positive value - to its end.
Return Value
An indication of successful completion is the MT_RET_OK response code. Otherwise, an error code will be returned.
Note
The position of a configuration can be changed only from the applications that run on the main server. For all other applications the response code MT_RET_ERR_NOTMAIN will be
returned.
IMTAdminAPI::HistorySyncTotal
The total number of configurations of price data synchronization available in the platform.
C++
UINT IMTAdminAPI::HistorySyncTotal()
.NET
uint CIMTAdminAPI.HistorySyncTotal()
file:///C:/Users/Administrator/AppData/Local/Temp/~hh4BC4.htm 7/17/2025
Manager API Page 98 of 464
Python
AdminAPI.HistorySyncTotal()
Return Value
The number of configurations of price data synchronization in the trading platform.
IMTAdminAPI::HistorySyncNext
Get a configuration of price data synchronization based on its index.
C++
MTAPIRES IMTAdminAPI::HistorySyncNext(
const UINT pos, // Position of the configuration
IMTConHistorySync* config // An object of configuration of price data synchronization
)
.NET
MTRetCode CIMTAdminAPI.HistorySyncNext(
uint pos, // Position of the configuration
CIMTConHistorySync config // An object of configuration of price data synchronization
)
Python
AdminAPI.HistorySyncNext(
pos # Position of the configuration
)
Parameters
pos
[in] Position of the configuration, starting with 0.
config
[out] An object of configuration of price data synchronization. The config object must first be created using the IMTAdminAPI::HistorySyncCreate method.
Return Value
An indication of successful completion is the MT_RET_OK response code. Otherwise, an error code will be returned.
Note
This method copies the synchronization configuration entry with a specified index to the config object.
Gateway Configuration
Functions allow managing the gateway configurations, as well subscribe and unsubscribe from events associated with their change.
To manage the configuration of gateways, the following functions are available:
Function Purpose
GatewayCreate Create an object of the gateway configuration.
GatewayModuleCreate Create an object of configuration of the gateway module.
GatewayParamCreate Create an object of the gateway parameter.
GatewayTranslateCreate Create an object of the parameter for converting the information received by the gateway.
GatewaySubscribe Subscribe to events associated with the gateway configuration.
GatewayUnsubscribe Unsubscribe from events associated with the gateway configuration.
GatewayRestart Restart gateways.
GatewayUpdate Add or update a gateway configuration.
GatewayUpdateBatch Add or edit multiple gateway configurations.
GatewayDelete Delete a gateway configuration by the name or index.
GatewayDeleteBatch Delete multiple gateway configurations.
GatewayShift Change the position of a gateway configuration in the list.
GatewayTotal The total number of gateway configurations available in the platform.
GatewayNext Get the gateway configuration by the index.
GatewayGet Get the gateway configuration by the name.
GatewayModuleTotal The total number of configurations of gateway modules available in the platform.
GatewayModuleNext Get the gateway module by the index.
GatewayModuleGet Get the gateway module configuration by the name.
GatewayPositionRequest Request the current state of positions from the trading accounts used by the gateway in an external system.
IMTAdminAPI::GatewayCreate
file:///C:/Users/Administrator/AppData/Local/Temp/~hh4BC4.htm 7/17/2025
Manager API Page 99 of 464
.NET
CIMTConGateway CIMTAdminAPI.GatewayCreate()
Return Value
It returns a pointer to the created object that implements the IMTConGateway interface. In case of failure, it returns NULL.
Note
The created object must be destroyed by calling the IMTConGateway::Release method of this object.
IMTAdminAPI::GatewayModuleCreate
Create an object of configuration of the gateway module.
C++
IMTConGatewayModule* IMTAdminAPI::GatewayModuleCreate()
.NET
CIMTConGatewayModule CIMTAdminAPI.GatewayModuleCreate()
Return Value
It returns a pointer to the created object that implements the IMTConGatewayModule interface. In case of failure, it returns NULL.
Note
The created object must be deleted by calling the IMTConGatewayModule::Release method of this object.
IMTAdminAPI::GatewayParamCreate
Create an object of the gateway parameter.
C++
IMTConParam* IMTAdminAPI::GatewayParamCreate()
.NET
CIMTConParam CIMTAdminAPI.GatewayParamCreate()
Return Value
It returns a pointer to the created object that implements the IMTConParam interface. In case of failure, it returns NULL.
Note
The created object must be destroyed by calling the IMTConParam::Release method of this object.
IMTAdminAPI::GatewayTranslateCreate
Create an object of the parameter for converting the information received by the gateway.
C++
IMTConGatewayTranslate* IMTAdminAPI::GatewayTranslateCreate()
.NET
CIMTConGatewayTranslate CIMTAdminAPI.GatewayTranslateCreate()
Return Value
It returns a pointer to the created object that implements the IMTConGatewayTranslate interface. In case of failure, it returns NULL.
Note
The created object must be destroyed by calling the IMTConGatewayTranslate::Release method of this object.
IMTAdminAPI::GatewaySubscribe
Subscribe to events associated with the gateway configuration.
C++
MTAPIRES IMTAdminAPI::GatewaySubscribe(
IMTConGatewaySink* sink // A pointer to the IMTConGatewaySink object
)
.NET
file:///C:/Users/Administrator/AppData/Local/Temp/~hh4BC4.htm 7/17/2025
Manager API Page 100 of 464
MTRetCode CIMTAdminAPI.GatewaySubscribe(
CIMTConGatewaySink sink // CIMTConGatewaySink object
)
Python
AdminAPI.GatewaySubscribe(
sink # IMTConGatewaySink object
)
Parameters
sink
[in] A pointer to the object that implements the IMTConGatewaySink interface.
Return Value
An indication of successful completion is the MT_RET_OK response code. Otherwise, an error has occurred that corresponds to the response code.
Note
Subscribing to events is thread safe. One and the same interface IMTConGatewaySink cannot subscribe to an event twice - in this case the response code MT_RET_ERR_DUPLICATE
is returned.
To receive IMTConGatewaySink::OnGatewaySync events, subscribe before calling the IMTAdminAPI::Connect method.
The object at which sink points, must remain in the memory (must not be removed) until the call of IMTAdminAPI::GatewayUnsubscribe or until the administrator interface is
deleted using the IMTAdminAPI::Release method.
IMTAdminAPI::GatewayUnsubscribe
Unsubscribe from events associated with the gateway configuration.
C++
MTAPIRES IMTAdminAPI::GatewayUnsubscribe(
IMTConGatewaySink* sink // A pointer to the IMTConGatewaySink object
)
.NET
MTRetCode CIMTAdminAPI.GatewayUnsubscribe(
CIMTConGatewaySink sink // CIMTConGatewaySink object
)
Python
AdminAPI.GatewayUnsubscribe(
sink # IMTConGatewaySink object
)
Parameters
sink
[in] A pointer to the object that implements the IMTConGatewaySink interface.
Return Value
An indication of successful completion is the MT_RET_OK response code. Otherwise, an error code will be returned.
Note
This is a pair method to IMTAdminAPI::GatewaySubscribe. If an attempt is made to unsubscribe from the interface to which it has not subscribed, MT_RET_ERR_NOTFOUND error
is returned.
IMTAdminAPI::GatewayRestart
Restart gateways.
C++
MTAPIRES IMTAdminAPI::GatewayRestart()
.NET
MTRetCode CIMTAdminAPI.GatewayRestart()
Python
AdminAPI.GatewayRestart()
Return Value
An indication of successful completion is the MT_RET_OK response code. Otherwise, an error code will be returned.
Note
This command restarts all gateways.
IMTAdminAPI::GatewayUpdate
Add or update a gateway configuration.
C++
file:///C:/Users/Administrator/AppData/Local/Temp/~hh4BC4.htm 7/17/2025
Manager API Page 101 of 464
MTAPIRES IMTAdminAPI::GatewayUpdate(
IMTConGateway* gateway // Gateway configuration object
)
.NET
MTRetCode CIMTAdminAPI.GatewayUpdate(
CIMTConGateway gateway // Gateway configuration object
)
Python
AdminAPI.GatewayUpdate(
gateway # Gateway configuration object
)
Parameters
gateway
[in] The gateway configuration object.
Return Value
An indication of successful completion is the MT_RET_OK response code. Otherwise, an error code will be returned.
Note
A configuration can be added or updated only from the applications that run on the main server. For all other applications the response code MT_RET_ERR_NOTMAIN will be
returned.
Before adding, the correctness of the record is checked. If the record is incorrect, the error code MT_RET_ERR_PARAMS is returned.
IMTAdminAPI::GatewayUpdateBatch
Add or edit multiple gateway configurations.
C++
MTAPIRES IMTAdminAPI::GatewayUpdateBatch(
IMTConGateway** configs, // An array of configurations
const UINT config_total, // The number of configurations in the array
MTAPIRES* results // An array of results
)
.NET
MTRetCode CIMTAdminAPI.GatewayUpdateBatch(
CIMTConGateway[] configs, // An array of configurations
MTRetCode[] results // An array of results
)
Python
AdminAPI.GatewayUpdateBatch(
configs # An array of configurations
)
Parameters
configs
[in] A pointer to an array of configurations which you want to add/update.
config_total
[in] The number of configurations in the 'configs' array.
results
[out] An array with the results of applying of each configuration change on the server.
Return Value
An indication of successful completion is the MT_RET_OK response code. Otherwise, an error code is returned. The MT_RET_OK response code is an indication of successful
sending of changes to a server; results of applying the changes are passed in the 'results' parameter.
Further Note
A configuration can only be added or updated from the applications that run on the main server. For all other applications, the response code MT_RET_ERR_NOTMAIN is returned.
Before adding an entry, its correctness is checked. If an entry is incorrect, the MT_RET_ERR_PARAMS error code is added to the 'results' array of this entry.
IMTAdminAPI::GatewayDelete
Delete a gateway configuration by the name.
C++
MTAPIRES IMTAdminAPI::GatewayDelete(
LPCWSTR name // Name of the configuration
)
.NET
MTRetCode CIMTAdminAPI.GatewayDelete(
string name // Name of the configuration
)
Python
AdminAPI.GatewayDelete(
name # Name of the configuration
)
file:///C:/Users/Administrator/AppData/Local/Temp/~hh4BC4.htm 7/17/2025
Manager API Page 102 of 464
Parameters
name
[in] The name of the configuration to delete.
Return Value
An indication of successful completion is the MT_RET_OK response code. Otherwise, an error code will be returned.
Note
A configuration can be deleted only from the applications that run on the main server. For all other applications the response code MT_RET_ERR_NOTMAIN will be returned. If the
object is not found, the response code MT_RET_ERR_NOTFOUND will be returned.
IMTAdminAPI::GatewayDelete
Delete a gateway configuration by the index.
C++
MTAPIRES IMTAdminAPI::GatewayDelete(
const UINT pos // Position of the configuration
)
.NET
MTRetCode CIMTAdminAPI.GatewayDelete(
uint pos // Position of the configuration
)
Python
AdminAPI.GatewayDelete(
pos # Position of the configuration
)
Parameters
pos
[in] Position of the configuration, starting with 0.
Return Value
An indication of successful completion is the MT_RET_OK response code. Otherwise, an error code will be returned.
Note
A configuration can be deleted only from the applications that run on the main server. For all other applications the response code MT_RET_ERR_NOTMAIN will be returned. If the
object is not found, the response code MT_RET_ERR_NOTFOUND will be returned.
IMTAdminAPI::GatewayDeleteBatch
Delete multiple gateway configurations.
C++
MTAPIRES IMTAdminAPI::GatewayDeleteBatch(
IMTConGateway** configs, // An array of configurations
const UINT config_total, // The number of configurations in the array
MTAPIRES* results // An array of results
)
.NET
MTRetCode CIMTAdminAPI.GatewayDeleteBatch(
CIMTConGateway[] configs, // An array of configurations
MTRetCode[] results // An array of results
)
Python
AdminAPI.GatewayDeleteBatch(
configs # An array of configurations
)
Parameters
configs
[in] A pointer to an array of configurations which you want to delete.
config_total
[in] The number of configurations in the 'configs' array.
results
[out] An array with the results of deletion of each configuration on the server.
Return Value
An indication of successful completion is the MT_RET_OK response code. Otherwise, an error code is returned. The MT_RET_OK response code is an indication of successful
sending of changes to a server; results of applying the changes are passed in the 'results' parameter.
Further Note
A configuration can only be deleted from the applications that run on the main server. For all other applications, the response code MT_RET_ERR_NOTMAIN is returned. If the
object is not found, the MT_RET_ERR_PARAMS error code is added to the 'results' array of this object.
IMTAdminAPI::GatewayShift
Change the position of a gateway configuration in the list.
C++
file:///C:/Users/Administrator/AppData/Local/Temp/~hh4BC4.htm 7/17/2025
Manager API Page 103 of 464
MTAPIRES IMTAdminAPI::GatewayShift(
const UINT pos, // Position of the configuration
const int shift // Shift
)
.NET
MTRetCode CIMTAdminAPI.GatewayShift(
uint pos, // Position of the configuration
int shift // Shift
)
Python
AdminAPI.GatewayShift(
pos, # Position of the configuration
shift # Shift
)
Parameters
pos
[in] Position of the configuration, starting with 0.
shift
[in] Shift of the configuration relative to its current position. A negative value means the shift to the top of the list, a positive value - to its end.
Return Value
An indication of successful completion is the MT_RET_OK response code. Otherwise, an error code will be returned.
Note
The position of a configuration can be changed only from the applications that run on the main server. For all other applications the response code MT_RET_ERR_NOTMAIN will be
returned.
IMTAdminAPI::GatewayTotal
The total number of gateway configurations available in the platform.
C++
UINT IMTAdminAPI::GatewayTotal()
.NET
uint CIMTAdminAPI.GatewayTotal()
Python
AdminAPI.GatewayTotal()
Return Value
The number of gateway configurations in the trading platform.
IMTAdminAPI::GatewayNext
Get the gateway configuration by the index.
C++
MTAPIRES IMTAdminAPI::GatewayNext(
const UINT pos, // Position of the configuration
IMTConGateway* gateway // Gateway configuration object
)
.NET
MTRetCode CIMTAdminAPI.GatewayNext(
uint pos, // Position of the configuration
CIMTConGateway gateway // Gateway configuration object
)
Python
AdminAPI.GatewayNext(
pos # Position of the configuration
)
Parameters
pos
[in] Position of the configuration, starting with 0.
gateway
[out] The gateway configuration object. The gateway object must be first created using the IMTAdminAPI::GatewayCreate method.
Return Value
An indication of successful completion is the MT_RET_OK response code. Otherwise, an error code will be returned.
Note
This method copies the configuration data of a gateway with a specified index to the gateway object.
file:///C:/Users/Administrator/AppData/Local/Temp/~hh4BC4.htm 7/17/2025
Manager API Page 104 of 464
IMTAdminAPI::GatewayGet
Get the gateway configuration by the name.
C++
MTAPIRES IMTAdminAPI::GatewayGet(
LPCWSTR name, // Name of the configuration
IMTConGateway* gateway // Gateway configuration object
)
.NET
MTRetCode CIMTAdminAPI.GatewayGet(
string name, // Name of the configuration
CIMTConGateway gateway // Gateway configuration object
)
Python
AdminAPI.GatewayGet(
name # Name of the configuration
)
Parameters
name
[in] The name of the configuration.
gateway
[out] The gateway configuration object. The gateway object must be first created using the IMTAdminAPI::GatewayCreate method.
Return Value
An indication of successful completion is the MT_RET_OK response code. Otherwise, an error code will be returned.
Note
The IMTConGateway::Name() value is used as the name.
IMTAdminAPI::GatewayModuleTotal
The total number of gateway modules available in the platform.
C++
UINT IMTAdminAPI::GatewayModuleTotal()
.NET
uint CIMTAdminAPI.GatewayModuleTotal()
Python
AdminAPI.GatewayModuleTotal()
Return Value
The number of gateway modules in the trading platform.
IMTAdminAPI::GatewayModuleGet
Get the gateway module by the name.
C++
MTAPIRES IMTAdminAPI::GatewayModuleGet(
LPCWSTR name, // Name of the module
IMTConGatewayModule* module // Object of the gateway module
)
.NET
MTRetCode CIMTAdminAPI.GatewayModuleGet(
string name, // Name of the configuration
CIMTConGatewayModule module // Object of the gateway module
)
Python
AdminAPI.GatewayModuleGet(
name # Name of the configuration
)
Parameters
name
[in] The name of the module.
module
[out] The gateway module object. The gateway object must be first created using the IMTAdminAPI::GatewayModuleCreate method.
Return Value
An indication of successful completion is the MT_RET_OK response code. Otherwise, an error code will be returned.
Note
The IMTConGatewayModule::Name value is used as the name.
file:///C:/Users/Administrator/AppData/Local/Temp/~hh4BC4.htm 7/17/2025
Manager API Page 105 of 464
IMTAdminAPI::GatewayModuleNext
Get the gateway module by the index.
C++
MTAPIRES IMTAdminAPI::GatewayModuleNext(
const UINT pos, // Position of the module
IMTConGatewayModule* module // Object of the gateway module
)
.NET
MTRetCode CIMTAdminAPI.GatewayModuleNext(
uint pos, // Position of the module
CIMTConGatewayModule module // Object of the gateway module
)
Python
AdminAPI.GatewayModuleNext(
pos # Position of the module
)
Parameters
pos
[in] Position of the module, starting with 0.
module
[out] The gateway module object. The gateway object must be first created using the IMTAdminAPI::GatewayModuleCreate method.
Return Value
An indication of successful completion is the MT_RET_OK response code. Otherwise, an error code will be returned.
Note
This method copies the gateway configuration with a specified index to the module object.
IMTAdminAPI::GatewayPositionRequest
Request the current state of positions from the trading accounts used by the gateway in an external system. Depending on the gateway tab, positions can be displayed via one or
several accounts.
C++
MTAPIRES IMTAdminAPI::GatewayPositionRequest(
UINT64 gateway_id, // Gateway ID
IMTPositionArray* positions, // Positions array
INT64& positions_time // Position state fixing time
)
.NET
MTRetCode CIMTAdminAPI.GatewayPositionRequest(
ulong gateway_id, // Gateway ID
CIMTPositionArray positions, // Positions array
out long positions_time // Position state fixing time
)
Python
AdminAPI.GatewayPositionRequest(
gateway_id # Gateway ID
)
Parameters
gateway_id
[in] Gateway ID (IMTConGateway::ID), for which positions status should be requested in an external trading system.
positions
[out] An object of positions array. Positions object must be first created using IMTAdminAPI::PositionCreateArray.
positions_time
[out] Positions state fixing time, specified in seconds that have elapsed since 01.01.1970. Depending on the gateway (and external trading system), states of positions can be
submitted either in real time mode or only at the end of a trading session.
Return Value
An indication of successful completion is the MT_RET_OK response code. Otherwise, an error code will be returned.
Note
Positions requests should be supported by the gateway.
This method cannot be called from event handlers (any methods of IMT*Sink classes).
Routing Configuration
Functions allow managing routing configurations, as well subscribe and unsubscribe from events associated with their change.
The following functions for managing routing are available:
Function Purpose
RouteCreate Create an object of a routing rule.
file:///C:/Users/Administrator/AppData/Local/Temp/~hh4BC4.htm 7/17/2025
Manager API Page 106 of 464
Function Purpose
IMTAdminAPI::RouteCreate
Create an object of a routing rule.
C++
IMTConRoute* IMTAdminAPI::RouteCreate()
.NET
CIMTConRoute CIMTAdminAPI.RouteCreate()
Return Value
It returns a pointer to the created object that implements the IMTConRoute interface. In case of failure, it returns NULL.
Note
The created object must be deleted by calling the IMTConRoute::Release method of this object.
IMTAdminAPI::RouteConditionCreate
Create an object of an additional condition to apply a rule.
IMTConCondition* IMTAdminAPI::RouteConditionCreate()
Return Value
It returns a pointer to the created object that implements the IMTConCondition interface. In case of failure, it returns NULL.
Note
The created object must be deleted by calling the IMTConCondition::Release method of this object.
IMTAdminAPI::RouteDealerCreate
Create an object of a dealer configuration to whom requests under this rule will be sent.
C++
IMTConRouteDealer* IMTAdminAPI::RouteDealerCreate()
.NET
CIMTConRouteDealer CIMTAdminAPI.RouteDealerCreate()
Return Value
It returns a pointer to the created object that implements the IMTConRouteDealer interface. In case of failure, it returns NULL.
Note
The created object must be deleted by calling the IMTConRouteDealer::Release method of this object.
IMTAdminAPI::RouteSubscribe
Subscribe to events associated with the configuration of request routing.
C++
MTAPIRES IMTAdminAPI::RouteSubscribe(
IMTConRouteSink* sink // A pointer to the IMTConRouteSink object
)
file:///C:/Users/Administrator/AppData/Local/Temp/~hh4BC4.htm 7/17/2025
Manager API Page 107 of 464
.NET
MTRetCode CIMTAdminAPI.RouteSubscribe(
CIMTConRouteSink sink // CIMTConRouteSink object
)
Python
AdminAPI.RouteSubscribe(
sink # IMTConRouteSink object
)
Parameters
sink
[in] A pointer to the object that implements the IMTConRouteSink interface.
Return Value
An indication of successful completion is the MT_RET_OK response code. Otherwise, an error has occurred that corresponds to the response code.
Note
Subscribing to events is thread safe. One and the same interface IMTConRouteSink cannot subscribe to an event twice - in this case the response code MT_RET_ERR_DUPLICATE is
returned.
To receive IMTConRouteSink::OnRouteSync events, subscribe before calling the IMTAdminAPI::Connect method.
The object at which sink points, must remain in the memory (must not be removed) until the call of IMTAdminAPI::RouteUnsubscribe or until the administrator interface is
deleted using the IMTAdminAPI::Release method.
IMTAdminAPI::RouteUnsubscribe
Unsubscribe from events associated with the configuration of request routing.
C++
MTAPIRES IMTAdminAPI::RouteUnsubscribe(
IMTConRouteSink* sink // A pointer to the IMTConRouteSink object
)
.NET
MTRetCode CIMTAdminAPI.RouteUnsubscribe(
CIMTConRouteSink sink // CIMTConRouteSink object
)
Python
AdminAPI.RouteUnsubscribe(
sink # IMTConRouteSink object
)
Parameters
sink
[in] A pointer to the object that implements the IMTConRouteSink interface.
Return Value
An indication of successful completion is the MT_RET_OK response code. Otherwise, an error has occurred that corresponds to the response code.
Note
This is a pair method to IMTAdminAPI::RouteSubscribe. If an attempt is made to unsubscribe from the interface to which it has not subscribed, MT_RET_ERR_NOTFOUND error is
returned.
IMTAdminAPI::RouteUpdate
Add or update a routing rule.
C++
MTAPIRES IMTAdminAPI::RouteUpdate(
IMTConRoute* route // An object of a routing rule
)
.NET
MTRetCode CIMTAdminAPI.RouteUpdate(
CIMTConRoute route // An object of a routing rule
)
Python
AdminAPI.RouteUpdate(
route # An object of a routing rule
)
Parameters
route
[in] An object of a routing rule.
Return Value
An indication of successful completion is the MT_RET_OK response code. Otherwise, an error code will be returned.
Note
A configuration can be added or updated only from the applications that run on the main server. For all other applications the response code MT_RET_ERR_NOTMAIN will be
returned.
file:///C:/Users/Administrator/AppData/Local/Temp/~hh4BC4.htm 7/17/2025
Manager API Page 108 of 464
Before adding, the correctness of the record is checked. If the record is incorrect, the error code MT_RET_ERR_PARAMS is returned.
IMTAdminAPI::RouteUpdateBatch
Add or edit multiple routing rules.
C++
MTAPIRES IMTAdminAPI::RouteUpdateBatch(
IMTConRoute** configs, // An array of configurations
const UINT config_total, // The number of configurations in the array
MTAPIRES* results // An array of results
)
.NET
MTRetCode CIMTAdminAPI.RouteUpdateBatch(
CIMTConRoute[] configs, // An array of configurations
MTRetCode[] results // An array of results
)
Python
AdminAPI.RouteUpdateBatch(
configs # An array of configurations
)
Parameters
configs
[in] A pointer to an array of configurations which you want to add/update.
config_total
[in] The number of configurations in the 'configs' array.
results
[out] An array with the results of applying of each configuration change on the server.
Return Value
An indication of successful completion is the MT_RET_OK response code. Otherwise, an error code is returned. The MT_RET_OK response code is an indication of successful
sending of changes to a server; results of applying the changes are passed in the 'results' parameter.
Further Note
A configuration can only be added or updated from the applications that run on the main server. For all other applications, the response code MT_RET_ERR_NOTMAIN is returned.
Before adding an entry, its correctness is checked. If an entry is incorrect, the MT_RET_ERR_PARAMS error code is added to the 'results' array of this entry.
IMTAdminAPI::RouteDelete
Delete a routing rule by the name.
C++
MTAPIRES IMTAdminAPI::RouteDelete(
LPCWSTR name // Rule name
)
.NET
MTRetCode CIMTAdminAPI.RouteDelete(
string name // Rule name
)
Python
AdminAPI.RouteDelete(
name # Rule name
)
Parameters
name
[in] The name of a routing rule (IMTConRoute::Name).
Return Value
An indication of successful completion is the MT_RET_OK response code. Otherwise, an error code will be returned.
Note
Routing rules can be deleted only from the applications that run on the main server. For all other applications the response code MT_RET_ERR_NOTMAIN will be returned. If the
object is not found, the response code MT_RET_ERR_NOTFOUND will be returned.
IMTAdminAPI::RouteDelete
Delete a routing rule by the index.
C++
MTAPIRES IMTAdminAPI::RouteDelete(
const UINT pos // Position of a rule
)
.NET
MTRetCode CIMTAdminAPI.RouteDelete(
uint pos // Position of a rule
)
Python
file:///C:/Users/Administrator/AppData/Local/Temp/~hh4BC4.htm 7/17/2025
Manager API Page 109 of 464
AdminAPI.RouteDelete(
pos # Position of a rule
)
Parameters
pos
[in] Position of a routing rule, starting with 0.
Return Value
An indication of successful completion is the MT_RET_OK response code. Otherwise, an error code will be returned.
Note
Routing rules can be deleted only from the applications that run on the main server. For all other applications the response code MT_RET_ERR_NOTMAIN will be returned. If the
object is not found, the response code MT_RET_ERR_NOTFOUND will be returned.
IMTAdminAPI::RouteDeleteBatch
Delete multiple routing routing rules.
C++
MTAPIRES IMTAdminAPI::RouteDeleteBatch(
IMTConRoute** configs, // An array of configurations
const UINT config_total, // The number of configurations in the array
MTAPIRES* results // An array of results
)
.NET
MTRetCode CIMTAdminAPI.RouteDeleteBatch(
CIMTConRoute[] configs, // An array of configurations
MTRetCode[] results // An array of results
)
Python
AdminAPI.RouteDeleteBatch(
configs # An array of configurations
)
Parameters
configs
[in] A pointer to an array of configurations which you want to delete.
config_total
[in] The number of configurations in the 'configs' array.
results
[out] An array with the results of deletion of each configuration on the server.
Return Value
An indication of successful completion is the MT_RET_OK response code. Otherwise, an error code is returned. The MT_RET_OK response code is an indication of successful
sending of changes to a server; results of applying the changes are passed in the 'results' parameter.
Further Note
Routing rules can only be deleted from the applications that run on the main server. For all other applications, the response code MT_RET_ERR_NOTMAIN is returned. If the
object is not found, the MT_RET_ERR_PARAMS error code is added to the 'results' array of this object.
IMTAdminAPI::RouteShift
Move a routing rule in the list.
C++
MTAPIRES IMTAdminAPI::RouteShift(
const UINT pos, // Position of a rule
const int shift // Shift
)
.NET
MTRetCode CIMTAdminAPI.RouteShift(
uint pos, // Position of a rule
int shift // Shift
)
Python
AdminAPI.RouteShift(
pos, # Position of a rule
shift # Shift
)
Parameters
pos
[in] Position of a routing rule, starting with 0.
shift
[in] Shift of a rule relative to its current position. A negative value means the shift to the top of the list, a positive value - to its end.
Return Value
An indication of successful completion is the MT_RET_OK response code. Otherwise, an error code will be returned.
file:///C:/Users/Administrator/AppData/Local/Temp/~hh4BC4.htm 7/17/2025
Manager API Page 110 of 464
Note
Rules are executed from top downwards. If a received request corresponds to the conditions of the top rule, it is handled under this rule, otherwise conditions of the second rule
are checked, and so on. A request is handled in accordance with the rules until it is executed or passed to a dealer.
The position of a routing rule can be changed only from the applications that run on the main server. For all other applications the response code MT_RET_ERR_NOTMAIN will be
returned.
IMTAdminAPI::RouteTotal
The total number of routing rules available in the platform.
C++
UINT IMTAdminAPI::RouteTotal()
.NET
uint CIMTAdminAPI.RouteTotal()
Python
AdminAPI.RouteTotal()
Return Value
The number of routing rules in the trading platform.
IMTAdminAPI::RouteNext
Get a routing rule by the index.
C++
MTAPIRES IMTAdminAPI::RouteNext(
const UINT pos, // Position of a rule
IMTConRoute* route // An object of a routing rule
)
.NET
MTRetCode CIMTAdminAPI.RouteNext(
uint pos, // Position of a rule
CIMTConRoute route // An object of a routing rule
)
Python
AdminAPI.RouteNext(
pos # Position of a rule
)
Parameters
pos
[in] Position of a routing rule, starting with 0.
route
[out] An object of a routing rule. The route object must be first created using the IMTAdminAPI::RouteCreate method.
Return Value
An indication of successful completion is the MT_RET_OK response code. Otherwise, an error code will be returned.
Note
This method copies the parameters of a routing rule with a specified index to the route object.
IMTAdminAPI::RouteGet
Get a routing rule by the name.
C++
MTAPIRES IMTAdminAPI::RouteGet(
LPCWSTR name, // Rule name
IMTConRoute* route // An object of a routing rule
)
.NET
MTRetCode CIMTAdminAPI.RouteGet(
string name, // Rule name
CIMTConRoute route // An object of a routing rule
)
Python
AdminAPI.RouteGet(
name # Rule name
)
Parameters
name
[in] The name of a routing rule.
file:///C:/Users/Administrator/AppData/Local/Temp/~hh4BC4.htm 7/17/2025
Manager API Page 111 of 464
route
[out] An object of a routing rule. The route object must be first created using the IMTAdminAPI::RouteCreate method.
Return Value
An indication of successful completion is the MT_RET_OK response code. Otherwise, an error code will be returned.
Note
The IMTConRoute::Name() value is used as the name.
Report Configuration
Functions allow managing configurations of reports, as well subscribe and unsubscribe from events associated with their change.
The following functions for managing reports are available:
Function Purpose
ReportCreate Create an object of the configuration of reports.
ReportModuleCreate Create an object of configuration of a report module.
ReportParamCreate Create an object of a report parameter.
ReportSubscribe Subscribe to events associated with the configuration of reports.
ReportUnsubscribe Unsubscribe from events associated with the configuration of reports.
ReportUpdate Add or update a report configuration.
ReportUpdateBatch Add or edit multiple report configurations.
ReportDelete Delete a report configuration by the name or index.
ReportDeleteBatch Delete multiple report configurations.
ReportShift Change the position of a report configuration in the list.
ReportTotal The total number of report configurations available in the platform.
ReportNext Get a report configuration by the index.
ReportGet Get a report configuration by the name.
ReportModuleTotal The total number of configurations of report modules available in the platform.
ReportModuleNext Get a report module by the index.
ReportModuleGet Get a report module configuration by the name.
IMTAdminAPI::ReportCreate
Create an object of the configuration of reports.
C++
IMTConReport* IMTAdminAPI::ReportCreate()
.NET
CIMTConReport CIMTAdminAPI.ReportCreate()
Return Value
It returns a pointer to the created object that implements the IMTConReport interface. In case of failure, it returns NULL.
Note
The created object must be deleted by calling the IMTConReport::Release method of this object.
IMTAdminAPI::ReportModuleCreate
Create an object of configuration of a report module.
C++
IMTConReportModule* IMTAdminAPI::ReportModuleCreate()
.NET
CIMTConReportModule CIMTAdminAPI.ReportModuleCreate()
Return Value
It returns a pointer to the created object that implements the IMTConReportModule interface. In case of failure, it returns NULL.
Note
The created object must be deleted by calling the IMTConReportModule::Release method of this object.
file:///C:/Users/Administrator/AppData/Local/Temp/~hh4BC4.htm 7/17/2025
Manager API Page 112 of 464
IMTAdminAPI::ReportParamCreate
Create an object of a report parameter.
C++
IMTConParam* IMTAdminAPI::ReportParamCreate()
.NET
CIMTConParam CIMTAdminAPI.ReportParamCreate()
Return Value
It returns a pointer to the created object that implements the IMTConParam interface. In case of failure, it returns NULL.
Note
The created object must be destroyed by calling the IMTConParam::Release method of this object.
IMTAdminAPI::ReportSubscribe
Subscribe to events associated with the configuration of reports.
C++
MTAPIRES IMTAdminAPI::ReportSubscribe(
IMTConReportSink* sink // A pointer to the IMTConReportSink object
)
.NET
MTRetCode CIMTAdminAPI.ReportSubscribe(
CIMTConReportSink sink // CIMTConReportSink object
)
Python
AdminAPI.ReportSubscribe(
sink # IMTConReportSink object
)
Parameters
sink
[in] A pointer to the object that implements the IMTConReportSink interface.
Return Value
An indication of successful completion is the MT_RET_OK response code. Otherwise, an error has occurred that corresponds to the response code.
Note
Subscribing to events is thread safe. One and the same interface IMTConReportSink cannot subscribe to an event twice - in this case the response code MT_RET_ERR_DUPLICATE is
returned.
To receive IMTConReportSink::OnReportSync events, subscribe before calling the IMTAdminAPI::Connect method.
The object at which sink points, must remain in the memory (must not be removed) until the call of IMTAdminAPI::ReportUnsubscribe or until the administrator interface is
deleted using the IMTAdminAPI::Release method.
IMTAdminAPI::ReportUnsubscribe
Unsubscribe from events associated with the configuration of reports.
C++
MTAPIRES IMTAdminAPI::ReportUnsubscribe(
IMTConReportSink* sink // A pointer to the IMTConReportSink object
)
.NET
MTRetCode CIMTAdminAPI.ReportUnsubscribe(
CIMTConReportSink sink // CIMTConReportSink object
)
Python
AdminAPI.ReportUnsubscribe(
sink # IMTConReportSink object
)
Parameters
sink
[in] A pointer to the object that implements the IMTConReportSink interface.
Return Value
An indication of successful completion is the MT_RET_OK response code. Otherwise, an error code will be returned.
Note
This is a pair method to IMTAdminAPI::ReportSubscribe. If an attempt is made to unsubscribe from the interface to which it has not subscribed, MT_RET_ERR_NOTFOUND error is
returned.
file:///C:/Users/Administrator/AppData/Local/Temp/~hh4BC4.htm 7/17/2025
Manager API Page 113 of 464
IMTAdminAPI::ReportUpdate
Add or update a report configuration.
C++
MTAPIRES IMTAdminAPI::ReportUpdate(
IMTConReport* report // An object of report configuration
)
.NET
MTRetCode CIMTAdminAPI.ReportUpdate(
CIMTConReport report // An object of report configuration
)
Python
AdminAPI.ReportUpdate(
report # An object of report configuration
)
Parameters
report
[in] An object of report configuration.
Return Value
An indication of successful completion is the MT_RET_OK response code. Otherwise, an error code will be returned.
Note
A configuration can be added or updated only from the applications that run on the main server. For all other applications the response code MT_RET_ERR_NOTMAIN will be
returned.
Before adding, the correctness of the record is checked. If the record is incorrect, the error code MT_RET_ERR_PARAMS is returned.
IMTAdminAPI::ReportUpdateBatch
Add or edit multiple report configurations.
C++
MTAPIRES IMTAdminAPI::ReportUpdateBatch(
IMTConReport** configs, // An array of configurations
const UINT config_total, // The number of configurations in the array
MTAPIRES* results // An array of results
)
.NET
MTRetCode CIMTAdminAPI.ReportUpdateBatch(
CIMTConReport[] configs, // An array of configurations
MTRetCode[] results // An array of results
)
Python
AdminAPI.ReportUpdateBatch(
configs # An array of configurations
)
Parameters
configs
[in] A pointer to an array of configurations which you want to add/update.
config_total
[in] The number of configurations in the 'configs' array.
results
[out] An array with the results of applying of each configuration change on the server.
Return Value
An indication of successful completion is the MT_RET_OK response code. Otherwise, an error code is returned. The MT_RET_OK response code is an indication of successful
sending of changes to a server; results of applying the changes are passed in the 'results' parameter.
Further Note
A configuration can only be added or updated from the applications that run on the main server. For all other applications, the response code MT_RET_ERR_NOTMAIN is returned.
Before adding an entry, its correctness is checked. If the record is incorrect, the error code MT_RET_ERR_PARAMS is returned.
IMTAdminAPI::ReportDelete
Delete a report configuration by the name.
C++
MTAPIRES IMTAdminAPI::ReportDelete(
const UINT64 server_id, // Server ID
LPCWSTR name // Report configuration name
)
.NET
file:///C:/Users/Administrator/AppData/Local/Temp/~hh4BC4.htm 7/17/2025
Manager API Page 114 of 464
MTRetCode CIMTAdminAPI.ReportDelete(
ulong server_id, // Server ID
string name // Report configuration name
)
Python
AdminAPI.ReportDelete(
server_id # Server ID
name # Report configuration name
)
Parameters
server_id
[in] The identifier of the server for which we delete the report configuration. The IMTConServer::Id value is used as the identifier.
name
[in] Name of the report configuration. The IMTConReport::Name value is used as the name..
Return Value
An indication of successful completion is the MT_RET_OK response code. Otherwise, an error code will be returned.
Note
A configuration can be deleted only when connecting to the main server. In all other cases the response code MT_RET_ERR_NOTMAIN will be returned. If the object is not found,
the response code MT_RET_ERR_NOTFOUND will be returned.
IMTAdminAPI::ReportDelete
Delete a report configuration by the index.
C++
MTAPIRES IMTAdminAPI::ReportDelete(
const UINT pos // Position of the configuration
)
.NET
MTRetCode CIMTAdminAPI.ReportDelete(
uint pos // Position of the configuration
)
Python
AdminAPI.ReportDelete(
pos # Position of the configuration
)
Parameters
pos
[in] Position of the configuration, starting with 0.
Return Value
An indication of successful completion is the MT_RET_OK response code. Otherwise, an error code will be returned.
Note
A configuration can be deleted only from the applications that run on the main server. For all other applications the response code MT_RET_ERR_NOTMAIN will be returned. If the
object is not found, the response code MT_RET_ERR_NOTFOUND will be returned.
IMTAdminAPI::ReportDeleteBatch
Delete multiple report configurations.
C++
MTAPIRES IMTAdminAPI::ReportDeleteBatch(
IMTConReport** configs, // An array of configurations
const UINT config_total, // The number of configurations in the array
MTAPIRES* results // An array of results
)
.NET
MTRetCode CIMTAdminAPI.ReportDeleteBatch(
CIMTConReport[] configs, // An array of configurations
MTRetCode[] results // An array of results
)
Python
AdminAPI.ReportDeleteBatch(
configs # An array of configurations
)
Parameters
configs
[in] A pointer to an array of configurations which you want to delete.
config_total
[in] The number of configurations in the 'configs' array.
results
[out] An array with the results of deletion of each configuration on the server.
Return Value
An indication of successful completion is the MT_RET_OK response code. Otherwise, an error code is returned. The MT_RET_OK response code is an indication of successful
sending of changes to a server; results of applying the changes are passed in the 'results' parameter.
Further Note
file:///C:/Users/Administrator/AppData/Local/Temp/~hh4BC4.htm 7/17/2025
Manager API Page 115 of 464
Configurations can only be deleted when connected to the main trade server. In all other cases, the MT_RET_ERR_NOTMAIN response code is returned. If the object is not found,
the MT_RET_ERR_PARAMS error code is added to the 'results' array of this object.
IMTAdminAPI::ReportShift
Change the position of a report configuration in the list.
C++
MTAPIRES IMTAdminAPI::ReportShift(
const UINT pos, // Position of the configuration
const int shift // Shift
)
.NET
MTRetCode CIMTAdminAPI.ReportShift(
uint pos, // Position of the configuration
int shift // Shift
)
Python
AdminAPI.ReportShift(
pos, # Position of the configuration
shift # Shift
)
Parameters
pos
[in] Position of the configuration, starting with 0.
shift
[in] Shift of the configuration relative to its current position. A negative value means the shift to the top of the list, a positive value - to its end.
Return Value
An indication of successful completion is the MT_RET_OK response code. Otherwise, an error code will be returned.
Note
The position of a configuration can be changed only from the applications that run on the main server. For all other applications the response code MT_RET_ERR_NOTMAIN will be
returned.
IMTAdminAPI::ReportTotal
The total number of report configurations available in the platform.
C++
UINT IMTAdminAPI::ReportTotal()
.NET
uint CIMTAdminAPI.ReportTotal()
Python
AdminAPI.ReportTotal()
Return Value
The number of configurations of reports in the trading platform.
IMTAdminAPI::ReportNext
Get a report configuration by the index.
C++
MTAPIRES IMTAdminAPI::ReportNext(
const UINT pos, // Position of the configuration
IMTConReport* report // An object of report configuration
)
.NET
MTRetCode CIMTAdminAPI.ReportNext(
uint pos, // Position of the configuration
CIMTConReport report // An object of report configuration
)
Python
AdminAPI.ReportNext(
pos, # Position of the configuration
report # An object of report configuration
)
Parameters
pos
[in] Position of the configuration, starting with 0.
file:///C:/Users/Administrator/AppData/Local/Temp/~hh4BC4.htm 7/17/2025
Manager API Page 116 of 464
report
[out] An object of report configuration. The report object must be first created using the IMTAdminAPI::ReportCreate method.
Return Value
An indication of successful completion is the MT_RET_OK response code. Otherwise, an error code will be returned.
Note
This method copies the configuration data of a report with a specified index to the report object.
IMTAdminAPI::ReportGet
Get a report configuration by the name.
C++
MTAPIRES IMTAdminAPI::ReportGet(
const UINT64 server_id, // Server ID
LPCWSTR name, // Report configuration name
IMTConReport* report // An object of report configuration
)
.NET
MTRetCode CIMTAdminAPI.ReportGet(
ulong server_id, // Server ID
string name, // Report configuration name
CIMTConReport report // An object of report configuration
)
Python
AdminAPI.ReportGet(
server_id, # Server ID
name # Report configuration name
)
Parameters
server_id
[in] The identifier of the server for which we get the report configuration. The IMTConServer::Id value is used as the identifier.
name
[in] Name of the report configuration. The IMTConReport::Name value is used as the name..
report
[out] An object of report configuration. The object must first be created using the IMTAdminAPI::ReportCreate method.
Return Value
An indication of successful completion is the MT_RET_OK response code. Otherwise, an error code will be returned.
Note
This method copies parameters of the specified report configuration to the report object.
IMTAdminAPI::ReportModuleTotal
The total number of configurations of report modules available in the platform.
C++
UINT IMTAdminAPI::ReportModuleTotal()
.NET
uint CIMTAdminAPI.ReportModuleTotal()
Python
AdminAPI.ReportModuleTotal()
Return Value
The number of configurations of report modules in the trading platform.
IMTAdminAPI::ReportModuleNext
Get a report module by the index.
C++
MTAPIRES IMTAdminAPI::ReportModuleNext(
const UINT pos, // Position of the configuration
IMTConReportModule* module // An object of the report module configuration
)
.NET
MTRetCode CIMTAdminAPI.ReportModuleNext(
uint pos, // Position of the configuration
CIMTConReportModule module // An object of the report module configuration
)
Python
file:///C:/Users/Administrator/AppData/Local/Temp/~hh4BC4.htm 7/17/2025
Manager API Page 117 of 464
AdminAPI.ReportModuleNext(
pos # Position of the configuration
)
Parameters
pos
[in] Position of the configuration, starting with 0.
module
[out] The report module configuration object. The module object must be first created using the IMTAdminAPI::ReportModuleCreate method.
Return Value
An indication of successful completion is the MT_RET_OK response code. Otherwise, an error code will be returned.
Note
This method copies a report configuration with a specified index to the module object.
IMTAdminAPI::ReportModuleGet
Get a report module configuration by the name.
C++
MTAPIRES IMTAdminAPI::ReportModuleGet(
const UINT64 server_id, // Server ID
LPCWSTR name, // The name of the report module
IMTConReportModule* module // An object of the report module configuration
)
.NET
MTRetCode CIMTAdminAPI.ReportModuleGet(
ulong server_id, // Server ID
string name, // The name of the report module
CIMTConReportModule module // An object of the report module configuration
)
Python
AdminAPI.ReportModuleGet(
server_id, # Server ID
name # The name of the report module
)
Parameters
server_id
[in] The identifier of the server for which we get the report module configuration. The IMTConServer::Id value is used as the identifier.
name
[in] The name of a report module.
module
[out] The report module configuration object. The module object must be first created using the IMTAdminAPI::ReportModuleCreate method.
Return Value
An indication of successful completion is the MT_RET_OK response code. Otherwise, an error code will be returned.
Note
The IMTConReportModule::Module() value is used as the name.
Function Purpose
EmailCreate Create a mail server configuration object.
EmailSubscribe Subscribe to events and hooks related to mail server configurations.
EmailUnsubscribe Unsubscribe from events and hooks related to mail server configurations.
EmailUpdate Add or update a mail server configuration.
EmailUpdateBatch Add or edit multiple mail server configurations.
EmailDelete Delete a mail server configuration by the name or index.
EmailDeleteBatch Delete multiple mail server configurations.
EmailShift Change the position of a mail server configuration in the list.
EmailTotal Get the total number of mail server configurations available in the platform.
EmailNext Get a mail server configuration by index.
EmailGet Get a mail server configuration by name.
EmailSend Send an email to a selected address.
file:///C:/Users/Administrator/AppData/Local/Temp/~hh4BC4.htm 7/17/2025
Manager API Page 118 of 464
IMTAdminAPI::EmailCreate
Create a mail server configuration object.
C++
IMTConEmail* IMTAdminAPI::EmailCreate()
.NET
CIMTConEmail CIMTAdminAPI.EmailCreate()
Return Value
Returns a pointer to the created object which implements the IMTConEmail interface. Null is returned in case of failure.
Note
The created object must be destroyed by calling the IMTConEmail::Release method of this object.
IMTAdminAPI::EmailSubscribe
Subscribe to events and hooks related to mail server configurations.
C++
MTAPIRES IMTAdminAPI::EmailSubscribe(
IMTConEmailSink* sink // A pointer to the IMTConEmailSink object
)
.NET
MTRetCode CIMTAdminAPI.EmailSubscribe(
CIMTConEmailSink sink // The CIMTConEmailSink object
)
Python
AdminAPI.EmailSubscribe(
sink # IMTConEmailSink object
)
Parameters
sink
[in] A pointer to the object which implements the IMTConEmailSink interface.
Return Value
An indication of successful completion is the MT_RET_OK response code. Otherwise, an error has occurred, which corresponds to the response code.
Note
Subscribing to events is thread safe. One and the same IMTConEmailSink interface cannot subscribe to an event twice: in this case the MT_RET_ERR_DUPLICATE response code is
returned.
To receive IMTConEmailSink::OnEmailSync events, subscribe before calling the IMTAdminAPI::Connect method.
The object at which 'sink' points, must remain in the memory (must not be removed) until the call of IMTServerAPI::EmailUnsubscribe or until the plugin is deleted.
IMTAdminAPI::EmailUnsubscribe
Unsubscribe from events and hooks related to mail server configurations.
C++
MTAPIRES IMTAdminAPI::EmailUnsubscribe(
IMTConEmailSink* sink // A pointer to the IMTConEmailSink object
)
.NET
MTRetCode CIMTAdminAPI.EmailUnsubscribe(
CIMTConEmailSink sink // The CIMTConEmailSink object
)
Python
AdminAPI.EmailUnsubscribe(
sink # IMTConEmailSink object
)
Parameters
sink
[in] A pointer to the object which implements the IMTConEmailSink interface.
Return Value
An indication of successful completion is the MT_RET_OK response code. Otherwise, an error code will be returned.
Note
This is a pair method to IMTServerAPI::EmailSubscribe. If an attempt is made to unsubscribe from the interface to which it has not subscribed, MT_RET_ERR_NOTFOUND error is
returned.
IMTAdminAPI::EmailUpdate
Add or update a mail server configuration.
C++
file:///C:/Users/Administrator/AppData/Local/Temp/~hh4BC4.htm 7/17/2025
Manager API Page 119 of 464
MTAPIRES IMTAdminAPI::EmailUpdate(
IMTConEmail* config // Mail server configuration object
)
.NET
MTRetCode CIMTAdminAPI.EmailUpdate(
CIMTConEmail config // Mail server configuration object
)
Python
AdminAPI.EmailUpdate(
config # Mail server configuration object
)
Parameters
config
[in] Mail server configuration object.
Return Value
An indication of successful completion is the MT_RET_OK response code. Otherwise, an error code will be returned.
Note
A configuration can only be added or updated from the applications running on the main server. For all other plugins the response code MT_RET_ERR_NOTMAIN will be returned.
The record correctness is checked before the configuration is added. If the record is incorrect, the error code MT_RET_ERR_PARAMS is returned.
IMTAdminAPI::EmailUpdateBatch
Add or edit multiple mail server configurations.
C++
MTAPIRES IMTAdminAPI::EmailUpdateBatch(
IMTConEmail** configs, // Array of configurations
const UINT config_total, // Number of configuration in the array
MTAPIRES* results // Array of results
)
.NET
MTRetCode CIMTAdminAPI.EmailUpdateBatch(
CIMTConEmail[] configs, // Array of settings
MTRetCode[] results // Array of results
)
Python
AdminAPI.EmailUpdateBatch(
configs // Array of settings
)
Parameters
configs
[in] A pointer to an array of configurations which you want to add/update.
config_total
[in] The number of configurations in the 'configs' array.
results
[out] An array with the results of each configuration applying on the server.
Return Value
An indication of successful completion is the MT_RET_OK response code. Otherwise, an error code is returned. The MT_RET_OK response code is an indication of successful
change sending to a server; change applying results are passed in the 'results' parameter.
Note
A configuration can only be added or updated from the applications running on the main server. For all other applications, the response code MT_RET_ERR_NOTMAIN is returned.
The record correctness is checked before the configuration is added. If the record is incorrect, the error code MT_RET_ERR_PARAMS is returned.
IMTAdminAPI::EmailDelete
Delete a mail server configuration by name.
C++
MTAPIRES IMTAdminAPI::EmailDelete(
LPCWSTR name // Configuration name
)
.NET
MTRetCode CIMTAdminAPI.EmailDelete(
string name // Configuration name
)
Python
AdminAPI.EmailDelete(
name # Configuration name
)
Parameters
name
[in] The name of the configuration to delete.
file:///C:/Users/Administrator/AppData/Local/Temp/~hh4BC4.htm 7/17/2025
Manager API Page 120 of 464
Return Value
An indication of successful completion is the MT_RET_OK response code. Otherwise, an error code will be returned.
Note
A configuration can only be deleted from the applications that run on the main server. For all other plugins the response code MT_RET_ERR_NOTMAIN will be returned. If the
object is not found, the response code MT_RET_ERR_NOTFOUND is returned.
The IMTConEmail::Name value is used as the configuration name.
IMTAdminAPI::EmailDelete
Delete a mail server configuration by index.
C++
MTAPIRES IMTAdminAPI::EmailDelete(
const UINT pos // Configuration position
)
.NET
MTRetCode CIMTAdminAPI.EmailDelete(
uint pos // Configuration index
)
Python
AdminAPI.EmailDelete(
pos # Configuration index
)
Parameters
pos
[in] Position of the configuration, starting with 0.
Return Value
An indication of successful completion is the MT_RET_OK response code. Otherwise, an error code will be returned.
Note
A configuration can only be deleted from the applications that run on the main server. For all other plugins the response code MT_RET_ERR_NOTMAIN will be returned. If the
object is not found, the response code MT_RET_ERR_NOTFOUND is returned.
IMTAdminAPI::EmailDeleteBatch
Delete multiple mail server configurations.
C++
MTAPIRES IMTAdminAPI::EmailDeleteBatch(
IMTConEmaail** configs, // Array of configurations
const UINT config_total, // Number of configuration in the array
MTAPIRES* results // Array of results
)
.NET
MTRetCode CIMTAdminAPI.EmailDeleteBatch(
CIMTConEmail[] configs, // Array of settings
MTRetCode[] results // Array of results
)
Python
AdminAPI.EmailDeleteBatch(
configs # Array of settings
)
Parameters
configs
[in] A pointer to an array of configurations which you want to delete.
config_total
[in] The number of configurations in the 'configs' array.
results
[out] An array with the results of each configuration deletion on the server.
Return Value
An indication of successful completion is the MT_RET_OK response code. Otherwise, an error code is returned. The MT_RET_OK response code is an indication of successful
change sending to a server; change applying results are passed in the 'results' parameter.
Note
Configurations can only be deleted when connected to the main trade server. In all other cases, the MT_RET_ERR_NOTMAIN response code is returned. If the object is not found,
the MT_RET_ERR_PARAMS error code is added to the 'results' array of this object.
IMTAdminAPI::EmailShift
Change the position of a mail server configuration in the list.
C++
MTAPIRES IMTAdminAPI::EmailShift(
const UINT pos, // Configuration position
const int shift // Shift
)
.NET
file:///C:/Users/Administrator/AppData/Local/Temp/~hh4BC4.htm 7/17/2025
Manager API Page 121 of 464
MTRetCode CIMTAdminAPI.EmailShift(
uint pos, // Configuration position
int shift // Shift
)
Python
AdminAPI.EmailShift(
pos, # Configuration position
shift # Shift
)
Parameters
pos
[in] Position of the configuration, starting with 0.
shift
[in] The shift of the configuration relative to its current position. A negative value means shift towards the top of the list, a positive value shifts towards the end.
Return Value
An indication of successful completion is the MT_RET_OK response code. Otherwise, an error code will be returned.
Note
The position of a configuration can only be changed from the applications running on the main server. For all other plugins the response code MT_RET_ERR_NOTMAIN will be
returned.
IMTAdminAPI::EmailTotal
Get the total number of mail server configurations available in the platform.
C++
UINT IMTAdminAPI::EmailTotal()
.NET
uint CIMTAdminAPI.EmailTotal()
Python
AdminAPI.EmailTotal()
Return Value
The number of mail server configurations in the trading platform.
IMTAdminAPI::EmailNext
Get a mail server configuration by index.
C++
MTAPIRES IMTAdminAPI::EmailNext(
const UINT pos, // Configuration position
IMTConEmail* email // Mail server configuration object
)
.NET
MTRetCode CIMTAdminAPI.EmailNext(
uint pos, // Configuration position
CIMTConEmail email // Email configuration object
)
Python
AdminAPI.EmailNext(
pos # Configuration position
)
Parameters
pos
[in] Position of the configuration, starting with 0.
email
[out] Mail server configuration object. The 'email' object must be previously created using the IMTAdminAPI::EmailCreate method.
Return Value
An indication of successful completion is the MT_RET_OK response code. Otherwise, an error code will be returned.
Note
The method copies mail server configuration data with the specified index to the 'email' object.
IMTAdminAPI::EmailGet
Get a mail server configuration by name.
C++
MTAPIRES IMTAdminAPI::EmailGet(
LPCWSTR name, // Configuration name
IMTConEmail* email // Mail server configuration object
)
.NET
file:///C:/Users/Administrator/AppData/Local/Temp/~hh4BC4.htm 7/17/2025
Manager API Page 122 of 464
MTRetCode CIMTAdminAPI.EmailGet(
string name, // Configuration name
CIMTConEmail email // Mail server configuration object
)
Python
AdminAPI.EmailGet(
name # Configuration name
)
Parameters
name
[in] The name of the configuration.
email
[out] Mail server configuration object. The 'email' object must be previously created using the IMTAdminAPI::EmailCreate method.
Return Value
An indication of successful completion is the MT_RET_OK response code. Otherwise, an error code will be returned.
Note
The IMTConEmail::Name value is used for the name.
IMTAdminAPI::EmailSend
Send an email to a selected address.
C++
MTAPIRES IMTAdminAPI::EmailSend(
LPCWSTR account, // Mail account used to send the email
LPCWSTR to, // Recipient address
LPCWSTR to_name, // Recipient name
LPCWSTR subject, // Email subject
LPCWSTR body // Email body
)
.NET
MTRetCode CIMTAdminAPI.EmailSend(
string account, // Mail account used to send the email
string to, // Recipient address
string to_name, // Recipient name
string subject, // Email subject
string body // Email body
)
Python
AdminAPI.EmailSend(
account, # Mail account used to send the email
to, # Recipient address
to_name, # Recipient name
subject, # Email subject
body # Email body
)
Program Parameters
account
[in] The name of the mail server configuration, via which the email will be sent. The IMTConEmail::Name value is used for the name.
to
[in] Recipient's email address.
to_name
[in] Email recipient's name.
subject
[in] Email subject.
body
[in] Email body.
Return Value
An indication of successful completion is the MT_RET_OK response code. Otherwise, an error code is returned.
Note
All method parameters are required.
To be able to send emails, the platform must have pre-configured mail services.
Function Purpose
MessengerCreate Create a messenger configuration object.
MessengerCountryCreate Create an object of a country for which the messenger will be used.
MessengerGroupCreate Create an object of an account group for which the messenger will be used.
MessengerTemplateCreate Create a message template object that will be used in the messenger.
file:///C:/Users/Administrator/AppData/Local/Temp/~hh4BC4.htm 7/17/2025
Manager API Page 123 of 464
Function Purpose
MessengerUnsubscribe Subscribe to events and hooks associated with messenger configurations.
MessengerUnsubscribe Unsubscribe from events and hooks associated with messenger configurations.
MessengerUpdate Add or update a messenger configuration.
MessengerUpdateBatch Add or edit multiple messenger configurations.
MessengerDelete Delete a messenger configuration by name or index.
MessengerDeleteBatch Delete multiple messenger configurations.
MessengerShift Change the position of a messenger configuration in the list.
MessengerTotal Get the total number of messenger configurations available in the platform.
MessengerNext Get a messenger configuration by index.
MessengerGet Get a messenger configuration by name.
MessengerVerifyPhone Verify the validity of a passed phone number based on local phone number formation rules.
MessengerSend Send an SMS message.
IMTAdminAPI::MessengerCreate
Create a messenger configuration object.
C++
IMTConMessenger* IMTAdminAPI::MessengerCreate()
.NET
CIMTConMessenger CIMTAdminAPI.MessengerCreate()
Return Value
Return the pointer to a created object implementing the IMTConMessenger interface. Null is returned in case of failure.
Note
The created object must be destroyed by calling the IMTConMessenger::Release method of this object.
IMTAdminAPI::MessengerCountryCreate
Create an object of a country for which the messenger will be used.
C++
IMTConMessengerCountry* IMTAdminAPI::MessengerCountryCreate()
.NET
CIMTConMessengerCountry CIMTAdminAPI.MessengerCountryCreate()
Return Value
The method returns a pointer to the created object that implements the IMTConMessengerCountry interface. Null is returned in case of failure.
Note
The created object must be destroyed by calling the IMTConMessengerCountry::Release method of this object.
IMTAdminAPI::MessengerGroupCreate
Create an object of an account group for which the messenger will be used.
C++
IMTConMessengerGroup* IMTAdminAPI::MessengerGroupCreate()
.NET
CIMTConMessengerGroup CIMTAdminAPI.MessengerGroupCreate()
Return Value
The method returns a pointer to the created object that implements the IMTConMessengerGroup interface. Null is returned in case of failure.
Note
The created object must be destroyed by calling the IMTConMessengerGroup::Release method of this object.
IMTAdminAPI::MessengerTemplateCreate
Создание объекта шаблона сообщений, которой будет использоваться в мессенджере.
C++
IMTConMessengerTemplate* IMTAdminAPI::MessengerTemplateCreate()
.NET
CIMTConMessengerTemplate CIMTAdminAPI.MessengerTemplateCreate()
file:///C:/Users/Administrator/AppData/Local/Temp/~hh4BC4.htm 7/17/2025
Manager API Page 124 of 464
Возвращаемое значение
Возвращает указатель на созданный объект, реализующий интерфейс IMTConMessengerTemplate. В случае неудачи возвращается NULL.
Примечание
Созданный объект должен быть уничтожен вызовом метода IMTConMessengerTemplate::Release этого объекта.
IMTAdminAPI::MessengerSubscribe
Subscribe to events and hooks associated with messenger configurations.
C++
MTAPIRES IMTAdminAPI::MessengerSubscribe(
IMTConMessengerSink* sink // A pointer to the IMTConMessengerSink object
)
.NET
MTRetCode CIMTAdminAPI.MessengerSubscribe(
CIMTConMessengerSink sink // The CIMTConMessengerSink object
)
Python
AdminAPI.MessengerSubscribe(
sink # IMTConMessengerSink object
)
Parameters
sink
[in] A pointer to the object which implements the IMTConMessengerSink interface.
Return Value
An indication of successful completion is the MT_RET_OK response code. Otherwise, an error has occurred, which corresponds to the response code.
Note
Subscribing to events is thread safe. One and the same IMTConMessengerSink interface cannot subscribe to an event twice: in this case the MT_RET_ERR_DUPLICATE response
code is returned.
To receive IMTConMessengerSink::OnMessengerSync events, subscribe before calling the IMTAdminAPI::Connect method.
The object at which 'sink' points, must remain in the memory (must not be removed) until the call of IMTServerAPI::MessengerUnsubscribe or until the plugin is deleted.
IMTAdminAPI::MessengerUnsubscribe
Unsubscribe from events and hooks associated with messenger configurations.
C++
MTAPIRES IMTAdminAPI::MessengerUnsubscribe(
IMTConMessengerSink* sink // A pointer to the IMTConMessengerSink object
)
.NET
MTRetCode CIMTAdminAPI.MessengerUnsubscribe(
CIMTConMessengerSink sink // The CIMTConMessengerSink object
)
Python
AdminAPI.MessengerUnsubscribe(
sink # IMTConMessengerSink object
)
Parameters
sink
[in] A pointer to the object which implements the IMTConMessengerSink interface.
Return Value
An indication of successful completion is the MT_RET_OK response code. Otherwise, an error code will be returned.
Note
This is a pair method to IMTServerAPI::MessengerSubscribe. If an attempt is made to unsubscribe from the interface to which it has not subscribed, MT_RET_ERR_NOTFOUND error
is returned.
IMTAdminAPI::MessengerAdd
Add or update a messenger configuration.
C++
MTAPIRES IMTAdminAPI::MessengerAdd(
IMTConMessenger* config // Messenger configuration object
)
.NET
MTRetCode CIMTAdminAPI.MessengerUpdate(
CIMTConMessenger config // Messenger configuration object
)
Python
file:///C:/Users/Administrator/AppData/Local/Temp/~hh4BC4.htm 7/17/2025
Manager API Page 125 of 464
AdminAPI.MessengerUpdate(
config # Messenger configuration object
)
Parameters
config
[in] Messenger configuration object.
Return Value
An indication of successful completion is the MT_RET_OK response code. Otherwise, an error code will be returned.
Note
A configuration can only be added or updated from the applications running on the main server. For all other plugins the response code MT_RET_ERR_NOTMAIN will be returned.
The record correctness is checked before the configuration is added. If the record is incorrect, the error code MT_RET_ERR_PARAMS is returned.
IMTAdminAPI::MessengerUpdateBatch
Add or edit multiple messenger configurations.
C++
MTAPIRES IMTAdminAPI::MessengerUpdateBatch(
IMTConMessenger** configs, // Array of configurations
const UINT config_total, // Number of configurations in the array
MTAPIRES* results // Array of results
)
.NET
MTRetCode CIMTAdminAPI.MessengerUpdateBatch(
CIMTConMessenger[] configs, // Array of configurations
MTRetCode[] results // Array of results
)
Python
AdminAPI.MessengerUpdateBatch(
configs # Array of configurations
)
Parameters
configs
[in] A pointer to an array of configurations which you want to add/update.
config_total
[in] The number of configurations in the 'configs' array.
results
[out] An array with the results of each configuration applying on the server.
Return Value
An indication of successful completion is the MT_RET_OK response code. Otherwise, an error code is returned. The MT_RET_OK response code is an indication of successful
change sending to a server; change applying results are passed in the 'results' parameter.
Note
A configuration can only be added or updated from the applications running on the main server. For all other applications, the response code MT_RET_ERR_NOTMAIN is returned.
The record correctness is checked before the configuration is added. If the record is incorrect, the error code MT_RET_ERR_PARAMS is returned.
IMTAdminAPI::MessengerDelete
Delete a messenger configuration by name.
C++
MTAPIRES IMTAdminAPI::MessengerDelete(
LPCWSTR name // Configuration name
)
.NET
MTRetCode CIMTAdminAPI.MessengerDelete(
string name // Configuration name
)
Python
AdminAPI.MessengerDelete(
string name // Configuration name
)
Parameters
name
[in] The name of the configuration to delete.
Return Value
An indication of successful completion is the MT_RET_OK response code. Otherwise, an error code will be returned.
Note
A configuration can only be deleted from the applications that run on the main server. For all other plugins the response code MT_RET_ERR_NOTMAIN will be returned. If the
object is not found, the response code MT_RET_ERR_NOTFOUND is returned.
The IMTConMessenger::Name value is used as the configuration name.
IMTAdminAPI::MessengerDelete
file:///C:/Users/Administrator/AppData/Local/Temp/~hh4BC4.htm 7/17/2025
Manager API Page 126 of 464
.NET
MTRetCode CIMTAdminAPI.MessengerDelete(
uint pos // Configuration index
)
Python
AdminAPI.MessengerDelete(
pos # Configuration index
)
Parameters
pos
[in] Position of the configuration, starting with 0.
Return Value
An indication of successful completion is the MT_RET_OK response code. Otherwise, an error code will be returned.
Note
A configuration can only be deleted from the applications that run on the main server. For all other plugins the response code MT_RET_ERR_NOTMAIN will be returned. If the
object is not found, the response code MT_RET_ERR_NOTFOUND is returned.
IMTAdminAPI::MessengerDeleteBatch
Delete multiple messenger configurations.
C++
MTAPIRES IMTAdminAPI::MessengerDeleteBatch(
IMTConMessenger** configs, // Array of configurations
const UINT config_total, // Number of configurations in the array
MTAPIRES* results // Array of results
)
.NET
MTRetCode CIMTAdminAPI.MessengerDeleteBatch(
CIMTConMessenger[] configs, // Array of configurations
MTRetCode[] results // Array of results
)
Python
AdminAPI.MessengerDeleteBatch(
configs # Array of configurations
)
Parameters
configs
[in] A pointer to an array of configurations which you want to delete.
config_total
[in] The number of configurations in the 'configs' array.
results
[out] An array with the results of each configuration deletion on the server.
Return Value
An indication of successful completion is the MT_RET_OK response code. Otherwise, an error code is returned. The MT_RET_OK response code is an indication of successful
change sending to a server; change applying results are passed in the 'results' parameter.
Note
Configurations can only be deleted when connected to the main trade server. In all other cases, the MT_RET_ERR_NOTMAIN response code is returned. If the object is not found,
the MT_RET_ERR_PARAMS error code is added to the 'results' array of this object.
IMTAdminAPI::MessengerShift
Change the position of a messenger configuration in the list.
C++
MTAPIRES IMTAdminAPI::MessengerShift(
const UINT pos, // Configuration position
const int shift // Shift
)
.NET
MTRetCode CIMTAdminAPI.MessengerShift(
uint pos, // Configuration position
int shift // Shift
)
Python
AdminAPI.MessengerShift(
pos, # Configuration position
shift # Shift
)
file:///C:/Users/Administrator/AppData/Local/Temp/~hh4BC4.htm 7/17/2025
Manager API Page 127 of 464
Parameters
pos
[in] Position of the configuration, starting with 0.
shift
[in] The shift of the configuration relative to its current position. A negative value means shift towards the top of the list, a positive value shifts towards the end.
Return Value
An indication of successful completion is the MT_RET_OK response code. Otherwise, an error code will be returned.
Note
The position of a configuration can only be changed from the applications running on the main server. For all other plugins the response code MT_RET_ERR_NOTMAIN will be
returned.
IMTAdminAPI::MessengerTotal
Get the total number of messenger configurations available in the platform.
C++
UINT IMTAdminAPI::MessengerTotal()
.NET
uint CIMTAdminAPI.MessengerTotal()
Python
AdminAPI.MessengerTotal()
Return Value
The number of messenger configurations in the trading platform.
IMTAdminAPI::MessengerNext
Get a messenger configuration by index.
C++
MTAPIRES IMTAdminAPI::MessengerNext(
const UINT pos, // Configuration position
IMTConMessenger* messenger // Messenger configuration object
)
.NET
MTRetCode CIMTAdminAPI.MessengerNext(
uint pos, // Configuration position
CIMTConMessenger messenger // Messenger configuration object
)
Python
AdminAPI.MessengerNext(
pos # Configuration position
)
Parameters
pos
[in] Position of the configuration, starting with 0.
messenger
[out] Messenger configuration object. The 'messenger' object must be previously created using the IMTAdminAPI::MessengerCreate method.
Return Value
An indication of successful completion is the MT_RET_OK response code. Otherwise, an error code will be returned.
Note
This method copies the configuration data of a messenger with a specified index to the 'messenger' object.
IMTAdminAPI::MessengerGet
Get a messenger configuration by name.
C++
MTAPIRES IMTAdminAPI::MessengerGet(
LPCWSTR name, // Configuration name
IMTConMessenger* messenger // Messenger configuration object
)
.NET
MTRetCode CIMTAdminAPI.MessengerGet(
string name, // Configuration name
CIMTConMessenger messenger // Messenger configuration object
)
Python
AdminAPI.MessengerGet(
name # Configuration name
)
file:///C:/Users/Administrator/AppData/Local/Temp/~hh4BC4.htm 7/17/2025
Manager API Page 128 of 464
Parameters
name
[in] The name of the configuration.
messenger
[out] Messenger configuration object. The 'messenger' object must be previously created using the IMTAdminAPI::MessengerCreate method.
Return Value
An indication of successful completion is the MT_RET_OK response code. Otherwise, an error code will be returned.
Note
The IMTConMessenger::Name value is used for the name.
IMTAdminAPI::MessengerVerifyPhone
Verify the validity of a passed phone number based on local phone number formation rules.
MTAPIRES IMTAdminAPI::MessengerVerifyPhone (
LPCWSTR phone_number // phone number
)
.NET
MTRetCode CIMTAdminAPI.MessengerVerifyPhone(
string phone_number // phone number
)
Python
AdminAPI.MessengerVerifyPhone(
phone_number # phone number
)
Parameters
phone_number
[in] Verified phone number. The phone number should be passed in the international format: +[country code] [phone number].
Return Value
An indication of successful completion is the MT_RET_OK response code. Otherwise, an error code will be returned.
IMTAdminAPI::MessengerSend
Send an SMS message.
C++
MTAPIRES IMTAdminAPI::MessengerSend(
LPCWSTR destination, // Phone number
LPCWSTR group, // Group
LPCWSTR sender, // Sender
LPCWSTR text // Message text
)
.NET
MTRetCode CIMTAdminAPI.MessengerSend(
string destination, // Phone number
string group, // Group
string sender, // Sender
string text // Message text
)
Python
AdminAPI.MessengerSend(
destination, # Phone number
group, # Group
sender, # Sender
text # Message text
)
Program Parameters
destination
[in] Recipient's phone number in the format +[country code][number], for example: +74951113594. The number is indicated without spaces.
group
[in] Here you can specify the group to which the message recipient's account belongs. In this case, the platform will send the message through the first provider, in whose
settings the specified group is found. The parameter is optional: is NULL is specified, the provider will be selected without regard to the group.
sender
[in] The name of the message sender. It is only used if the appropriate function is supported by the provider. This parameter is optional (NULL can be passed).
text
[in] The text of the notification. The maximum allowable length depends on the provider.
Return Value
An indication of successful completion is the MT_RET_OK response code. Otherwise, an error code is returned.
Code MT_RET_MESSENGER_INVALID_PHONE means that the specified phone number is invalid.
Code MT_RET_MESSENGER_NOT_MOBILE means that a landline phone number is specified instead of a mobile phone number.
Note
The MT_RET_OK does not indicate the successful message delivery.
To be able to send emails, the platform must have pre-configured integration with messengers.
file:///C:/Users/Administrator/AppData/Local/Temp/~hh4BC4.htm 7/17/2025
Manager API Page 129 of 464
Automations
The Automations service enables the execution of various actions in the platform based on predefined scenarios. To automate routine operations, select conditions and appropriate
actions that should trigger under these conditions. Automations allow companies to streamline numerous day-to-day operations and eventually reduce manual work. For more
details, please read the MetaTrader 5 Administrator Help.
The functions described in this section enable users to manage automation configurations, as well as to subscribe and to unsubscribe from events related to configuration changes.
Function Purpose
AutomationCreate Create an automation configuration object.
AutomationConditionCreate Create an automation task condition object.
AutomationActionCreate Create an automation task action object.
AutomationParamCreate Create an automation condition parameter object.
AutomationSubscribe Subscribe to events and hooks associated with automation configurations.
AutomationUnsubscribe Unsubscribe from events and hooks associated with the automation configuration.
AutomationUpdate Add or update an automation configuration.
AutomationUpdateBatch Add or edit multiple automation configurations.
AutomationDelete Delete an automation configuration by the name or index
AutomationDeleteBatch Delete multiple automation configurations.
AutomationShift Change the position of an automation configuration in the list.
AutomationTotal Get the total number of automation configurations available in the platform.
AutomationNext Get an automation configuration by index.
AutomationGet Get an automation configuration by name.
IMTAdminAPI::AutomationCreate
Create an automation configuration object.
C++
IMTConAutomation* IMTAdminAPI::AutomationCreate()
.NET
CIMTConAutomation CIMTAdminAPI.AutomationCreate()
Return Value
It returns a pointer to the created object that implements the IMTConAutomation interface. Null is returned in case of failure.
Note
The created object must be destroyed by calling the IMTConAutomation::Release method of this object.
IMTAdminAPI::AutomationConditionCreate
Create an automation task condition object.
C++
IMTConAutoCondition* IMTAdminAPI::AutomationConditionCreate()
.NET
CIMTConAutoCondition CIMTAdminAPI.AutomationConditionCreate()
Return Value
It returns a pointer to the created object that implements the IMTConAutoCondition interface. Null is returned in case of failure.
Note
The created object must be destroyed by calling the IMTConAutoCondition::Release method of this object.
IMTAdminAPI::AutomationActionCreate
Create an automation task action object.
C++
IMTConAutoAction* IMTAdminAPI::AutomationActionCreate()
.NET
CIMTConAutoAction CIMTAdminAPI.AutomationActionCreate()
Return Value
It returns a pointer to the created object that implements the IMTConAutoAction interface. Null is returned in case of failure.
Note
The created object must be destroyed by calling the IMTConAutoAction::Release method of this object.
file:///C:/Users/Administrator/AppData/Local/Temp/~hh4BC4.htm 7/17/2025
Manager API Page 130 of 464
IMTAdminAPI::AutomationParamCreate
Create an automation condition parameter object.
C++
IMTConAutoParam* IMTAdminAPI::AutomationParamCreate()
.NET
CIMTConAutoParam CIMTAdminAPI.AutomationParamCreate()
Return Value
It returns a pointer to the created object that implements the IMTConAutoParam interface. Null is returned in case of failure.
Note
The created object must be destroyed by calling the IMTConAutoParam::Release method of this object.
IMTAdminAPI::AutomationSubscribe
Subscribe to events and hooks associated with automation configurations.
C++
MTAPIRES IMTAdminAPI::AutomationSubscribe(
IMTConAutomationSink* sink // A pointer to the IMTConAutomationSink object
)
.NET
MTRetCode CIMTAdminAPI.AutomationSubscribe(
CIMTConAutomationSink sink // CIMTConAutomationSink object
)
Python
AdminAPI.AutomationSubscribe(
sink # IMTConAutomationSink object
)
Parameters
sink
[in] A pointer to the object that implements the IMTConAutomationSink interface.
Return Value
An indication of successful completion is the MT_RET_OK response code. Otherwise, an error has occurred that corresponds to the response code.
Note
Subscribing to events is thread safe. The same IMTConAutomationSink interface cannot subscribe to an event twice. The MT_RET_ERR_DUPLICATE response code is returned in
this case.
The object at which sink points, must remain in the memory (must not be removed) until IMTAdminAPI::AutomationUnsubscribe is called or until the plugin is deleted.
IMTAdminAPI::AutomationUnsubscribe
Unsubscribe from events and hooks associated with the automation configuration.
C++
MTAPIRES IMTAdminAPI::AutomationUnsubscribe(
IMTConAutomationSink* sink // A pointer to the IMTConAutomationSink object
)
.NET
MTRetCode CIMTAdminAPI.AutomationUnsubscribe(
CIMTConAutomationSink sink // CIMTConAutomationSink object
)
Python
AdminAPI.AutomationUnsubscribe(
sink # IMTConAutomationSink object
)
Parameters
sink
[in] A pointer to the object that implements the IMTConAutomationSink interface.
Return Value
An indication of successful completion is the MT_RET_OK response code. Otherwise, an error code will be returned.
Note
This method is paired with IMTAdminAPI::AutomationSubscribe. If an attempt is made to unsubscribe from the interface which has not been previously subscribed to, the
MT_RET_ERR_NOTFOUND error is returned.
IMTAdminAPI::AutomationUpdate
Add or update an automation configuration.
file:///C:/Users/Administrator/AppData/Local/Temp/~hh4BC4.htm 7/17/2025
Manager API Page 131 of 464
C++
MTAPIRES IMTAdminAPI::AutomationUpdate(
IMTConAutomation* config // Automation configuration object
)
.NET
MTRetCode CIMTAdminAPI.AutomationUpdate(
CIMTConAutomation config // Automation configuration object
)
Python
AdminAPI.AutomationUpdate(
config # Automation configuration object
)
Parameters
config
[in] The IMTConAutomation automaton configuration object.
Return Value
An indication of successful completion is the MT_RET_OK response code. Otherwise, an error code will be returned.
Note
The record existence is checked during the method call. If the record already exists, it is updated. Otherwise a new record is added. The key field for comparison is the
configuration name IMTConAutomation::Name(). When you try to add a completely identical record, no changes are made, and therefore the
IMTConAutomationSink::OnAutomationUpdate notification method is not called.
A configuration can only be added or updated from the applications running on the main server. For all other applications, the response code MT_RET_ERR_NOTMAIN is returned.
Before adding a record, its correctness is checked. If the record is incorrect, the error code MT_RET_ERR_PARAMS is returned.
IMTAdminAPI::AutomationUpdateBatch
Add or edit multiple automation configurations.
C++
MTAPIRES IMTAdminAPI::AutomationUpdateBatch(
IMTConAutomation** configs, // Array of settings
const UINT config_total, // Number of settings in the array
MTAPIRES* results // Array of results
)
.NET
MTRetCode CIMTAdminAPI.AutomationUpdateBatch(
CIMTConAutomation[] configs, // Array of settings
MTRetCode[] results // Array of results
)
Python
AdminAPI.AutomationUpdateBatch(
configs # Array of settings
)
Parameters
configs
[in] A pointer to an array of configurations which you want to add/update.
config_total
[in] The number of configurations in the 'configs' array.
results
[out] An array with the results of applying of each configuration change on the server.
Return Value
An indication of successful completion is the MT_RET_OK response code. Otherwise, an error code will be returned. The MT_RET_OK response code is an indication of successful
sending of changes to a server; results of applying the changes are passed in the 'results' parameter.
Note
A configuration can only be added or updated from the applications running on the main server. For all other applications, the response code MT_RET_ERR_NOTMAIN is returned.
Before adding a record, its correctness is checked. If the record is incorrect, the error code MT_RET_ERR_PARAMS is returned.
IMTAdminAPI::AutomationDelete
Delete an automation configuration by name.
C++
MTAPIRES IMTAdminAPI::AutomationDelete(
LPCWSTR name // Configuration name
)
.NET
MTRetCode CIMTAdminAPI.AutomationDelete(
string name // Configuration name
)
Python
AdminAPI.AutomationDelete(
name # Configuration name
)
file:///C:/Users/Administrator/AppData/Local/Temp/~hh4BC4.htm 7/17/2025
Manager API Page 132 of 464
Parameters
name
[in] The name of the configuration to delete.
Return Value
An indication of successful completion is the MT_RET_OK response code. Otherwise, an error code will be returned.
Note
A configuration can only be deleted from the applications that run on the main server. For all other plugins the response code MT_RET_ERR_NOTMAIN will be returned. If the
object is not found, the response code MT_RET_ERR_NOTFOUND is returned.
The IMTConAutomation::Name value is used as the configuration name.
IMTAdminAPI::AutomationDelete
Delete an automation configuration by index.
C++
MTAPIRES IMTAdminAPI::AutomationDelete(
const UINT pos // Configuration position
)
.NET
MTRetCode CIMTAdminAPI.AutomationDelete(
uint pos // Configuration position
)
Python
AdminAPI.AutomationDelete(
pos # Configuration position
)
Parameters
pos
[in] Position of the configuration, starting at 0.
Return Value
An indication of successful completion is the MT_RET_OK response code. Otherwise, an error code will be returned.
Note
A configuration can only be deleted from the applications that run on the main server. For all other plugins the response code MT_RET_ERR_NOTMAIN will be returned. If the
object is not found, the response code MT_RET_ERR_NOTFOUND is returned.
IMTAdminAPI::AutomationDeleteBatch
Delete multiple automation configurations.
C++
MTAPIRES IMTAdminAPI::AutomationDeleteBatch(
IMTConAutomation** configs, // Array of settings
const UINT config_total, // Number of settings in the array
MTAPIRES* results // Array of results
)
.NET
MTRetCode CIMTAdminAPI.AutomationDeleteBatch(
CIMTConAutomation[] configs, // Array of settings
MTRetCode[] results // Array of results
)
Python
AdminAPI.AutomationDeleteBatch(
configs # Array of settings
)
Parameters
configs
[in] A pointer to an array of configurations which you want to delete.
config_total
[in] The number of configurations in the 'configs' array.
results
[out] An array with the results of deletion of each configuration on the server.
Return Value
An indication of successful completion is the MT_RET_OK response code. Otherwise, an error code will be returned. The MT_RET_OK response code is an indication of successful
sending of changes to a server; results of applying the changes are passed in the 'results' parameter.
Note
Configurations can only be deleted when connected to the main trade server. In all other cases, the MT_RET_ERR_NOTMAIN response code is returned. If the object is not found,
the MT_RET_ERR_PARAMS error code is added to the 'results' array of this object.
IMTAdminAPI::AutomationShift
Change the position of an automation configuration in the list.
C++
file:///C:/Users/Administrator/AppData/Local/Temp/~hh4BC4.htm 7/17/2025
Manager API Page 133 of 464
MTAPIRES IMTAdminAPI::AutomationShift(
const UINT pos, // Configuration position
const int shift // Shift
)
.NET
MTRetCode CIMTAdminAPI.AutomationShift(
uint pos, // Configuration position
int shift // Shift
)
Python
AdminAPI.AutomationShift(
pos, # Configuration position
shift # Shift
)
Parameters
pos
[in] Position of the configuration, starting at 0.
shift
[in] The shift of the configuration relative to its current position. A negative value means shift to the top of the list, a positive value - to its end.
Return Value
An indication of successful completion is the MT_RET_OK response code. Otherwise, an error code will be returned.
Note
The position of a configuration can only be changed from the applications running on the main server. For all other plugins, the response code MT_RET_ERR_NOTMAIN will be
returned.
IMTAdminAPI::AutomationTotal
Get the total number of automation configurations available in the platform.
C++
UINT IMTAdminAPI::AutomationTotal()
.NET
uint CIMTAdminAPI.AutomationTotal()
Python
AdminAPI.AutomationTotal()
Return Value
The number of automation configurations in the trading platform.
IMTAdminAPI::AutomationNext
Get an automation configuration by index.
C++
MTAPIRES IMTAdminAPI::AutomationNext(
const UINT pos, // Configuration position
IMTConAutomation* config // Automation configuration object
)
.NET
MTRetCode CIMTAdminAPI.AutomationNext(
uint pos, // Configuration position
CIMTConAutomation config // Automation configuration object
)
Python
AdminAPI.AutomationNext(
pos # Configuration position
)
Parameters
pos
[in] Position of the configuration, starting at 0.
config
[out] Automation configuration object. The 'config' object must be previously created using the IMTAdminAPI::AutomationCreate method.
Return Value
An indication of successful completion is the MT_RET_OK response code. Otherwise, an error code will be returned.
Note
This method copies the configuration data of the automation task a specified index to the 'config' object.
IMTAdminAPI::AutomationGet
Get an automation configuration by name.
C++
file:///C:/Users/Administrator/AppData/Local/Temp/~hh4BC4.htm 7/17/2025
Manager API Page 134 of 464
MTAPIRES IMTAdminAPI::AutomationGet(
LPCWSTR name, // Configuration name
IMTConAutomation* config // Automation configuration object
)
.NET
MTRetCode CIMTAdminAPI.AutomationGet(
string name, // Configuration name
CIMTConAutomation config // Automation configuration object
)
Python
AdminAPI.AutomationGet(
name // Configuration name
)
Parameters
name
[in] The name of the configuration.
config
[out] Automation configuration object. The 'config' object must be previously created using the IMTAdminAPI::AutomationCreate method.
Return Value
An indication of successful completion is the MT_RET_OK response code. Otherwise, an error code will be returned.
Note
The IMTConAutomation::Name value is used as the name.
Sponsored Hosting is a great tool for attracting new traders. Start providing a free useful service to your clients and create a competitive edge to attract more traders.
Furthermore, by providing stable and continuous trading 24/7 for existing clients, you will increase trading volumes.
Find out more about the service in the MetaTrader 5 Administrator Help files.
The functions described in this section allow users to manage the Sponsored VPS settings, as well as subscribe and unsubscribe from events related to their changes.
Function Purpose
VPSCreate Create the VPS sponsorship settings object.
VPSCreateRule Create a VPS allocation rule object.
VPSCreateCondition Create a condition object for the VPS allocation rule.
VPSCreateGroup Create an entry object in the list of groups for which the Sponsored VPS is allowed.
VPSSubscribe Subscribe to events and hooks associated with changes in the Sponsored VPS settings.
VPSUnsubscribe Unsubscribe from events and hooks associated with changes in the Sponsored VPS settings.
VPSGet Get the Sponsored VPS settings.
VPSSet Update the Sponsored VPS settings.
IMTAdminAPI::VPSCreate
Create the VPS sponsorship settings object.
C++
IMTConVPS* IMTAdminAPI::VPSCreate()
.NET
CIMTConVPS CIMTAdminAPI.VPSCreate()
Return Value
It returns a pointer to the created object that implements the IMTConVPS interface. In case of failure, it returns NULL.
Note
The created object should be destroyed by calling the IMTConVPS::Release method of this object.
IMTAdminAPI::VPSCreateRule
Create a VPS allocation rule object.
C++
IMTConVPSRule* IMTAdminAPI::VPSCreateRule()
.NET
CIMTConVPSRule CIMTAdminAPI.VPSCreateRule()
Return Value
file:///C:/Users/Administrator/AppData/Local/Temp/~hh4BC4.htm 7/17/2025
Manager API Page 135 of 464
The method returns a pointer to the created object that implements the IMTConVPSRule interface. NULL is returned on failure.
Note
The created object must be destroyed by calling the IMTConVPSRule::Release method of this object.
IMTAdminAPI::VPSCreateCondition
Create a condition object for the VPS allocation rule.
C++
IMTConVPSCondition* IMTAdminAPI::VPSCreateCondition()
.NET
CIMTConVPSCondition CIMTAdminAPI.VPSCreateCondition()
Return Value
The method returns a pointer to the created object that implements the IMTConVPSCondition interface. NULL is returned on failure.
Note
The created object must be destroyed by calling the IMTConVPSCondition::Release method of this object.
IMTAdminAPI::VPSCreateGroup
Create an entry object in the list of groups for which the Sponsored VPS is allowed.
C++
IMTConVPS* IMTAdminAPI::VPSCreateGroup()
.NET
CIMTConVPS CIMTAdminAPI.VPSCreateGroup()
Return Value
It returns a pointer to the created object that implements the IMTConVPSGroup interface. In case of failure, it returns NULL.
Note
The created object should be destroyed by calling the IMTConVPSGroup::Release method of this object.
IMTAdminAPI::VPSSubscribe
Subscribe to events and hooks associated with changes in the VPS sponsorship settings.
C++
MTAPIRES IMTAdminAPI::VPSSubscribe(
IMTConVPSSink* sink // the pointer to the IMTConVPSSink object
)
.NET
MTRetCode CIMTAdminAPI.VPSSubscribe(
CIMTConVPSSink sink // CIMTConVPSSink object
)
VPSSubscribe
AdminAPI.VPSSubscribe(
sink # IMTConVPSSink object
)
Parameters
sink
[in] The pointer to the object that implements the IMTConVPSSink interface.
Return Value
An indication of successful completion is the MT_RET_OK response code. Otherwise, an error has occurred that corresponds to the response code.
Note
Subscribing to events is thread safe. The same IMTConVPSSink interface cannot subscribe to an event twice. The MT_RET_ERR_DUPLICATE response code is returned in this case.
The object at which sink points, must remain in the memory (must not be removed) until the call of IMTServerAPI::VPSUnsubscribe or until the plugin is deleted.
IMTAdminAPI::VPSUnsubscribe
Unsubscribe from events and hooks associated with changes in the VPS sponsorship settings.
C++
MTAPIRES IMTAdminAPI::VPSUnsubscribe(
IMTConVPSSink* sink // the pointer to the IMTConVPSSink object
)
.NET
MTRetCode CIMTAdminAPI.VPSUnsubscribe(
CIMTConVPSSink sink // CIMTConVPSSink object
)
file:///C:/Users/Administrator/AppData/Local/Temp/~hh4BC4.htm 7/17/2025
Manager API Page 136 of 464
Python
AdminAPI.VPSUnsubscribe(
sink // IMTConVPSSink object
)
Parameters
sink
[in] The pointer to the object that implements the IMTConVPSSink interface.
Return Value
An indication of successful completion is the MT_RET_OK response code. Otherwise, an error code will be returned.
Note
This is a pair method to IMTServerAPI::VPSSubscribe. If an attempt is made to unsubscribe from the interface to which it has not subscribed, MT_RET_ERR_NOTFOUND error is
returned.
IMTAdminAPI::VPSGet
Get VPS sponsorship settings.
C++
MTAPIRES IMTAdminAPI::VPSGet(
IMTConVPS* config // VPS settings object
)
.NET
MTRetCode CIMTAdminAPI.VPSGet(
CIMTConVPS config // VPS settings object
)
Python
AdminAPI.VPSGet()
Parameters
config
[out] Settings object IMTConVPS. The 'config' object must be previously created using the IMTAdminAPI::VPSCreate method.
Return Value
An indication of successful completion is the MT_RET_OK response code. Otherwise, an error code will be returned.
IMTAdminAPI::VPSSet
Update VPS sponsorship settings.
C++
MTAPIRES IMTAdminAPI::VPSSet(
IMTConVPS* config // VPS settings object
)
.NET
MTRetCode CIMTAdminAPI.VPSSet(
CIMTConVPS config // VPS settings object
)
Python
AdminAPI.VPSSet(
config # VPS settings object
)
Parameters
config
[in] Settings object IMTConVPS.
Return Value
An indication of successful completion is the MT_RET_OK response code. Otherwise, an error code will be returned.
• The user requests an account from the terminal by filling our a simple form and uploading the relevant documents
• The data is automatically verified through the KYC provider
• A verification report is added to the client record, and the corresponding status is assigned to it
• After a final check, the manager can move the account to the appropriate real group
Function Purpose
KYCCreate Create a KYC provider configuration object.
KYCCountryCreate Create an object of a country for which the KYC provider will be used.
file:///C:/Users/Administrator/AppData/Local/Temp/~hh4BC4.htm 7/17/2025
Manager API Page 137 of 464
Function Purpose
KYCGroupCreate Create an object of an account group for which the KYC provider will be used.
KYCSubscribe Subscribe to events and hooks associated with KYC provider configurations.
KYCUnsubscribe Unsubscribe from events and hooks associated with KYC provider configurations.
KYCUpdate Add or update a KYC provider configuration.
KYCUpdateBatch Add or update a batch of KYC provider configurations.
KYCDelete Delete a KYC provider configuration by name or index.
KYCDeleteBatch Delete a batch of KYC provider configurations.
KYCShift Change the position of a KYC provider configuration in the list.
KYCTotal Get the total number of KYC provider configurations existing in the platform.
KYCNext Get a KYC provider configuration by index.
KYCGet Get a KYC provider configuration by name.
KYCStart Run a KYC check for the specified client.
IMTAdminAPI::KYCCreate
Create a KYC provider configuration object.
C++
IMTConKYC* IMTAdminAPI::KYCCreate()
.NET
CIMTConKYC CIMTAdminAPI.KYCCreate()
Return Value
Returns a pointer to the created object implementing the IMTConKYC interface. Null is returned in case of failure.
Note
The created object should be destroyed by calling the IMTConKYC::Release method of this object.
IMTAdminAPI::KYCCountryCreate
Create an object of a country for which the messenger will be used.
C++
IMTConKYCCountry* IMTAdminAPI::KYCCountryCreate()
.NET
CIMTConKYCCountry CIMTAdminAPI.KYCCountryCreate()
Return Value
Returns a pointer to the created object implementing the IMTConKYCCountry interface. Null is returned in case of failure.
Note
The created object should be destroyed by calling the IMTConKYCCountry::Release method of this object.
IMTAdminAPI::KYCGroupCreate
Create an object of the account group for which the KYC provider will be used.
C++
IMTConKYCGroup* IMTAdminAPI::KYCGroupCreate()
.NET
CIMTConKYCGroup CIMTAdminAPI.KYCGroupCreate()
Return Value
Returns a pointer to the created object implementing the IMTConKYCGroup interface. Null is returned in case of failure.
Note
The created object should be destroyed by calling the IMTConKYCGroup::Release method of this object.
IMTAdminAPI::KYCSubscribe
Subscribe to events and hooks associated with KYC provider configurations.
C++
MTAPIRES IMTAdminAPI::KYCSubscribe(
IMTConKYCSink* sink // A pointer to the IMTConKYCSink object
)
file:///C:/Users/Administrator/AppData/Local/Temp/~hh4BC4.htm 7/17/2025
Manager API Page 138 of 464
.NET
MTRetCode CIMTAdminAPI.KYCSubscribe(
CIMTConKYCSink sink // The IMTConKYCSink object
)
Parameters
sink
[in] A pointer to the object implementing the IMTConKYCSink interface.
Return Value
An indication of successful completion is the MT_RET_OK response code. Otherwise, an error corresponding to the response code has occurred.
Note
Subscribing to events is thread safe. The same IMTConKYCSink interface cannot be subscribed to an event twice. In this case code MT_RET_ERR_DUPLICATE will be returned.
The object at which 'sink' points, must remain in memory (must not be removed) until IMTAdminAPI::KYCUnsubscribe is called or until the plugin is deleted.
IMTAdminAPI::KYCUnsubscribe
Unsubscribe from events and hooks associated with KYC provider configurations.
C++
MTAPIRES IMTAdminAPI::KYCUnsubscribe(
IMTConKYCSink* sink // A pointer to the IMTConKYCSink object
)
.NET
MTRetCode CIMTAdminAPI.KYCUnsubscribe(
CIMTConKYCSink sink // The IMTConKYCSink object
)
Parameters
sink
[in] A pointer to the object implementing the IMTConKYCSink interface.
Return Value
An indication of successful completion is the MT_RET_OK response code. Otherwise, an error code will be returned.
Note
This method is paired with IMTAdminAPI::KYCSubscribe. If an attempt is made to unsubscribe from the interface which has not been previously subscribed to, the
MT_RET_ERR_NOTFOUND error is returned.
IMTAdminAPI::KYCUpdate
Add or update a KYC provider configuration.
C++
MTAPIRES IMTAdminAPI::KYCUpdate(
IMTConKYC* config // KYC provider configuration object
)
.NET
MTRetCode CIMTAdminAPI.KYCUpdate(
CIMTConKYC config // KYC provider configuration object
)
Parameters
config
[in] KYC provider configuration object.
Return Value
An indication of successful completion is the MT_RET_OK response code. Otherwise, an error code will be returned.
Note
When calling the method, a check is made whether the record exists. If the record already exists, it is updated; otherwise, a new entry is added. A key field for comparison is the
configuration name IMTConKYC::Name(). If you try to add a completely identical record, no changes are made, and therefore the IMTConKYCSink::OnKYCUpdate notification
method is not called.
A configuration can only be added or updated from the applications running on the main server. For all other plugins, the response code MT_RET_ERR_NOTMAIN will be returned.
Before adding a record, its correctness is checked. If the record is incorrect, the error code MT_RET_ERR_PARAMS is returned.
IMTAdminAPI::KYCUpdateBatch
Add or update a batch of KYC provider configurations.
C++
MTAPIRES IMTAdminAPI::KYCUpdateBatch(
IMTConKYC** configs, // Array of settings
const UINT config_total, // Number of settings in the platform
MTAPIRES* results // Array of results
)
.NET
file:///C:/Users/Administrator/AppData/Local/Temp/~hh4BC4.htm 7/17/2025
Manager API Page 139 of 464
MTRetCode CIMTAdminAPI.KYCUpdateBatch(
CIMTConKYC[] configs, // Array of settings
MTRetCode[] results // Array of results
)
Parameters
configs
[in] A pointer to an array of configurations which you want to add/update.
config_total
[in] The number of configurations in the 'configs' array.
results
[out] An array with the results of applying of each configuration change on the server.
Return Value
An indication of successful completion is the MT_RET_OK response code. Otherwise, an error code will be returned. The MT_RET_OK response code is an indication of successful
change sending to a server; the results of applying changes are passed in the 'results' parameter.
Note
A configuration can only be added or updated from the applications running on the main server. The response code MT_RET_ERR_NOTMAIN is returned for all other applications.
Before adding a record, its correctness is checked. If the record is incorrect, the error code MT_RET_ERR_PARAMS is returned.
IMTAdminAPI::KYCDelete
Delete a KYC provider configuration by name.
C++
MTAPIRES IMTAdminAPI::KYCDelete(
LPCWSTR name // Configuration name
)
.NET
MTRetCode CIMTAdminAPI.KYCDelete(
string name // Configuration name
)
Parameters
name
[in] The name of the configuration to delete.
Return Value
An indication of successful completion is the MT_RET_OK response code. Otherwise, an error code will be returned.
Note
A configuration can only be deleted from the applications that run on the main server. For all other plugins the response code MT_RET_ERR_NOTMAIN will be returned. If the
object is not found, the response code MT_RET_ERR_NOTFOUND is returned.
The IMTConKYC::Name value is used as the configuration name.
IMTAdminAPI::KYCDelete
Delete a KYC provider configuration by index.
C++
MTAPIRES IMTAdminAPI::KYCDelete(
const UINT pos // Position of configuration
)
.NET
MTRetCode CIMTAdminAPI.KYCDelete(
uint pos // Position of configuration
)
Parameters
pos
[in] Position of the configuration, starting with 0.
Return Value
An indication of successful completion is the MT_RET_OK response code. Otherwise, an error code will be returned.
Note
A configuration can only be deleted from the applications that run on the main server. For all other plugins the response code MT_RET_ERR_NOTMAIN will be returned. If the
object is not found, the response code MT_RET_ERR_NOTFOUND is returned.
IMTAdminAPI::KYCDeleteBatch
Delete a batch of KYC provider configurations.
C++
MTAPIRES IMTAdminAPI::KYCDeleteBatch(
IMTConKYC** configs, // Array of settings
const UINT config_total, // Number of settings in the platform
MTAPIRES* results // Array of results
)
.NET
file:///C:/Users/Administrator/AppData/Local/Temp/~hh4BC4.htm 7/17/2025
Manager API Page 140 of 464
MTRetCode CIMTAdminAPI.KYCDeleteBatch(
CIMTConKYC[] configs, // Array of settings
MTRetCode[] results // Array of results
)
Parameters
configs
[in] A pointer to an array of configurations which you want to delete.
config_total
[in] The number of configurations in the 'configs' array.
results
[out] An array with the results of each configuration deletion on the server.
Return Value
An indication of successful completion is the MT_RET_OK response code. Otherwise, an error code will be returned. The MT_RET_OK response code is an indication of successful
change sending to a server; the results of applying changes are passed in the 'results' parameter.
Note
Configurations can only be deleted when connected to the main trade server. In all other cases, the MT_RET_ERR_NOTMAIN response code is returned. If the object is not found,
the MT_RET_ERR_PARAMS error code is added to the 'results' array of this object.
IMTAdminAPI::KYCShift
Change the position of a KYC provider configuration in the list.
C++
MTAPIRES IMTAdminAPI::KYCShift(
const UINT pos, // Configuration position
const int shift // Shift
)
.NET
MTRetCode CIMTAdminAPI.KYCShift(
uint pos, // Configuration position
int shift // Shift
)
Parameters
pos
[in] Position of the configuration, starting with 0.
shift
[in] The shift of the configuration relative to its current position. A negative value means shift towards the top of the list; a positive value shifts the item towards the end.
Return Value
An indication of successful completion is the MT_RET_OK response code. Otherwise, an error code will be returned.
Note
The position of a configuration can only be changed from the applications running on the main server. For all other plugins, the response code MT_RET_ERR_NOTMAIN will be
returned.
IMTAdminAPI::KYCTotal
Get the total number of KYC provider configurations existing in the platform.
C++
UINT IMTAdminAPI::KYCTotal()
.NET
uint CIMTAdminAPI.KYCTotal()
Return Value
The number of KYC provider configurations in the trading platform.
IMTAdminAPI::KYCNext
Get a KYC provider configuration by index.
C++
MTAPIRES IMTAdminAPI::KYCNext(
const UINT pos, // Position of configuration
IMTConKYC* kyc // KYC provider configuration object
)
.NET
MTRetCode CIMTAdminAPI.KYCNext(
uing pos, // Position configuration
CIMTConKYC kyc // KYC provider configuration object
)
Parameters
pos
[in] Position of the configuration, starting with 0.
file:///C:/Users/Administrator/AppData/Local/Temp/~hh4BC4.htm 7/17/2025
Manager API Page 141 of 464
kyc
[out] KYC provider configuration object. The 'kyc' object must be created in advance using the IMTServerAPI::KYCCreate method.
Return Value
An indication of successful completion is the MT_RET_OK response code. Otherwise, an error code will be returned.
Note
This method copies the configuration data of the KYC provider with a specified index to the 'kyc' object.
IMTAdminAPI::KYCGet
Get a KYC provider configuration by name.
C++
MTAPIRES IMTAdminAPI::KYCGet(
LPCWSTR name, // Configuration name
IMTConKYC* kyc // KYC provider configuration object
)
.NET
MTRetCode CIMTAdminAPI.KYCGet(
string name, // Configuration name
CIMTConKYC kyc // KYC provider configuration object
)
Parameters
name
[in] The name of the configuration.
kyc
[out] KYC provider configuration object. The 'kyc' object must be created in advance using the IMTServerAPI::KYCCreate method.
Return Value
An indication of successful completion is the MT_RET_OK response code. Otherwise, an error code will be returned.
Note
The IMTConKYC::Name value is used as the configuration name.
IMTAdminAPI::KYCStart
Run a KYC check for the specified client.
C++
MTAPIRES IMTAdminAPI::KYCStart(
const UINT64 client_id // Client id
)
.NET
MTRetCode CIMTAdminAPI.KYCStart(
ulong client_id // Client id
)
Parameters
client_id
[in] The identifier of the client for whom the check should be run. The client ID is equal to the IMTClient::RecordID value.
Return Value
An indication of successful completion is the MT_RET_OK response code. Otherwise, an error code will be returned.
Note
The KYC provider through which the check will be performed, is selected based on the client's country and group. For further information, please see MetaTrader 5 Administrator
Help.
Subscriptions
With the "Subscriptions" service, you can offer additional paid services to traders directly in the client terminals. For example, you can sell subscriptions for high-quality market
data from well-known providers, offer personal manager services to assist traders in understanding the basics of trading, deliver one-time services such as position transferring or
currency conversion, and much more. For further details, please read the MetaTrader 5 Administrator Help.
The functions described in this section enable the management of subscription settings:
Function Purpose
SubscriptionCfgCreate Create a subscription configuration object.
SubscriptionCfgSymbolCreate Create a subscription symbol configuration object.
SubscriptionCfgNewsCreate Create a subscription news configuration object.
SubscriptionCfgSubscribe Subscribe to events and hooks associated with subscription configurations.
SubscriptionCfgUnsubscribe Unsubscribe from events and hooks associated with subscription configurations.
SubscriptionCfgUpdate Add or update a subscription configuration.
SubscriptionCfgUpdateBatch Add or edit multiple subscription configurations.
SubscriptionCfgDelete Delete a subscription configuration by name or position.
file:///C:/Users/Administrator/AppData/Local/Temp/~hh4BC4.htm 7/17/2025
Manager API Page 142 of 464
Function Purpose
SubscriptionCfgDeleteByID Delete a subscription configuration by internal ID.
SubscriptionCfgDeleteBatch Delete multiple subscription configurations.
SubscriptionCfgShift Change the position of a subscription configuration in the list.
SubscriptionCfgTotal Get the total number of subscription configurations available in the platform.
SubscriptionCfgNext Get a subscription configuration by index.
SubscriptionCfgGet Get a subscription configuration by name.
SubscriptionCfgGetByID Get a subscription configuration by ID.
IMTAdminAPI::SubscriptionCfgCreate
Create a subscription configuration object.
C++
IMTConSubscription* IMTAdminAPI::SubscriptionCfgCreate()
.NET
CIMTConSubscription CIMTAdminAPI.SubscriptionCfgCreate()
Return Value
The function returns a pointer to the created object that implements the IMTConSubscription interface. Null is returned in case of failure.
Note
The created object must be destroyed by calling the IMTConSubscription::Release method of this object.
IMTAdminAPI::SubscriptionCfgSymbolCreate
Create a subscription symbol configuration object.
C++
IMTConSubscriptionSymbol* IMTAdminAPI::SubscriptionCfgSymbolCreate()
.NET
CIMTConSubscriptionSymbol CIMTAdminAPI.SubscriptionCfgSymbolCreate()
Return Value
Returns a pointer to the created object that implements the IMTConSubscriptionSymbol interface. Null is returned in case of failure.
Note
The created object must be destroyed by calling the IMTConSubscriptionSymbol::Release method of this object.
IMTAdminAPI::SubscriptionCfgNewsCreate
Create a subscription news configuration object.
C++
IMTConSubscriptionNews* IMTAdminAPI::SubscriptionCfgNewsCreate()
.NET
CIMTConSubscriptionNews CIMTAdminAPI.SubscriptionCfgNewsCreate()
Return Value
Returns a pointer to the created object that implements the IMTConSubscriptionNews interface. Null is returned in case of failure.
Note
The created object must be destroyed by calling the IMTConSubscriptionNews::Release method of this object.
IMTAdminAPI::SubscriptionCfgSubscribe
Subscribe to events and hooks associated with subscription configurations.
C++
MTAPIRES IMTAdminAPI::SubscriptionCfgSubscribe(
IMTConSubscriptionSink* sink // A pointer to the IMTConSubscriptionSink object
)
.NET
MTRetCode CIMTAdminAPI.SubscriptionCfgSubscribe(
CIMTConSubscriptionSink sink // The IMTConSubscriptionSink object
)
Parameters
sink
[in] A pointer to the object that implements the IMTConSubscriptionSink interface.
file:///C:/Users/Administrator/AppData/Local/Temp/~hh4BC4.htm 7/17/2025
Manager API Page 143 of 464
Return Value
An indication of successful completion is the MT_RET_OK response code. Otherwise, an error has occurred corresponding to the response code.
Note
Subscribing to events is thread safe. The same IMTConSubscriptionSink interface cannot subscribe to an event twice. The MT_RET_ERR_DUPLICATE response code is returned in
this case.
The object at which 'sink' points must remain in memory (must not be deleted) until IMTAdminAPI::SubscriptionCfgUnsubscribe is called or until the administrator interface is
deleted by the IMTAdminAPI::Release method.
IMTAdminAPI::SubscriptionCfgUnsubscribe
Unsubscribe from events and hooks associated with subscription configurations.
C++
MTAPIRES IMTAdminAPI::SubscriptionCfgUnsubscribe(
IMTConSubscriptionSink* sink // A pointer to the IMTConSubscriptionSink object
)
.NET
MTRetCode CIMTAdminAPI.SubscriptionCfgUnsubscribe(
CIMTConSubscriptionSink sink // The IMTConSubscriptionSink object
)
Parameters
sink
[in] A pointer to the object that implements the IMTConSubscriptionSink interface.
Return Value
An indication of successful completion is the MT_RET_OK response code. Otherwise, an error code will be returned.
Note
This method is paired with IMTAdminAPI::SubscriptionCfgSubscribe. If an attempt is made to unsubscribe from the interface to which it has not subscribed,
MT_RET_ERR_NOTFOUND error is returned.
IMTAdminAPI::SubscriptionCfgUpdate
Add or update a subscription configuration.
C++
MTAPIRES IMTAdminAPI::SubscriptionCfgUpdate(
IMTConSubscription* config // Subscription configuration object
)
.NET
MTRetCode CIMTAdminAPI.SubscriptionCfgUpdate(
CIMTConSubscription config // Subscription configuration object
)
Parameters
config
[in] Subscription configuration object IMTConSubscription.
Return Value
An indication of successful completion is the MT_RET_OK response code. Otherwise, an error code will be returned.
Note
When calling the method, a check is made whether the record already exists. If the record already exists, it is updated, otherwise a new entry is added. A key field for
comparison is the configuration name IMTConSubscription::Name(). When you try to add a completely identical record, no changes are made, and therefore the
IMTConSubscriptionSink::OnSubscriptionUpdate notification method is not called.
A configuration can only be added or updated from the applications running on the main server. For all other applications, the response code MT_RET_ERR_NOTMAIN is returned.
Before adding, the correctness of the account is checked. If the record is incorrect, the error code MT_RET_ERR_PARAMS is returned.
IMTAdminAPI::SubscriptionCfgUpdateBatch
Add or edit multiple subscription configurations.
C++
MTAPIRES IMTAdminAPI::SubscriptionCfgUpdateBatch(
IMTConSubscription** configs, // Array of settings
const UINT config_total, // Number of settings in the array
MTAPIRES* results // Array of results
)
.NET
MTRetCode CIMTAdminAPI.SubscriptionCfgUpdateBatch(
CIMTConSubscription[] configs, // Array of settings
MTRetCode[] results // Array of results
)
Parameters
configs
[in] A pointer to an array of configurations which you want to add/edit.
config_total
file:///C:/Users/Administrator/AppData/Local/Temp/~hh4BC4.htm 7/17/2025
Manager API Page 144 of 464
IMTAdminAPI::SubscriptionCfgDelete
Delete a subscription configuration by name.
C++
MTAPIRES IMTAdminAPI::SubscriptionCfgDelete(
LPCWSTR name // Configuration name
)
.NET
MTRetCode CIMTAdminAPI.SubscriptionCfgDelete(
string name // Configuration name
)
Parameters
name
[in] The name of the configuration to delete. The IMTConSubscription::Name value is used for the configuration name.
Return Value
An indication of successful completion is the MT_RET_OK response code. Otherwise, an error code will be returned.
Note
A configuration can only be deleted from the applications that run on the main server. For all other plugins, the response code MT_RET_ERR_NOTMAIN will be returned. If the
object is not found, the response code MT_RET_ERR_NOTFOUND is returned.
IMTAdminAPI::SubscriptionCfgDelete
Delete a subscription configuration by index.
C++
MTAPIRES IMTAdminAPI::SubscriptionCfgDelete(
const UINT pos // Configuration position
)
.NET
MTRetCode CIMTAdminAPI.SubscriptionCfgDelete(
uint pos // Configuration position
)
Parameters
pos
[in] Position of the configuration, starting with 0.
Return Value
An indication of successful completion is the MT_RET_OK response code. Otherwise, an error code will be returned.
Note
A configuration can only be deleted from the applications that run on the main server. For all other plugins, the response code MT_RET_ERR_NOTMAIN will be returned. If the
object is not found, the response code MT_RET_ERR_NOTFOUND is returned.
IMTAdminAPI::SubscriptionCfgDeleteByID
Delete a subscription configuration by internal ID.
C++
MTAPIRES IMTAdminAPI::SubscriptionCfgDeleteByID(
const UINT64 id // Configuration ID
)
.NET
MTRetCode CIMTAdminAPI.SubscriptionCfgDeleteByID(
ulong id // Configuration ID
)
Parameters
id
[in] Configuration ID. The IMTConSubscription::ID value is used for the identifier.
Return Value
An indication of successful completion is the MT_RET_OK response code. Otherwise, an error code will be returned.
Note
A configuration can only be deleted from the applications that run on the main server. For all other plugins, the response code MT_RET_ERR_NOTMAIN will be returned. If the
object is not found, the response code MT_RET_ERR_NOTFOUND is returned.
file:///C:/Users/Administrator/AppData/Local/Temp/~hh4BC4.htm 7/17/2025
Manager API Page 145 of 464
IMTAdminAPI::SubscriptionCfgDeleteBatch
Delete multiple subscription configurations.
C++
MTAPIRES IMTAdminAPI::SubscriptionCfgDeleteBatch(
IMTConAutomation** configs, // Array of settings
const UINT config_total, // Number of settings in the array
MTAPIRES* results // Array of results
)
.NET
MTRetCode CIMTAdminAPI.SubscriptionCfgDeleteBatch(
CIMTConAutomation[] configs, // Array of settings
MTRetCode[] results // Array of results
)
Parameters
configs
[in] A pointer to an array of configurations which you want to delete.
config_total
[in] The number of configurations in the 'configs' array.
results
[out] An array with the results of each configuration deletion on the server.
Return Value
An indication of successful completion is the MT_RET_OK response code. Otherwise, an error code will be returned. The MT_RET_OK response code is an indication of successful
change sending to a server; the results of applying the changes are passed in the 'results' parameter.
Note
Configurations can only be deleted when connected to the main trade server. In all other cases, the MT_RET_ERR_NOTMAIN response code is returned. If the object is not found,
the MT_RET_ERR_PARAMS error code is added to the 'results' array of this object.
IMTAdminAPI::SubscriptionCfgShift
Change the position of a subscription configuration in the list.
C++
MTAPIRES IMTAdminAPI::SubscriptionCfgShift(
const UINT pos, // Configuration position
const int shift // Shift
)
.NET
MTRetCode CIMTAdminAPI.SubscriptionCfgShift(
uint pos, // Configuration position
int shift // Shift
)
Parameters
pos
[in] Position of the configuration, starting with 0.
shift
[in] The shift of the configuration relative to its current position. A negative value means shift towards the top of the list, a positive value shifts towards the end.
Return Value
An indication of successful completion is the MT_RET_OK response code. Otherwise, an error code will be returned.
Note
The position of a configuration can only be changed from the applications running on the main server. For all other plugins, the response code MT_RET_ERR_NOTMAIN will be
returned.
IMTAdminAPI::SubscriptionCfgTotal
Get the total number of subscription configurations available in the platform.
C++
UINT IMTAdminAPI::SubscriptionCfgTotal()
.NET
uint CIMTAdminAPI.SubscriptionCfgTotal()
Return Value
The number of subscription configurations in the trading platform.
IMTAdminAPI::SubscriptionCfgNext
Get a subscription configuration by index.
C++
file:///C:/Users/Administrator/AppData/Local/Temp/~hh4BC4.htm 7/17/2025
Manager API Page 146 of 464
MTAPIRES IMTAdminAPI::SubscriptionCfgNext(
const UINT pos, // Configuration position
IMTConSubscription* config // Subscription configuration object
)
.NET
MTRetCode CIMTAdminAPI.SubscriptionCfgNext(
uint pos, // Configuration position
CIMTConSubscription config // Subscription configuration object
)
Parameters
pos
[in] Position of the configuration, starting with 0.
config
[out] Subscription configuration object. The 'config' object must be previously created using the IMTAdminAPI::SubscriptionCfgCreate method.
Return Value
An indication of successful completion is the MT_RET_OK response code. Otherwise, an error code will be returned.
Note
This method copies the subscription configuration with a specified index to the 'config' object.
IMTAdminAPI::SubscriptionCfgGet
Get a subscription configuration by name.
C++
MTAPIRES IMTAdminAPI::SubscriptionCfgGet(
LPCWSTR name, // Configuration name
IMTConSubscription* config // Subscription configuration object
)
.NET
MTRetCode CIMTAdminAPI.SubscriptionCfgGet(
string name, // Configuration name
CIMTConSubscription config // Subscription configuration object
)
Parameters
name
[in] Configuration name. The IMTConSubscription::Name value is used for the configuration name.
config
[out] Subscription configuration object. The 'config' object must be previously created using the IMTAdminAPI::SubscriptionCfgCreate method.
Return Value
An indication of successful completion is the MT_RET_OK response code. Otherwise, an error code will be returned.
IMTAdminAPI::SubscriptionCfgGetByID
Get a subscription configuration by ID.
C++
MTAPIRES IMTAdminAPI::SubscriptionCfgGetByID(
const UINT64 id, // Configuration ID
IMTConSubscription* config // Subscription configuration object
)
.NET
MTRetCode CIMTAdminAPI.SubscriptionCfgGetByID(
uint id, // Configuration ID
CIMTConSubscription config // Subscription configuration object
)
Parameters
id
[in] Configuration ID. The IMTConSubscription::ID value is used for the identifier.
config
[out] Subscription configuration object. The 'config' object must be previously created using the IMTAdminAPI::SubscriptionCfgCreate method.
Return Value
An indication of successful completion is the MT_RET_OK response code. Otherwise, an error code will be returned.
Clients
The MetaTrader 5 Manager API allows managing a database of clients on a trade server. Using the API, you can add or remove records, edit data and handle database change
events. Use the API to expand the standard functionality of client management system in the platform, or to integrate it with external CRM systems.
A detailed description of operations with clients is provided in the MetaTrader 5 Administrator documentation.
The Manager API only allows managing the clients, which are available to the manager account used by the application to connect to the server. A client record is available to
the manager if one of the following conditions is met:
file:///C:/Users/Administrator/AppData/Local/Temp/~hh4BC4.htm 7/17/2025
Manager API Page 147 of 464
• The preferred trading group (IMTClient::TradingGroup) set for the client is available to the manager (the manager has permissions for the group)
• Any of the trading accounts bound to the client is available to the manager (the manager has permissions for the group in which the account is located)
Functions Purpose
ClientCreate Create a client object.
ClientCreateArray Create an object of the client array.
ClientAdd Add a client to the server database.
ClientAddBatch Add a batch of clients to the server database.
ClientAddBatchArray Add a batch of clients to the server database.
ClientUpdate Update a client in the server database.
ClientUpdateBatch Update a batch of clients in the server database.
ClientUpdateBatchArray Update a batch of clients in the server database.
ClientDelete Delete a client from the server database.
ClientDeleteBatch Delete a batch of clients from the server database.
ClientRequest Get a client by identifier.
ClientRequestByGroup Get clients by groups.
ClientRequestHistory Get the history of client changes.
ClientUserAdd Bind a trading account to a client.
ClientUserAddBatch Bind a batch of trading accounts to a client.
ClientUserDelete Unbind a trading account from a client.
ClientUserDeleteBatch Unbind a batch of trading accounts from a client.
ClientUserRequest Get the list of client's trading accounts.
DocumentCreate Create a document object.
DocumentCreateArray Create an object of the array of documents.
DocumentAdd Add a document to a client record.
DocumentAddBatch Add a document to a client record.
DocumentAddBatchArray Add a document to a client record.
DocumentUpdate Change a document in the client record.
DocumentUpdateBatch Change a document in the client record.
DocumentUpdateBatchArray Change a document in the client record.
DocumentDelete Delete a document from a client record.
DocumentDeleteBatch Delete a document from a client record.
DocumentRequest Get a document by identifier.
DocumentRequestByClient Get client documents.
DocumentRequestHistory Get the history of client document changes.
CommentCreate Create a comment object.
CommentCreateArray Create an object of the array of comments.
CommentAdd Add a comment to a document or client.
CommentAddBatch Add a batch of comments to a document or client.
CommentAddBatchArray Add a batch of comments to a document or client.
CommentUpdate Change a comment to a document or client.
CommentUpdateBatch Update a batch of comments to a document or client.
CommentUpdateBatchArray Update a batch of comments to a document or client.
CommentDelete Delete a comment from a document or client.
CommentDeleteBatch Delete a batch of comments from a document or client.
CommentRequest Get a comment by identifier.
CommentRequestByClient Get comments on a client by position.
CommentRequestByDocument Get comments on client documents by position.
AttachmentCreate Create an attachment object.
AttachmentCreateArray Create an object of the array of attachments.
AttachmentAdd Create an attachment file for a document or a comment.
AttachmentAddBatch Create attachment files for documents or comments in batch.
AttachmentAddBatchArray Create attachment files for documents or comments in batch.
AttachmentRequest Get attachments by identifiers.
file:///C:/Users/Administrator/AppData/Local/Temp/~hh4BC4.htm 7/17/2025
Manager API Page 148 of 464
IMTAdminAPI::ClientCreate
Create a client object.
C++
IMTClient* IMTAdminAPI::ClientCreate()
.NET
CIMTClient CIMTAdminAPI.ClientCreate()
Return Value
Returns a pointer to the created object that implements the IMTClient interface. NULL is returned in case of failure.
Note
The created object must be destroyed by calling the IMTClient::Release method of this object.
IMTAdminAPI::ClientCreateArray
Create an object of the client array.
C++
IMTClientArray* IMTAdminAPI::ClientCreateArray()
.NET
CIMTClientArray CIMTAdminAPI.ClientCreateArray()
Return Value
Returns a pointer to the created object that implements the IMTClientArray interface. NULL is returned in case of failure.
Note
The created object must be destroyed by calling the IMTClientArray::Release method of this object.
IMTAdminAPI::ClientAdd
Add a client to the server database.
C++
MTAPIRES IMTAdminAPI::ClientAdd(
IMTClient* client // client object
)
.NET
MTRetCode CIMTAdminAPI.ClientAdd(
CIMTClient client // client object
)
Python
AdminAPI.ClientAdd(
MTClient client # client object
)
Parameters
client
[in] Client object.
Return Value
An indication of successful completion is the MT_RET_OK response code. Otherwise, an error has occurred which corresponds to the response code.
Note
A client can only be added to the database of the server, to which the application is connected.
When creating a client, the server automatically assigns to this client a unique identifier IMTClient::RecordID.
During addition, the integrity of client records is checked. The IMTClient::PersonName field must be filled in the record.
IMTAdminAPI::ClientAddBatch
Add a batch of clients to the server database.
C++
MTAPIRES IMTAdminAPI::ClientAddBatch(
IMTClientArray* clients, // array of clients
MTAPIRES* results // array of results
)
.NET
MTRetCode CIMTAdminAPI.ClientAddBatch(
CIMTClientArray clients, // array of clients
MTRetCode[] retcodes // array of results
)
Python
AdminAPI.ClientAddBatch(
[MTClient] clients # array of clients
)
file:///C:/Users/Administrator/AppData/Local/Temp/~hh4BC4.htm 7/17/2025
Manager API Page 149 of 464
Parameters
clients
[in] A pointer to the object of the IMTClientArray array of clients.
results
[out] An array with the results of adding of clients. The size of the 'results' array must not be less than that of 'clients'.
Return Value
The MT_RET_OK response code indicates that all specified clients have been added. The MT_RET_ERR_PARTIAL response code means that only some of the clients have been
added. Analyze the 'results' array for more details of the execution results. The result of adding of each client from the 'clients' array is added to 'results'. The index of a result
corresponds to the index of a client in the source array.
Note
A client can only be added to the database of the server, to which the application is connected.
When creating a client, the server automatically assigns to this client a unique identifier IMTClient::RecordID.
During addition, the integrity of client records is checked. The IMTClient::PersonName field must be filled in the record.
IMTAdminAPI::ClientAddBatchArray
Add a batch of clients to the server database.
C++
MTAPIRES IMTAdminAPI::ClientAddBatchArray(
IMTClient** clients, // array of clients
const UINT clients_total, // number of clients in the array
MTAPIRES* results // array of results
)
.NET
MTRetCode CIMTAdminAPI.ClientAddBatchArray(
IMTClient[] clients, // array of clients
MTRetCode[] retcodes // array of results
)
Parameters
clients
[in] A pointer to the array of clients.
clients_total
[in] The number of clients in the 'clients' array.
results
[out] An array with the results of adding of clients. The size of the 'results' array must not be less than that of 'clients'.
Return Value
The MT_RET_OK response code indicates that all specified clients have been added. The MT_RET_ERR_PARTIAL response code means that only some of the clients have been
added. Analyze the 'results' array for more details of the execution results. The result of adding of each client from the 'clients' array is added to 'results'. The index of a result
corresponds to the index of a client in the source array.
Note
A client can only be added to the database of the server, to which the application is connected.
When creating a client, the server automatically assigns to this client a unique identifier IMTClient::RecordID.
During addition, the integrity of client records is checked. The IMTClient::PersonName field must be filled in the record.
IMTAdminAPI::ClientUpdate
Update a client in the server database.
C++
MTAPIRES IMTAdminAPI::ClientUpdate(
IMTClient* client // client object
)
.NET
MTRetCode CIMTAdminAPI.ClientUpdate(
CIMTClient client // client object
)
Python
AdminAPI.ClientUpdate(
MTClient client # client object
)
Parameters
client
[in] Client object.
Return Value
An indication of successful completion is the MT_RET_OK response code. Otherwise, an error has occurred that corresponds to the response code.
Note
A client can only be updated from the applications connected to the trade server, on which the client has been created. For all other applications the response code
MT_RET_ERR_NOTMAIN will be returned. If the object is not found, the response code MT_RET_ERR_NOTFOUND is returned.
All required fields in the 'client' object must be filled, not only the ones that need to be changed. It is recommended that you first receive a client object from the server, change
the required fields in it, and then send the changed object back to the server.
During update, a client record is checked for integrity. The IMTClient::PersonName field must be filled in the record.
file:///C:/Users/Administrator/AppData/Local/Temp/~hh4BC4.htm 7/17/2025
Manager API Page 150 of 464
IMTAdminAPI::ClientUpdateBatch
Update a batch of clients in the server database.
C++
MTAPIRES IMTAdminAPI::ClientUpdateBatch(
IMTClientArray* clients, // array of clients
MTAPIRES* results // array of results
)
.NET
MTRetCode CIMTAdminAPI.ClientUpdateBatch(
CIMTClientArray clients, // array of clients
MTRetCode[] retcodes // array of results
)
Python
AdminAPI.ClientUpdateBatch(
list[MTClient] clients # array of clients
)
Parameters
clients
[in] A pointer to the object of the IMTClientArray array of clients.
results
[out] An array with the results of adding of clients. The size of the 'results' array must not be less than that of 'clients'.
Return Value
The MT_RET_OK response code indicates that all specified clients have been updated. The MT_RET_ERR_PARTIAL response code means that only some of the clients have been
updated. Analyze the 'results' array for more details of the execution results. The result of update of each client from the 'clients' array is added to 'results'. The index of a result
corresponds to the index of a client in the source array.
Note
A client can only be updated from the applications connected to the trade server, on which the client has been created. For all other applications the response code
MT_RET_ERR_NOTMAIN will be returned. If the object is not found, the response code MT_RET_ERR_NOTFOUND is returned.
All required fields in the 'client' object must be filled, not only the ones that need to be changed. It is recommended that you first receive a client object from the server, change
the required fields in it, and then send the changed object back to the server.
During update, a client record is checked for integrity. The IMTClient::PersonName field must be filled in the record.
IMTAdminAPI::ClientUpdateBatchArray
Update a batch of clients in the server database.
C++
MTAPIRES IMTAdminAPI::ClientUpdateBatchArray(
IMTClient** clients, // array of clients
const UINT clients_total, // number of clients in the array
MTAPIRES* results // array of results
)
.NET
MTRetCode CIMTAdminAPI.ClientUpdateBatchArray(
CIMTClient[] clients, // array of clients
MTRetCode[] retcodes // array of results
)
Parameters
clients
[in] A pointer to the array of clients.
clients_total
[in] The number of clients in the 'clients' array.
results
[out] An array with the results of updating of clients. The size of the 'results' array must not be less than that of 'clients'.
Return Value
The MT_RET_OK response code indicates that all specified clients have been updated. The MT_RET_ERR_PARTIAL response code means that only some of the clients have been
updated. Analyze the 'results' array for more details of the execution results. The result of update of each client from the 'clients' array is added to 'results'. The index of a result
corresponds to the index of a client in the source array.
Note
A client can only be updated from the applications connected to the trade server, on which the client has been created. For all other applications the response code
MT_RET_ERR_NOTMAIN will be returned. If the object is not found, the response code MT_RET_ERR_NOTFOUND is returned.
All required fields in the 'client' object must be filled, not only the ones that need to be changed. It is recommended that you first receive a client object from the server, change
the required fields in it, and then send the changed object back to the server.
During update, a client record is checked for integrity. The IMTClient::PersonName field must be filled in the record.
IMTAdminAPI::ClientDelete
Delete a client from the server database.
C++
file:///C:/Users/Administrator/AppData/Local/Temp/~hh4BC4.htm 7/17/2025
Manager API Page 151 of 464
MTAPIRES IMTAdminAPI::ClientDelete(
const UINT64 client_id // identifier
)
.NET
MTRetCode IMTAdminAPI.ClientDelete(
ulong client_id // identifier
)
Python
AdminAPI.ClientDelete(
int client_id # identifier
)
Parameters
client_id
[in] Client identifier (IMTClient::RecordID).
Return Value
An indication of successful completion is the MT_RET_OK response code. Otherwise, an error code is returned.
Note
A client can only be deleted from the applications connected to the trade server, on which the client has been created. For all other applications the response code
MT_RET_ERR_NOTMAIN will be returned. If the object is not found, the response code MT_RET_ERR_NOTFOUND is returned.
IMTAdminAPI::ClientDeleteBatch
Delete a batch of clients from the server database.
C++
MTAPIRES IMTAdminAPI::ClientDeleteBatch(
const UINT64* client_ids, // array of clients
const UINT client_ids_total, // number of clients
MTAPIRES* results // array of results
)
.NET
MTRetCode CIMTAdminAPI.ClientDeleteBatch(
ulong[] client_ids, // array of clients
MTRetCode[] results // array of results
)
Python
AdminAPI.ClientDeleteBatch(
list[int] client_ids # array of clients
)
Parameters
client_ids
[in] An array with client identifiers in the server database (IMTClient::RecordID).
client_ids_total
[in] The number of identifiers in the 'client_ids' array.
results
[out] An array with the client deletion results. The size of the 'results' array must not be less than that of 'clients'.
Return Value
The MT_RET_OK response code indicates that all specified clients have been deleted. The MT_RET_ERR_PARTIAL response code means that only some of the clients have been
deleted. Analyze the 'results' array for more details of the execution results. The result of deletion of each client from the 'clients' array is added to 'results'. The index of a result
corresponds to the index of a client in the source array.
Note
A client can only be deleted from the applications connected to the trade server, on which the client has been created. For all other applications the response code
MT_RET_ERR_NOTMAIN will be returned. If the object is not found, the response code MT_RET_ERR_NOTFOUND is returned.
Bulk deletion is executed faster than deletion of the same number of clients in a cycle one by one, using IMTAdminAPI::ClientDelete.
IMTAdminAPI::ClientRequest
Get a client by identifier.
C++
MTAPIRES IMTAdminAPI::ClientRequest(
const UINT64 client_id, // identifier
IMTClient* client // client object
)
.NET
MTRetCode CIMTAdminAPI.ClientRequest(
ulong client_id, // identifier
CIMTClient client // client object
)
Python
AdminAPI.ClientRequest(
int client_id # identifier
)
Parameters
file:///C:/Users/Administrator/AppData/Local/Temp/~hh4BC4.htm 7/17/2025
Manager API Page 152 of 464
client_id
[in] Client identifier (IMTClient::RecordID).
client
[out] Client object. The 'client' object must be previously created using the IMTAdminAPI::ClientCreate method.
Return Value
An indication of successful completion is the MT_RET_OK response code. Otherwise, an error code is returned.
Note
The method copies data of a client with the specified ID, to the 'client' object.
The method cannot be called from event handlers (any IMT*Sink class methods).
IMTAdminAPI::ClientRequestByGroup
Get clients by groups.
C++
MTAPIRES IMTAdminAPI::ClientRequestByGroup(
LPCWSTR groups, // groups
IMTClientArray* clients // object of clients array
)
.NET
MTRetCode CIMTAdminAPI.ClientRequestByGroup(
string groups, // groups
CIMTClientArray clients // object of clients array
)
Python
AdminAPI.ClientRequestByGroup(
str groups # groups
)
Parameters
groups
[in] The preferred group (TradingGroup) specified for the client. You can specify one group, several groups (comma separated) or a group mask. The mask is specified using
"*" (any value) and "!" (exception). For example: "demo*,!demoforex" - all groups with the names beginning with 'demo', except for the group demoforex. The following clients
are returned when filter by groups is used:
• Clients for whom TradingGroup is specified and this group corresponds to the request mask
• Clients for whom TradingGroup is not specified, but there is at least one bound account from the requested group
• Clients for whom TradingGroup is not specified and there are no bound accounts (to prevent the clients from being lost)
clients
[out] An object of an array of clients. The 'clients' object must be previously created using the IMTAdminAPI::ClientCreateArray method.
Return Value
An indication of successful completion is the MT_RET_OK response code. Otherwise, an error code is returned.
Note
The method cannot be called from event handlers (any IMT*Sink class methods).
IMTAdminAPI::ClientRequestHistory
Get the history of client changes.
C++
MTAPIRES IMTAdminAPI::ClientRequestHistory(
const UINT64 client_id, // identifier
const UINT64 author, // author
const INT64 from, // period beginning
const UINT64 to, // period end
IMTClientArray* history // object of client array
)
.NET
MTRetCode CIMTAdminAPI.ClientRequestHistory(
ulong client_id, // identifier
ulong author, // author
long from, // period beginning
long to, // period end
CIMTClientArray history // object of client array
)
Python
AdminAPI.ClientRequestHistory(
int client_id, # identifier
int author, # author
from, # period beginning
to # period end
)
Parameters
client_id
[in] Client identifier (IMTClient::RecordID).
author
[in] The login of the manager account by whom the client was changed. The login is equal to the IMTConManager::Login value.
from
file:///C:/Users/Administrator/AppData/Local/Temp/~hh4BC4.htm 7/17/2025
Manager API Page 153 of 464
[in] The beginning of the period for which you wish to get the history of client changes. The date is specified in seconds that have elapsed since 01.01.1970.
to
[in] The end of the period for which you wish to get the history of client changes. The date is specified in seconds that have elapsed since 01.01.1970.
history
[out] An object of an array of clients. The 'history' object must be previously created using the IMTAdminAPI::ClientCreateArray method.
Return Value
An indication of successful completion is the MT_RET_OK response code. Otherwise, an error code is returned.
Note
The method returns an array of client descriptions: all the client states after changes by the specified author, in the specified time period.
The method cannot be called from event handlers (any IMT*Sink class methods).
IMTAdminAPI::ClientUserAdd
Bind a trading account to a client.
C++
MTAPIRES IMTAdminAPI::ClientUserAdd(
const UINT64 client_id, // identifier
const UINT64 login // account number
)
.NET
MTRetCode CIMTAdminAPI.ClientUserAdd(
ulong client_id, // identifier
ulong login // account number
)
Python
AdminAPI.ClientUserAdd(
int client_id, # identifier
int login # account number
)
Parameters
client_id
[in] The ID of the client (IMTClient::RecordID), to which the account should be linked.
login
[in] The login of the account (IMTUser::Login), which should be linked to the client.
Return Value
An indication of successful completion is the MT_RET_OK response code. Otherwise, an error code is returned.
Note
The method does not create a trading account. It binds an existing account to a client.
When binding, account data are not copied to the client record.
IMTAdminAPI::ClientUserAddBatch
Bind a batch of trading accounts to a client.
C++
MTAPIRES IMTAdminAPI::ClientUserAddBatch(
const UINT64 client_id, // identifier
const UINT64* logins, // array of accounts
const UINT logins_total, // number of accounts
MTAPIRES* results // results
)
.NET
MTRetCode CIMTAdminAPI.ClientUserAddBatch(
ulong client_id, // identifier
ulong[] logins, // array of accounts
MTRetCode[] retcodes // results
)
Python
AdminAPI.ClientUserAddBatch(
int client_id, # identifier
list[int] logins # array of accounts
)
Parameters
client_id
[in] The ID of the client (IMTClient::RecordID), to which the accounts should be linked.
logins
[in] The array of account logins (IMTUser::Login), which should be bound to the client.
logins_total
[in] Number of accounts in the logins array.
results
[out] An array with account binding results. The size of the 'results' array must not be less than that of 'logins'.
Return Value
file:///C:/Users/Administrator/AppData/Local/Temp/~hh4BC4.htm 7/17/2025
Manager API Page 154 of 464
The MT_RET_OK response code indicates that all specified accounts have been bound. The MT_RET_ERR_PARTIAL response code means that only some of the clients have been
bound. Analyze the 'results' array for more details of the execution results. The result of binding of each account from the 'logins' array is added to 'results'. The index of a result
corresponds to the index of an account in the source array.
Note
The method does not create trading accounts. It only binds existing accounts to a client.
When binding, account data are not copied to the client record.
IMTAdminAPI::ClientUserDelete
Unbind a trading account from a client.
C++
MTAPIRES IMTAdminAPI::ClientUserDelete(
const UINT64 client_id, // identifier
const UINT64 login // account number
)
.NET
MTRetCode CIMTAdminAPI.ClientUserDelete(
ulong client_id, // identifier
ulong login // account number
)
Python
AdminAPI.ClientUserDelete(
int client_id, # identifier
int login # account number
)
Parameters
client_id
[in] The ID of the client (IMTClient::RecordID), from which the account should be unbound.
login
[in] The login of the account (IMTUser::Login), which is unbound from the client.
Return Value
An indication of successful completion is the MT_RET_OK response code. Otherwise, an error code is returned.
Note
The request does not delete the trading account. It unbinds the account from the client.
IMTAdminAPI::ClientUserDeleteBatch
Unbind a batch of trading accounts from a client.
C++
MTAPIRES IMTAdminAPI::ClientUserDeleteBatch(
const UINT64 client_id, // identifier
const UINT64* logins, // array of accounts
const UINT logins_total, // number of accounts
MTAPIRES* results // results
)
.NET
MTRetCode CIMTAdminAPI.ClientUserDeleteBatch(
ulong client_id, // identifier
ulong[] logins, // array of accounts
MTRetCode[] retcodes // results
)
Python
AdminAPI.ClientUserDeleteBatch(
int client_id, # identifier
list[int] logins # array of accounts
)
Parameters
client_id
[in] The ID of the client (IMTClient::RecordID), from which the accounts are unbound.
logins
[in] The array of account logins (IMTUser::Login), which are unbound from the client.
logins_total
[in] Number of accounts in the logins array.
results
[out] An array with account unbinding results. The size of the 'results' array must not be less than that of 'logins'.
Return Value
The MT_RET_OK response code indicates that all specified accounts have been unbound. The MT_RET_ERR_PARTIAL response code means that only some of the clients have been
unbound. Analyze the 'results' array for more details of the execution results. The result of unbinding of each account from the 'logins' array is added to 'results'. The index of a
result corresponds to the index of an account in the source array.
Note
The request does not delete trading accounts. It only unbinds accounts from the client.
file:///C:/Users/Administrator/AppData/Local/Temp/~hh4BC4.htm 7/17/2025
Manager API Page 155 of 464
IMTAdminAPI::ClientUserRequest
Get the list of client's trading accounts.
C++
MTAPIRES IMTAdminAPI::ClientUserRequest(
const UINT64 client_id, // identifier
UINT64*& logins, // array of accounts
UINT& logins_total // number of accounts
)
.NET
MTRetCode CIMTAdminAPI.ClientUserRequest(
ulong client_id, // identifier
ulong[] logins // array of accounts
)
Python
AdminAPI.ClientUserRequest(
int client_id # identifier
)
Parameters
client_id
[in] Client identifier (IMTClient::RecordID).
logins
[out] Array with account logins. The login is equal to IMTUser::Login.
logins_total
[out] The number of accounts in the 'logins' array.
Return Value
An indication of successful completion is the MT_RET_OK response code. Otherwise, an error code is returned.
Note
The method allocates and fills an array of accounts. A pointer to the passed block is placed to the 'logins' parameter. After use, the array placed in the 'logins' variable must be
released using the IMTAdminAPI::Free method.
The method cannot be called from event handlers (any IMT*Sink class methods).
IMTAdminAPI::DocumentCreate
Create a document object.
C++
IMTClient* IMTAdminAPI::DocumentCreate()
.NET
CIMTClient CIMTAdminAPI.DocumentCreate()
Return Value
Returns a pointer to the created object that implements the IMTDocument interface. NULL is returned in case of failure.
Note
The created object must be destroyed by calling the IMTDocument::Release method of this object.
IMTAdminAPI::DocumentCreateArray
Create an object of the array of documents.
C++
IMTClientArray* IMTAdminAPI::DocumentCreateArray()
.NET
CIMTClientArray CIMTAdminAPI.DocumentCreateArray()
Return Value
Returns a pointer to the created object that implements the IMTDocumentArray interface. NULL is returned in case of failure.
Note
The created object must be destroyed by calling the IMTDocumentArray::Release method of this object.
IMTAdminAPI::DocumentAdd
Add a document to a client record.
C++
MTAPIRES IMTAdminAPI::DocumentAdd(
IMTDocument* document // document object
)
.NET
file:///C:/Users/Administrator/AppData/Local/Temp/~hh4BC4.htm 7/17/2025
Manager API Page 156 of 464
MTRetCode CIMTAdminAPI.DocumentAdd(
CIMTDocument document // document object
)
Parameters
document
[in] Document object.
Return Value
An indication of successful completion is the MT_RET_OK response code. Otherwise, an error has occurred that corresponds to the response code.
Note
A document can only be added from the applications connected to the trading server, on which the client has been created (IMTDocument::RelatedClient). The
MT_RET_ERR_NOTMAIN response code will be returned for all other applications. If the object is not found, the response code MT_RET_ERR_NOTFOUND will be returned.
IMTAdminAPI::DocumentAddBatch
Add a document to a client record.
C++
MTAPIRES IMTAdminAPI::DocumentAddBatch(
IMTDocumentArray* documents, // array of documents
MTAPIRES* results // array of results
)
.NET
MTRetCode CIMTAdminAPI.DocumentAddBatch(
CIMTDocumentArray documents, // array of documents
MTRetCode[] retcodes // array of results
)
Parameters
documents
[in] Document array object.
results
[out] An array with document addition results. The size of the 'results' array must not be less than that of 'documents'.
Return Value
The MT_RET_OK response code means that all the specified documents have been added. The MT_RET_ERR_PARTIAL response code means that only some of the documents have
been added. Analyze the 'results' array for more details of the execution results. The result of adding of each document from the 'documents' array is added to 'results'. The index
of a result corresponds to the index of a document in the source array.
Note
A document can only be added from the applications connected to the same trading server on which the client has been created (IMTDocument::RelatedClient). The
MT_RET_ERR_NOTMAIN response code will be returned for all other applications. If the object is not found, the response code MT_RET_ERR_NOTFOUND will be returned.
IMTAdminAPI::DocumentAddBatchArray
Add a document to a client record.
C++
MTAPIRES IMTAdminAPI::DocumentAddBatchArray(
IMTDocument** documents, // array documents
const UINT documents_total, // number of documents in the array
MTAPIRES* results // array of results
)
.NET
MTRetCode CIMTAdminAPI.DocumentAddBatchArray(
CIMTDocument[] documents, // array of documents
MTRetCode[] retcodes // array of results
)
Parameters
documents
[in] Array of document objects.
documents_total
[in] The number of documents in the 'documents' array.
results
[out] An array with document addition results. The size of the 'results' array must not be less than that of 'documents'.
Return Value
The MT_RET_OK response code means that all the specified documents have been added. The MT_RET_ERR_PARTIAL response code means that only some of the documents have
been added. Analyze the 'results' array for more details of the execution results. The result of adding of each document from the 'documents' array is added to 'results'. The index
of a result corresponds to the index of a document in the source array.
Note
Documents can only be added from the applications connected to the trading server, on which the client has been created (IMTDocument::RelatedClient). The
MT_RET_ERR_NOTMAIN response code will be returned for all other applications. If the object is not found, the response code MT_RET_ERR_NOTFOUND will be returned.
IMTAdminAPI::DocumentUpdate
Change a document in the client record.
file:///C:/Users/Administrator/AppData/Local/Temp/~hh4BC4.htm 7/17/2025
Manager API Page 157 of 464
C++
MTAPIRES IMTAdminAPI::DocumentUpdate(
IMTDocument* document // document object
)
.NET
MTRetCode CIMTAdminAPI.DocumentUpdate(
CIMTDocument document // document object
)
Parameters
document
[in] Document object.
Return Value
An indication of successful completion is the MT_RET_OK response code. Otherwise, an error has occurred that corresponds to the response code.
Note
A document can only be changed from the applications connected to the trading server, on which the client has been created (IMTDocument::RelatedClient). The
MT_RET_ERR_NOTMAIN response code will be returned for all other applications. If the object is not found, the response code MT_RET_ERR_NOTFOUND will be returned.
IMTAdminAPI::DocumentUpdateBatch
Change a document in the client record.
C++
MTAPIRES IMTAdminAPI::DocumentUpdateBatch(
IMTDocumentArray* documents, // array of documents
MTAPIRES* results // array of results
)
.NET
MTRetCode CIMTAdminAPI.DocumentUpdateBatch(
CIMTDocumentArray documents, // array of documents
MTRetCode[] retcodes // array of results
)
Parameters
documents
[in] Document array object.
results
[out] An array with the document changing results. The size of the 'results' array must not be less than that of 'documents'.
Return Value
The MT_RET_OK response code means that all the specified documents have been updated. The MT_RET_ERR_PARTIAL response code means that only some of the documents
have been updated. Analyze the 'results' array for more details of the execution results. The result of update of each document from the 'documents' array is added to 'results'.
The index of a result corresponds to the index of a document in the source array.
Note
A document can only be changed from the applications connected to the trading server, on which the client has been created (IMTDocument::RelatedClient). The
MT_RET_ERR_NOTMAIN response code will be returned for all other applications. If the object is not found, the response code MT_RET_ERR_NOTFOUND will be returned.
IMTAdminAPI::DocumentUpdateBatchArray
Change a document in the client record.
C++
MTAPIRES IMTAdminAPI::DocumentUpdateBatchArray(
IMTDocument** documents, // array documents
const UINT documents_total, // number of documents in the array
MTAPIRES* results // array of results
)
.NET
MTRetCode CIMTAdminAPI.DocumentUpdateBatchArray(
CIMTDocument[] documents, // array of documents
MTRetCode[] retcodes // array of results
)
Parameters
documents
[in] Array of document objects.
documents_total
[in] The number of documents in the 'documents' array.
results
[out] An array with the document changing results. The size of the 'results' array must not be less than that of 'documents'.
Return Value
The MT_RET_OK response code means that all the specified documents have been updated. The MT_RET_ERR_PARTIAL response code means that only some of the documents
have been updated. Analyze the 'results' array for more details of the execution results. The result of update of each document from the 'documents' array is added to 'results'.
The index of a result corresponds to the index of a document in the source array.
Note
A document can only be changed from the applications connected to the trading server, on which the client has been created (IMTDocument::RelatedClient). The
MT_RET_ERR_NOTMAIN response code will be returned for all other applications. If the object is not found, the response code MT_RET_ERR_NOTFOUND will be returned.
file:///C:/Users/Administrator/AppData/Local/Temp/~hh4BC4.htm 7/17/2025
Manager API Page 158 of 464
IMTAdminAPI::DocumentDelete
Delete a document from a client record.
C++
MTAPIRES IMTAdminAPI::DocumentDelete(
const UINT64 document_id // document identifier
)
.NET
MTRetCode CIMTAdminAPI.DocumentDelete(
ulong document_id // document identifier
)
Parameters
document
[in] The identifier of the document (IMTDocument::RecordId) to be deleted.
Return Value
An indication of successful completion is the MT_RET_OK response code. Otherwise, an error code is returned.
Note
A document can only be deleted from the applications connected to the trading server, on which the client has been created (IMTDocument::RelatedClient). The
MT_RET_ERR_NOTMAIN response code will be returned for all other applications. If the object is not found, the response code MT_RET_ERR_NOTFOUND will be returned.
IMTAdminAPI::DocumentDeleteBatch
Delete a document from a client record.
C++
MTAPIRES IMTAdminAPI::DocumentDeleteBatch(
const UINT64* document_ids, // document identifiers
const UINT document_ids_total, // number of documents
MTAPIRES* results // results
)
.NET
MTRetCode CIMTAdminAPI.DocumentDeleteBatch(
ulong[] document_ids, // document identifiers
MTRetCode[] retcodes // results
)
Parameters
document_ids
[in] The identifiers of the documents (IMTDocument::RecordId) to be deleted.
document_ids_total
[in] The number of identifiers in the document_ids array.
results
[out] An array with document deletion results. The size of the 'results' array must not be less than that of 'document_ids'.
Return Value
The MT_RET_OK response code indicates that all specified documents have been deleted. The MT_RET_ERR_PARTIAL response code means that only some of the documents have
been deleted. Analyze the 'results' array for more details of the execution results. The result of deletion of each document from the 'document_ids' array is added to 'results'. The
index of a result corresponds to the index of a document in the source array.
Note
A document can only be deleted from the applications connected to the trading server, on which the client has been created (IMTDocument::RelatedClient). The
MT_RET_ERR_NOTMAIN response code will be returned for all other applications. If the object is not found, the response code MT_RET_ERR_NOTFOUND will be returned.
IMTAdminAPI::DocumentRequest
Get a document by identifier.
C++
MTAPIRES IMTAdminAPI::DocumentRequest(
const UINT64 document_id, // identifier
IMTDocument* document // document object
)
.NET
MTRetCode IMTAdminAPI::DocumentRequest(
ulong document_id, // identifier
CIMTDocument document // document object
)
Parameters
document_id
[in] Document ID (IMTDocument::RecordID).
document
[out] Document object. The 'document' object must be previously created using the IMTAdminAPI::DocumentCreate method.
Return Value
An indication of successful completion is the MT_RET_OK response code. Otherwise, an error code is returned.
file:///C:/Users/Administrator/AppData/Local/Temp/~hh4BC4.htm 7/17/2025
Manager API Page 159 of 464
Note
The method copies data of a document with the specified ID, to the 'document' object.
The method cannot be called from event handlers (any IMT*Sink class methods).
IMTAdminAPI::DocumentRequestByClient
Get client documents.
C++
MTAPIRES IMTAdminAPI::DocumentRequestByClient(
const UINT64 client_id, // client identifier
IMTDocumnentArray* documents // array of documents
)
.NET
MTRetCode CIMTAdminAPI.DocumentRequestByClient(
ulong client_id, // client identifier
CIMTDocumnentArray documents // array of documents
)
Parameters
client_id
[in] Client identifier (IMTClient::RecordID).
documents
[out] An object of an array of documents. The documents object must be previously created using the IMTAdminAPI::DocumentCreateArray method.
Return Value
An indication of successful completion is the MT_RET_OK response code. Otherwise, an error code is returned.
Note
The method cannot be called from event handlers (any IMT*Sink class methods).
IMTAdminAPI::DocumentRequestHistory
Get the history of client document changes.
C++
MTAPIRES IMTAdminAPI::DocumentRequestHistory(
const UINT64 document_id, // identifier
const UINT64 author, // author
const INT64 from, // period beginning
const UINT64 to, // period end
IMTClientArray* history // object of the array of clients
)
.NET
MTRetCode CIMTAdminAPI.DocumentRequestHistory(
ulong document_id, // identifier
ulong author, // author
long from, // period beginning
long to, // period end
CIMTClientArray history // object of the array of clients
)
Parameters
document_id
[in] Document ID (IMTDocument::RecordID).
author
[in] The login of the manager account by whom the document was changed. The login is equal to the IMTConManager::Login value.
from
[in] The beginning of the period for which you wish to get the history of document changes. The date is specified in seconds that have elapsed since 01.01.1970.
to
[in] The end of the period for which you wish to get the history of document changes. The date is specified in seconds that have elapsed since 01.01.1970.
history
[out] An object of an array of documents. The 'history' object must be previously created using the IMTServerAPI::DocumentCreateArray method.
Return Value
An indication of successful completion is the MT_RET_OK response code. Otherwise, an error code is returned.
Note
The method returns an array of document descriptions: all the document states after being changed by the specified author, in the specified time period.
The method cannot be called from event handlers (any IMT*Sink class methods).
IMTAdminAPI::CommentCreate
Create a comment object.
C++
IMTClient* IMTAdminAPI::CommentCreate()
.NET
file:///C:/Users/Administrator/AppData/Local/Temp/~hh4BC4.htm 7/17/2025
Manager API Page 160 of 464
CIMTClient CIMTAdminAPI.CommentCreate()
Return Value
Returns a pointer to the created object that implements the IMTComment interface. NULL is returned in case of failure.
Note
The created object must be destroyed by calling the IMTComment::Release method of this object.
IMTAdminAPI::CommentCreateArray
Create an object of the array of comments.
C++
IMTClientArray* IMTAdminAPI::CommentCreateArray()
.NET
CIMTClientArray CIMTAdminAPI.CommentCreateArray()
Return Value
Returns a pointer to the created object that implements the IMTCommentArray interface. NULL is returned in case of failure.
Note
The created object must be destroyed by calling the IMTCommentArray::Release method of this object.
IMTAdminAPI::CommentAdd
Add a comment to a document or client.
C++
MTAPIRES IMTAdminAPI::CommentAdd(
IMTComment* comment // comment object
)
.NET
MTRetCode CIMTAdminAPI.CommentAdd(
CIMTComment comment // comment object
)
Parameters
document
[in] Comment object.
Return Value
An indication of successful completion is the MT_RET_OK response code. Otherwise, an error has occurred that corresponds to the response code.
Note
To add a comment to a client, specify the client ID in IMTComment::RelatedClient. To add a comment to a document, specify appropriate identifiers both in
IMTComment::RelatedClient and in IMTComment::RelatedDocument.
Comments can only be added from the applications connected to the trading server, on which the client has been created (IMTComment::RelatedClient). The
MT_RET_ERR_NOTMAIN response code will be returned for all other applications. If the object is not found, the response code MT_RET_ERR_NOTFOUND will be returned.
IMTAdminAPI::CommentAddBatch
Add a batch of comments to a document or client.
C++
MTAPIRES IMTAdminAPI::CommentAddBatch(
IMTCommentArray* comments, // array of comments
MTAPIRES* results // array of results
)
.NET
MTRetCode CIMTAdminAPI.CommentAddBatch(
CIMTCommentArray comments, // array of comments
MTRetCode[] retcodes // array of results
)
Parameters
comments
[in] Object of the comments array.
results
[out] An array with the results of adding of comments. The size of the 'results' array must not be less than that of 'comments'.
Return Value
The MT_RET_OK response code means that all the specified comments have been added. The MT_RET_ERR_PARTIAL response code means that only some of the comments have
been added. Analyze the 'results' array for more details of the execution results. The result of adding of each comment from the 'comments' array is added to 'results'. The index
of a result corresponds to the index of a comment in the source array.
Note
To add a comment to a client, specify the client ID in IMTComment::RelatedClient. To add a comment to a document, specify appropriate identifiers both in
IMTComment::RelatedClient and in IMTComment::RelatedDocument.
file:///C:/Users/Administrator/AppData/Local/Temp/~hh4BC4.htm 7/17/2025
Manager API Page 161 of 464
Comments can only be added from the applications connected to the trading server, on which the client has been created (IMTComment::RelatedClient). The
MT_RET_ERR_NOTMAIN response code will be returned for all other applications. If the object is not found, the response code MT_RET_ERR_NOTFOUND will be returned.
IMTAdminAPI::CommentAddBatchArray
Add a batch of comments to a document or client.
C++
MTAPIRES IMTAdminAPI::CommentAdd(
IMTComment** comments, // array of documents
const UINT comments_total, // number of documents in the array
MTAPIRES* results // array of results
)
.NET
MTRetCode CIMTAdminAPI.CommentAdd(
CIMTComment[] comments, // array of documents
MTRetCode[] retcodes // array of results
)
Parameters
comments
[in] Array of comment objects.
comments_total
[in] The number of comments in the 'comments' object.
results
[out] An array with the results of adding of comments. The size of the 'results' array must not be less than that of 'comments'.
Return Value
The MT_RET_OK response code means that all the specified comments have been added. The MT_RET_ERR_PARTIAL response code means that only some of the comments have
been added. Analyze the 'results' array for more details of the execution results. The result of adding of each comment from the 'comments' array is added to 'results'. The index
of a result corresponds to the index of a comment in the source array.
Note
To add a comment to a client, specify the client ID in IMTComment::RelatedClient. To add a comment to a document, specify appropriate identifiers both in
IMTComment::RelatedClient and in IMTComment::RelatedDocument.
Comments can only be added from the applications connected to the trading server, on which the client has been created (IMTComment::RelatedClient). The
MT_RET_ERR_NOTMAIN response code will be returned for all other applications. If the object is not found, the response code MT_RET_ERR_NOTFOUND will be returned.
IMTAdminAPI::CommentUpdate
Change a comment to a document or client.
C++
MTAPIRES IMTAdminAPI::CommentUpdate(
IMTComment* comment // comment object
)
.NET
MTRetCode CIMTAdminAPI.CommentUpdate(
CIMTComment comment // comment object
)
Parameters
comment
[in] Comment object.
Return Value
An indication of successful completion is the MT_RET_OK response code. Otherwise, an error has occurred that corresponds to the response code.
Note
To update a comment to a client, specify the client ID in IMTComment::RelatedClient. To edit a comment to a document, specify appropriate identifiers both in
IMTComment::RelatedClient and in IMTComment::RelatedDocument.
A comment can only be changed from the applications connected to the trading server, on which the client has been created (IMTComment::RelatedClient). The
MT_RET_ERR_NOTMAIN response code will be returned for all other applications. If the object is not found, the response code MT_RET_ERR_NOTFOUND will be returned.
IMTAdminAPI::CommentUpdateBatch
Update a batch of comments to a document or client.
C++
MTAPIRES IMTAdminAPI::CommentUpdateBatch(
IMTCommentArray* comments, // array of comments
MTAPIRES* results // array of results
)
.NET
MTRetCode CIMTAdminAPI.CommentUpdateBatch(
CIMTCommentArray comments, // array of comments
MTRetCode[] retcodes // array of results
)
Parameters
comments
file:///C:/Users/Administrator/AppData/Local/Temp/~hh4BC4.htm 7/17/2025
Manager API Page 162 of 464
IMTAdminAPI::CommentUpdateBatchArray
Update a batch of comments to a document or client.
C++
MTAPIRES IMTAdminAPI::CommentUpdateBatchArray(
IMTComment** comments, // array of documents
const UINT comments_total, // number of documents in the array
MTAPIRES* results // array of results
)
.NET
MTRetCode CIMTAdminAPI.CommentUpdateBatchArray(
CIMTComment[] comments, // array of documents
MTRetCode[] retcodes // array of results
)
Parameters
comments
[in] Array of comment objects.
comments_total
[in] The number of comments in the 'comments' object.
results
[out] An array with the results of updating of comments. The size of the 'results' array must not be less than that of 'comments'.
Return Value
The MT_RET_OK response code means that all the specified comments have been updated. The MT_RET_ERR_PARTIAL response code means that only some of the comments have
been updated. Analyze the 'results' array for more details of the execution results. The result of update of each comment from the 'comments' array is added to 'results'. The
index of a result corresponds to the index of a comment in the source array.
Note
To update a comment to a client, specify the client ID in IMTComment::RelatedClient. To edit a comment to a document, specify appropriate identifiers both in
IMTComment::RelatedClient and in IMTComment::RelatedDocument.
Comments can only be changed from the applications connected to the trading server, on which the client has been created (IMTComment::RelatedClient). The
MT_RET_ERR_NOTMAIN response code will be returned for all other applications. If the object is not found, the response code MT_RET_ERR_NOTFOUND will be returned.
IMTAdminAPI::CommentDelete
Delete a comment from a document or client.
C++
MTAPIRES IMTAdminAPI::CommentDelete(
IMTComment* comment // comment object
)
.NET
MTRetCode CIMTAdminAPI.CommentDelete(
CIMTComment comment // comment object
)
Parameters
comment
[in] Comment object.
Return Value
An indication of successful completion is the MT_RET_OK response code. Otherwise, an error code is returned.
Note
Comments can only be deleted from the applications connected to the trading server, on which the client has been created (IMTComment::RelatedClient). The
MT_RET_ERR_NOTMAIN response code will be returned for all other applications. If the object is not found, the response code MT_RET_ERR_NOTFOUND will be returned.
IMTAdminAPI::CommentDeleteBatch
Delete a batch of comments from a document or client.
C++
file:///C:/Users/Administrator/AppData/Local/Temp/~hh4BC4.htm 7/17/2025
Manager API Page 163 of 464
MTAPIRES IMTAdminAPI::CommentDeleteBatch(
const UINT64* comment_ids, // document identifiers
const UINT comment_ids_total, // number of documents
MTAPIRES* results // results
)
.NET
MTRetCode CIMTAdminAPI.CommentDeleteBatch(
ulong[] comment_ids, // document identifiers
MTRetCode[] retcodes // results
)
Parameters
comment_ids
[in] The identifiers of the documents (IMTDocument::RecordId) to be deleted.
comment_ids_total
[in] The number of identifiers in the comment_ids array.
results
[out] An array with document deletion results. The size of the 'results' array must not be less than that of 'comment_ids'.
Return Value
The MT_RET_OK response code indicates that all specified documents have been deleted. The MT_RET_ERR_PARTIAL response code means that only some of the documents have
been deleted. Analyze the 'results' array for more details of the execution results. The result of deletion of each document from the 'comment_ids' array is added to 'results'. The
index of a result corresponds to the index of a document in the source array.
Note
Documents can only be deleted from the applications connected to the trading server, on which the client has been created (IMTComment::RelatedClient). The
MT_RET_ERR_NOTMAIN response code will be returned for all other applications. If the object is not found, the response code MT_RET_ERR_NOTFOUND will be returned.
IMTAdminAPI::CommentRequest
Get a comment by identifier.
C++
MTAPIRES IMTAdminAPI::CommentRequest(
const UINT64 comment_id, // identifier
IMTComment* comment // comment object
)
.NET
MTRetCode CIMTAdminAPI.CommentRequest(
ulong comment_id, // identifier
CIMTComment comment // Comment object
)
Parameters
comment_id
[in] Comment object (IMTComment::RecordID).
comment
[out] Comment object. The 'comment' object must be previously created using the IMTAdminAPI::CommentCreate method.
Return Value
An indication of successful completion is the MT_RET_OK response code. Otherwise, an error code is returned.
Note
The method copies data of a comment with the specified ID, to the 'comment' object.
The method cannot be called from event handlers (any IMT*Sink class methods).
IMTAdminAPI::CommentRequestByClient
Get comments on a client by position.
C++
MTAPIRES IMTAdminAPI::CommentGetByClient(
const UINT64 client_id, // client identifier
const UINT position, // initial position
const UINT total, // number
IMTCommentArray* comments // array of comments
)
.NET
MTRetCode CIMTAdminAPI.CommentGetByClient(
ulong client_id, // client identifier
uint position, // initial position
uint total, // number
CIMTCommentArray comments // array of comments
)
Parameters
client_id
[in] Client identifier (IMTClient::RecordID).
position
[in] Position in the list of comments, starting with 0. The method returns comments starting with this position.
total
[in] The number of comments which should be received.
file:///C:/Users/Administrator/AppData/Local/Temp/~hh4BC4.htm 7/17/2025
Manager API Page 164 of 464
comments
[out] An object of an array of comments. The 'comments' object must be previously created using the IMTAdminAPI::CommentCreateArray method.
Return Value
An indication of successful completion is the MT_RET_OK response code. Otherwise, an error code is returned.
Note
The method cannot be called from event handlers (any IMT*Sink class methods).
IMTAdminAPI::CommentRequestByDocument
Get comments on client documents by position.
C++
MTAPIRES IMTAdminAPI::CommentRequestByDocument(
const UINT64 document_id, // document identifier
const UINT position, // initial position
const UINT total, // number
IMTCommentArray* comments // array of documents
)
.NET
MTRetCode CIMTAdminAPI.CommentRequestByDocument(
ulong document_id, // document identifier
uint position, // initial position
uint total, // number
CIMTCommentArray comments // array of documents
)
Parameters
document_id
[in] Document ID (IMTDocument::RecordID).
position
[in] Position in the list of comments, starting with 0. The method returns comments starting with this position.
total
[in] The number of comments which should be received.
comments
[out] An object of an array of comments. The 'comments' object must be previously created using the IMTAdminAPI::CommentCreateArray method.
Return Value
An indication of successful completion is the MT_RET_OK response code. Otherwise, an error code is returned.
Note
The method cannot be called from event handlers (any IMT*Sink class methods).
IMTAdminAPI::AttachmentCreate
Create an attachment object.
C++
IMTClient* IMTAdminAPI::AttachmentCreate()
.NET
CIMTClient CIMTAdminAPI.AttachmentCreate()
Return Value
Returns a pointer to the created object that implements the IMTAttachment interface. NULL is returned in case of failure.
Note
The created object must be destroyed by calling the IMTAttachment::Release method of this object.
IMTAdminAPI::AttachmentCreateArray
Create an object of the array of attachments.
C++
IMTClient* IMTAdminAPI::AttachmentCreateArray()
.NET
CIMTClient CIMTAdminAPI.AttachmentCreateArray()
Return Value
Returns a pointer to the created object that implements the IMTAttachmentArray. NULL is returned in case of failure.
Note
The created object must be destroyed by calling the IMTAttachmentArray::Release method of this object.
IMTAdminAPI::AttachmentAdd
file:///C:/Users/Administrator/AppData/Local/Temp/~hh4BC4.htm 7/17/2025
Manager API Page 165 of 464
.NET
MTRetCode CIMTAdminAPI.AttachmentAdd(
CIMTAttachment attachment // Attachment object
)
Parameters
attachment
[in/out] Attachment object. A ready description of the attachment is input. At the output, the server fills the IMTAttachment::RecordID identifier in this description.
Return Value
An indication of successful completion is the MT_RET_OK response code. Otherwise, an error has occurred that corresponds to the response code.
Note
Once the attachment identifier is received, you can add the attachment to a document or a request by calling the IMTDocument::AttachmenAdd or IMTComment::AttachmentAdd
respectively.
IMTAdminAPI::AttachmentAddBatch
Create attachment files for documents or comments in batch.
C++
MTAPIRES IMTAdminAPI::AttachmentAddBatch(
IMTAttachmentArray* attachments, // array of attachments
MTAPIRES* results // array of results
)
.NET
MTRetCode CIMTAdminAPI.AttachmentAddBatch(
CIMTAttachmentArray attachments, // array of attachments
MTRetCode[] retcodes // array of results
)
Parameters
attachments
[in/out] Attachment array object. You input ready descriptions of attachments. At the output, the server fills the IMTAttachment::RecordID in these attachments.
results
[out] An array with attachment creation results. The size of the 'results' array must not be less than that of 'attachments'.
Return Value
The MT_RET_OK response code means that all the specified comments have been created. The MT_RET_ERR_PARTIAL response code means that only some of the comments have
been created. Analyze the 'results' array for more details of the execution results. The result of creation of each attachment from the 'attachments' array is added to 'results'. The
index of a result corresponds to the index of an attachment in the source array.
Note
Once the attachment identifier is received, you can add the attachment to a document or a request by calling the IMTDocument::AttachmenAdd or IMTComment::AttachmentAdd
respectively.
IMTAdminAPI::AttachmentAddBatchArray
Create attachment files for documents or comments in batch.
C++
MTAPIRES IMTAdminAPI::AttachmentAddBatchArray(
IMTAttachment** attachments, // array of attachments
const UINT comments_total, // number of attachments in the array
MTAPIRES* results // array of results
)
.NET
MTRetCode CIMTAdminAPI.AttachmentAddBatchArray(
CIMTAttachment[] attachments, // array of attachments
MTRetCode[] retcodes // array of results
)
Parameters
attachments
[in/out] Array of attachment objects. You input ready descriptions of attachments. At the output, the server fills the IMTAttachment::RecordID in these attachments.
attachments_total
[in] The number of attachments in the 'attachments' array.
results
[out] An array with attachment creation results. The size of the 'results' array must not be less than that of 'attachments'.
Return Value
The MT_RET_OK response code means that all the specified comments have been created. The MT_RET_ERR_PARTIAL response code means that only some of the comments have
been created. Analyze the 'results' array for more details of the execution results. The result of creation of each attachment from the 'attachments' array is added to 'results'. The
index of a result corresponds to the index of an attachment in the source array.
Note
Once the attachment identifier is received, you can add the attachment to a document or a request by calling the IMTDocument::AttachmenAdd or IMTComment::AttachmentAdd
respectively.
file:///C:/Users/Administrator/AppData/Local/Temp/~hh4BC4.htm 7/17/2025
Manager API Page 166 of 464
IMTAdminAPI::AttachmentRequest
Get attachments by identifiers.
C++
MTAPIRES IMTAdminAPI::AttachmentRequest(
const UINT64* attachment_ids, // array of identifiers
const UINT attachment_ids_total, // number of identifiers in the array
IMTAttachmentArray* attachments // array of attachments
)
.NET
MTRetCode CIMTAdminAPI.AttachmentRequest(
ulong[] attachment_ids, // array of identifiers
CIMTAttachmentArray attachments // array of attachments
)
Parameters
attachment_ids
[in] An array of attachment identifiers (IMTAttachment::RecordID).
attachment_ids_total
[in] The number of identifiers in the attachment_ids array.
attachments
[out] An array of attachment objects. The 'attachments' object must first be created using the IMTAdminAPI::AttachmentCreateArray method.
Return Value
An indication of successful completion is the MT_RET_OK response code. Otherwise, an error code is returned.
Note
The method copies data of attachments with the specified IDs, to the 'attachments' object.
The method cannot be called from event handlers (any IMT*Sink class methods).
User Functions
Using these functions, you can manage the user database on the server and user access to the trading platform. The following functions for managing users are available:
Functions Purpose
UserCreate Create an object of a client record.
UserCreateArray Create an object of an array of client records.
UserAdd Add a user.
UserDelete Delete a user.
UserDeleteBatch Delete multiple accounts.
UserUpdate Update a user.
UserUpdateBatch Update multiple accounts.
UserUpdateBatchArray Update multiple accounts.
UserRequest Request a client record by the login from a server.
UserRequestArray Request an array of client records by the group name.
UserRequestByLogins Request accounts from the server by a list of logins.
UserPasswordCheck Check the user's password.
UserPasswordChange Change the user's password.
UserCertCreate Create an object of a certificate.
UserCertUpdate Add or update a client certificate.
UserCertGet Get the certificate of a client by the login.
UserCertDelete Reset the user certificate.
UserCertConfirm Confirm the user certificate.
UserArchive Move a user to an archive database.
UserArchiveBatch Move multiple accounts to an archive database.
UserArchiveRequest Request a client record from an archive database.
UserArchiveRequestArray Request accounts from an archive databased, filtered by groups.
UserArchiveRequestByLogins Request accounts from an archive databased, filtered by logins.
UserBackupRequest Request a client record from a backup database.
UserBackupRequestArray Request accounts from the specified server's backup, filtered by groups.
UserBackupRequestByLogins Request accounts from the specified server's backup, filtered by a list of logins.
UserBackupList Request the dates of backup databases of users for the specified time range.
UserRestore Restore a user from an archive or backup database.
UserRestoreBatch Restore multiple accounts from an archive or backup database.
UserRestoreBatchArray Restore multiple accounts from an archive or backup database.
file:///C:/Users/Administrator/AppData/Local/Temp/~hh4BC4.htm 7/17/2025
Manager API Page 167 of 464
Functions Purpose
UserBalanceCheck Check and adjust a client's balance and credit assets.
UserBalanceCheckBatch Check and adjust balance and credit funds for multiple clients.
UserExternalRequest Request a client record from a server by the gateway identifier and/or the account number in an external trading system.
UserExternalSync Synchronizing client's trading status with an external trading system.
UserLogins Returns an array of logins of the clients who are included in the specified group.
NotificationsSend Sends push notifications to mobile devices.
Enumerations
The following enumerations are available for working with users in IMTAdminAPI:
• IMTAdminAPI::EnExternalSyncModes
IMTAdminAPI::EnExternalSyncModes
Modes of synchronizing client's trading status with an external system are enumerated in IMTAdminAPI::EnExternalSyncModes.
ID Value Description
EXTERNAL_SYNC_ALL 0 Full synchronization of trading status including current pending orders, open positions and balance.
EXTERNAL_SYNC_BALANCE 1 Synchronizing balance.
EXTERNAL_SYNC_POSITIONS 2 Synchronizing open positions.
EXTERNAL_SYNC_ORDERS 3 Synchronizing current pending orders.
EXTERNAL_SYNC_LAST End of enumeration. It corresponds to EXTERNAL_SYNC_ORDERS.
IMTAdminAPI::UserCreate
Create an object of a client record.
C++
IMTUser* IMTAdminAPI::UserCreate()
.NET
CIMTUser CIMTAdminAPI.UserCreate()
Return Value
It returns a pointer to the created object that implements the IMTUser interface. In case of failure, it returns NULL.
Note
The created object must be deleted by calling the IMTUser::Release method of this object.
IMTAdminAPI::UserCreateArray
Create an object of an array of client records.
C++
IMTUserArray* IMTAdminAPI::UserCreateArray()
.NET
CIMTUserArray CIMTAdminAPI.UserCreateArray()
Return Value
It returns a pointer to the created object that implements the IMTUserArray interface. In case of failure, it returns NULL.
Note
The created object must be deleted by calling the IMTUserArray::Release method of this object.
IMTAdminAPI::UserAdd
Add a client record.
C++
file:///C:/Users/Administrator/AppData/Local/Temp/~hh4BC4.htm 7/17/2025
Manager API Page 168 of 464
MTAPIRES IMTAdminAPI::UserAdd(
IMTUser* user, // An object of the client record
LPCWSTR master_pass, // The master password
LPCWSTR investor_pass // The investor password
)
.NET
MTRetCode CIMTAdminAPI.UserAdd(
CIMTUser user, // An object of the client record
string master_pass, // The master password
string investor_pass // The investor password
)
Python
AdminAPI.UserAdd(
user, # An object of the client record
master_pass, # The master password
investor_pass # The investor password
)
Parameters
user
[in][out] An object of the client record.
master_pass
[in] The master password of an account. The password must contain four character types: lowercase letters, uppercase letters, numbers, and special characters (#, @, ! etc.).
For example, 1Ar#pqkj. The minimum password length is determined by group settings (IMTConGroup::AuthPasswordMin), while the lowest possible value is 8 characters. The
maximum length is 16 characters.
investor_pass
[in] The investor password of an account. The password must contain four character types: lowercase letters, uppercase letters, numbers, and special characters (#, @, ! etc.).
For example, 1Ar#pqkj. The minimum password length is determined by group settings (IMTConGroup::AuthPasswordMin), while the lowest possible value is 8 characters. The
maximum length is 16 characters.
Return Value
An indication of a successful execution is the MT_RET_OK response code. Otherwise, a corresponding error code will be returned.
Note
In case no login is specified for a record (is equal to 0), the server will automatically allocate a login from the available range and will assign it to the user record. In case there
are no more available ranges of logins, the MT_RET_USR_LOGIN_EXHAUSTED error is returned.
The following parameters must be filled in the user record you are adding: IMTUser::Group and IMTUser::Leverage, as well as IMTUser::FirstName or IMTUser::LastName. To allow
an account to be used in client terminals, enable the IMTUser::USER_RIGHT_ENABLED right for that account.
When calling the method, a check is made whether the entry already exists. If the account already exists, the MT_RET_USR_LOGIN_EXIST error is returned. A key field for
comparison is the user login IMTUser::Login.
A user can be added on a trade server only from the applications that run in the same trade server. For all other applications the response code MT_RET_USR_LOGIN_PROHIBITED
will be returned.
Before adding, the correctness of the record is checked. If the record is incorrect, the error code MT_RET_ERR_PARAMS is returned.
IMTAdminAPI::UserDelete
Delete a user.
C++
MTAPIRES IMTAdminAPI::UserDelete(
const UINT64 login // Login
)
.NET
MTRetCode CIMTAdminAPI.UserDelete(
ulong login // Login
)
Python
AdminAPI.UserDelete(
login # Login
)
Parameters
login
[in] The login of a user.
Return Value
An indication of successful completion is the MT_RET_OK response code. Otherwise, an error code will be returned.
Note
A client record can be deleted only from the applications that run on the trade server where the record was created. For all other applications the response code
MT_RET_ERR_NOTFOUND will be returned.
IMTAdminAPI::UserDeleteBatch
Delete multiple accounts.
C++
file:///C:/Users/Administrator/AppData/Local/Temp/~hh4BC4.htm 7/17/2025
Manager API Page 169 of 464
MTAPIRES IMTAdminAPI::UserDeleteBatch(
const UINT64* logins, // Logins
const UINT logins_total, // Number of logins
MTAPIRES* results // Array of results
)
.NET
MTRetCode CIMTAdminAPI.UserDeleteBatch(
ulong[] logins, // Logins
MTRetCode[] res // Array of results
)
Python
AdminAPI.UserDeleteBatch(
logins # Logins
)
Parameters
logins
[in] An array of account logins which should be deleted.
logins_total
[in] Number of logins in the 'logins' array.
results
[out] An array with account deleting results. The size of the 'results' array must be at least the size of the 'logins' array.
Return Value
The MT_RET_OK response code indicates that all specified accounts have been deleted. The MT_RET_ERR_PARTIAL response code means that only some of the accounts have
been deleted. Analyze the 'results' array for further details concerning the execution results. This array will contain the result of deleting of each individual account from the
'logins' array. The index of a result corresponds to the index of an account in the source array.
Note
It is only possible to delete accounts from applications running on the same trade server on which the accounts are created. The MT_RET_ERR_NOTFOUND response code will be
returned for all other applications.
IMTAdminAPI::UserUpdate
Update a user.
C++
MTAPIRES IMTAdminAPI::UserUpdate(
IMTUser* user // An object of the user
)
.NET
MTRetCode CIMTAdminAPI.UserUpdate(
CIMTUser user // An object of the user
)
Python
AdminAPI.UserUpdate(
user # An object of the user
)
Parameters
user
[in] An object of the user.
Return Value
An indication of successful completion is the MT_RET_OK response code. Otherwise, an error code will be returned.
Note
A client record can be updated only from the applications that run on the trade server where the record was created. For all other applications the response code
MT_RET_ERR_NOTFOUND will be returned.
IMTAdminAPI::UserUpdateBatch
Update multiple accounts.
C++
MTAPIRES IMTAdminAPI::UserUpdateBatch(
IMTUserArray* users, // Array of accounts
MTAPIRES* results // Array of results
)
.NET
MTRetCode CIIMTAdminAPI.UserUpdateBatch(
CIMTUserArray users, // Array of accounts
MTRetCode[] res // Array of results
)
Parameters
users
[in] A pointer to the accounts array object IMTUserArray.
results
[out] An array with the account updating results. The size of the 'results' array must be at least the size of the 'users' array.
file:///C:/Users/Administrator/AppData/Local/Temp/~hh4BC4.htm 7/17/2025
Manager API Page 170 of 464
Return Value
Response code MT_RET_OK indicates that all specified accounts have been updated. Response code MT_RET_ERR_PARTIAL indicates that only some of them have been updated.
Analyze the 'results' array for further details concerning the execution results. This array will contain the result of updating of each individual account from the 'users' array. The
index of a result corresponds to the index of an account in the source array.
Note
It is only possible to update accounts from applications running on the same trade server on which the accounts are created. The MT_RET_ERR_NOTFOUND response code will be
returned for all other applications.
IMTAdminAPI::UserUpdateBatchArray
Update multiple client records.
C++
MTAPIRES IMTAdminAPI::UserUpdateBatchArray(
IMTUser** users, // Array of accounts
const UINT users_total, // Number of accounts in the array
MTAPIRES* results // Array of results
)
.NET
MTRetCode CIMTAdminAPI.UserUpdateBatchArray(
CIMTUser[] users, // Array of accounts
MTRetCode[] retcodes // Array of results
)
Parameters
users
[in] A pointer to the array of accounts IMTUser.
users_total
[in] Number of accounts in the 'users' array.
results
[out] An array with the account updating results. The size of the 'results' array must be at least the size of the 'users' array.
Return Value
Response code MT_RET_OK indicates that all specified accounts have been updated. Response code MT_RET_ERR_PARTIAL indicates that only some of them have been updated.
Analyze the 'results' array for further details concerning the execution results. This array will contain the result of updating of each individual account from the 'users' array. The
index of a result corresponds to the index of an account in the source array.
Note
It is only possible to update accounts from applications running on the same trade server on which the accounts are created. The MT_RET_ERR_NOTFOUND response code will be
returned for all other applications.
IMTAdminAPI::UserRequest
Request a client record by the login from a server.
C++
MTAPIRES IMTAdminAPI::UserRequest(
const UINT64 login, // Client login
IMTUser* user // An object of the client record
)
.NET
MTRetCode CIMTAdminAPI.UserRequest(
ulong login, // Client login
CIMTUser user // An object of the client record
)
Python
AdminAPI.UserRequest(
login # Client login
)
Parameters
login
[in] The login of a client.
*user
[out] An object of the client login. The user object must first be created using the IMTAdminAPI::UserCreate method.
Return Value
An indication of successful completion is the MT_RET_OK response code. Otherwise, an error code will be returned.
Note
This method copies the data of a client with the specified login to the user object.
IMTAdminAPI::UserRequestArray
Request an array of client records by the group name.
C++
file:///C:/Users/Administrator/AppData/Local/Temp/~hh4BC4.htm 7/17/2025
Manager API Page 171 of 464
MTAPIRES IMTAdminAPI::UserRequestArray(
LPCWSTR group, // Client group
IMTUserArray* users // Array of client records
)
.NET
MTRetCode CIMTAdminAPI.UserRequestArray(
string group, // Client group
CIMTUserArray users // Array of client records<
)
Python
AdminAPI.UserRequestByGroup(
str group # Client group
)
AdminAPI.UserRequestByGroupCSV(
str group, # Client group
str fields # Comma-separated list of required fields
)
AdminAPI.UserRequestByGroupNumPy(
str group, # Client group
str fields # Comma-separated list of required fields
)
Parameters
group
[in] One or more groups, separated by commas, from which accounts are requested. The full group name must be specified, including the path. For example, demo\demoforex.
The group name can be obtained using the IMTConGroup::Group method. Groups can also be specified using wildcard characters: "*" (any value) and "!" (exclude). For example:
"demo*,!demoforex" - all groups whose names begin with 'demo', except for the group demoforex.
user
[out] An array of objects of users. The object of array of users must first be created using the IMTAdminAPI::UserCreateArray method.
Return Value
An indication of successful completion is the MT_RET_OK response code. Otherwise, a corresponding error code will be returned.
Note
This method copies the data of users with the group to the users array object.
IMTAdminAPI::UserRequestByLogins
Request accounts from the server by a list of logins.
C++
MTAPIRES IMTAdminAPI::UserRequestByLogins(
const UINT64* logins, // logins
const UINT logins_total, // number of logins
IMTUserArray* users // array of accounts
)
.NET
MTRetCode CIMTAdminAPI.UserRequestByLogins(
ulong[] logins, // logins
CIMTUserArray users // array of accounts
)
Python
AdminAPI.UserRequestByLogins(
login-list # logins
)
AdminAPI.UserRequestByLoginsCSV(
login-list, # logins
fields # comma-separated list of required fields
)
AdminAPI.UserRequestByLoginsNumPy(
login-list, # logins
fields # comma-separated list of required fields
)
Parameters
logins
[in] Array of client logins.
logins_total
[in] Number of logins in the 'logins' array.
users
[out] An object of the accounts array. The 'users' object must be previously created using the IMTAdminAPI::UserCreateArray method.
Return Value
An indication of successful completion is the MT_RET_OK response code. Otherwise, an error has occurred that corresponds to the response code.
Note
The method cannot be called from event handlers (any IMT*Sink class methods).
IMTAdminAPI::UserPasswordCheck
Check the user's password.
file:///C:/Users/Administrator/AppData/Local/Temp/~hh4BC4.htm 7/17/2025
Manager API Page 172 of 464
C++
MTAPIRES IMTAdminAPI::UserPasswordCheck(
const UINT type, // Type of password
const UINT64 login, // User's login
LPCWSTR password // User's password
)
.NET
MTRetCode CIMTAdminAPI.UserPasswordCheck(
EnUsersPasswords type, // Type of password
ulong login, // User's login
string password // User's password
)
Python
AdminAPI.UserPasswordCheck(
type, # Type of password
login, # User's login
password # User's password
)
Parameters
type
[in] The type of a password to check is specified using the IMTUser::EnUsersPasswords enumeration.
login
[in] The login of a user whose password should be checked.
password
[in] A password to check.
Return Value
An indication of successful completion is the MT_RET_OK response code. Otherwise, an error code will be returned.
IMTAdminAPI::UserPasswordChange
Change the user's password.
C++
MTAPIRES IMTAdminAPI::UserPasswordChange(
const UINT type, // Type of password
const UINT64 login, // User's login
LPCWSTR password // New password
)
.NET
MTRetCode CIMTAdminAPI.UserPasswordChange(
EnUsersPasswords type, // Type of password
ulong login, // User's login
string password // New password
)
Python
AdminAPI.UserPasswordChange(
type, # Type of password
login, # User's login
password # New password
)
Parameters
type
[in] The type of a password to change is specified using the IMTUser::EnUsersPasswords enumeration.
login
[in] The login of a user whose password should be changed.
password
[in] A new password. The password must contain four character types: lowercase letters, uppercase letters, numbers, and special characters (#, @, ! etc.). For example,
1Ar#pqkj. The minimum password length is determined by group settings (IMTConGroup::AuthPasswordMin), while the lowest possible value is 8 characters. The maximum
length is 16 characters.
Return Value
An indication of a successful execution is the MT_RET_OK response code. Otherwise, a corresponding error code will be returned.
IMTAdminAPI::UserCertCreate
Create an object of a certificate.
C++
IMTCertificate* IMTAdminAPI::UserCertCreate()
.NET
CIMTCertificate CIMTAdminAPI.UserCertCreate()
Return Value
It returns a pointer to the created object that implements the IMTCertificate interface. In case of failure, it returns NULL.
Note
file:///C:/Users/Administrator/AppData/Local/Temp/~hh4BC4.htm 7/17/2025
Manager API Page 173 of 464
The created object must be deleted by calling the IMTCertificate::Release method of this object.
IMTAdminAPI::UserCertUpdate
Add or update a client certificate.
C++
MTAPIRES IMTAdminAPI::UserCertUpdate(
const UINT64 login // Login
IMTCertificate* certificate // The object of the certificate
)
.NET
MTRetCode CIMTAdminAPI.UserCertUpdate(
ulong login // Login
CIMTCertificate certificate // The object of the certificate
)
Python
AdminAPI.UserCertUpdate(
login # Login
certificate # The object of the certificate
)
Parameters
login
[in] The login of the client whose certificate needs to be replaced.
certificate
[in] The object of the certificate that will replace the current certificate of a client.
Return Value
An indication of successful completion is the MT_RET_OK response code. Otherwise, an error code will be returned.
Note
If a client already has a certificate, it is updated, otherwise a new certificate is added.
A certificate can be updated only from the applications that are connected to the same trade server where the client account was created. If the client with the specified login is
not found, the response code MT_RET_ERR_NOTFOUND is returned.
IMTAdminAPI::UserCertGet
Get the certificate of a client by the login.
C++
MTAPIRES IMTAdminAPI::UserCertGet(
const UINT64 login, // Client login
IMTUCertificate* certificate // The object of the certificate
)
.NET
MTRetCode CIMTAdminAPI.UserCertGet(
ulong login, // Client login
CIMTUCertificate certificate // The object of the certificate
)
Python
AdminAPI.UserCertGet(
login, # Client login
certificate # The object of the certificate
)
Parameters
login
[in] The login of a client.
certificate
[out] The object of the certificate. The certificate object must be first created using the IMTAdminAPI::UserCertCreate method.
Return Value
An indication of successful completion is the MT_RET_OK response code. Otherwise, an error code will be returned.
Note
This method copies the data of a client with the specified login to the certificate object.
IMTAdminAPI::UserCertDelete
Reset the user certificate.
C++
MTAPIRES IMTAdminAPI::UserCertDelete(
const UINT64 login // User's login
)
file:///C:/Users/Administrator/AppData/Local/Temp/~hh4BC4.htm 7/17/2025
Manager API Page 174 of 464
.NET
MTRetCode CIMTAdminAPI.UserCertDelete(
ulong login // User's login
)
Python
AdminAPI.UserCertDelete(
login # User's login
)
Parameters
login
[in] The login of a user whose certificate needs to be reset.
Return Value
An indication of successful completion is the MT_RET_OK response code. Otherwise, an error code will be returned.
Note
If the extended authorization mode is used for the group to which the account belongs, then using this command the previously issued certificate can be reset. After that,
authorization with the certificate will be impossible, and a new certificate will be issued during the next attempt of the account to connect to the server.
IMTAdminAPI::UserCertConfirm
Confirm the user certificate.
C++
MTAPIRES IMTAdminAPI::UserCertConfirm(
const UINT64 login // User's login
)
.NET
MTRetCode CIMTAdminAPI.UserCertConfirm(
ulong login // User's login
)
Python
AdminAPI.UserCertConfirm(
login # User's login
)
Parameters
login
[in] The login of a user whose certificate needs to be confirmed.
Return Value
An indication of successful completion is the MT_RET_OK response code. Otherwise, an error code will be returned.
Note
This function allows confirming certificates of accounts in the groups for which the appropriate mode is enabled. It is impossible to log in using a certificate until it is confirmed.
IMTAdminAPI::UserArchive
Move a user to an archive database.
C++
MTAPIRES IMTAdminAPI::UserArchive(
const UINT64 login // Login
)
.NET
MTRetCode CIMTAdminAPI.UserArchive(
ulong login // Login
)
Python
AdminAPI.UserArchive(
login # Login
)
Parameters
login
[in] The login of a user that will be moved to an archive.
Return Value
An indication of successful completion is the MT_RET_OK response code. Otherwise, an error code will be returned.
IMTAdminAPI::UserArchiveBatch
Move multiple accounts to an archive database.
C++
file:///C:/Users/Administrator/AppData/Local/Temp/~hh4BC4.htm 7/17/2025
Manager API Page 175 of 464
MTAPIRES IMTAdminAPI::UserArchiveBatch(
const UINT64* logins, // Logins
const UINT logins_total, // Number of logins
MTAPIRES* results // Array of results
)
.NET
MTRetCode CIMTAdminAPI.UserArchiveBatch(
ulong[] logins, // Logins
MTRetCode[] res // Array of results
)
Python
AdminAPI.UserArchiveBatch(
logins # Logins
)
Parameters
logins
[in] An array of account logins which should be archived.
logins_total
[in] Number of logins in the 'logins' array.
results
[out] An array with account archiving results. The size of the 'results' array must be at least the size of the 'logins' array.
Return Value
The MT_RET_OK response code indicates that all specified accounts have been archived. The MT_RET_ERR_PARTIAL response code means that only some of the accounts have
been archived. Analyze the 'results' array for further details concerning the execution results. This array will contain the result of archiving of each individual account from the
'logins' array. The index of a result corresponds to the index of an account in the source array.
IMTAdminAPI::UserArchiveRequest
Request a client record from an archive database.
C++
MTAPIRES IMTAdminAPI::UserArchiveRequest(
const UINT64 login, // Login
IMTUser* user // An object of the client record
)
.NET
MTRetCode CIMTAdminAPI.UserArchiveRequest(
ulong login, // Login
CIMTUser user // An object of the client record
)
Python
AdminAPI.UserArchiveRequest(
login # Login
)
Parameters
login
[in] The login of a user.
user
[out] An object of the client login. The user object must first be created using the IMTAdminAPI::UserCreate method.
Return Value
An indication of successful completion is the MT_RET_OK response code. Otherwise, an error code will be returned.
Note
This method cannot be called from event handlers (any methods of IMT*Sink classes).
IMTAdminAPI::UserArchiveRequestArray
Request accounts from an archive databased, filtered by groups.
C++
MTAPIRES IMTAdminAPI.UserArchiveRequestArray(
LPCWSTR groups, // Groups
IMTUserArray* users // Array of accounts
)
.NET
MTRetCode CIMTAdminAPI.UserArchiveRequestArray(
string groups, // Groups
CIMTUserArray users // Array of accounts
)
Python
AdminAPI.UserArchiveRequestArray(
groups # Groups
)
Parameters
file:///C:/Users/Administrator/AppData/Local/Temp/~hh4BC4.htm 7/17/2025
Manager API Page 176 of 464
groups
[in] One or more groups, separated by commas, from which accounts are requested. The full group name must be specified, including the path. For example, demo\demoforex.
The group name can be obtained using the IMTConGroup::Group method.
user
[out] An object of the accounts array. The 'users' object must be previously created using the IMTAdminAPI::UserCreateArray method.
Return Value
An indication of successful completion is the MT_RET_OK response code. Otherwise, an error code will be returned.
Note
The method cannot be called from event handlers (any IMT*Sink class methods).
IMTAdminAPI::UserArchiveRequestByLogins
Request accounts from an archive databased, filtered by logins.
C++
MTAPIRES IMTAdminAPI.UserArchiveRequestByLogins(
const UINT64* logins, // Logins
const UINT logins_total, // Number of logins
IMTUserArray* users // Array of accounts
)
.NET
MTRetCode CIMTAdminAPI.UserArchiveRequestByLogins(
ulong[] logins, // Logins
CIMTUserArray users // Array of accounts
)
Python
AdminAPI.UserArchiveRequestArray(
logins # Logins
)
Parameters
logins
[in] An array of logins.
logins_total
[in] Number of logins in the 'logins' array.
user
[out] An object of the accounts array. The 'users' object must be previously created using the IMTAdminAPI::UserCreateArray method.
Return Value
An indication of successful completion is the MT_RET_OK response code. Otherwise, an error code will be returned.
Note
The method cannot be called from event handlers (any IMT*Sink class methods).
IMTAdminAPI::UserBackupRequest
Request a client record from a backup database.
C++
MTAPIRES IMTAdminAPI::UserBackupRequest(
const INT64 backup, // Backup date
const UINT64 login, // Login
IMTUser* user // An object of a client record
)
.NET
MTRetCode CIMTAdminAPI.UserBackupRequest(
long backup, // Backup date
long login, // Login
CIMTUser user // An object of a client record
)
Python
AdminAPI.UserBackupRequest(
backup, # Backup date
login # Login
)
Parameters
backup
[in] The date of creation of the backup to which the requested user belongs. The date is specified in seconds that have elapsed since 01.01.1970. Dates of backups can be
obtained using the IMTAdminAPI::UserBackupList method.
login
[in] The login of a user.
user
[out] An object of the client login. The user object must first be created using the IMTAdminAPI::UserCreate method.
Return Value
An indication of successful completion is the MT_RET_OK response code. Otherwise, a corresponding error code will be returned.
Note
This method cannot be called from event handlers (any methods of IMT*Sink classes).
file:///C:/Users/Administrator/AppData/Local/Temp/~hh4BC4.htm 7/17/2025
Manager API Page 177 of 464
IMTAdminAPI::UserBackupRequest
Request a client record from a backup database of the specified server.
C++
MTAPIRES IMTAdminAPI.UserBackupRequest(
const UINT64 server, // Server ID
const INT64 backup, // Backup date
const UINT64 login, // Login
IMTUser* user // An object of a client record
)
.NET
MTRetCode CIMTAdminAPI.UserBackupRequest(
ulong server, // Server ID
long backup, // Backup date
long login, // Login
CIMTUser user // An object of a client record
)
Python
AdminAPI.UserBackupRequest(
server, # Server ID
backup, # Backup date
login # Login
)
Parameters
server
[in] The identifier of the server from which the information should be requested.
backup
[in] The date of creation of the backup to which the requested user belongs. The date is specified in seconds that have elapsed since 01.01.1970. Dates of backups can be
obtained using the IMTAdminAPI::UserBackupList method.
login
[in] The login of a user.
user
[out] An object of the client login. The user object must first be created using the IMTAdminAPI::UserCreate method.
Return Value
An indication of successful completion is the MT_RET_OK response code. Otherwise, a corresponding error code will be returned.
Note
This method cannot be called from event handlers (any methods of IMT*Sink classes).
IMTAdminAPI::UserBackupRequestArray
Request accounts from the specified server's backup, filtered by groups.
C++
MTAPIRES IMTAdminAPI.UserBackupRequestArray(
const UINT64 server, // Server identifier
const INT64 backup, // Backup date
LPCWSTR groups, // Groups
IMTUserArray* users // Array of accounts
)
.NET
MTRetCode CIMTAdminAPI.UserBackupRequestArray(
ulong server, // Server ID
long backup, // Backup date
string groups, // Groups
CIMTUserArray users // Array of accounts
)
Python
AdminAPI.UserBackupRequestArray(
server, # Server ID
backup, # Backup date
groups # Groups
)
Parameters
server
[in] The ID of the server, from which you request the data.
backup
[in] The creation date of the backup from which accounts should be requested. The date is specified in seconds since 01.01.1970. Backup creation dates can be obtained using
the IMTAdminAPI::UserBackupList method.
groups
[in] One or more groups, separated by commas, from which accounts are requested. The full group name must be specified, including the path. For example, demo\demoforex.
The group name can be obtained using the IMTConGroup::Group method.
user
[out] An object of the accounts array. The 'users' object must be previously created using the IMTAdminAPI::UserCreateArray method.
Return Value
An indication of successful completion is the MT_RET_OK response code. Otherwise, a corresponding error code will be returned.
Note
The method cannot be called from event handlers (any IMT*Sink class methods).
file:///C:/Users/Administrator/AppData/Local/Temp/~hh4BC4.htm 7/17/2025
Manager API Page 178 of 464
IMTAdminAPI::UserBackupRequestByLogins
Request accounts from the specified server's backup, filtered by a list of logins.
C++
MTAPIRES IMTAdminAPI.UserBackupRequestByLogins(
const UINT64 server, // Server ID
const INT64 backup, // Backup date
const UINT64* logins, // Logins
const UINT logins_total, // Number of logins
IMTUserArray* users // Array of accounts
)
.NET
MTRetCode CIMTAdminAPI.UserBackupRequestByLogins(
ulong server, // Server ID
long backup, // Backup date
ulong[] logins, // Logins
CIMTUserArray users // Array of accounts
)
Python
AdminAPI.UserBackupRequestByLogins(
server, # Server ID
backup, # Backup date
logins # Logins
)
Parameters
server
[in] The ID of the server, from which you request the data.
backup
[in] The creation date of the backup from which accounts should be requested. The date is specified in seconds since 01.01.1970. Backup creation dates can be obtained using
the IMTAdminAPI::UserBackupList method.
logins
[in] An array of logins.
logins_total
[in] Number of logins in the 'logins' array.
user
[out] An object of the accounts array. The 'users' object must be previously created using the IMTAdminAPI::UserCreateArray method.
Return Value
An indication of successful completion is the MT_RET_OK response code. Otherwise, a corresponding error code will be returned.
Note
The method cannot be called from event handlers (any IMT*Sink class methods).
IMTAdminAPI::UserBackupList
Request the dates of backup databases of users for the specified time range.
C++
MTAPIRES IMTAdminAPI::UserBackupList(
const INT64 from, // Beginning of period
const INT64 to, // End of period
INT64*& backups, // An array of dates of backups
UINT& backups_total // The number of dates of backups
)
.NET
long[] CIMTAdminAPI.UserBackupList(
long from, // Beginning of period
long to, // End of period
out MTRetCode res // Response code
)
Python
AdminAPI.UserBackupList(
from, # Beginning of period
to # End of period
)
Parameters
from
[in] The beginning of the period for which you need to get the list of backup copies. The date is specified in seconds that have elapsed since 01.01.1970.
to
[in] The end of the period for which you need to get the list of backup copies. The date is specified in seconds that have elapsed since 01.01.1970.
backups
[out] An array of backup creation dates.
backups_total
[out] The number of received dates of backups.
Return Value
file:///C:/Users/Administrator/AppData/Local/Temp/~hh4BC4.htm 7/17/2025
Manager API Page 179 of 464
An indication of successful completion is the MT_RET_OK response code. Otherwise, an error code will be returned.
Note
After using, the backups array must be released using the IMTAdminAPI::Free method.
IMTAdminAPI::UserBackupList
Request the dates of backup databases of users for the specified time range from the specified server.
C++
MTAPIRES IMTAdminAPI::UserBackupList(
const UINT64 server, // Server ID
const INT64 from, // Beginning of period
const INT64 to, // End of period
INT64*& backups, // An array of dates of backups
UINT& backups_total // The number of dates of backups
)
.NET
long[] CIMTAdminAPI.UserBackupList(
ulong server, // Server ID
long from, // Beginning of period
long to, // End of period
out MTRetCode res // Response code
)
Python
AdminAPI.UserBackupList(
server, # Server ID
from, # Beginning of period
to # End of period
)
Parameters
server
[in] The identifier of the server from which the information should be requested.
from
[in] The beginning of the period for which you need to get the list of backup copies. The date is specified in seconds that have elapsed since 01.01.1970.
to
[in] The end of the period for which you need to get the list of backup copies. The date is specified in seconds that have elapsed since 01.01.1970.
backups
[out] An array of backup creation dates.
backups_total
[out] The number of received dates of backups.
Return Value
An indication of successful completion is the MT_RET_OK response code. Otherwise, an error code will be returned.
Note
After using, the backups array must be released using the IMTAdminAPI::Free method.
IMTAdminAPI::UserRestore
Restore a user from an archive or a backup database.
C++
MTAPIRES IMTAdminAPI::UserRestore(
IMTUser* user // A user restore
)
.NET
MTRetCode CIMTAdminAPI.UserRestore(
CIMTUser user // A user to restore
)
Python
AdminAPI.UserRestore(
user # A user to restore
)
Parameters
user
[in] An object of the client record to restore.
Return Value
An indication of successful completion is the MT_RET_OK response code. Otherwise, an error code will be returned.
Note
Restored users are not deleted from the archive.
When a restored account is once again moved to archive or a backup database, new data replace previously stored data.
IMTAdminAPI::UserRestoreBatch
Restore multiple accounts from an archive or backup database.
file:///C:/Users/Administrator/AppData/Local/Temp/~hh4BC4.htm 7/17/2025
Manager API Page 180 of 464
C++
MTAPIRES IMTAdminAPI::UserRestoreBatch(
IMTUserArray* users, // Array of accounts
MTAPIRES* results // Array of results
)
.NET
MTRetCode CIMTAdminAPI.UserRestoreBatch(
CIMTUserArray users, // Array of accounts
MTRetCode[] res // Array of results
)
Python
AdminAPI.UserRestoreBatch(
users # List of accounts
)
Parameters
users
[in] A pointer to the accounts array object IMTUserArray.
results
[out] An array with account recovery results. The size of the 'results' array must be at least the size of the 'logins' array.
Return Value
The MT_RET_OK response code indicates that all specified accounts have been restored. The MT_RET_ERR_PARTIAL response code means that only part of the accounts gave been
restored. Analyze the 'results' array for further details concerning the execution results. This array will contain the result of restoring of each individual account from the 'logins'
array. The index of a result corresponds to the index of an account in the source array.
Note
Restored users are not deleted from the archive.
When a restored user is moved backed to an archive or backup database, new data replace the previously stored data.
IMTAdminAPI::UserRestoreBatchArray
Restore multiple accounts from an archive or backup database.
C++
MTAPIRES IMTAdminAPI::UserRestoreBatchArray(
IMTUser** users, // Array of accounts
const UINT users_total, // Number of accounts in the array
MTAPIRES* results // Array of results
)
.NET
MTRetCode CIMTAdminAPI.UserRestoreBatchArray(
CIMTUser[] users, // Array of accounts
MTRetCode[] res // Array of results
)
Parameters
users
[in] A pointer to the array of accounts IMTUser.
users_total
[in] Number of accounts in the 'users' array.
results
[out] An array with account recovery results. The size of the 'results' array must be at least the size of the 'logins' array.
Return Value
The MT_RET_OK response code indicates that all specified accounts have been restored. The MT_RET_ERR_PARTIAL response code means that only part of the accounts gave been
restored. Analyze the 'results' array for further details concerning the execution results. This array will contain the result of restoring of each individual account from the 'logins'
array. The index of a result corresponds to the index of an account in the source array.
Note
Restored users are not deleted from the archive.
When a restored user is moved backed to an archive or backup database, new data replace the previously stored data.
IMTAdminAPI::UserBalanceCheck
Check and correction of a client's balance and credit assets.
C++
MTAPIRES IMTAdminAPI::UserBalanceCheck(
const UINT64 login, // Login
const UINT fixflag, // Flag of balance correction
double& balance_user, // Balance at the moment of check
double& balance_history // Balance calculated on the basis of the history of deals
double& credit_user, // Credit assets at the moment of check
double& credit_history // Credit assets calculated on the basis of the history of deals
)
.NET
file:///C:/Users/Administrator/AppData/Local/Temp/~hh4BC4.htm 7/17/2025
Manager API Page 181 of 464
MTRetCode CIMTAdminAPI.UserBalanceCheck(
ulong login, // Login
bool fixflag, // Flag of balance correction
out double balance_user, // Balance at the moment of check
out double balance_history // Balance calculated on the basis of the history of deals
out double credit_user, // Credit assets at the moment of check
out double credit_history // Credit assets calculated on the basis of the history of deals
)
Python
AdminAPI.UserBalanceCheck(
login, # Login
fixflag # Flag of balance correction
)
Parameters
login
[in] The login of a user whose balance should be checked.
fixflag
[in] Flag of the need to correct a client's balance after the check. If fixflag is equal to 1, the client's balance is corrected in accordance with history of deals. If the flag is 0, no
correction will be made.
balance_user
[out] The value of the client's balance stored in the client record at the time of check.
balance_history
[out] The value of the client's balance calculated by analyzing the history of deals.
credit_user
[out] The value of the client's credit assets stored in the client record at the time of check.
credit_history
[out] The value of the client's credit assets calculated by analyzing the history of deals.
Return Value
An indication of successful completion is the MT_RET_OK response code. Otherwise, a corresponding error code will be returned.
If the balance values do not match but balance correction is not performed (fixflag=0), the function returns the MT_RET_ERR_DATA response code.
Note
This function checks the client's balance on the basis of the history of his or her deals and makes corrections in the client's balance if necessary. Credit assets are checked on the
basis of deals of the IMTDeal::DEAL_CREDIT type.
IMTAdminAPI::UserBalanceCheckBatch
Check and adjust balance and credit funds for multiple clients.
C++
MTAPIRES IMTAdminAPI::UserBalanceCheckBatch(
const UINT64* logins, // list of logins
const UINT logins_total, // number of logins
const UINT fixflag, // balance adjustment flag
MTAPIRES* results, // array of check results
double* balance_user, // array with balances as of the check time
double* balance_history // array with balances from the history of deals
double* credit_user, // array with credit funds as of the check time
double* credit_history // array with credit funds from the history of deals
)
.NET
MTRetCode CIMTAdminAPI.UserBalanceCheckBatch(
ulong[] logins, // list of logins
bool fixflag, // balance adjustment flag
MTRetCode[] res, // array of check results
out double[] balance_user, // array with balances as of the check time
out double[] balance_history // array with balances from the history of deals
out double[] credit_user, // array with credit funds as of the check time
out double[] credit_history // array with credit funds from the history of deals
)
Python
AdminAPI.UserBalanceCheckBatch(
logins, # list of logins
fixflag # balance adjustment flag
)
Parameters
logins
[in] The array of client logins for which you want to check balances.
logins_total
[in] Number of logins in the 'logins' array.
fixflag
[in] Flag indicating the need to adjust the client's balance and credit funds after the check. If fixflag is equal to 1, the client's balance and credit funds are adjusted in
accordance with the history of deals. If the flag is 0, no correction will be made.
results
[out] Array with balance check results. The size of the 'results' array must not be less than that of 'logins'.
balance_user
[out] Array with balance values existing on the accounts at the check time. The index of the value corresponds to the index of the account in the source array.
balance_history
[out] Array with balance values calculated based on the history of deals on the accounts. The index of the value corresponds to the index of the account in the source array.
file:///C:/Users/Administrator/AppData/Local/Temp/~hh4BC4.htm 7/17/2025
Manager API Page 182 of 464
credit_user
[out] Array with credit values existing on the accounts at the check time. The index of the value corresponds to the index of the account in the source array.
credit_history
[out] Array with credit values calculated based on the history of deals on the accounts. The index of the value corresponds to the index of the account in the source array. The
credit funds are checked based on the deals with the IMTDeal::DEAL_CREDIT type.
Return Value
The MT_RET_OK response code indicates that all of the specified accounts have been checked. The MT_RET_ERR_PARTIAL code indicates that only some of the accounts have
been checked.
Analyze the 'results' array for further execution details. This array will contain check results for each account from the 'logins'. The index of the result corresponds to the index of
the account in the source array. If the balances mismatch but no adjustment is performed (fixflag=0), the MT_RET_ERR_DATA response code is written to the result.
Note
The method checks the clients' balances based on their trading history and adjust the balances if necessary.
IMTAdminAPI::UserExternalRequest
Request a client record from a server by the gateway identifier and the account number in an external trading system.
C++
MTAPIRES IMTAdminAPI::UserExternalRequest(
const UINT64 gateway_id, // Gateway ID
LPCWSTR account, // Account number in an external system
IMTUser* user // An object of the user record
)
.NET
MTRetCode CIMTAdminAPI.UserExternalRequest(
ulong gateway_id, // Gateway ID
string account, // Account number in an external system
CIMTUser user // An object of the user record
)
Python
AdminAPI.UserExternalRequest(
gateway_id # Gateway ID
account # Account number in an external system
)
Parameters
gateway_id
[in] The identifier of a gateway. The account number of a client in an external system.
account
[in] Client's account in an external system.
user
[out] An object of the client login. The user object must first be created using the IMTAdminAPI::UserCreate method.
Return Value
An indication of successful completion is the MT_RET_OK response code. Otherwise, an error code will be returned.
Note
This method copies the data of a client with the specified gateway identifier and account number.
The number of account in an external system and the identifier of a gateway, to which that number refers, are stored in the client record as a string. The
IMTUser::ExternalAccount* methods are used to work with this data.
This method cannot be called from event handlers (any methods of IMT*Sink classes).
IMTAdminAPI::UserExternalRequest
Request a client record from a server by the account number in an external trading system irrespective of a gateway identifier.
C++
MTAPIRES IMTAdminAPI::UserExternalRequest(
LPCWSTR account, // Account number in an external system
IMTUser* user // An object of the user record
)
.NET
MTRetCode CIMTAdminAPI.UserExternalRequest(
string account, // Account number in an external system
CIMTUser user // An object of the user record
)
Python
AdminAPI.UserExternalRequest(
account # Account number in an external system
)
Parameters
account
[in] Client's account in an external system.
user
[out] An object of the client login. The user object must first be created using the IMTAdminAPI::UserCreate method.
Return Value
An indication of successful completion is the MT_RET_OK response code. Otherwise, an error code will be returned.
Note
file:///C:/Users/Administrator/AppData/Local/Temp/~hh4BC4.htm 7/17/2025
Manager API Page 183 of 464
This method copies the data of a client with the specified gateway identifier and account number.
If there are several clients that have the same number of account in a external system, the nearest client record will be obtained.
The number of account in an external system and the identifier of a gateway, to which that number refers, are stored in the client record as a string. The
IMTUser::ExternalAccount* methods are used to work with this data.
This method cannot be called from event handlers (any methods of IMT*Sink classes).
IMTAdminAPI::UserExternalSync
Synchronizing client's trading status with an external trading system. When calling this method, IMTGatewaySink::HookGatewayAccountRequest hook is called in Gateway API.
MetaTrader 5 client's trading status will be brought in line with an external trading system when this method is executed in case the gateway developer has provided such a
possibility.
C++
MTAPIRES IMTAdminAPI::UserExternalSync(
const UINT64 login, // Login
const UINT64 gateway_id, // Gateway ID
LPCWSTR account_id, // External system account
UINT sync_mode // Synchronization mode
)
.NET
MTRetCode CIMTAdminAPI.UserExternalSync(
ulong login, // Login
ulong gateway_id, // Gateway ID
string account_id, // External system account
EnExternalSyncModes sync_mode // Synchronization mode
)
Python
AdminAPI.UserExternalSync(
login, # Login
gateway_id, # Gateway ID
account_id, # External system account
sync_mode # Synchronization mode
)
Parameters
login
[in] Login of the client, for whom synchronization is performed.
gateway_id
[in] Gateway ID. Gateway ID is associated with an account number in an external system.
account_id
[in] Client's account in an external system.
sync_mode
[out] Synchronization mode. Transferred using IMTAdminAPI::EnExternalSyncModes enumeration.
Return Value
An indication of successful completion is the MT_RET_OK response code. Otherwise, an error code will be returned.
Note
This method works only if trading status synchronization is provided at the gateway used by the client.
Correcting operations are created as a result of trading data synchronization. These operations are displayed in the client's trading history.
No matter what data is sent by the gateway in response to the method call (orders, positions, balance), the server will apply the changes according to synchronization mode
specified in sync_mode parameter.
IMTAdminAPI::UserLogins
Returns an array of logins of the clients who are included in the specified group.
C++
MTAPIRES IMTAdminAPI::UserLogins(
LPCWSTR group, // Group name
UINT64*& logins, // An array of client logins
UINT& logins_total // The number of logins
)
.NET
ulong[] CIMTAdminAPI.UserLogins(
string group, // Group name
out MTRetCode res // Response code
)
Python
AdminAPI.UserLogins(
group # Group name
)
Parameters
group
[in] The name of a group of users. The entire name of the group must be specified including the path. For example, demo\demoforex. To get the name of a group, use the
IMTConGroup::Group method.
file:///C:/Users/Administrator/AppData/Local/Temp/~hh4BC4.htm 7/17/2025
Manager API Page 184 of 464
logins
[out] An array of client logins.
logins_total
[out] The number of logins in the logins array.
Return Value
An indication of successful completion is the MT_RET_OK response code. Otherwise, an error code will be returned.
Note
The UserLogins method allocates and fills an array of logins that belong to the passed group, a pointer to the passed block is placed to the logins parameter After using, the array
placed in the logins variable must be released using the IMTAdminAPI::Free() method of the Manager API.
IMTAdminAPI::NotificationsSend
Sends push-notifications to a list of MetaQuotes IDs.
C++
MTAPIRES IMTAdminAPI::NotificationsSend(
LPCWSTR metaquotest_ids, // The list of MetaQuotes IDs
LPCWSTR message // Message
)
.NET
MTRetCode CIMTAdminAPI.NotificationsSend(
string metaquotest_ids, // The list of MetaQuotes IDs
srting message // Message
)
Python
AdminAPI.NotificationsSend(
metaquotest_ids, # The list of MetaQuotes IDs
message # Message
)
Parameters
metaquotes_ids
[in] A comma separated list of MetaQuotes IDs.
message
[in] The text of the notification.
Return Value
An indication of successful completion is the MT_RET_OK response code. Otherwise, an error code will be returned.
Note
Push notifications are personal messages sent over the Internet. They do not depend on the phone number or mobile network operator. Messages are delivered instantly; no need
to run any applications on the receiver's device.
Messages are sent based on MetaQuotes ID, which is a unique user identifier. To obtain the ID, a user needs to install MetaTrader 5 Mobile for iPhone or Android.
The maximum message length is 1024 characters.
When sending to a list of MetaQuotes IDs, the company name from the Server License will be specified in the signature.
IMTAdminAPI::NotificationsSend
Sends push-notifications to a list of logins.
C++
MTAPIRES IMTAdminAPI::NotificationsSend(
const UINT64* logins, // Logins
const UNIT logins_total, // Number of logins
LPCWSTR message // Message
)
.NET
MTRetCode CIMTAdminAPI.NotificationsSend(
ulong[] logins, // Logins
string message // Message
)
Python
AdminAPI.NotificationsSend(
logins, # Logins
message # Message
)
Parameters
logins
[in] An array of logins.
logins_total
[in] The total number of logins in logins.
message
[in] The text of the notification.
Return Value
An indication of successful completion is the MT_RET_OK response code. Otherwise, an error code will be returned.
Note
Push notifications are personal messages sent over the Internet. They do not depend on the phone number or mobile network operator. Messages are delivered instantly; no need
to run any applications on the receiver's device.
file:///C:/Users/Administrator/AppData/Local/Temp/~hh4BC4.htm 7/17/2025
Manager API Page 185 of 464
Messages are sent based on MetaQuotes ID, which is a unique user identifier. To obtain the ID, a user needs to install MetaTrader 5 Mobile for iPhone or Android.
The maximum message length is 1024 characters.
MetaQuotes ID must be specified in the settings of appropriate accounts (IMTUser::MQID) in order to send messages by specifying logins.
If you send messages specifying logins, the signature will contain the name of the Owner company from the settings of the group, to which the accounts belong. Use this type for
White Labels to add the correct company name in the signature.
• Orders
• Deals
• Positions
Orders
Using the functions, you can request a server database of orders and create new orders. The following functions are available for this purpose:
Function Purpose
OrderCreate Create an object of a trade order.
OrderCreateArray Create an object of the array of orders.
OrderRequest Request a trade order from a server by the ticket.
OrderRequestOpen Request open orders of a client from a server.
OrderRequestByGroup Request from the server open orders related to a client group.
OrderRequestByGroupSymbol Request open orders from the server by group and symbol.
OrderRequestByLogins Request from the server open orders related to the list of logins.
OrderRequestByLoginsSymbol Request open orders from the server by list of logins and symbol.
OrderRequestByTickets Request from the server open orders by the list of tickets.
OrderAdd Add an open order the server database.
OrderAddBatch Add a batch of open orders to the server database.
OrderAddBatchArray Add a batch of open orders to the server database.
OrderUpdate Update a trade order.
OrderUpdateBatch Update multiple orders in a server database.
OrderUpdateBatchArray Update multiple orders in a server database.
OrderDelete Delete a trade order.
OrderDeleteBatch Delete orders from the server database in bulk.
OrderCancel Move an open trading order to history.
OrderCancelBatch Move multiple open order to history.
OrderBackupList Request the dates of backup databases of orders for the specified time range.
OrderBackupRequest Request an order from a backup database.
OrderBackupRequestOpen Request open orders from a backup database.
OrderBackupRequestHistory Request closed orders from a backup database.
OrderBackupRestore Restore an order from a backup database.
OrderReopen Reopen a pending order from the client history.
HistoryRequest Request from the server the client's closed orders (history) in the specified date range.
HistoryRequestByTickets Request from the server closed orders (history) related to the list of tickets.
HistoryRequestByLogins Request from the server the closed orders (history) related to the list of logins.
HistoryRequestByLoginsSymbol Request closed orders (history) from the server by group and symbol.
HistoryRequestByGroup Request from the server the closed orders (history) related to a client group.
HistoryRequestByGroupSymbol Request closed orders (history) from the server by list of logins and symbol.
HistoryRequestPage Request from the server client's closed orders (history) in a paged form.
IMTAdminAPI::OrderCreate
Create an object of a trade order.
C++
IMTOrder* IMTAdminAPI::OrderCreate()
file:///C:/Users/Administrator/AppData/Local/Temp/~hh4BC4.htm 7/17/2025
Manager API Page 186 of 464
.NET
CIMTOrder CIMTAdminAPI.OrderCreate()
Return Value
It returns a pointer to the created object that implements the IMTOrder interface. In case of failure, it returns NULL.
Note
The created object must be deleted by calling the IMTOrder::Release method of this object.
IMTAdminAPI::OrderCreateArray
Create an object of the array of orders.
C++
IMTOrderArray* IMTAdminAPI::OrderCreateArray()
.NET
CIMTOrderArray CIMTAdminAPI.OrderCreateArray()
Return Value
It returns a pointer to the created object that implements the IMTOrderArray interface. In case of failure, it returns NULL.
Note
The created object must be destroyed by calling IMTOrderArray::Release method of this object.
IMTAdminAPI::OrderRequest
Request a trade order from a server by the ticket.
C++
MTAPIRES IMTAdminAPI::OrderRequest(
const UINT64 ticket, // Ticket
IMTOrder* order // An order object
)
.NET
MTRetCode CIMTAdminAPI.OrderRequest(
ulong ticket, // Ticket
CIMTOrder order // An order objec
)
Python
AdminAPI.OrderRequest(
ticket # Ticket
)
Parameters
ticket
[in] The number (ticket) of an order.
order
[out] An object of a trade order. The order object must be first created using the IMTAdminAPI::OrderCreate method.
Return Value
An indication of successful completion is the MT_RET_OK response code. Otherwise, an error code will be returned.
Note
This method copies data of an order with the specified ticket to the order object.
This method cannot be called from event handlers (any methods of IMT*Sink classes).
IMTAdminAPI::OrderRequestOpen
Request open orders of a client from a server.
C++
MTAPIRES IMTAdminAPI::OrderRequestOpen(
const UINT64 login, // Client login
IMTOrderArray* orders // An object of the array of orders
)
.NET
MTRetCode CIMTAdminAPI.OrderRequestOpen(
ulong login, // Client login
CIMTOrderArray orders // An object of the array of orders
)
Python
file:///C:/Users/Administrator/AppData/Local/Temp/~hh4BC4.htm 7/17/2025
Manager API Page 187 of 464
AdminAPI.OrderRequestOpen(
login # Client login
)
Parameters
login
[in] The login of the client, whose open orders you need to get.
orders
[out] An object of the array of orders. The orders object must be first created using the IMTAdminAPI::OrderCreateArray method.
Return Value
An indication of successful completion is the MT_RET_OK response code. Otherwise, an error code will be returned.
Note
This method cannot be called from event handlers (any methods of IMT*Sink classes).
IMTAdminAPI::OrderRequestByGroup
Request from the server open orders related to a client group.
C++
MTAPIRES IMTAdminAPI::OrderRequestByGroup(
LPCWSTR group, // Group
IMTOrderArray* orders // Object of the orders array
)
.NET
MTRetCode CIMTAdminAPI.OrderRequestByGroup(
string mask, // Group
CIMTOrderArray orders // Object of the orders array
)
Python
AdminAPI.OrderRequestByGroup(
group # Group
)
AdminAPI.OrderRequestByGroupCSV(
group, # Group
fields # Comma-separated list of required fields
)
AdminAPI.OrderRequestByGroupNumPy(
group, # Group
fields # Comma-separated list of required fields
)
Parameters
group
[in] The groups for which the orders are requested. You can specify one group, several groups (comma separated) or a group mask. The mask is specified using "*" (any value)
and "!" (exception). For example: "demo*,!demoforex" - all groups with the names beginning with 'demo', except for the group demoforex.
orders
[out] An object of the array of orders. The 'orders' object should be first created using the IMTAdminAPI::OrderCreateArray method.
Return Value
An indication of successful completion is the MT_RET_OK response code. Otherwise, an error code will be returned.
Note
The method copies to the 'orders' object the data on all open orders belonging to clients in the specified groups.
The method cannot be called from event handlers (any IMT*Sink class methods).
IMTAdminAPI::OrderRequestByGroupSymbol
Request open orders from the server by group and symbol.
C++
MTAPIRES IMTAdminAPI::OrderRequestByGroupSymbol(
LPCWSTR group, // group
LPCWSTR symbol, // symbol
IMTOrderArray* orders // order array object
)
.NET
MTRetCode CIMTAdminAPI.OrderRequestByGroupSymbol(
string mask, // group
string symbol, // symbol
CIMTOrderArray orders // order array object
)
Python
AdminAPI.OrderRequestByGroupSymbol(
group, # group
symbol # symbol
)
file:///C:/Users/Administrator/AppData/Local/Temp/~hh4BC4.htm 7/17/2025
Manager API Page 188 of 464
AdminAPI.OrderRequestByGroupSymbolCSV(
group, # group
symbol, # symbol
fields # comma-separated list of required fields
)
AdminAPI.OrderRequestByGroupSymbolNumPy(
group, # group
symbol, # symbol
fields # comma-separated list of required fields
)
Parameters
group
[in] The groups for which the orders are requested. You can specify one group, several groups (comma separated) or a group mask. The mask is specified using characters
"*" (any value) and "!" (exception). For example: "demo*,!demoforex" - all groups whose names begin with 'demo', except for the group demoforex.
symbol
[in] The symbol, for which you wish to get orders. You can specify multiple symbols separated by commas. You can specify multiple symbols separated by commas as well as
symbol masks. The maximum length of the string is 127 characters.
orders
[out] An object of the array of orders. The 'orders' object must first be created using the IMTAdminAPI::OrderCreateArray method.
Return Value
An indication of successful completion is the MT_RET_OK response code. Otherwise, an error code will be returned.
Note
The method copies to the 'orders' object the data on all open orders belonging to clients in the specified groups.
The method cannot be called from event handlers (any IMT*Sink class methods).
IMTAdminAPI::OrderRequestByLogins
Request from the server open orders related to the list of logins.
C++
MTAPIRES IMTAdminAPI::OrderRequestByLogins(
const UINT64* logins, // Logins
const UINT logins_total, // Number of logins
IMTOrderArray* orders // Object of the orders array
)
.NET
MTRetCode CIMTAdminAPI.OrderRequestByLogins(
ulong[] logins, // Logins
CIMTOrderArray orders // Object of the orders array
)
Python
AdminAPI.OrderRequestByLogins(
logins # Logins
)
AdminAPI.OrderRequestByLoginsCSV(
logins, # Logins
fields # Object of the orders array
)
AdminAPI.OrderRequestByLoginsNumPy(
logins, # Logins
fields # Object of the orders array
)
Parameters
logins
[in] Array of client logins.
logins_total
[in] Number of logins in the 'logins' array.
orders
[out] An object of the array of orders. The 'orders' object should be first created using the IMTAdminAPI::OrderCreateArray method.
Return Value
An indication of successful completion is the MT_RET_OK response code. Otherwise, an error code will be returned.
Note
The method copies to the 'orders' object the data of all open orders belonging to the specified accounts.
The method cannot be called from event handlers (any IMT*Sink class methods).
IMTAdminAPI::OrderRequestByLoginsSymbol
Request open orders from the server by list of logins and symbol.
C++
file:///C:/Users/Administrator/AppData/Local/Temp/~hh4BC4.htm 7/17/2025
Manager API Page 189 of 464
MTAPIRES IMTAdminAPI::OrderRequestByLoginsSymbol(
const UINT64* logins, // logins
const UINT logins_total, // number of logins
LPCWSTR symbol, // symbol
IMTOrderArray* orders // order array object
)
.NET
MTRetCode CIMTAdminAPI.OrderRequestByLoginsSymbol(
ulong[] logins, // logins
string symbol, // symbol
CIMTOrderArray orders // order array object
)
Python
AdminAPI.OrderRequestByLoginsSymbol(
logins, # logins
symbol # symbol
)
AdminAPI.OrderRequestByLoginsSymbolCSV(
logins, # logins
symbol, # symbol
fields # comma-separated list of required fields
)
AdminAPI.OrderRequestByLoginsSymbolNumPy(
logins, # logins
symbol, # symbol
fields # comma-separated list of required fields
)
Parameters
logins
[in] Array of client logins.
logins_total
[in] Number of logins in the 'logins' array.
symbol
[in] The symbol, for which you wish to get orders. You can specify multiple symbols separated by commas.
orders
[out] An object of the array of orders. The 'orders' object must first be created using the IMTAdminAPI::OrderCreateArray method.
Return Value
An indication of successful completion is the MT_RET_OK response code. Otherwise, an error code will be returned.
Note
The method cannot be called from event handlers (any IMT*Sink class methods).
IMTAdminAPI::OrderRequestByTickets
Request from the server open orders by the list of tickets.
C++
MTAPIRES IMTAdminAPI::OrderRequestByTickets(
const UINT64* tickets, // Tickets
const UINT tickets_total,// Number of tickets
IMTOrderArray* orders // Array of orders
)
.NET
MTRetCode CIMTAdminAPI.OrderRequestByTickets(
ulong[] tickets, // Tickets
CIMTOrderArray orders // Array of orders
)
Python
AdminAPI.OrderRequestByTickets(
tickets # Tickets
)
AdminAPI.OrderRequestByTicketsCSV(
tickets, # Tickets
fields # comma-separated list of required fields
)
AdminAPI.OrderRequestByTicketsNumPy(
tickets, # Tickets
fields # comma-separated list of required fields
)
Parameters
tickets
[in] List of order tickets.
tickets_total
[in] The number of tickets in the 'tickets' array.
orders
[out] An object of the array of orders. The 'orders' object should be first created using the IMTAdminAPI::OrderCreateArray method.
Return Value
An indication of successful completion is the MT_RET_OK response code. Otherwise, an error code will be returned.
Note
file:///C:/Users/Administrator/AppData/Local/Temp/~hh4BC4.htm 7/17/2025
Manager API Page 190 of 464
This method copies data of orders with the specified tickets to the 'orders' object.
The method cannot be called from event handlers (any IMT*Sink class methods).
IMTAdminAPI::OrderAdd
Add an open order the server database.
C++
MTAPIRES IMTAdminAPI::OrderAdd(
IMTOrder* order // Order object
)
.NET
MTRetCode CIMTAdminAPI.OrderAdd(
CIMTOrder order // Order object
)
Python
AdminAPI.OrderAdd(
order # Order object
)
Parameters
order
[in] Order object.
Return Value
An indication of successful completion is the MT_RET_OK response code. Otherwise, an error code will be returned.
Note
An order can only be added to the database of the server, to which the application is connected.
The manager account requires the RIGHT_TRADE_MANAGER permission in order to use the function.
The ticket of the order you are adding (IMTOrder::OrderSet) must fall within the orders range on the trading server (IMTConServerTrade::OrdersRange*), and it must be greater
than the last used ticket.
Note that the server allocates new tickets starting from the last used ticket in the range. For example, if you create an order with a ticket of 5000, the server will allocate for
further orders the tickets 5001, 5002, etc. (even if tickets before 5000 are not busy).
If an order is added with a zero ticket, the server will assign the ticket automatically.
The integrity of the order being added is checked. The following fields must be filled:
• IMTOrder::Login (an account with this login must exist on the server)
• IMTOrder::Symbol
• IMTOrder::Type
• IMTOrder::Digits
• IMTOrder::DigitsCurrency
• IMTOrder::ContractSize
• IMTOrder::VolumeInitial (must be less than IMTOrder::VolumeCurrent)
• IMTOrder::VolumeCurrent (must not be greater than IMTOrder::VolumeInitial)
• IMTOrder::PriceOrder
• IMTOrder::State (the state must correspond to an open order; it cannot be ORDER_STATE_CANCELED, ORDER_STATE_PARTIAL, ORDER_STATE_FILLED,
ORDER_STATE_REJECTED, ORDER_STATE_EXPIRED)
• IMTOrder::TimeSetupMsc
The IMTOrder::TimeDone and IMTOrder::TimeDoneMsc fields must not be filled in the order.
IMTAdminAPI::OrderAddBatch
Add a batch of open orders to the server database.
C++
MTAPIRES IMTAdminAPI::OrderAddBatch(
IMTOrderArray* orders, // Array of orders
MTAPIRES* results // Array of results
)
.NET
MTRetCode CIMTAdminAPI.OrderAddBatch(
CIMTOrderArray orders, // Array of orders
MTRetCode[] res // Array of results
)
Python
AdminAPI.OrderAddBatch(
orders # Array of orders
)
Parameters
orders
[in] A pointer to the array of orders IMTOrderArray.
results
[out] An array with the order addition results. The size of the 'results' array must not be less than that of 'orders'.
Return Value
file:///C:/Users/Administrator/AppData/Local/Temp/~hh4BC4.htm 7/17/2025
Manager API Page 191 of 464
The MT_RET_OK response code indicates that all the specified orders have been added. The MT_RET_ERR_PARTIAL response code means that only some of the orders have been
added. Analyze the 'results' array for more details on the execution results. The result of adding of each order from the 'orders' array is added to 'results'. The index of a result
corresponds to the index of an order in the source array.
Note
Orders can only be added to the database of the server, to which the application is connected.
The manager account requires the RIGHT_TRADE_MANAGER permission in order to use the function.
The tickets of the orders you are adding (IMTOrder::OrderSet) must fall within the orders range on the trading server (IMTConServerTrade::OrdersRange*), and they must be
greater than the last used ticket.
Note that the server allocates new tickets starting from the last used ticket in the range. For example, if you create an order with a ticket of 5000, the server will allocate for
further orders the tickets 5001, 5002, etc. (even if tickets before 5000 are not busy).
If orders are added with a zero ticket, the server will assign the tickets automatically.
Orders being added are checked for integrity. The following fields must be filled:
• IMTOrder::Login (an account with this login must exist on the server)
• IMTOrder::Symbol
• IMTOrder::Type
• IMTOrder::Digits
• IMTOrder::DigitsCurrency
• IMTOrder::ContractSize
The IMTOrder::TimeDone and IMTOrder::TimeDoneMsc fields must not be filled in the orders.
To improve performance, it is recommended to create arrays and perform group operations separately for each trading account.
IMTManagerAPI::OrderAddBatchArray
Add a batch of open orders to the server database.
C++
MTAPIRES IMTManagerAPI::OrderAddBatchArray(
IMTOrder** order, // Array of orders
const UINT orders_total, // Number of orders in the array
MTAPIRES* results // Array of results
)
.NET
MTRetCode CIMTManagerAPI.OrderAddBatchArray(
CIMTOrder[] orders, // Array of orders
MTRetCode[] retcodes // Array of results
)
Parameters
orders
[in] A pointer to the array of orders.
orders_total
[in] The number of orders in the 'orders' array.
results
[out] An array with the results of update of orders. The size of the 'results' array must not be less than that of 'orders'.
Return Value
The MT_RET_OK response code indicates that all the specified orders have been added. The MT_RET_ERR_PARTIAL response code means that only some of the orders have been
added. Analyze the 'results' array for more details on the execution results. The result of adding of each order from the 'orders' array is added to 'results'. The index of a result
corresponds to the index of an order in the source array.
Note
Orders can only be added to the database of the server, to which the application is connected.
The manager account requires the RIGHT_TRADE_MANAGER permission in order to use the function.
The tickets of the orders you are adding (IMTOrder::OrderSet) must fall within the orders range on the trading server (IMTConServerTrade::OrdersRange*), and they must be
greater than the last used ticket.
Note that the server allocates new tickets starting from the last used ticket in the range. For example, if you create an order with a ticket of 5000, the server will allocate for
further orders the tickets 5001, 5002, etc. (even if tickets before 5000 are not busy).
If orders are added with a zero ticket, the server will assign the tickets automatically.
Orders being added are checked for integrity. The following fields must be filled:
• IMTOrder::Login
• IMTOrder::Symbol
• IMTOrder::Type
• IMTOrder::Digits
• IMTOrder::DigitsCurrency
• IMTOrder::ContractSize
file:///C:/Users/Administrator/AppData/Local/Temp/~hh4BC4.htm 7/17/2025
Manager API Page 192 of 464
The IMTOrder::TimeDone and IMTOrder::TimeDoneMsc fields must not be filled in the orders.
To improve performance, it is recommended to create arrays and perform group operations separately for each trading account.
IMTAdminAPI::OrderUpdate
Updates a trade order.
C++
MTAPIRES IMTAdminAPI::OrderUpdate(
IMTOrder* order // An order object
)
.NET
MTRetCode CIMTAdminAPI.OrderUpdate(
CIMTOrder order // An order object
)
Python
AdminAPI.OrderUpdate(
order # An order object
)
Parameters
*order
[in] Order object.
Return Value
An indication of successful completion is the MT_RET_OK response code. Otherwise, an error code will be returned.
Note
An order can only be updated from the applications connected to the trade server, on which the order has been created. For all other applications the response code
MT_RET_ERR_NOTMAIN will be returned. If the object is not found, the response code MT_RET_ERR_NOTFOUND will be returned.
The manager account requires the RIGHT_TRADE_MANAGER permission in order to use the function.
IMTAdminAPI::OrderUpdateBatch
Update multiple orders in a server database.
C++
MTAPIRES IMTAdminAPI::OrderUpdateBatch(
IMTOrderArray* orders, // Array of orders
MTAPIRES* results // Array of results
)
.NET
MTRetCode CIMTAdminAPI.OrderUpdateBatch(
CIMTOrderArray orders, // Array of orders
MTRetCode[] res // Array of results
)
Python
AdminAPI.OrderUpdateBatch(
orders # Array of orders
)
Parameters
orders
[in] A pointer to the array of orders IMTOrderArray.
results
[out] An array with order update results. The size of the 'results' array must not be less than that of 'orders'.
Return Value
The MT_RET_OK response code indicates that all orders have been updated. The MT_RET_ERR_PARTIAL response code means that only some of the orders have been updated.
Analyze the 'results' array for more details concerning the execution results. The result of update of each order from the 'orders' array is added to 'results'. The index of a result
corresponds to the index of an order in the source array.
Note
Orders can only be updated from the applications connected to the trade server, on which the orders have been created. For all other applications, the response code
MT_RET_ERR_NOTMAIN is returned. If the object is not found, the response code MT_RET_ERR_NOTFOUND is returned.
All required fields of orders must be filled in, not only the ones which you want to change It is recommended that you first receive orders from the server, change the required
fields in them and then send them back to the server.
The server checks the correctness of the updated orders. The following fields must be filled:
• IMTOrder::Login
• IMTOrder::Symbol
• IMTOrder::Type
• IMTOrder::Digits
• IMTOrder::DigitsCurrency
• IMTOrder::ContractSize
• IMTOrder::VolumeInitial
• IMTOrder::VolumeCurrent
• IMTOrder::PriceOrder
• IMTOrder::State
file:///C:/Users/Administrator/AppData/Local/Temp/~hh4BC4.htm 7/17/2025
Manager API Page 193 of 464
• IMTOrder::TimeSetupMsc
• IMTOrder::TimeDone or IMTOrder::TimeDoneMsc (for closed orders)
To improve performance, it is recommended to create arrays and perform group operations separately for each trading account.
IMTManagerAPI::OrderUpdateBatchArray
Update multiple open orders in a server database.
C++
MTAPIRES IMTManagerAPI::OrderUpdateBatchArray(
IMTOrder** order, // Array of orders
const UINT orders_total, // Number of orders in the array
MTAPIRES* results // Array of results
)
.NET
MTRetCode CIMTManagerAPI.OrderUpdateBatchArray(
CIMTOrder[] orders, // Array of orders
MTRetCode[] retcodes // Array of results
)
Parameters
orders
[in] A pointer to the array of orders.
orders_total
[in] The number of orders in the 'orders' array.
results
[out] An array with order update results. The size of the 'results' array must not be less than that of 'orders'.
Return Value
The MT_RET_OK response code indicates that all orders have been updated. The MT_RET_ERR_PARTIAL response code means that only some of the orders have been updated.
Analyze the 'results' array for more details concerning the execution results. The result of update of each order from the 'orders' array is added to 'results'. The index of a result
corresponds to the index of an order in the source array.
Note
Orders can only be updated from the applications connected to the trade server, on which the orders have been created. For all other applications, the response code
MT_RET_ERR_NOTMAIN is returned. If the object is not found, the response code MT_RET_ERR_NOTFOUND is returned.
All required fields of orders must be filled in, not only the ones which you want to change It is recommended that you first receive orders from the server, change the required
fields in them and then send them back to the server.
The server checks the correctness of the updated orders. The following fields must be filled:
• IMTOrder::Login
• IMTOrder::Symbol
• IMTOrder::Type
• IMTOrder::Digits
• IMTOrder::DigitsCurrency
• IMTOrder::ContractSize
• IMTOrder::VolumeInitial
• IMTOrder::VolumeCurrent
• IMTOrder::PriceOrder
• IMTOrder::State
• IMTOrder::TimeSetupMsc
• IMTOrder::TimeDone or IMTOrder::TimeDoneMsc (for closed orders)
To improve performance, it is recommended to create arrays and perform group operations separately for each trading account.
IMTAdminAPI::OrderDelete
Deletes a trade order.
C++
MTAPIRES IMTAdminAPI::OrderDelete(
const UINT64 ticket // Order number
)
.NET
MTRetCode CIMTAdminAPI.OrderDelete(
ulong ticket // Order number
)
Python
AdminAPI.OrderDelete(
ticket # Order number
)
Parameters
ticket
[in] Order number.
Return Value
An indication of successful completion is the MT_RET_OK response code. Otherwise, an error code will be returned.
Note
file:///C:/Users/Administrator/AppData/Local/Temp/~hh4BC4.htm 7/17/2025
Manager API Page 194 of 464
An order can only be deleted from the applications connected to the trade server, on which the order has been created. For all other applications the response code
MT_RET_ERR_NOTMAIN will be returned. If the object is not found, the response code MT_RET_ERR_NOTFOUND will be returned.
The manager account requires the RIGHT_TRADE_DELETE and RIGHT_TRADES_MANAGER permissions in order to use the function.
IMTAdminAPI::OrderDeleteBatch
Delete orders from the server database in bulk.
C++
MTAPIRES IMTAdminAPI::OrderDeleteBatch(
const UINT64* tickets, // Array of tickets
const UINT tickets_total, // Number of tickets in the array
MTAPIRES* results // Array of results
)
.NET
MTRetCode CIMTAdminAPI.OrderDeleteBatch(
ulong[] tickets, // Deal ticket
MTRetCode[] retcodes // Array of results
)
Python
AdminAPI.OrderDeleteBatch(
tickets # Deal ticket
)
Parameters
tickets
[in] A pointer to an array of tickets of the orders which you want to delete.
tickets_total
[in] The number of tickets in the 'tickets' array.
results
[out] The array with the order deletion results. The size of the 'results' array must not be less than that of 'tickets'.
Return Value
The MT_RET_OK response code indicates that all orders have been deleted. The MT_RET_ERR_PARTIAL response code means that only some of the orders have been deleted.
Analyze the 'results' array for more details concerning the execution results. The result of deletion of each order from the 'tickets' array is added to 'results'. The result index
corresponds to the ticket index in the source array.
Note
Orders can only be deleted from the applications connected to the trade server, on which the orders have been created. For all other applications, the response code
MT_RET_ERR_NOTMAIN is returned. If the object is not found, the response code MT_RET_ERR_NOTFOUND is returned.
Bulk deletion is executed faster than deletion of the same number of orders in a cycle one by one, using IMTManagerAPI::OrderDelete. The acceleration can be especially
noticeable when deleting orders belonging to one account.
To improve performance, it is recommended to create arrays and perform group operations separately for each trading account.
IMTAdminAPI::OrderCancel
Move an open trading order to history.
C++
MTAPIRES IMTAdminAPI::OrderCancel(
const UINT64 ticket // order ticket
)
.NET
MTRetCode CIMTAdminAPI.OrderCancel(
ulong ticket // order number
)
Python
AdminAPI.OrderCancel(
ticket # order number
)
Parameters
ticket
[in] Order number (ticket).
Return Value
An indication of successful completion is the MT_RET_OK response code. Otherwise, an error code will be returned.
Note
When an order is transferred, its state changes to IMTOrder::ORDER_STATE_CANCELED. Such orders are not executed or triggered, and no margin is charged for them.
An order can be moved only from the plugins running on the same trade server where the order was created. For all other plugins, the response code MT_RET_ERR_NOTMAIN will
be returned. If the object is not found, the response code MT_RET_ERR_NOTFOUND will be returned.
IMTAdminAPI::OrderCancelBatch
Move multiple open order to history.
C++
file:///C:/Users/Administrator/AppData/Local/Temp/~hh4BC4.htm 7/17/2025
Manager API Page 195 of 464
MTAPIRES IMTAdminAPI::OrderCancelBatch(
const UINT64* tickets, // array of tickets
const UINT tickets_total, // number of tickets in the array
MTAPIRES* results // array of results
)
.NET
MTRetCode CIMTAdminAPI.OrderCancelBatch(
ulong[] tickets, // deal ticket
MTRetCode[] retcodes // array of results
)
Python
AdminAPI.OrderCancelBatch(
tickets # deal ticket
)
Parameters
tickets
[in] A pointer to an array of order tickets which you want to move to history.
tickets_total
[in] The number of tickets in the 'tickets' array.
results
[out] An array with the order transferring result. The size of the 'results' array must not be less than that of 'tickets'.
Return Value
The MT_RET_OK response code indicates that all specified accounts have been moved to history. The MT_RET_ERR_PARTIAL response code means that only some of the orders
have been moved. Analyze the 'results' array for a detailed information on execution results. The result of transfer of each order from the 'tickets' array is added to 'results'. The
result index corresponds to the ticket index in the source array.
Note
When an order is transferred, its state changes to IMTOrder::ORDER_STATE_CANCELED. Such orders are not executed or triggered, and no margin is charged for them.
An order can be moved only from the plugins running on the same trade server where the orders were created. For all other plugins, the response code MT_RET_ERR_NOTMAIN
will be returned. If the object is not found, the response code MT_RET_ERR_NOTFOUND will be returned.
The bulk transfer is executed faster than moving the same number of orders in a loop one by one, using IMTManagerAPI::OrderCancel. The acceleration can be especially
noticeable when moving orders belonging to one account.
To improve performance, it is recommended to create arrays and perform group operations separately for each trading account.
IMTAdminAPI::OrderBackupList
Request the dates of backup databases of orders for the specified time range.
C++
MTAPIRES IMTAdminAPI::OrderBackupList(
const INT64 from, // Beginning of period
const INT64 to, // End of period
INT64*& backups, // An array of dates of backups
UINT& backups_total // The number of dates of backups
)
.NET
long[] CIMTAdminAPI.OrderBackupList(
long from, // Beginning of period
long to, // End of period
out MTRetCode res // Response code
)
Python
AdminAPI.OrderBackupList(
from, # Beginning of period
to # End of period
)
Parameters
from
[in] The beginning of the period for which you need to get the list of backup copies. The date is specified in seconds that have elapsed since 01.01.1970.
to
[in] The end of the period for which you need to get the list of backup copies. The date is specified in seconds that have elapsed since 01.01.1970.
backups
[out] An array of backup creation dates.
backups_total
[out] The number of received dates of backups.
Return Value
An indication of successful completion is the MT_RET_OK response code. Otherwise, an error code will be returned.
Note
After using, the backups array must be released using the IMTAdminAPI::Free method.
IMTAdminAPI::OrderBackupList
Request the dates of backup databases of orders for the specified time range from the specified server.
C++
file:///C:/Users/Administrator/AppData/Local/Temp/~hh4BC4.htm 7/17/2025
Manager API Page 196 of 464
MTAPIRES IMTAdminAPI::OrderBackupList(
const UINT64 server, // Server ID
const INT64 from, // Beginning of period
const INT64 to, // End of period
INT64*& backups, // An array of dates of backups
UINT& backups_total // The number of dates of backups
)
.NET
long[] CIMTAdminAPI.OrderBackupList(
ulong server, // Server ID
long from, // Beginning of period
long to, // End of period
out MTRetCode res // Response code
)
Python
AdminAPI.OrderBackupList(
server, # Server ID
from, # Beginning of period
to # End of period
)
Parameters
server
[in] The identifier of the server from which the information should be requested.
from
[in] The beginning of the period for which you need to get the list of backup copies. The date is specified in seconds that have elapsed since 01.01.1970.
to
[in] The end of the period for which you need to get the list of backup copies. The date is specified in seconds that have elapsed since 01.01.1970.
backups
[out] An array of backup creation dates.
backups_total
[out] The number of received dates of backups.
Return Value
An indication of successful completion is the MT_RET_OK response code. Otherwise, an error code will be returned.
Note
After using, the backups array must be released using the IMTAdminAPI::Free method.
IMTAdminAPI::OrderBackupRequest
Request an order from a backup database.
C++
MTAPIRES IMTAdminAPI::OrderBackupRequest(
const INT64 backup, // Backup date
const UINT64 ticket, // Order number
IMTOrder* order // An order object
)
.NET
MTRetCode CIMTAdminAPI.OrderBackupRequest(
long backup, // Backup date
ulong ticket, // Order number
CIMTOrder order // An order objec
)
Python
AdminAPI.OrderBackupRequest(
backup, # Backup date
ticket # Order number
)
Parameters
backup
[in] The date of creation of the backup to which the requested order belongs. The date is specified in seconds that have elapsed since 01.01.1970. Dates of backups can be
obtained using the IMTAdminAPI::OrderBackupList method.
ticket
[in] Order number.
order
[out] An object of a trade order. The order object must be first created using the IMTAdminAPI::OrderCreate method.
Return Value
An indication of successful completion is the MT_RET_OK response code. Otherwise, an error code will be returned.
Note
This method cannot be called from event handlers (any methods of IMT*Sink classes).
IMTAdminAPI::OrderBackupRequest
Request an order from a backup database from the specified server.
C++
file:///C:/Users/Administrator/AppData/Local/Temp/~hh4BC4.htm 7/17/2025
Manager API Page 197 of 464
MTAPIRES IMTAdminAPI::OrderBackupRequest(
const UINT64 server, // Server ID
const INT64 backup, // Backup date
const UINT64 ticket, // Order number
IMTOrder* order // An order object
)
.NET
MTRetCode CIMTAdminAPI.OrderBackupRequest(
ulong server, // Server ID
long backup, // Backup date
ulong ticket, // Order number
CIMTOrder order // An order objec
)
Python
AdminAPI.OrderBackupRequest(
server, # Server ID
backup, # Backup date
ticket # Order number
)
Parameters
server
[in] The identifier of the server from which the information should be requested.
backup
[in] The date of creation of the backup to which the requested order belongs. The date is specified in seconds that have elapsed since 01.01.1970. Dates of backups can be
obtained using the IMTAdminAPI::OrderBackupList method.
ticket
[in] Order number.
order
[out] An object of a trade order. The order object must be first created using the IMTAdminAPI::OrderCreate method.
Return Value
An indication of successful completion is the MT_RET_OK response code. Otherwise, an error code will be returned.
Note
This method cannot be called from event handlers (any methods of IMT*Sink classes).
IMTAdminAPI::OrderBackupRequestOpen
Request open orders from a backup database.
C++
MTAPIRES IMTAdminAPI::OrderBackupRequestOpen(
const INT64 backup, // Backup date
const UINT64 login, // Login
IMTOrderArray* orders // An object of the array of orders
)
.NET
MTRetCode CIMTAdminAPI.OrderBackupRequestOpen(
long backup, // Backup date
ulong login, // Login
CIMTOrderArray orders // An object of the array of orders
)
Python
AdminAPI.OrderBackupRequestOpen(
backup, # Backup date
login # Login
)
Parameters
backup
[in] The date of creation of the backup to which the requested order belongs. The date is specified in seconds that have elapsed since 01.01.1970. Dates of backups can be
obtained using the IMTAdminAPI::OrderBackupList method.
login
[in] The login of the client, whose open orders you need to get.
orders
[out] An object of the array of orders. The orders object must be first created using the IMTAdminAPI::OrderCreateArray method.
Return Value
An indication of successful completion is the MT_RET_OK response code. Otherwise, an error code will be returned.
Note
This method cannot be called from event handlers (any methods of IMT*Sink classes).
IMTAdminAPI::OrderBackupRequestOpen
Request open orders from a backup database of the specified server.
C++
MTAPIRES IMTAdminAPI::OrderBackupRequestOpen(
const UINT64 server, // Server ID
const INT64 backup, // Backup date
const UINT64 login, // Login
IMTOrderArray* orders // An object of the array of orders
)
file:///C:/Users/Administrator/AppData/Local/Temp/~hh4BC4.htm 7/17/2025
Manager API Page 198 of 464
.NET
MTRetCode CIMTAdminAPI.OrderBackupRequestOpen(
ulong server, // Server ID
long backup, // Backup date
ulong login, // Login
CIMTOrderArray orders // An object of the array of orders
)
Python
AdminAPI.OrderBackupRequestOpen(
server, # Server ID
backup, # Backup date
login # Login
)
Parameters
server
[in] The identifier of the server from which the information should be requested.
backup
[in] The date of creation of the backup to which the requested order belongs. The date is specified in seconds that have elapsed since 01.01.1970. Dates of backups can be
obtained using the IMTAdminAPI::OrderBackupList method.
login
[in] The login of the client, whose open orders you need to get.
orders
[out] An object of the array of orders. The orders object must be first created using the IMTAdminAPI::OrderCreateArray method.
Return Value
An indication of successful completion is the MT_RET_OK response code. Otherwise, an error code will be returned.
Note
This method cannot be called from event handlers (any methods of IMT*Sink classes).
IMTAdminAPI::OrderBackupRequestHistory
Request closed orders from a backup database.
C++
MTAPIRES IMTAdminAPI::OrderBackupRequestHistory(
const INT64 backup, // Backup date
const UINT64 login, // Login
const INT64 from, // Beginning of period
const INT64 to, // End of period
IMTOrderArray* orders // An object of the array of orders
)
.NET
MTRetCode CIMTAdminAPI.OrderBackupRequestHistory(
long backup, // Backup date
ulong login, // Login
long from, // Beginning of period
long to, // End of period
CIMTOrderArray orders // An object of the array of orders
)
Python
AdminAPI.OrderBackupRequestHistory(
backup, # Backup date
login, # Login
from, # Beginning of period
to # End of period
)
Parameters
backup
[in] The date of creation of the backup to which the requested order belongs. The date is specified in seconds that have elapsed since 01.01.1970. Dates of backups can be
obtained using the IMTAdminAPI::OrderBackupList method.
login
[in] The login of the client, whose closed orders you need to get.
from
[in] The beginning of the period you want to receive orders for. The date is specified in seconds that have elapsed since 01.01.1970.
to
[in] The end of the period for which you need to get orders. The date is specified in seconds that have elapsed since 01.01.1970.
orders
[out] An object of the array of orders. The orders object must be first created using the IMTAdminAPI::OrderCreateArray method.
Return Value
An indication of successful completion is the MT_RET_OK response code. Otherwise, an error code will be returned.
Note
This method cannot be called from event handlers (any methods of IMT*Sink classes).
IMTAdminAPI::OrderBackupRequestHistory
Request closed orders from a backup database of the specified server.
C++
file:///C:/Users/Administrator/AppData/Local/Temp/~hh4BC4.htm 7/17/2025
Manager API Page 199 of 464
MTAPIRES IMTAdminAPI::OrderBackupRequestHistory(
const UINT64 server, // Server ID
const INT64 backup, // Backup date
const UINT64 login, // Login
const INT64 from, // Beginning of period
const INT64 to, // End of period
IMTOrderArray* orders // An object of the array of orders
)
.NET
MTRetCode CIMTAdminAPI.OrderBackupRequestHistory(
ulong server, // Server ID
long backup, // Backup date
ulong login, // Login
long from, // Beginning of period
long to, // End of period
CIMTOrderArray orders // An object of the array of orders
)
Python
AdminAPI.OrderBackupRequestHistory(
server, # Server ID
backup, # Backup date
login, # Login
from, # Beginning of period
to # End of period
)
Parameters
server
[in] The identifier of the server from which the information should be requested.
backup
[in] The date of creation of the backup to which the requested order belongs. The date is specified in seconds that have elapsed since 01.01.1970. Dates of backups can be
obtained using the IMTAdminAPI::OrderBackupList method.
login
[in] The login of the client, whose closed orders you need to get.
from
[in] The beginning of the period you want to receive orders for. The date is specified in seconds that have elapsed since 01.01.1970.
to
[in] The end of the period for which you need to get orders. The date is specified in seconds that have elapsed since 01.01.1970.
orders
[out] An object of the array of orders. The orders object must be first created using the IMTAdminAPI::OrderCreateArray method.
Return Value
An indication of successful completion is the MT_RET_OK response code. Otherwise, an error code will be returned.
Note
This method cannot be called from event handlers (any methods of IMT*Sink classes).
IMTAdminAPI::OrderBackupRestore
Restore an order from a backup database.
C++
MTAPIRES IMTAdminAPI::OrderBackupRestore(
IMTOrder* order // An order object
)
.NET
MTRetCode CIMTAdminAPI.OrderBackupRestore(
CIMTOrder order // An order object
)
Python
MTAdminAPI.OrderBackupRestore(
MTOrder order # An order object
)
Parameters
order
[in] An object of the order to restore.
Return Value
An indication of successful completion is the MT_RET_OK response code. Otherwise, an error code will be returned.
Note
Restored orders are not deleted from the backup copy.
IMTAdminAPI::OrderReopen
Reopens a pending order from the client history.
C++
file:///C:/Users/Administrator/AppData/Local/Temp/~hh4BC4.htm 7/17/2025
Manager API Page 200 of 464
MTAPIRES IMTAdminAPI::OrderReopen(
const UINT64 ticket // The ticket of an order
)
.NET
MTRetCode CIMTAdminAPI.OrderReopen(
ulong ticket // The ticket of an order
)
Python
AdminAPI.OrderReopen(
int ticket # The ticket of an order
)
Parameters
ticket
[in] Ticket of an order to be reopened.
Return Value
An indication of successful completion is the MT_RET_OK response code. Otherwise, an error code will be returned.
Note
Only Limit, Stop and Stop Limit orders can be reopened. The order you want to reopen must exist in the client's history.
The method finds an order in the client's history and moves it to open orders:
Before reopening a previously triggered order, you should properly correct the state of the client's trading positions and account:
• Delete the trade, which was opened in accordance with the order. If several trades were performed in connection with the order, delete all of them.
• Fix the client's positions (IMTAdminAPI::PositionFix).
• Fix the client's balance (IMTAdminAPI::UserBalanceCheck).
After the above actions, the client's state will correspond to the history of orders.
IMTAdminAPI::HistoryRequest
Request from the server the client's closed orders (history) in the specified date range.
C++
MTAPIRES IMTAdminAPI::HistoryRequest(
const UINT64 login, // Client login
const INT64 from, // Beginning of period
const INT64 to, // End of period
IMTOrderArray* orders // An object of the array of orders
)
.NET
MTRetCode CIMTAdminAPI.HistoryRequest(
ulong login, // Client login
long from, // Beginning of period
long to, // End of period
CIMTOrderArray orders // An object of the array of orders
)
Python
AdminAPI.HistoryRequest(
login, # Client login
from, # Beginning of period
to # End of period
)
Parameters
login
[in] The login of the client, whose open orders you need to get.
from
[in] The beginning of the period you want to receive orders for. The date is specified in seconds that have elapsed since 01.01.1970.
to
[in] The end of the period for which you need to get orders. The date is specified in seconds that have elapsed since 01.01.1970.
orders
[out] An object of the array of orders. The orders object must be first created using the IMTAdminAPI::OrderCreateArray method.
Return Value
An indication of successful completion is the MT_RET_OK response code. Otherwise, an error code will be returned.
Note
This method cannot be called from event handlers (any methods of IMT*Sink classes).
The method was previously called OrderRequestHistory.
IMTAdminAPI::HistoryRequestByTickets
file:///C:/Users/Administrator/AppData/Local/Temp/~hh4BC4.htm 7/17/2025
Manager API Page 201 of 464
Request from the server the closed orders (history) related to the list of tickets.
C++
MTAPIRES IMTAdminAPI::HistoryRequestByTickets(
const UINT64* tickets, // Tickets
const UINT tickets_total,// Number of tickets
IMTOrderArray* orders // Array of orders
)
.NET
MTRetCode CIMTAdminAPI.HistoryRequestByTickets(
ulong[] tickets, // Tickets
CIMTOrderArray orders // Array of orders
)
Python
AdminAPI.HistoryRequestByTickets(
tickets # Tickets
)
AdminAPI.HistoryRequestByTicketsCSV(
tickets, # Tickets
fields # Array of orders
)
AdminAPI.HistoryRequestByTicketsNumPy(
tickets, # Tickets
fields # Array of orders
)
Parameters
tickets
[in] List of order tickets.
tickets_total
[in] The number of tickets in the 'tickets' array.
orders
[out] An object of the array of orders. The 'orders' object should be first created using the IMTAdminAPI::OrderCreateArray method.
Return Value
An indication of successful completion is the MT_RET_OK response code. Otherwise, an error code will be returned.
Note
This method copies data of orders with the specified tickets to the 'orders' object.
The method cannot be called from event handlers (any IMT*Sink class methods).
IMTAdminAPI::HistoryRequestByLogins
Request from the server the closed orders (history) related to the list of logins.
C++
MTAPIRES IMTAdminAPI::HistoryRequestByLogins(
const UINT64* logins, // Logins
const UINT logins_total, // Number of logins
const INT64 from, // Beginning of the period
const INT64 to, // End of the period
IMTOrderArray* orders // Object of the orders array
)
.NET
MTRetCode CIMTAdminAPI.HistoryRequestByLogins(
ulong[] logins, // Logins
long from, // Beginning of the period
long to, // End of the period
CIMTOrderArray orders // Object of the orders array
)
Python
AdminAPI.HistoryRequestByLogins(
logins, # Logins
from, # Beginning of the period
to # End of the period
)
AdminAPI.HistoryRequestByLoginsCSV(
logins, # Logins
from, # Beginning of the period
to, # End of the period
fields # Comma-separated list of required fields
)
AdminAPI.HistoryRequestByLoginsNumPy(
logins, # Logins
from, # Beginning of the period
to, # End of the period
fields # Comma-separated list of required fields
)
Parameters
logins
[in] Array of client logins.
logins_total
[in] Number of logins in the 'logins' array.
from
file:///C:/Users/Administrator/AppData/Local/Temp/~hh4BC4.htm 7/17/2025
Manager API Page 202 of 464
[in] The beginning of the period for which you need to receive orders. The date is specified in seconds which have elapsed since 01.01.1970.
to
[in] The end of the period for which you need to receive orders. The date is specified in seconds which have elapsed since 01.01.1970.
orders
[out] An object of the array of orders. The 'orders' object should be first created using the IMTAdminAPI::OrderCreateArray method.
Return Value
An indication of successful completion is the MT_RET_OK response code. Otherwise, an error code will be returned.
Note
The method copies to the 'orders' object the data of all closed orders belonging to the specified accounts.
The method cannot be called from event handlers (any IMT*Sink class methods).
IMTAdminAPI::HistoryRequestByLoginsSymbol
Request closed orders (history) from the server by list of logins and symbol.
C++
MTAPIRES IMTAdminAPI::HistoryRequestByLoginsSymbol(
const UINT64* logins, // logins
const UINT logins_total, // number of logins
const INT64 from, // beginning of period
const INT64 to, // end of period
IMTOrderArray* orders // order array object
)
.NET
MTRetCode CIMTAdminAPI.HistoryRequestByLoginsSymbol(
ulong[] logins, // logins
string symbol, // symbol
long from, // beginning of period
long to, // end of period
CIMTOrderArray orders // order array object
)
Python
AdminAPI.HistoryRequestByLoginsSymbol(
logins, # logins
symbol, # symbol
from, # beginning of period
to # end of period
)
AdminAPI.HistoryRequestByLoginsSymbolCSV(
logins, # logins
symbol, # symbol
from, # beginning of period
to, # end of period
fields # comma-separated list of required fields
)
AdminAPI.HistoryRequestByLoginsSymbolNumPy(
logins, # logins
symbol, # symbol
from, # beginning of period
to, # end of period
fields # comma-separated list of required fields
)
Parameters
logins
[in] Array of client logins.
logins_total
[in] Number of logins in the 'logins' array.
symbol
[in] The symbol, for which you wish to get orders. You can specify multiple symbols separated by commas.
from
[in] The beginning of the period for which you need to get orders. The date is specified in seconds since 01.01.1970.
to
[in] The end of the period for which you need to get orders. The date is specified in seconds since 01.01.1970.
orders
[out] An object of the array of orders. The 'orders' object must first be created using the IMTAdminAPI::OrderCreateArray method.
Return Value
An indication of successful completion is the MT_RET_OK response code. Otherwise, an error code will be returned.
Note
The method cannot be called from event handlers (any IMT*Sink class methods).
IMTAdminAPI::HistoryRequestByGroup
Request from the server closed orders (history) related to a client group.
C++
file:///C:/Users/Administrator/AppData/Local/Temp/~hh4BC4.htm 7/17/2025
Manager API Page 203 of 464
MTAPIRES IMTAdminAPI::HistoryRequestByGroup(
LPCWSTR group, // Group
const INT64 from, // Beginning of the period
const INT64 to, // End of the period
IMTOrderArray* orders // Object of the orders array
)
.NET
MTRetCode CIMTAdminAPI.HistoryRequestByGroup(
string mask, // Group
long from, // Beginning of the period
long to, // End of the period
CIMTOrderArray orders // Object of the orders array
)
Python
AdminAPI.HistoryRequestByGroup(
group, # Group
from, # Beginning of the period
to # End of the period
)
AdminAPI.HistoryRequestByGroupCSV(
group, # Group
from, # Beginning of the period
to, # End of the period
fields # Comma-separated list of required fields
)
AdminAPI.HistoryRequestByGroupNumPy(
group, # Group
from, # Beginning of the period
to, # End of the period
fields # Comma-separated list of required fields
)
Parameters
group
[in] The groups for which the orders are requested. You can specify one group, several groups (comma separated) or a group mask. The mask is specified using "*" (any value)
and "!" (exception). For example: "demo*,!demoforex" - all groups with the names beginning with 'demo', except for the group demoforex.
from
[in] The beginning of the period for which you need to receive orders. The date is specified in seconds which have elapsed since 01.01.1970.
to
[in] The end of the period for which you need to receive orders. The date is specified in seconds which have elapsed since 01.01.1970.
orders
[out] An object of the array of orders. The 'orders' object should be first created using the IMTAdminAPI::OrderCreateArray method.
Return Value
An indication of successful completion is the MT_RET_OK response code. Otherwise, an error code will be returned.
Note
The method copies to the 'orders' object the data of all closed orders belonging to clients in the specified groups.
The method cannot be called from event handlers (any IMT*Sink class methods).
IMTAdminAPI::HistoryRequestByGroupSymbol
Request closed orders (history) from the server by group and symbol.
C++
MTAPIRES IMTAdminAPI::HistoryRequestByGroupSymbol(
LPCWSTR group, // group
LPCWSTR symbol, // symbol
const INT64 from, // beginning of period
const INT64 to, // end of period
IMTOrderArray* orders // order array object
)
.NET
MTRetCode CIMTAdminAPI.HistoryRequestByGroupSymbol(
string mask, // group
string symbol, // symbol
long from, // beginning of period
long to, // end of period
CIMTOrderArray orders // order array object
)
Python
AdminAPI.HistoryRequestByGroupSymbol(
group, # group
symbol, # symbol
from, # beginning of period
to # end of period
)
AdminAPI.HistoryRequestByGroupSymbolCSV(
group, # group
symbol, # symbol
from, # beginning of period
to, # end of period
fields # comma-separated list of required fields
)
file:///C:/Users/Administrator/AppData/Local/Temp/~hh4BC4.htm 7/17/2025
Manager API Page 204 of 464
AdminAPI.HistoryRequestByGroupSymbolNumPy(
group, # group
symbol, # symbol
from, # beginning of period
to, # end of period
fields # comma-separated list of required fields
)
Parameters
group
[in] The groups for which the orders are requested. You can specify one group, several groups (comma separated) or a group mask. The mask is specified using characters
"*" (any value) and "!" (exception). For example: "demo*,!demoforex" - all groups whose names begin with 'demo', except for the group demoforex.
symbol
[in] The symbol, for which you wish to get orders. You can specify multiple symbols separated by commas.
from
[in] The beginning of the period for which you need to get orders. The date is specified in seconds since 01.01.1970.
to
[in] The end of the period for which you need to get orders. The date is specified in seconds since 01.01.1970.
orders
[out] An object of the array of orders. The 'orders' object must first be created using the IMTAdminAPI::OrderCreateArray method.
Return Value
An indication of successful completion is the MT_RET_OK response code. Otherwise, an error code will be returned.
Note
The method cannot be called from event handlers (any IMT*Sink class methods).
IMTAdminAPI::HistoryRequestPage
Request from the server client's closed orders (history) in a paged form.
C++
MTAPIRES IMTAdminAPI::HistoryRequestPage(
const UINT64 login, // login
const INT64 from, // beginning of period
const INT64 to, // end of period
const UINT offset, // order index
const UINT total, // number of orders
IMTOrderArray* orders // array of orders
)
.NET
MTRetCode CIMTAdminAPI::HistoryRequestPage(
ulong login, // login
long from, // beginning of period
long to, // end of period
uint offset, // order index
uint total, // number of orders
CIMTOrderArray orders // array of orders
)
Python
AdminAPI::HistoryRequestPage(
login, # login
from, # beginning of period
to, # end of period
offset, # order index
total # number of orders
)
AdminAPI::HistoryRequestPageCSV(
login, # login
from, # beginning of period
to, # end of period
offset, # order index
total, # number of orders
fields # comma-separated list of required fields
)
AdminAPI::HistoryRequestPageNumPy(
login, # login
from, # beginning of period
to, # end of period
offset, # order index
total, # number of orders
fields # comma-separated list of required fields
)
Parameters
login
[in] The login of the client, whose orders you need to get.
from
[in] The beginning of the period for which you need to get orders. The date is specified in seconds since 01.01.1970.
to
[in] The end of the period for which you need to get orders. The date is specified in seconds since 01.01.1970.
offset
[in] The index of the order starting from which you need to get orders. Numbering starts from 0.
total
[in] The number of orders that should be obtained.
orders
file:///C:/Users/Administrator/AppData/Local/Temp/~hh4BC4.htm 7/17/2025
Manager API Page 205 of 464
[out] An object of the array of orders. The 'orders' object must be previously created using the IMTManagerAPI::OrderCreateArray method.
Return Value
An indication of successful completion is the MT_RET_OK response code. Otherwise, an error code will be returned.
Note
This method allows to easily arrange a paged output of resulting orders. Determine the number of orders that should be displayed on one page by setting it in the 'total'
parameter. Then find the 'offset' parameter for each page, starting with 0 for the first page.
The method cannot be called from event handlers (any IMT*Sink class methods).
Deals
Using the functions, you can request a server database of deals and create new deals. The following functions are available for working with deals:
Function Purpose
DealCreate Create an object of a deal.
DealCreateArray Create an object of the array of deals.
DealRequest Get a deal by a ticket and login.
DealRequestByGroup Receive deals related to a group of accounts.
DealRequestByGroupSymbol Get deals by group and symbol.
DealRequestByLogins Receive deals by the list of logins.
DealRequestByLoginsSymbol Get deals by a list of logins and symbol.
DealRequestByTickets Receive deals by the list of tickets.
DealRequestPage Get client deals with a paged output.
DealAdd Add a deal to the server database.
DealAddBatch Add a batch of deals to the server database.
DealAddBatchArray Add a batch of deals to the server database.
DealUpdate Update a deal.
DealUpdateBatch Update deals in a server database in bulk.
DealUpdateBatchArray Update deals in a server database in bulk.
DealDelete Delete a deal.
DealDeleteBatch Delete deals from the server database in bulk.
DealBackupList Request the dates of backup databases of deals for the specified time range.
DealBackupRequest Request deals from a backup database.
DealBackupRestore Recover a deal from a backup database.
DealPerform Perform a deal on the client's account. This method performs a market buy or sell operation on the account as if it were performed by the
client through the terminal.
DealPerformBatch Perform multiple deals on the client's account. This method performs market buy or sell operations on the account as if they were performed
by the client through the terminal.
DealPerformBatchArray Perform multiple deals on the client's account. This method performs market buy or sell operations on the account as if they were performed
by the client through the terminal.
IMTAdminAPI::DealCreate
Create an object of a deal.
C++
IMTDeal* IMTAdminAPI::DealCreate()
.NET
CIMTDeal CIMTAdminAPI.DealCreate()
Return Value
It returns a pointer to the created object that implements the IMTDeal interface. In case of failure, it returns NULL.
Note
The created object must be deleted by calling the IMTDeal::Release method of this object.
IMTAdminAPI::DealCreateArray
Create an object of the array of deals.
C++
IMTDealArray* IMTAdminAPI::DealCreateArray()
.NET
file:///C:/Users/Administrator/AppData/Local/Temp/~hh4BC4.htm 7/17/2025
Manager API Page 206 of 464
CIMTDealArray CIMTAdminAPI.DealCreateArray()
Return Value
It returns a pointer to the created object that implements the IMTDealArray interface. In case of failure, it returns NULL.
Note
The created object must be deleted by calling the IMTDealArray::Release method of this object.
IMTAdminAPI::DealRequest
Get a deal by a ticket.
C++
MTAPIRES IMTAdminAPI::DealRequest(
const UINT64 ticket, // The ticket of a deal
IMTDeal* deal // An object of a deal
)
.NET
MTRetCode CIMTAdminAPI.DealRequest(
ulong ticket, // The ticket of a deal
CIMTDeal deal // An object of a deal
)
Python
AdminAPI.DealRequest(
ticket # The ticket of a deal
)
Parameters
ticket
[in] The number (ticket) of a deal.
deal
[out] An object of a deal. The deal object must be first created using the IMTAdminAPI::DealCreate method.
Return Value
An indication of successful completion is the MT_RET_OK response code. Otherwise, an error has occurred that corresponds to the response code.
Note
This method copies the data of a deal with the specified ticket to the deal object.
This method cannot be called from event handlers (any methods of IMT*Sink classes).
IMTAdminAPI::DealRequest
Get the deals of a client in the specified date range.
C++
MTAPIRES IMTAdminAPI::DealRequest(
const UINT64 login, // Login
const INT64 from, // Beginning of period
const INT64 to, // End of period
IMTDealArray* deals // An object of the array of deals
)
.NET
MTAPIRES IMTAdminAPI::DealRequest(
ulong login, // Login
long from, // Beginning of period
long to, // End of period
CIMTDealArray deals // An object of the array of deals
)
Python
AdminAPI::DealRequest(
login, # Login
from, # Beginning of period
to # End of period
)
Parameters
login
[in] The login of the client, whose deals you need to get.
from
[in] The beginning of the period for which you need to get deals. The date is specified in seconds that have elapsed since 01.01.1970.
to
[in] The end of the period for which you need to get deals. The date is specified in seconds that have elapsed since 01.01.1970.
deals
[out] An object of the array of deals. The deals object must be first created using the IMTAdminAPI::DealCreateArray method.
Return Value
An indication of successful completion is the MT_RET_OK response code. Otherwise, an error has occurred that corresponds to the response code.
Note
This method cannot be called from event handlers (any methods of IMT*Sink classes).
file:///C:/Users/Administrator/AppData/Local/Temp/~hh4BC4.htm 7/17/2025
Manager API Page 207 of 464
IMTAdminAPI::DealRequestByGroup
Receive deals related to a group of accounts.
C++
MTAPIRES IMTAdminAPI::DealRequestByGroup(
LPCWSTR group, // Group
const INT64 from, // Beginning of the period
const INT64 to, // End of the period
IMTDealArray* deals // Array of deals
)
.NET
MTRetCode CIMTAdminAPI.DealRequestByGroup(
string mask, // Group
long from, // Beginning of the period
long to, // End of the period
CIMTDealArray deals // Array of deals
)
Python
AdminAPI.DealRequestByGroup(
group, # Group
from, # Beginning of the period
to # End of the period
)
AdminAPI.DealRequestByGroupCSV(
group, # Group
from, # Beginning of the period
to, # End of the period
fields # Comma-separated list of required fields
)
AdminAPI.DealRequestByGroupNumPy(
group, # Group
from, # Beginning of the period
to, # End of the period
fields # Comma-separated list of required fields
)
Parameters
group
[in] The groups for which deals are requested. You can specify one group, several groups (comma separated) or a group mask. The mask is specified using "*" (any value) and
"!" (exception). For example: "demo*,!demoforex" - all groups with the names beginning with 'demo', except for the group demoforex.
from
[in] The beginning of the period for which you need to receive deals. The date is specified in seconds which have elapsed since 01.01.1970.
to
[in] The end of the period for which you need to receive deals. The date is specified in seconds which have elapsed since 01.01.1970.
deals
[out] An object of the deals array. The 'deals' object must be first created using IMTAdminAPI::DealCreateArray.
Return Value
An indication of successful completion is the MT_RET_OK response code. Otherwise, an error has occurred, which corresponds to the response code.
Note
The method copies to the 'deals' object data of all deals, which belong to clients in the specified groups and which were executed in the specified time range.
The method cannot be called from event handlers (any IMT*Sink class methods).
IMTAdminAPI::DealRequestByGroupSymbol
Get deals by group and symbol.
C++
MTAPIRES IMTAdminAPI::DealRequestByGroupSymbol(
LPCWSTR group, // group
LPCWSTR symbol, // symbol
const INT64 from, // beginning of period
const INT64 to, // end of period
IMTDealArray* deals // array of deals
)
.NET
MTRetCode CIMTAdminAPI.DealRequestByGroupSymbol(
string mask, // group
string symbol, // symbol
long from, // beginning of period
long to, // end of period
CIMTDealArray deals // array of deals
)
Python
AdminAPI.DealRequestByGroupSymbol(
group, # group
symbol, # symbol
from, # beginning of period
to # end of period
)
file:///C:/Users/Administrator/AppData/Local/Temp/~hh4BC4.htm 7/17/2025
Manager API Page 208 of 464
AdminAPI.DealRequestByGroupSymbolCSV(
group, # group
symbol, # symbol
from, # beginning of period
to, # end of period
fields # comma-separated list of required fields
)
AdminAPI.DealRequestByGroupSymbolNumPy(
group, # group
symbol, # symbol
from, # beginning of period
to, # end of period
fields # comma-separated list of required fields
)
Parameters
group
[in] The groups for which deals are requested. You can specify one group, several groups (comma separated) or a group mask. The mask is specified using characters "*" (any
value) and "!" (exception). For example: "demo*,!demoforex" - all groups whose names begin with 'demo', except for the group demoforex.
symbol
[in] The symbol for which you need to get deals. You can specify multiple symbols separated by commas.
from
[in] The beginning of the period for which you need to get deals. The date is specified in seconds since 01.01.1970.
to
[in] The end of the period for which you need to receive deals. The date is specified in seconds since 01.01.1970.
deals
[out] An object of the deals array. The 'deals' object must be previously created using IMTAdminAPI::DealCreateArray.
Return Value
An indication of successful completion is the MT_RET_OK response code. Otherwise, an error has occurred that corresponds to the response code.
Note
The method cannot be called from event handlers (any IMT*Sink class methods).
IMTAdminAPI::DealRequestByLogins
Receive deals by the list of logins.
C++
MTAPIRES IMTAdminAPI::DealRequestByLogins(
const UINT64* logins, // Logins
const UINT logins_total, // Number of logins
const INT64 from, // Beginning of the period
const INT64 to, // End of the period
IMTDealArray* deals // Array of deals
)
.NET
MTRetCode CIMTAdminAPI.DealRequestByLogins(
ulong[] logins, // Logins
long from, // Beginning of the period
long to, // End of the period
CIMTDealArray deals // Array of deals
)
Python
AdminAPI.DealRequestByLogins(
logins, # Logins
from, # Beginning of the period
to # End of the period
)
AdminAPI.DealRequestByLoginsCSV(
logins, # Logins
from, # Beginning of the period
to, # End of the period
fields # Comma-separated list of required fields
)
AdminAPI.DealRequestByLoginsNumPy(
logins, # Logins
from, # Beginning of the period
to, # End of the period
fields # Comma-separated list of required fields
)
Parameters
logins
[in] Array of client logins.
logins_total
[in] Number of logins in the 'logins' array.
from
[in] The beginning of the period for which you need to receive deals. The date is specified in seconds which have elapsed since 01.01.1970.
to
[in] The end of the period for which you need to receive deals. The date is specified in seconds which have elapsed since 01.01.1970.
deals
[out] An object of the deals array. The 'deals' object must be first created using IMTAdminAPI::DealCreateArray.
Return Value
An indication of successful completion is the MT_RET_OK response code. Otherwise, an error has occurred, which corresponds to the response code.
file:///C:/Users/Administrator/AppData/Local/Temp/~hh4BC4.htm 7/17/2025
Manager API Page 209 of 464
Note
The method copies to the 'deals' object data of all deals, which belong to the specified accounts and which were executed in the specified time range.
The method cannot be called from event handlers (any IMT*Sink class methods).
IMTAdminAPI::DealRequestByLoginsSymbol
Get deals by a list of logins and symbol.
C++
MTAPIRES IMTAdminAPI::DealRequestByLoginsSymbol(
const UINT64* logins, // logins
const UINT logins_total, // number of logins
LPCWSTR symbol, // symbol
const INT64 from, // beginning of period
const INT64 to, // end of period
IMTDealArray* deals // array of deals
)
.NET
MTRetCode CIMTAdminAPI.DealRequestByLoginsSymbol(
ulong[] logins, // logins
string symbol, // symbol
long from, // beginning of period
long to, // end of period
CIMTDealArray deals // array of deals
)
Python
AdminAPI.DealRequestByLoginsSymbol(
logins, # logins
symbol, # symbol
from, # beginning of period
to # end of period
)
AdminAPI.DealRequestByLoginsSymbolCSV(
logins, # logins
symbol, # symbol
from, # beginning of period
to, # end of period
fields # comma-separated list of required fields
)
AdminAPI.DealRequestByLoginsSymbolNumPy(
logins, # logins
symbol, # symbol
from, # beginning of period
to, # end of period
fields # comma-separated list of required fields
)
Parameters
logins
[in] Array of client logins.
logins_total
[in] Number of logins in the 'logins' array.
symbol
[in] The symbol for which you need to get deals. You can specify multiple symbols separated by commas.
from
[in] The beginning of the period for which you need to get deals. The date is specified in seconds since 01.01.1970.
to
[in] The end of the period for which you need to receive deals. The date is specified in seconds since 01.01.1970.
deals
[out] An object of the deals array. The 'deals' object must be previously created using IMTAdminAPI::DealCreateArray.
Return Value
An indication of successful completion is the MT_RET_OK response code. Otherwise, an error has occurred that corresponds to the response code.
Note
The method cannot be called from event handlers (any IMT*Sink class methods).
IMTAdminAPI::DealRequestByTickets
Receive deals by the list of tickets.
C++
MTAPIRES IMTAdminAPI::DealRequestByTickets(
const UINT64* tickets, // Tickets
const UINT tickets_total,// Number of tickets
IMTDealArray* deals // Array of deals
)
.NET
MTRetCode CIMTAdminAPI.DealRequestByTickets(
ulong[] tickets, // Tickets
CIMTDealArray deals // Array of deals
)
Python
file:///C:/Users/Administrator/AppData/Local/Temp/~hh4BC4.htm 7/17/2025
Manager API Page 210 of 464
AdminAPI.DealRequestByTickets(
tickets # Tickets
)
AdminAPI.DealRequestByTicketsCSV(
tickets, # Tickets
fields # Comma-separated list of required fields
)
AdminAPI.DealRequestByTicketsNumPy(
tickets, # Tickets
fields # Comma-separated list of required fields
)
Parameters
tickets
[in] Array of tickets of the deals which you want to receive.
tickets_total
[in] The number of tickets in the 'tickets' array.
deals
[out] An object of the deals array. The 'deals' object must be first created using IMTAdminAPI::DealCreateArray.
Return Value
An indication of successful completion is the MT_RET_OK response code. Otherwise, an error has occurred, which corresponds to the response code.
Note
The method copies deals with the specified tickets into the 'deals' object.
The method cannot be called from event handlers (any IMT*Sink class methods).
IMTAdminAPI::DealRequestPage
Get client deals with a paged output.
C++
MTAPIRES IMTAdminAPI::DealRequestPage(
const UINT64 login, // login
const INT64 from, // beginning of period
const INT64 to, // end of period
const UINT offset, // deal index
const UINT total, // number of deals
IMTDealArray* deals // object of deals array
)
.NET
MTRetCode CIMTAdminAPI.DealRequestPage(
ulong login, // login
long from, // beginning of period
long to, // end of period
uint offset, // deal index
uint total, // number of deals
CIMTDealArray deals // object of deals array
)
Python
AdminAPI.DealRequestPage(
login, # login
from, # beginning of period
to, # end of period
offset, # deal index
total # number of deals
)
AdminAPI.DealRequestPageCSV(
login, # login
from, # beginning of period
to, # end of period
offset, # deal index
total, # number of deals
fields # comma-separated list of required fields
)
AdminAPI.DealRequestPageNumPy(
login, # login
from, # beginning of period
to, # end of period
offset, # deal index
total, # number of deals
fields # comma-separated list of required fields
)
Parameters
login
[in] The login of the client, whose deals you wish to receive.
from
[in] The beginning of the period for which you wish to receive deals. The date is specified in seconds that have elapsed since 01.01.1970.
to
[in] The end of the period for which you wish to receive deals. The date is specified in seconds that have elapsed since 01.01.1970.
offset
[in] The index of the deal starting from which you wish to receive deals. Numbering starts from 0.
total
[in] The number of deals that should be received.
deals
[out] An object of the deals array. The 'deals' object must be previously created using IMTManagerAPI::DealCreateArray.
file:///C:/Users/Administrator/AppData/Local/Temp/~hh4BC4.htm 7/17/2025
Manager API Page 211 of 464
Return Value
An indication of successful completion is the MT_RET_OK response code. Otherwise, an error has occurred that corresponds to the response code.
Note
This request allows to easily arrange a paged output of resulting deals. Determine the number of deals that should be displayed on one page by setting it in the 'total' parameter.
Then find the 'offset' parameter for each page, starting with 0 for the first page.
The method cannot be called from event handlers (any IMT*Sink class methods).
IMTAdminAPI::DealAdd
Add a deal to the server database.
C++
MTAPIRES IMTAdminAPI::DealAdd(
IMTDeal* deal // deal object
)
.NET
MTRetCode CIMTAdminAPI.DealAdd(
CIMTDeal deal // deal object
)
Python
AdminAPI.DealAdd(
deal # deal object
)
Parameters
deal
[in] An object of a deal.
Return Value
An indication of successful completion is the MT_RET_OK response code. Otherwise, an error corresponding to the response code has occurred.
Note
A deal can only be added to the database of the server, to which the application is connected.
The manager account requires the RIGHT_TRADE_MANAGER permission in order to use the function.
Use this method very carefully. The deal is added directly to client's trading history. The addition of a deal does not affect the client's balance and positions. Therefore,
IMTAdminAPI::PositionCheck will show that the client's positions do not match the history of deals. Note that further correction of balance (IMTAdminAPI::UserBalanbceCheck)
and positions (IMTAdminAPI::PositionFix) will require a lot of resources and time, because these methods analyze the entire trading history of the client.
The ticket of the deal you are adding (IMTDeal::DealSet) must fall within the deals range on the trading server (IMTConServerTrade::DealsRange*), and it must be greater than
the last used ticket.
Note that the server allocates new tickets starting from the last used ticket in the range. For example, if you create a deal with a ticket of 5000, the server will allocate tickets
5001, 5002, etc. for further deals (even if tickets before 5000 are not busy).
If a deal is added with a zero ticket, the server will assign the ticket automatically.
The deal being added is checked for integrity. The following fields must be filled in that deal:
• IMTDeal::Login (an account with this login must exist on the server)
• IMTDeal::Symbol
• IMTDeal::Action
• IMTDeal::Volume
• IMTDeal::Price
• IMTDeal::TimeMsc
• IMTDeal::Digits
• IMTDeal::DigitsCurrency
• IMTDeal::ContractSize
IMTAdminAPI::DealAddBatch
Add a batch of deals to the server database.
C++
MTAPIRES IMTAdminAPI::DealAddBatch(
IMTDealArray* deals, // Array of deals
MTAPIRES* results // Array of results
)
.NET
MTRetCode CIMTAdminAPI.DealAddBatch(
CIMTDealArray deals, // Array of deals
MTRetCode[] res // Array of results
)
Python
AdminAPI.DealAddBatch(
deals # Array of deals
)
Parameters
deals
[in] A pointer to the array of deals IMTDealArray.
results
file:///C:/Users/Administrator/AppData/Local/Temp/~hh4BC4.htm 7/17/2025
Manager API Page 212 of 464
[out] An array with the deal addition results. The size of the 'results' array must not be less than the size of the 'deals' array.
Return Value
The MT_RET_OK response code indicates that all deals have been added. The MT_RET_ERR_PARTIAL response code means that only some of the deals have been added. Analyze
the 'results' array for more details on the execution results. This array features the results of adding of each individual deal from the 'deals' array. The result index corresponds to
the deal index in the source array.
Note
Deals can only be added to the database of the server, to which the application is connected.
The manager account requires the RIGHT_TRADE_MANAGER permission in order to use the function.
Use this method very carefully. The deals are added directly to clients' trading histories. The addition of deals does not affect clients' balances and positions. Therefore,
IMTAdminAPI::PositionCheck will show that the clients' positions do not match their history of deals. Note that further correction of balances (IMTAdminAPI::UserBalanbceCheck)
and positions (IMTAdminAPI::PositionFix) will require a lot of resources and time, since these methods analyze clients' entire trading histories.
The tickets of the deals you are adding (IMTDeal::DealSet) must fall within the deals range on the trading server (IMTConServerTrade::DealsRange*), and they must be greater
than the last used ticket.
Note that the server allocates new tickets starting from the last used ticket in the range. For example, if you create a deal with a ticket of 5000, the server will allocate tickets
5001, 5002, etc. for further deals (even if tickets before 5000 are not busy).
If deals are added with zero tickets, the server will assign the tickets automatically.
Deals being added are checked for integrity. The following fields must be filled:
• IMTDeal::Login (an account with this login must exist on the server)
• IMTDeal::Symbol
• IMTDeal::Action
• IMTDeal::Volume
• IMTDeal::Price
• IMTDeal::TimeMsc
• IMTDeal::Digits
• IMTDeal::DigitsCurrency
• IMTDeal::ContractSize
To improve performance, it is recommended to create arrays and perform group operations separately for each trading account.
IMTAdminAPI::DealAddBatchArray
Add a batch of deals to the server database.
C++
MTAPIRES IMTAdminAPI::DealAddBatchArray(
IMTDeal** deals, // Array of deals
const UINT deals_total, // Number of deals in the array
MTAPIRES* results // Array of results
)
.NET
MTRetCode CIMTAdminAPI.DealAddBatchArray(
CIMTDeal[] deals, // Array of deals
MTRetCode[] retcodes // Array of results
)
Parameters
deals
[in] A pointer to the array of deals.
deals_total
[in] The number of deals in the 'deals' array.
results
[out] An array with deal addition results. The size of the 'results' array must not be less than the size of the 'deals' array.
Return Value
The MT_RET_OK response code indicates that all deals have been added. The MT_RET_ERR_PARTIAL response code means that only some of the deals have been added. Analyze
the 'results' array for more details on the execution results. This array features the results of adding of each individual deal from the 'deals' array. The result index corresponds to
the deal index in the source array.
Note
Deals can only be added to the database of the server, to which the application is connected.
The manager account requires the RIGHT_TRADE_MANAGER permission in order to use the function.
Use this method very carefully. Deals are added directly to clients' trading histories. The addition of deals does not affect clients' balances and positions. Therefore,
IMTAdminAPI::PositionCheck will show that the clients' positions do not match their history of deals. Note that further correction of balances (IMTAdminAPI::UserBalanbceCheck)
and positions (IMTAdminAPI::PositionFix) will require a lot of resources and time, since these methods analyze clients' entire trading histories.
The tickets of the deals you are adding (IMTDeal::DealSet) must fall within the deals range on the trading server (IMTConServerTrade::DealsRange*), and they must be greater
than the last used ticket.
Note that the server allocates new tickets starting from the last used ticket in the range. For example, if you create a deal with a ticket of 5000, the server will allocate tickets
5001, 5002, etc. for further deals (even if tickets before 5000 are not busy).
If deals are added with zero tickets, the server will assign the tickets automatically.
Deals being added are checked for integrity. The following fields must be filled:
• IMTDeal::Login (an account with this login must exist on the server)
• IMTDeal::Symbol
• IMTDeal::Action
• IMTDeal::Volume
• IMTDeal::Price
• IMTDeal::TimeMsc
• IMTDeal::Digits
• IMTDeal::DigitsCurrency
• IMTDeal::ContractSize
file:///C:/Users/Administrator/AppData/Local/Temp/~hh4BC4.htm 7/17/2025
Manager API Page 213 of 464
To improve performance, it is recommended to create arrays and perform group operations separately for each trading account.
IMTAdminAPI::DealUpdate
Updates a deal.
C++
MTAPIRES IMTAdminAPI::DealUpdate(
IMTDeal* deal // Deal object
)
.NET
MTRetCode CIMTAdminAPI.DealUpdate(
CIMTDeal deal // Deal object
)
Python
AdminAPI.DealUpdate(
deal # Deal object
)
Parameters
deal
[in] An object of a deal.
Return Value
An indication of successful completion is the MT_RET_OK response code. Otherwise, an error has occurred that corresponds to the response code.
Note
A deal can be updated only from the applications that are connected to the same trade server where the deal was created. For all other applications the response code
MT_RET_ERR_NOTMAIN will be returned. If the object is not found, the response code MT_RET_ERR_NOTFOUND will be returned.
The manager account requires the RIGHT_TRADE_MANAGER permission in order to use the function.
IMTAdminAPI::DealUpdateBatch
Update deals in a server database in bulk.
C++
MTAPIRES IMTAdminAPI::DealUpdateBatch(
IMTDealArray* deals, // Array of deals
MTAPIRES* results // Array of results
)
.NET
MTRetCode CIMTAdminAPI.DealUpdateBatch(
CIMTDealArray deals, // Array of deals
MTRetCode[] res // Array of results
)
Python
AdminAPI.DealUpdateBatch(
deals # Array of deals
)
Parameters
deals
[in] A pointer to the array of deals IMTDealArray.
results
[out] An array with deal update results. The size of the 'results' array must not be less than that of 'deals'.
Return Value
The MT_RET_OK response code indicates that all deals have been updated. The MT_RET_ERR_PARTIAL response code means that only some of the deals have been updated.
Analyze the 'results' array for more details concerning the execution results. The update result of each deal from the 'deals' array is added to 'results'. The result index
corresponds to the deal index in the source array.
Note
A deal can only be updated from the applications connected to the trade server, on which the deals have been created. For all other applications, the response code
MT_RET_ERR_NOTMAIN is returned. If the object is not found, the response code MT_RET_ERR_NOTFOUND is returned.
Make sure to fill in all the required fields of the deals, not only the ones which you want to change. It is recommended that you first receive deals from the server, change the
required fields in them and then send them back to the server.
The server checks the correctness of the updated deals. The following fields must be filled:
• IMTDeal::Login (an account with this login must exist on the server)
• IMTDeal::Symbol
• IMTDeal::Action
• IMTDeal::Volume
• IMTDeal::Price
• IMTDeal::TimeMsc
• IMTDeal::Digits
• IMTDeal::DigitsCurrency
• IMTDeal::ContractSize
To improve performance, it is recommended to create arrays and perform group operations separately for each trading account.
file:///C:/Users/Administrator/AppData/Local/Temp/~hh4BC4.htm 7/17/2025
Manager API Page 214 of 464
IMTAdminAPI::DealUpdateBatchArray
Update deals in a server database in bulk.
C++
MTAPIRES IMTAdminAPI::DealUpdateBatchArray(
IMTDeal** deals, // Array of deals
const UINT deals_total, // Number of deals in the array
MTAPIRES* results // Array of results
)
.NET
MTRetCode CIMTAdminAPI.DealUpdateBatch(
CIMTDeal[] deals, // Array of deals
MTRetCode[] retcodes // Array of results
)
Parameters
deals
[in] A pointer to the array of deals.
deals_total
[in] The number of deals in the 'deals' array.
results
[out] An array with deal update results. The size of the 'results' array must not be less than that of 'deals'.
Return Value
The MT_RET_OK response code indicates that all deals have been updated. The MT_RET_ERR_PARTIAL response code means that only some of the deals have been updated.
Analyze the 'results' array for more details concerning the execution results. The update result of each deal from the 'deals' array is added to 'results'. The result index
corresponds to the deal index in the source array.
Note
A deal can only be updated from the applications connected to the trade server, on which the deals have been created. For all other applications, the response code
MT_RET_ERR_NOTMAIN is returned. If the object is not found, the response code MT_RET_ERR_NOTFOUND is returned.
Make sure to fill in all the required fields of the deals, not only the ones which you want to change. It is recommended that you first receive deals from the server, change the
required fields in them and then send them back to the server.
The server checks the correctness of the updated deals. The following fields must be filled:
• IMTDeal::Login (an account with this login must exist on the server)
• IMTDeal::Symbol
• IMTDeal::Action
• IMTDeal::Volume
• IMTDeal::Price
• IMTDeal::TimeMsc
• IMTDeal::Digits
• IMTDeal::DigitsCurrency
• IMTDeal::ContractSize
To improve performance, it is recommended to create arrays and perform group operations separately for each trading account.
IMTAdminAPI::DealDelete
Deletes a deal.
C++
MTAPIRES IMTAdminAPI::DealDelete(
const UINT64 ticket // The ticket of a deal
)
.NET
MTRetCode CIMTAdminAPI.DealDelete(
ulong ticket // The ticket of a deal
)
Python
AdminAPI.DealDelete(
ticket # The ticket of a deal
)
Parameters
ticket
[in] The number (ticket) of a deal.
Return Value
An indication of successful completion is the MT_RET_OK response code. Otherwise, an error has occurred that corresponds to the response code.
Note
A deal can only be deleted from the applications connected to the trade server, on which the deal has been created. For all other applications the response code
MT_RET_ERR_NOTMAIN will be returned. If the object is not found, the response code MT_RET_ERR_NOTFOUND will be returned.
The manager account requires the RIGHT_TRADE_DELETE and RIGHT_TRADES_MANAGER permissions in order to use the function.
file:///C:/Users/Administrator/AppData/Local/Temp/~hh4BC4.htm 7/17/2025
Manager API Page 215 of 464
IMTAdminAPI::DealDeleteBatch
Delete deals from the server database in bulk.
C++
MTAPIRES IMTAdminAPI::DealDeleteBatch(
const UINT64* tickets, // Array of tickets
const UINT tickets_total, // Number of tickets in the array
MTAPIRES* results // Array of results
)
.NET
MTRetCode CIMTAdminAPI.DealDeleteBatch(
ulong[] tickets, // Deal ticket
MTRetCode[] res // Array of results
)
Python
AdminAPI.DealDeleteBatch(
tickets # Deal ticket
)
Parameters
tickets
[in] A pointer to an array of tickets of the deal which you want to delete.
tickets_total
[in] The number of tickets in the 'tickets' array.
results
[out] The array with the deal deletion results. The size of the 'results' array must not be less than that of 'tickets'.
Return Value
The MT_RET_OK response code means that all the specified deals were deleted. The MT_RET_ERR_PARTIAL response code means that only some of the deals have been deleted.
Analyze the 'results' array for more details concerning the execution results. The result of deletion of each deal from the 'tickets' array is added to 'results'. The result index
corresponds to the ticket index in the source array.
Note
A deal can only be deleted from the applications connected to the trade server, on which the deals have been created. For all other applications, the response code
MT_RET_ERR_NOTMAIN is returned. If the object is not found, the response code MT_RET_ERR_NOTFOUND is returned.
Please note that deletion of deals does not affect the client's balance and current positions. Therefore, IMTAdmin::PositionCheck and IMTManagerAPI::UserBalanbceCheckwill
show that the client's positions and balance do not match the relevant deals history.
Bulk deletion is executed faster than deletion of the same number of deals in a cycle one by one, using IMTManagerAPI::DealDelete. The acceleration can be especially noticeable
when deleting deals belonging to one account.
To improve performance, it is recommended to create arrays and perform group operations separately for each trading account.
IMTAdminAPI::DealBackupList
Request the dates of backup databases of deals for the specified time range.
C++
MTAPIRES IMTAdminAPI::DealBackupList(
const INT64 from, // Beginning of period
const INT64 to, // End of period
INT64*& backups, // An array of dates of backups
UINT& backups_total // The number of dates of backups
)
.NET
long[] CIMTAdminAPI.DealBackupList(
long from, // Beginning of period
long to, // End of period
out MTRetCode res // Response code
)
Python
AdminAPI.DealBackupList(
from, # Beginning of period
to # End of period
)
Parameters
from
[in] The beginning of the period for which you need to get the list of backup copies. The date is specified in seconds that have elapsed since 01.01.1970.
to
[in] The end of the period for which you need to get the list of backup copies. The date is specified in seconds that have elapsed since 01.01.1970.
backups
[out] An array of backup creation dates.
backups_total
[out] The number of received dates of backups.
Return Value
An indication of successful completion is the MT_RET_OK response code. Otherwise, an error code will be returned.
Note
After using, the backups array must be released using the IMTAdminAPI::Free method.
IMTAdminAPI::DealBackupList
Request the dates of backup databases of deals for the specified time range from the specified server.
file:///C:/Users/Administrator/AppData/Local/Temp/~hh4BC4.htm 7/17/2025
Manager API Page 216 of 464
C++
MTAPIRES IMTAdminAPI::DealBackupList(
const UINT64 server, // Server ID
const INT64 from, // Beginning of period
const INT64 to, // End of period
INT64*& backups, // An array of dates of backups
UINT& backups_total // The number of dates of backups
)
.NET
long[] CIMTAdminAPI.DealBackupList(
ulong server, // Server ID
long from, // Beginning of period
long to, // End of period
out MTRetCode res // Response code
)
Python
AdminAPI.DealBackupList(
server, # Server ID
from, # Beginning of period
to # End of period
)
Parameters
server
[in] The identifier of the server from which the information should be requested.
from
[in] The beginning of the period for which you need to get the list of backup copies. The date is specified in seconds that have elapsed since 01.01.1970.
to
[in] The end of the period for which you need to get the list of backup copies. The date is specified in seconds that have elapsed since 01.01.1970.
backups
[out] An array of backup creation dates.
backups_total
[out] The number of received dates of backups.
Return Value
An indication of successful completion is the MT_RET_OK response code. Otherwise, an error code will be returned.
Note
After using, the backups array must be released using the IMTAdminAPI::Free method.
IMTAdminAPI::DealBackupRequest
Request a deal from a backup database.
C++
MTAPIRES IMTAdminAPI::DealBackupRequest(
const INT64 backup, // Backup date
const UINT64 ticket, // Deal number
IMTDeal* deal // An object of a deal
)
.NET
MTRetCode CIMTAdminAPI.DealBackupRequest(
long backup, // Backup date
ulong ticket, // Deal number
CIMTDeal deal // An object of a deal
)
Python
AdminAPI.DealBackupRequest(
backup, # Backup date
ticket # Deal number
)
Parameters
backup
[in] The date of creation of the backup to which the requested deal belongs. The date is specified in seconds that have elapsed since 01.01.1970. Dates of backups can be
obtained using the IMTAdminAPI::DealBackupList method.
ticket
[in] Deal number.
deal
[out] An object of a deal. The deal object must be first created using the IMTAdminAPI::DealCreate method.
Return Value
An indication of successful completion is the MT_RET_OK response code. Otherwise, an error code will be returned.
Note
This method cannot be called from event handlers (any methods of IMT*Sink classes).
IMTAdminAPI::DealBackupRequest
Request an array of deals from a backup database.
C++
file:///C:/Users/Administrator/AppData/Local/Temp/~hh4BC4.htm 7/17/2025
Manager API Page 217 of 464
MTAPIRES IMTAdminAPI::DealBackupRequest(
const INT64 backup, // Backup date
const UINT64 login, // Login
const INT64 from, // Beginning of period
const INT64 to, // End of period
IMTDealArray* deals // An object of the array of deals
)
.NET
MTRetCode CIMTAdminAPI.DealBackupRequest(
long backup, // Backup date
ulong login, // Login
long from, // Beginning of period
long to, // End of period
CIMTDealArray deals // An object of the array of deals
)
Python
AdminAPI.DealBackupRequest(
backup, # Backup date
login, # Login
from, # Beginning of period
to # End of period
)
Parameters
backup
[in] The date of creation of the backup to which the requested deal belongs. The date is specified in seconds that have elapsed since 01.01.1970. Dates of backups can be
obtained using the IMTAdminAPI::DealBackupList method.
login
[in] The login of a user whose deals we want to obtain.
from
[in] The beginning of the period for which you need to get deals. The date is specified in seconds that have elapsed since 01.01.1970.
to
[in] The end of the period for which you need to get deals. The date is specified in seconds that have elapsed since 01.01.1970.
deals
[out] An object of the array of deals. The deals object must be first created using the IMTAdminAPI::DealCreateArray method.
Return Value
An indication of successful completion is the MT_RET_OK response code. Otherwise, an error code will be returned.
Note
This method cannot be called from event handlers (any methods of IMT*Sink classes).
IMTAdminAPI::DealBackupRequest
Request a deal from a backup database from the specified server.
C++
MTAPIRES IMTAdminAPI::DealBackupRequest(
const UINT64 server, // Server ID
const INT64 backup, // Backup date
const UINT64 ticket, // Deal number
IMTDeal* deal // An object of a deal
)
.NET
MTRetCode CIMTAdminAPI.DealBackupRequest(
ulong server, // Server ID
long backup, // Backup date
ulong ticket, // Deal number
CIMTDeal deal // An object of a deal
)
Python
AdminAPI.DealBackupRequest(
server, # Server ID
backup, # Backup date
ticket # Deal number
)
Parameters
server
[in] The identifier of the server from which the information should be requested.
backup
[in] The date of creation of the backup to which the requested deal belongs. The date is specified in seconds that have elapsed since 01.01.1970. Dates of backups can be
obtained using the IMTAdminAPI::DealBackupList method.
ticket
[in] Deal number.
deal
[out] An object of a deal. The deal object must be first created using the IMTAdminAPI::DealCreate method.
Return Value
An indication of successful completion is the MT_RET_OK response code. Otherwise, an error code will be returned.
Note
This method cannot be called from event handlers (any methods of IMT*Sink classes).
IMTAdminAPI::DealBackupRequest
Request an array of deals from a backup database from the specified server.
C++
file:///C:/Users/Administrator/AppData/Local/Temp/~hh4BC4.htm 7/17/2025
Manager API Page 218 of 464
MTAPIRES IMTAdminAPI::DealBackupRequest(
const UINT64 server, // Server ID
const INT64 backup, // Backup date
const UINT64 login, // Login
const INT64 from, // Beginning of period
const INT64 to, // End of period
IMTDealArray* deals // An object of the array of deals
)
.NET
MTRetCode CIMTAdminAPI.DealBackupRequest(
ulong server, // Server ID
long backup, // Backup date
ulong login, // Login
long from, // Beginning of period
long to, // End of period
CIMTDealArray deals // An object of the array of deals
)
Python
AdminAPI.DealBackupRequest(
server, # Server ID
backup, # Backup date
login, # Login
from, # Beginning of period
to # End of period
)
Parameters
server
[in] The identifier of the server from which the information should be requested.
backup
[in] The date of creation of the backup to which the requested deal belongs. The date is specified in seconds that have elapsed since 01.01.1970. Dates of backups can be
obtained using the IMTAdminAPI::DealBackupList method.
login
[in] The login of a user whose deals we want to obtain.
from
[in] The beginning of the period for which you need to get deals. The date is specified in seconds that have elapsed since 01.01.1970.
to
[in] The end of the period for which you need to get deals. The date is specified in seconds that have elapsed since 01.01.1970.
deals
[out] An object of the array of deals. The deals object must be first created using the IMTAdminAPI::DealCreateArray method.
Return Value
An indication of successful completion is the MT_RET_OK response code. Otherwise, an error code will be returned.
Note
This method cannot be called from event handlers (any methods of IMT*Sink classes).
IMTAdminAPI::DealBackupRestore
Recover a deal from a backup database.
C++
MTAPIRES IMTAdminAPI::DealBackupRestore(
IMTDeal* deal // A deal to recover
)
.NET
MTRetCode CIMTAdminAPI.DealBackupRestore(
CIMTDeal deal // A deal to recover
)
Python
AdminAPI.DealBackupRestore(
MTDeal deal # A deal to recover
)
Parameters
deal
[in] An object of the deal to recover.
Return Value
An indication of successful completion is the MT_RET_OK response code. Otherwise, an error code will be returned.
Note
Recovered deals are not deleted from the backup copy.
IMTAdminAPI::DealPerform
Perform a deal on the client's account. This method performs a market buy or sell operation on the account as if it were performed by the client through the terminal. The only
difference is that no trade request and no order is created to perform the deal, and thus routing rules are not applied to the operation. In all other respects, the behavior is the
same: the deal execution result is applied to the position and the account trading state; commission is calculated and charged for the deal in accordance with the relevant account
group settings.
file:///C:/Users/Administrator/AppData/Local/Temp/~hh4BC4.htm 7/17/2025
Manager API Page 219 of 464
C++
MTAPIRES IMTAdminAPI::DealPerform(
IMTDeal* deal // deal object
)
.NET
MTRetCode CIMTAdminAPI.DealPerform(
CIMTDeal deal // deal object
)
Python
AdminAPI.DealPerform(
deal # deal object
)
Parameters
deal
[in/out] Deal object. The deal object must be first created using the IMTAdminAPI::DealCreate method.
Return Value
The MT_RET_OK response code means that the deals has been successfully performed. The object of the performed deal from the server database is added to the 'deal' array. If
the deal could not be performed, the method will return the relevant error code.
Note
A deal can only be performed on the account that is opened on the same server to which the application is connected.
The ticket of the deal you are performing (IMTDeal::DealSet) must fall within the deals range on the trading server (IMTConServerTrade::DealsRange*), and it must be greater
than the last used ticket.
Note that the server allocates new tickets starting from the last used ticket in the range. For example, if you create a deal with a ticket of 5000, the server will allocate tickets
5001, 5002, etc. for further deals (even if tickets before 5000 are not busy).
If no ticket is specified in the deal, the server will assign the ticket automatically.
If to execution time (IMTDeal::Time or IMTDeal::TimeMsc) is specified in the deal, the server will automatically assign the current time.
The deal is checked for integrity during the operation execution. The following fields must be filled in that deal:
• IMTDeal::Login
• IMTDeal::Symbol
• IMTDeal::Action (only IMTDeal::DEAL_BUY and IMTDeal::DEAL_SELL values are allowed)
• IMTDeal::Volume
• IMTDeal::Price
• IMTDeal::PositionID (when closing a position on a hedging account)
You can additionally specify individual margin (IMTDeal::RateMargin) and profit (IMTDeal::RateProfit) recalculation rates in the deal. If not specified, calculated rates will be used.
If commission (IMTDeal::Commission) is specified in the deal, it will be applied to the client account. However, it does not replace the commission charged in accordance with the
trader's group settings (IMTConGroup::Commission*). Therefore, the commission specified in the deal is summed up with the calculated commission.
The deal profit is always calculated by the server even if you specify it in the IMTDeal::Profit field. If necessary, the server charges the deal commission automatically (in
accordance with the commission settings).
It is not recommended to call the IMTAdminAPI::DealPerform method from the IMTDealSink::OnDealAdd, IMTDealSink::OnDealUpdate and IMTDealSink::OnDealPerform handlers.
An example of closing positions (even if trading is disabled for an instrument)
file:///C:/Users/Administrator/AppData/Local/Temp/~hh4BC4.htm 7/17/2025
Manager API Page 220 of 464
//+------------------------------------------------------------------+
//| Close client's all positions at the current price |
//+------------------------------------------------------------------+
MTAPIRES CPluginInstance::CloseAll(UINT64 login)
{
IMTPositionArray* positions={0};
IMTDeal* deal_tmp ={0};
IMTPosition* pos_tmp={0};
MTAPIRES res;
//--- check
if(m_api)
{
positions=m_api->PositionCreateArray();
deal_tmp=m_api->DealCreate();
pos_tmp=m_api->PositionCreate();
}
else return(MT_RET_ERR_PARAMS);
//--- get positions
if(res=m_api->PositionGet(login, positions)!=MT_RET_OK)
{
m_api->LoggerOut(MTLogOK, L"PositionGet failed [%d]", res);
return(MT_RET_ERR_PARAMS);
}
else
{
m_api->LoggerOut(MTLogOK, L"client '%I64u' has %d positions, try to close them", login, positions->Total());
//---
for(UINT index=0;index<positions->Total();index++)
{
pos_tmp=positions->Next(index);
if(pos_tmp)
{
//--- fill the deal object
deal_tmp->Login(pos_tmp->Login());
deal_tmp->Symbol(pos_tmp->Symbol());
//--- set the direction of the closing deal depending on the position direction
if(pos_tmp->Action() == IMTPosition::POSITION_BUY)
deal_tmp->Action(IMTDeal::DEAL_SELL);
else
deal_tmp->Action(IMTDeal::DEAL_BUY);
//--- fill other deal parameters
deal_tmp->Volume(pos_tmp->Volume());
deal_tmp->Price(pos_tmp->PriceCurrent());
deal_tmp->PositionID(pos_tmp->Position()); // only filled for hedging accounts
//--- close the position
if(res=m_api->DealPerform(deal_tmp)!=MT_RET_OK)
m_api->LoggerOut(MTLogOK, L"DealPerform failed [%d]", res);
}
}
}
//--- clear the objects
if(positions)
positions->Release();
//--- clear the objects
if(pos_tmp)
pos_tmp->Release();
//--- clear the objects
if(deal_tmp)
deal_tmp->Release();
}
//+------------------------------------------------------------------+
IMTAdminAPI::DealPerformBatch
Perform multiple deals on the client's account. This method performs market buy or sell operations on the account as if they were performed by the client through the terminal.
The only difference is that trade requests and orders are not created to perform the deals, and thus routing rules are not applied to the operations. In all other respects, the
behavior the same: deal execution results are applied to positions and to the account trading state; commissions are calculated and charged for the deals in accordance with the
relevant account group settings.
C++
MTAPIRES IMTAdminAPI::DealPerformBatch(
IMTDealArray* deals, // Array of deals
MTAPIRES* results // Array of results
)
.NET
MTRetCode CIMTAdminAPI.DealPerformBatch(
CIMTDealArray deals, // Array of deals
MTRetCode[] res // Array of results
)
Python
AdminAPI.DealPerformBatch(
deals # Array of deals
)
Parameters
deals
[in] A pointer to the array of deals IMTDealArray.
results
[out] An array with deal execution results. The size of the 'results' array must not be less than the size of the 'deals' array.
Return Value
The MT_RET_OK response code indicates that all the specified deals have been executed. The MT_RET_ERR_PARTIAL response code means that only some of the deals have been
executed. Analyze the 'results' array for more details on the execution results. This array features the results of execution of each individual deal from the 'deals' array. The
result index corresponds to the deal index in the source array.
Note
Deals can only be performed on the account that is opened on the same server to which the application is connected.
The tickets of the deals you are performing (IMTDeal::DealSet) must fall within the deals range on the trading server (IMTConServerTrade::DealsRange*), and they must be
greater than the last used ticket.
file:///C:/Users/Administrator/AppData/Local/Temp/~hh4BC4.htm 7/17/2025
Manager API Page 221 of 464
Note that the server allocates new tickets starting from the last used ticket in the range. For example, if you create a deal with a ticket of 5000, the server will allocate tickets
5001, 5002, etc. for further deals (even if tickets before 5000 are not busy).
If no ticket is specified in the deal, the server will assign the ticket automatically.
If to execution time (IMTDeal::Time or IMTDeal::TimeMsc) is specified in the deal, the server will automatically assign the current time.
The deal is checked for integrity during the operation execution. The following fields must be filled in that deal:
• IMTDeal::Login
• IMTDeal::Symbol
• IMTDeal::Action (only IMTDeal::DEAL_BUY and IMTDeal::DEAL_SELL values are allowed)
• IMTDeal::Volume
• IMTDeal::Price
• IMTDeal::PositionID (when closing a position on a hedging account)
You can additionally specify individual margin (IMTDeal::RateMargin) and profit (IMTDeal::RateProfit) recalculation rates in the deal. If not specified, calculated rates will be used.
If commission (IMTDeal::Commission) is specified in the deal, it will be applied to the client account. However, it does not replace the commission charged in accordance with the
trader's group settings (IMTConGroup::Commission*). Therefore, the commission specified in the deal is summed up with the calculated commission.
The deal profit is always calculated by the server even if you specify it in the IMTDeal::Profit field. If necessary, the server charges the deal commission automatically (in
accordance with the commission settings).
It is not recommended to call the IMTAdminAPI::DealPerformBatch method from the IMTDealSink::OnDealAdd, IMTDealSink::OnDealUpdate and IMTDealSink::OnDealPerform
handlers.
IMTAdminAPI::DealPerformBatchArray
Perform multiple deals on the client's account. This method performs market buy or sell operations on the account as if they were performed by the client through the terminal.
The only difference is that trade requests and orders are not created to perform the deals, and thus routing rules are not applied to the operations. In all other respects, the
behavior the same: deal execution results are applied to positions and to the account trading state; commissions are calculated and charged for the deals in accordance with the
relevant account group settings.
C++
MTAPIRES IMTAdminAPI::DealPerformBatchArray(
IMTDeal** deals, // Array of deals
const UINT deals_total, // Number of deals in the array
MTAPIRES* results // Array of results
)
.NET
MTRetCode CIMTAdminAPI.DealPerformBatchArray(
CIMTDealArray deals, // Array of deals
MTRetCode[] res // Array of results
)
Parameters
deals
[in] A pointer to the array of deals.
deals_total
[in] The number of deals in the 'deals' array.
results
[out] An array with deal update results. The size of the 'results' array must not be less than the size of the 'deals' array.
Return Value
The MT_RET_OK response code indicates that all the specified deals have been executed. The MT_RET_ERR_PARTIAL response code means that only some of the deals have been
executed. Analyze the 'results' array for more details on the execution results. This array features the results of execution of each individual deal from the 'deals' array. The
result index corresponds to the deal index in the source array.
Note
Deals can only be performed on the account that is opened on the same server to which the application is connected.
The tickets of the deals you are performing (IMTDeal::DealSet) must fall within the deals range on the trading server (IMTConServerTrade::DealsRange*), and they must be
greater than the last used ticket.
Note that the server allocates new tickets starting from the last used ticket in the range. For example, if you create a deal with a ticket of 5000, the server will allocate tickets
5001, 5002, etc. for further deals (even if tickets before 5000 are not busy).
If no ticket is specified in the deal, the server will assign the ticket automatically.
If to execution time (IMTDeal::Time or IMTDeal::TimeMsc) is specified in the deal, the server will automatically assign the current time.
The deal is checked for integrity during the operation execution. The following fields must be filled in that deal:
• IMTDeal::Login
• IMTDeal::Symbol
• IMTDeal::Action (only IMTDeal::DEAL_BUY and IMTDeal::DEAL_SELL values are allowed)
• IMTDeal::Volume
• IMTDeal::Price
• IMTDeal::PositionID (when closing a position on a hedging account)
You can additionally specify individual margin (IMTDeal::RateMargin) and profit (IMTDeal::RateProfit) recalculation rates in the deal. If not specified, calculated rates will be used.
If commission (IMTDeal::Commission) is specified in the deal, it will be applied to the client account. However, it does not replace the commission charged in accordance with the
trader's group settings (IMTConGroup::Commission*). Therefore, the commission specified in the deal is summed up with the calculated commission.
The deal profit is always calculated by the server even if you specify it in the IMTDeal::Profit field. If necessary, the server charges the deal commission automatically (in
accordance with the commission settings).
It is not recommended to call the IMTAdminAPI::DealPerformBatchArray method from the IMTDealSink::OnDealAdd, IMTDealSink::OnDealUpdate and IMTDealSink::OnDealPerform
handlers.
Positions
Using the functions, you can request a database of trade positions of the server and create new orders. The following functions are available for this purpose:
file:///C:/Users/Administrator/AppData/Local/Temp/~hh4BC4.htm 7/17/2025
Manager API Page 222 of 464
Function Purpose
PositionCreate Create an object of a trade position.
PositionCreateArray Create an object of the array of trade positions.
PositionRequest Request from the server open positions by login.
PositionRequestByGroup Request from the server open positions related to a client group.
PositionRequestByGroupSymbol Request open positions from the server by group and symbol.
PositionRequestByLogins Request from the server open positions by the list of logins.
PositionRequestByLoginsSymbol Request open positions from the server by list of logins and symbol.
PositionRequestByTickets Request from the server open positions by the list of tickets.
PositionUpdate Update a position.
PositionUpdateBatch Update positions in a server database in bulk.
PositionUpdateBatchArray Update positions in a server database in bulk.
PositionDelete Delete a position.
PositionDeleteByTicket Delete a position by ticket.
PositionDeleteBatch Delete positions from the server database in bulk.
PositionBackupList Request the dates of backup databases of positions for the specified time range.
PositionBackupRequest Request an array of positions from a backup database.
PositionBackupRestore Restore a position from a backup database.
PositionCheck Check the correctness of a client's positions based on the history of deals.
PositionFix Correct a client's positions based on the history of his deals.
PositionSplit Split trading positions.
IMTAdminAPI::PositionCreate
Create an object of a trade position.
C++
IMTPosition* IMTAdminAPI::PositionCreate()
.NET
CIMTPosition CIMTAdminAPI.PositionCreate()
Return Value
It returns a pointer to the created object that implements the IMTPosition interface. In case of failure, it returns NULL.
Note
The created object must be deleted by calling the IMTPosition::Release method of this object.
IMTAdminAPI::PositionCreateArray
Create an object of the array of trade positions.
C++
IMTPositionArray* IMTAdminAPI::PositionCreateArray()
.NET
CIMTPositionArray CIMTAdminAPI.PositionCreateArray()
Return Value
It returns a pointer to the created object that implements the IMTPositionArray interface. In case of failure, it returns NULL.
Note
The created object must be deleted by calling the IMTAdminAPI::Release method of this object.
IMTAdminAPI::PositionRequest
Request from the server open positions by login.
C++
MTAPIRES IMTAdminAPI::PositionRequest(
const UINT64 login, // User's login
IMTPositionArray* positions // An object of the array of positions
)
.NET
file:///C:/Users/Administrator/AppData/Local/Temp/~hh4BC4.htm 7/17/2025
Manager API Page 223 of 464
MTRetCode CIMTAdminAPI.PositionRequest(
ulong login, // User's login
CIMTPositionArray positions // An object of the array of positions
)
Python
AdminAPI.PositionRequest(
int login # User's login
)
Parameters
login
[in] The login of a user.
positions
[out] An object of the array of trade positions. The position object must be first created using the IMTAdminAPI::PositionCreateArray method.
Return Value
An indication of successful completion is the MT_RET_OK response code. Otherwise, an error code will be returned.
Note
This method copies the array of positions of a client with the specified login to the position object.
IMTAdminAPI::PositionRequestByGroup
Request from the server open positions related to a client group.
C++
MTAPIRES IMTAdminAPI::PositionRequestByGroup(
LPCWSTR group, // Group
IMTPositionArray* positions // An object of positions array
)
.NET
MTRetCode CIMTAdminAPI.PositionRequestByGroup(
string mask, // Group
CIMTPositionArray positions // An object of positions array
)
Python
AdminAPI.PositionRequestByGroup(
group # Group
)
AdminAPI.PositionRequestByGroupCSV(
group, # Group
fields # comma-separated list of required fields
)
AdminAPI.PositionRequestByGroupNumPy(
group, # Group
fields # comma-separated list of required fields
)
Parameters
group
[in] The groups the positions are requested for. You can specify one group, several groups (comma separated) or a group mask. The mask is specified using "*" (any value) and
"!" (exception). For example: "demo*,!demoforex" - all groups with the names beginning with 'demo', except for the group demoforex. The maximum length of the string is 127
characters.
positions
[out] An object of the array of trade positions. The 'positions' object must be first created using IMTAdminAPI::PositionCreateArray.
Return Value
An indication of successful completion is the MT_RET_OK response code. Otherwise, an error code will be returned.
Note
The method copies to the 'positions' object the data of all open positions belonging to clients in the specified groups.
The method cannot be called from event handlers (any IMT*Sink class methods).
IMTAdminAPI::PositionRequestByGroupSymbol
Request open positions from the server by group and symbol.
C++
MTAPIRES IMTAdminAPI::PositionRequestByGroupSymbol(
LPCWSTR group, // group
LPCWSTR symbol, // symbol
IMTPositionArray* positions // object of positions array
)
.NET
MTRetCode CIMTAdminAPI.PositionRequestByGroupSymbol(
string mask, // group
string symbol, // symbol
CIMTPositionArray positions // object of positions array
)
file:///C:/Users/Administrator/AppData/Local/Temp/~hh4BC4.htm 7/17/2025
Manager API Page 224 of 464
Python
AdminAPI.PositionRequestByGroupSymbol(
group, # group
symbol # symbol
)
AdminAPI.PositionRequestByGroupSymbolCSV(
group, # group
symbol, # symbol
fields # comma-separated list of required fields
)
AdminAPI.PositionRequestByGroupSymbolNumPy(
group, # group
symbol, # symbol
fields # comma-separated list of required fields
)
Parameters
group
[in] The groups for which the positions are requested. You can specify one group, several groups (comma separated) or a group mask. The mask is specified using characters
"*" (any value) and "!" (exception). For example: "demo*,!demoforex" - all groups whose names begin with 'demo', except for the group demoforex.
symbol
[in] The symbol, for which you need to get positions. You can specify multiple symbols separated by commas.
positions
[out] An object of the array of trade positions. The 'positions' object must be first created using IMTAdminAPI::PositionCreateArray.
Return Value
An indication of successful completion is the MT_RET_OK response code. Otherwise, an error code will be returned.
Note
The method cannot be called from event handlers (any IMT*Sink class methods).
IMTAdminAPI::PositionRequestByLogins
Request from the server open positions by the list of logins.
C++
MTAPIRES IMTAdminAPI::PositionRequestByLogins(
const UINT64* logins, // Logins
const UINT logins_total, // Number of logins
IMTPositionArray* positions // An object of positions array
)
.NET
MTRetCode CIMTAdminAPI.PositionRequestByLogins(
ulong[] logins, // Logins
CIMTPositionArray positions // An object of positions array
)
Python
AdminAPI.PositionRequestByLogins(
logins # Logins
)
AdminAPI.PositionRequestByLoginsCSV(
logins, # Logins
fields # comma-separated list of required fields
)
AdminAPI.PositionRequestByLoginsNumPy(
logins, # Logins
fields # comma-separated list of required fields
)
Parameters
logins
[in] Array of client logins.
logins_total
[in] Number of logins in the 'logins' array.
positions
[out] An object of positions array. Positions object must be first created using IMTAdminAPI::PositionCreateArray.
Return Value
An indication of successful completion is the MT_RET_OK response code. Otherwise, an error code will be returned.
Note
The method copies to the 'positions' object the data of all open positions belonging to the specified accounts.
The method cannot be called from event handlers (any IMT*Sink class methods).
IMTAdminAPI::PositionRequestByLoginsSymbol
Request open positions from the server by list of logins and symbol.
C++
file:///C:/Users/Administrator/AppData/Local/Temp/~hh4BC4.htm 7/17/2025
Manager API Page 225 of 464
MTAPIRES IMTAdminAPI::PositionRequestByLoginsSymbol(
const UINT64* logins, // logins
const UINT logins_total, // number of logins
LPCWSTR symbol, // symbol
IMTPositionArray* positions // object of positions array
)
.NET
MTRetCode CIMTAdminAPI.PositionRequestByLoginsSymbol(
ulong[] logins, // logins
string symbol, // symbol
CIMTPositionArray positions // object of positions array
)
Python
AdminAPI.PositionRequestByLoginsSymbol(
logins, # logins
symbol # symbol
)
AdminAPI.PositionRequestByLoginsSymbolCSV(
logins, # logins
symbol, # symbol
fields # comma-separated list of required fields
)
AdminAPI.PositionRequestByLoginsSymbolNumPy(
logins, # logins
symbol, # symbol
fields # comma-separated list of required fields
)
Parameters
logins
[in] Array of client logins.
logins_total
[in] Number of logins in the 'logins' array.
symbol
[in] The symbol, for which you need to get positions. You can specify multiple symbols separated by commas.
positions
[out] An object of positions array. Positions object must be first created using IMTAdminAPI::PositionCreateArray.
Return Value
An indication of successful completion is the MT_RET_OK response code. Otherwise, an error code will be returned.
Note
The method cannot be called from event handlers (any IMT*Sink class methods).
IMTAdminAPI::PositionRequestByTickets
Request from the server open positions by the list of tickets.
C++
MTAPIRES IMTAdminAPI::PositionRequestByTickets(
const UINT64* tickets, // Tickets
const UINT tickets_total,// Number of tickets
IMTPositionArray* positions // An array of positions
)
.NET
MTRetCode CIMTAdminAPI.PositionRequestByTickets(
ulong[] tickets, // Tickets
CIMTPositionArray positions // An array of positions
)
Python
AdminAPI.PositionRequestByTickets(
tickets # Tickets
)
AdminAPI.PositionRequestByTicketsCSV(
tickets, # Tickets
fields # Comma-separated list of required fields
)
AdminAPI.PositionRequestByTicketsNumPy(
tickets, # Tickets
fields # Comma-separated list of required fields
)
Parameters
tickets
[in] List of position tickets.
tickets_total
[in] The number of tickets in the 'tickets' array.
positions
[out] An object of positions array. Positions object must be first created using IMTAdminAPI::PositionCreateArray.
Return Value
An indication of successful completion is the MT_RET_OK response code. Otherwise, an error code will be returned.
Note
file:///C:/Users/Administrator/AppData/Local/Temp/~hh4BC4.htm 7/17/2025
Manager API Page 226 of 464
This method copies data of positions with the specified tickets to the 'positions' object.
The method cannot be called from event handlers (any IMT*Sink class methods).
IMTAdminAPI::PositionUpdate
Update a position.
C++
MTAPIRES IMTAdminAPI::PositionUpdate(
IMTPosition* position // Position object
)
.NET
MTRetCode CIMTAdminAPI.PositionUpdate(
CIMTPosition position // Position object
)
Python
AdminAPI.PositionUpdate(
position # Position object
)
Parameters
position
[in] An object of a trade position.
Return Value
An indication of successful completion is the MT_RET_OK response code. Otherwise, an error code is returned.
Note
A position can only be updated from the applications connected to the trade server, on which the position has been created. For all other applications the response code
MT_RET_ERR_NOTMAIN will be returned. If the object is not found, the response code MT_RET_ERR_NOTFOUND will be returned.
The manager account requires the RIGHT_TRADE_MANAGER permission in order to use the function.
Make sure to fill in all the required fields of the positions, not only the ones which you want to change. It is recommended that you first receive positions from the server, edit
the required fields in them, and then send them back to the server. However, please note that while you are working with the position in the API, the position price may change
on the server, and the previously received IMTPosition::PriceCurrent value may no longer be valid. If you send the value back as is, a price jump can be observed on the client
side: an outdated value will be set for positions, and the price will be updated to the relevant one at the next tick. To avoid such price jumps, retrieve the current symbol price
just before sending position changes to the server, and place it in IMTPosition::PriceCurrent.
IMTAdminAPI::PositionUpdateBatch
Update positions in a server database in bulk.
C++
MTAPIRES IMTAdminAPI::PositionUpdateBatch(
IMTPositionArray* position, // Array of positions
MTAPIRES* results // Array of results
)
.NET
MTRetCode CIMTAdminAPI.PositionUpdateBatch(
CIMTPositionArray positions, // Array of positions
MTRetCode[] res // Array of results
)
Python
AdminAPI.PositionUpdateBatch(
positions # Array of positions
)
Parameters
positions
[in] A pointer to the object of the positions array IMTPositionArray.
results
[out] An array with position update results. The size of the 'results' array must not be less than that of 'positions'.
Return Value
The MT_RET_OK response code indicates that all positions have been updated. The MT_RET_ERR_PARTIAL response code means that only some of the positions have been
updated. Analyze the 'results' array for more details concerning the execution results. The result of update of each position from the 'positions' array is added to 'results'. The
index of a result corresponds to the index of a position in the source array.
Note
Positions can only be updated from the applications connected to the trade server, on which the positions have been created. For all other applications, the response code
MT_RET_ERR_NOTMAIN is returned. If the object is not found, the response code MT_RET_ERR_NOTFOUND is returned.
Make sure to fill in all the required fields of the positions, not only the ones which you want to change. It is recommended that you first receive positions from the server, edit
the required fields in them, and then send them back to the server. However, please note that while you are working with the position in the API, the position price may change
on the server, and the previously received IMTPosition::PriceCurrent value may no longer be valid. If you send the value back as is, a price jump can be observed on the client
side: an outdated value will be set for positions, and the price will be updated to the relevant one at the next tick. To avoid such price jumps, retrieve the current symbol price
just before sending position changes to the server, and place it in IMTPosition::PriceCurrent.
The server checks the correctness of the updated positions. The following fields must be filled:
• IMTPosition::Login (an account with this login must exist on the server)
• IMTPosition::Symbol
file:///C:/Users/Administrator/AppData/Local/Temp/~hh4BC4.htm 7/17/2025
Manager API Page 227 of 464
• IMTPosition::Action
• IMTPosition::Volume or IMTPosition::VolumeExt
• IMTPosition::PriceOpen
• IMTPosition::Digits
• IMTPosition::DigitsCurrency
• IMTPosition::ContractSize
• IMTPosition::TimeCreate
• IMTPosition::RateMargin
To improve performance, it is recommended to create arrays and perform group operations separately for each trading account.
IMTAdminAPI::PositionUpdateBatchArray
Update positions in a server database in bulk.
C++
MTAPIRES IMTAdminAPI::PositionUpdateBatchArray(
IMTPosition** positions, // An array of positions
const UINT positions_total, // Number of positions in the array
MTAPIRES* results // Array of results
)
.NET
MTRetCode CIMTAdminAPI.PositionUpdateBatchArray(
CIMTPosition[] positions, // Array of positions
MTRetCode[] retcodes // Array of results
)
Parameters
positions
[in] A pointer to the array of positions.
positions_total
[in] The number of positions in the 'positions' array.
results
[out] An array with position update results. The size of the 'results' array must not be less than that of 'positions'.
Return Value
The MT_RET_OK response code indicates that all positions have been updated. The MT_RET_ERR_PARTIAL response code means that only some of the positions have been
updated. Analyze the 'results' array for more details concerning the execution results. The result of update of each position from the 'positions' array is added to 'results'. The
index of a result corresponds to the index of a position in the source array.
Note
Positions can only be updated from the applications connected to the trade server, on which the positions have been created. For all other applications, the response code
MT_RET_ERR_NOTMAIN is returned. If the object is not found, the response code MT_RET_ERR_NOTFOUND is returned.
Make sure to fill in all the required fields of the positions, not only the ones which you want to change. It is recommended that you first receive positions from the server, edit
the required fields in them, and then send them back to the server. However, please note that while you are working with the position in the API, the position price may change
on the server, and the previously received IMTPosition::PriceCurrent value may no longer be valid. If you send the value back as is, a price jump can be observed on the client
side: an outdated value will be set for positions, and the price will be updated to the relevant one at the next tick. To avoid such price jumps, retrieve the current symbol price
just before sending position changes to the server, and place it in IMTPosition::PriceCurrent.
The server checks the correctness of the updated positions. The following fields must be filled:
• IMTPosition::Login (an account with this login must exist on the server)
• IMTPosition::Symbol
• IMTPosition::Action
• IMTPosition::Volume or IMTPosition::VolumeExt
• IMTPosition::PriceOpen
• IMTPosition::Digits
• IMTPosition::DigitsCurrency
• IMTPosition::ContractSize
• IMTPosition::TimeCreate
• IMTPosition::RateMargin
To improve performance, it is recommended to create arrays and perform group operations separately for each trading account.
IMTAdminAPI::PositionDelete
Deletes a position.
C++
MTAPIRES IMTAdminAPI::PositionDelete(
IMTPosition* position // Position object
)
.NET
MTRetCode CIMTAdminAPI.PositionDelete(
CIMTPosition position // Position object
)
Python
AdminAPI.PositionDelete(
position # Position object
)
Parameters
position
file:///C:/Users/Administrator/AppData/Local/Temp/~hh4BC4.htm 7/17/2025
Manager API Page 228 of 464
IMTAdminAPI::PositionDeleteByTicket
Delete a position by ticket.
C++
MTAPIRES IMTAdminAPI::PositionDeleteByTicket(
UINT64 ticket // Position object
)
.NET
MTRetCode CIMTAdminAPI.PositionDeleteByTicket(
ulong ticket // Position object
)
Python
AdminAPI.PositionDeleteByTicket(
ticket # Position object
)
Parameters
ticket
[in] The ticket of the position you want to delete.
Return Value
An indication of successful completion is the MT_RET_OK response code. Otherwise, an error has occurred, which corresponds to the response code.
Note
A position can only be deleted from the applications connected to the trade server, on which the position has been created. For all other applications, the response code
MT_RET_ERR_NOTMAIN is returned. If the object is not found, the response code MT_RET_ERR_NOTFOUND is returned.
To be able to use the function, the manager account requires the RIGHT_TRADE_DELETE and RIGHT_TRADES_MANAGER permissions.
IMTAdminAPI::PositionDeleteBatch
Delete positions from the server database in bulk.
C++
MTAPIRES IMTAdminAPI::PositionDeleteBatch(
const UINT64* tickets, // Array of tickets
const UINT tickets_total, // Number of tickets in the array
MTAPIRES* results // Array of results
)
.NET
MTRetCode CIMTAdminAPI.PositionDeleteBatch(
ulong[] tickets, // Array of tickets
MTRetCode[] retcodes // Array of results
)
Python
AdminAPI.PositionDeleteBatch(
tickets // Array of tickets
)
Parameters
tickets
[in] A pointer to an array of tickets of the position which you want to delete.
tickets_total
[in] The number of tickets in the 'tickets' array.
results
[out] The array with the position deletion results. The size of the 'results' array must not be less than that of 'tickets'.
Return Value
The MT_RET_OK response code indicates that all positions have been deleted. The MT_RET_ERR_PARTIAL response code means that only some of the positions have been deleted.
Analyze the 'results' array for more details concerning the execution results. The result of deletion of each position from the 'tickets' array is added to 'results'. The result index
corresponds to the ticket index in the source array.
Note
Positions can only be deleted from the applications connected to the trade server, on which the positions have been created. For all other applications, the response code
MT_RET_ERR_NOTMAIN is returned. If the object is not found, the response code MT_RET_ERR_NOTFOUND is returned.
Please note that deletion of positions does not affect the client's current deals. Therefore, IMTAdmin::PositionCheck will show that the client's positions do not match the history
of deals.
Bulk deletion is executed faster than deletion of the same number of positions in a cycle one by one, using IMTManagerAPI::PositionDelete. The acceleration can be especially
noticeable when deleting positions belonging to one account.
file:///C:/Users/Administrator/AppData/Local/Temp/~hh4BC4.htm 7/17/2025
Manager API Page 229 of 464
To improve performance, it is recommended to create arrays and perform group operations separately for each trading account.
IMTAdminAPI::PositionBackupList
Request the dates of backup databases of positions for the specified time range.
C++
MTAPIRES IMTAdminAPI::PositionBackupList(
const INT64 from, // Beginning of period
const INT64 to, // End of period
INT64*& backups, // An array of dates of backups
UINT& backups_total // The number of dates of backups
)
.NET
long[] CIMTAdminAPI.PositionBackupList(
long from, // Beginning of period
long to, // End of period
out MTRetCode res // Response code
)
Python
AdminAPI.PositionBackupList(
from_date, # Beginning of period
to_date # End of period
)
Parameters
from
[in] The beginning of the period for which you need to get the list of backup copies. The date is specified in seconds that have elapsed since 01.01.1970.
to
[in] The end of the period for which you need to get the list of backup copies. The date is specified in seconds that have elapsed since 01.01.1970.
backups
[out] An array of backup creation dates.
backups_total
[out] The number of received dates of backups.
Return Value
An indication of successful completion is the MT_RET_OK response code. Otherwise, an error code will be returned.
Note
After using, the backups array must be released using the IMTAdminAPI::Free method.
Backup copies are snapshots of the database of positions at certain time moments.
IMTAdminAPI::PositionBackupList
Request the dates of backup databases of positions for the specified time range from the specified server.
C++
MTAPIRES IMTAdminAPI::PositionBackupList(
const UINT64 server, // Server ID
const INT64 from, // Beginning of period
const INT64 to, // End of period
INT64*& backups, // An array of dates of backups
UINT& backups_total // The number of dates of backups
)
.NET
long[] CIMTAdminAPI.PositionBackupList(
ulong server, // Server ID
long from, // Beginning of period
long to, // End of period
out MTRetCode res // Response code
)
Python
AdminAPI.PositionBackupList(
server, # Server ID
from_date, # Beginning of period
to_date # End of period
)
Parameters
server
[in] The identifier of the server from which the information should be requested.
from
[in] The beginning of the period for which you need to get the list of backup copies. The date is specified in seconds that have elapsed since 01.01.1970.
to
[in] The end of the period for which you need to get the list of backup copies. The date is specified in seconds that have elapsed since 01.01.1970.
backups
[out] An array of backup creation dates.
backups_total
[out] The number of received dates of backups.
Return Value
An indication of successful completion is the MT_RET_OK response code. Otherwise, an error code will be returned.
Note
After using, the backups array must be released using the IMTAdminAPI::Free method.
file:///C:/Users/Administrator/AppData/Local/Temp/~hh4BC4.htm 7/17/2025
Manager API Page 230 of 464
Backup copies are snapshots of the database of positions at certain time moments.
IMTAdminAPI::PositionBackupRequest
Request an array of positions from a backup database.
C++
MTAPIRES IMTAdminAPI::PositionBackupRequest(
const INT64 backup, // Backup date
const UINT64 login, // Login
IMTPositionArray* positions // An object of the array of positions
)
.NET
MTRetCode CIMTAdminAPI.PositionBackupRequest(
long backup, // Backup date
ulong login, // Login
CIMTPositionArray positions // An object of the array of positions
)
Python
AdminAPI.PositionBackupRequest(
backup, # Backup date
login # Login
)
Parameters
backup
[in] The date of creation of the backup to which the requested position belongs. The date is specified in seconds that have elapsed since 01.01.1970. Dates of backups can be
obtained using the IMTAdminAPI::PositionBackupList method.
login
[in] The login of a user whose deals we want to obtain.
positions
[out] An object of positions array. The positions object must be first created using the IMTAdminAPI::PositionCreateArray method.
Return Value
An indication of successful completion is the MT_RET_OK response code. Otherwise, an error code will be returned.
Note
Backup copies are snapshots of the database of positions at certain time moments.
IMTAdminAPI::PositionBackupRequest
Request an array of positions from a backup database of the specified server.
C++
MTAPIRES IMTAdminAPI::PositionBackupRequest(
const UINT64 server, // Server ID
const INT64 backup, // Backup date
const UINT64 login, // Login
IMTPositionArray* positions // An object of the array of positions
)
.NET
MTRetCode CIMTAdminAPI.PositionBackupRequest(
ulong server, // Server ID
long backup, // Backup date
ulong login, // Login
CIMTPositionArray positions // An object of the array of positions
)
Python
AdminAPI.PositionBackupRequest(
server, # Server ID
backup, # Backup date
login # Login
)
Parameters
server
[in] The identifier of the server from which the information should be requested.
backup
[in] The date of creation of the backup to which the requested position belongs. The date is specified in seconds that have elapsed since 01.01.1970. Dates of backups can be
obtained using the IMTAdminAPI::PositionBackupList method.
login
[in] The login of a user whose deals we want to obtain.
positions
[out] An object of positions array. The positions object must be first created using the IMTAdminAPI::PositionCreateArray method.
Return Value
An indication of successful completion is the MT_RET_OK response code. Otherwise, an error code will be returned.
Note
Backup copies are snapshots of the database of positions at certain time moments.
file:///C:/Users/Administrator/AppData/Local/Temp/~hh4BC4.htm 7/17/2025
Manager API Page 231 of 464
IMTAdminAPI::PositionBackupRestore
Restore a position from a backup database.
C++
MTAPIRES IMTAdminAPI::PositionBackupRestore(
IMTPosition* position // A position to restore
)
.NET
MTRetCode CIMTAdminAPI.PositionBackupRestore(
CIMTPosition position // A position to restore
)
Python
AdminAPI.PositionBackupRestore(
MTPosition position # A position to restore
)
Parameters
position
[in] An object of the position to restore.
Return Value
An indication of successful completion is the MT_RET_OK response code. Otherwise, an error code will be returned.
Note
Restored positions are not deleted from the backup copy When restoring a position, deals that resulted in that position are not recovered.
Backup copies are snapshots of the database of positions at certain time moments.
IMTAdminAPI::PositionCheck
Checking the correctness of a client's positions based on the history of deals.
C++
MTAPIRES IMTAdminAPI::PositionCheck(
const UINT64 login, // The user's login
IMTPositionArray* current, // Current positions
IMTPositionArray* invalid, // Unmatched positions
IMTPositionArray* missed, // Missing positions
IMTPositionArray* nonexist // Odd positions
)
.NET
MTRetCode CIMTAdminAPI.PositionCheck(
ulong login, // The user's login
CIMTPositionArray current, // Current positions
CIMTPositionArray invalid, // Unmatched positions
CIMTPositionArray missed, // Missing positions
CIMTPositionArray nonexist // Odd positions
)
Python
AdminAPI.PositionCheck(
int login # The user's login
)
Parameters
login
[in] The login of a user.
current
[out] An array of the client's current positions.
invalid
[out] During the check, the platform calculates what positions a client should have based on his history of trades. Calculated positions are compared with actual ones. If the
calculate list contains positions that do not match actual positions, such records will be passed to the invalid array.
missed
[out] Positions that were calculated based on the client's history and that are not found among actual positions are placed into this array. In other words, missing positions are
placed into the 'missed' array.
nonexist
[out] The client's actual positions that are not found in the calculated list based on the history of deals are added to this array. In other words, the client's odd positions that do
not exist in the history are added to the 'nonexist' array.
Return Value
An indication of a successful check is the MT_RET_OK response code. Otherwise, an error code will be returned.
Disclaimer
The MT_RET_OK response code does not indicate that the client;s positions are correct. Positions can be considered correct if you receive the MT_RET_OK code and empty
'invalid', 'missed' and 'nonexsit' arrays.
The 'current', 'invalid', 'missed' and 'nonexsit' array must be created beforehand using the IMTAdminAPI::PositionCreateArray method.
If you need to correct positions based on the history of deals, you should use the IMTAdminAPI::PositionFix method.
IMTAdminAPI::PositionFix
file:///C:/Users/Administrator/AppData/Local/Temp/~hh4BC4.htm 7/17/2025
Manager API Page 232 of 464
.NET
MTRetCode CIMTAdminAPI.PositionFix(
ulong login, // The user's login
CIMTPositionArray current // Client's positions after correction
)
Python
AdminAPI.PositionFix(
int login # The user's login
)
Parameters
login
[in] The login of a user.
current
[out] The array of the client's positions after correction based on the history. The 'current' object must be first created using the IMTAdminAPI::PositionCreateArray method.
Return Value
An indication of successful completion is the MT_RET_OK response code. Otherwise, an error code will be returned.
Disclaimer
Upon the call of the method, the platform calculates a client's positions based on the history of his deals, and corrects current positions if necessary.
IMTAdminAPI::PositionSplit
Split trading positions. For details please read the MetaTrader 5 Manager Help.
C++
MTAPIRES IMTAdminAPI::PositionSplit(
UINT64* tickets, // Tickets of positions
const UINT tickets_total, // Number of tickets
const double* adjustments, // Balance adjustments
const UINT new_shares, // Number of new shares
const UINT old_shares, // Number of old shares
const UINT round_rule_price, // Price rounding rule
const UINT round_rule_volume, // Volume rounding rule
const UINT flags, // Additional split options
MTAPIRES* results // Array of results
)
.NET
MTRetCode CIMTAdminAPI.PositionSplit(
ulong[] tickets, // Tickets of positions
ulong[] adjustments, // Balance adjustments
uint new_shares, // Number of new shares
uint old_shares, // Number of old shares
uint round_rule_price, // Price rounding rule
uint round_rule_volume, // Volume rounding rule
uint flags, // Additional split options
MTRetCode[] results // Array of results
)
Python
AdminAPI.PositionSplit(
tickets, # Tickets of positions
adjustments, # Balance adjustments
new_shares, # Number of new shares
old_shares, # Number of old shares
round_rule_price, # Price rounding rule
round_rule_volume, # Volume rounding rule
flags # Additional split options
)
Parameters
tickets
[in] An array of tickets of the positions for which you want to perform the split operation.
ticket_total
[in] The number of tickets in the 'tickets' array.
adjustments
[in] Adjustment calculation mode:
new_shares
[in] Number of new shares. Shares are split/consolidated in a certain ratio, while their prices are also converted accordingly.
old_shares
[in] Number of old shares. Shares are split/consolidated in a certain ratio, while their prices are also converted accordingly.
round_rule_price
[in] The price rounding rule in case the number of digital places of a new price exceeds the value set in the symbol's Digits parameter (IMTConSymbol::Digits). The following
three options are available:
file:///C:/Users/Administrator/AppData/Local/Temp/~hh4BC4.htm 7/17/2025
Manager API Page 233 of 464
• 0 — standard rounding
• 1 — round down
• 2 — round up
For example, when transforming the price of 35.15 with the ratio of 2:1, we obtain 17.575. When rounded down, the final price is 17.57, when rounded up, it is 17.58. The
"Standard" rounding option (standard rounding to the nearest integer) is available as well. For example, if the Digits is 2, the rounding is performed as follows: 17.234 -> 17.23,
17.235 -> 17.24.
round_rule_volume
[in] The volume rounding rule in case the client will have a fractional number of shares after the split. The following three options are available:
• 0 — standard rounding
• 1 — round down
• 2 — round up
For example, dividing 35 stocks using the 3:2 ratio results in 52.5 stocks. In this case, the number may be rounded down (against a trader) or up (in a trader's favor).
flags
[in] Additional split options as flags:
• 1 — it is recommended to clear trading positions' stop levels to avoid their activation after a split. This can be done by setting flag 1.
• 2 — if the split operation will cause a position volume to become less than one contract, the split operation will be not performed. You can close such positions
automatically by using this flag.
results
[in] An array of each position split results.
Return Value
An indication of successful command setting is the MT_RET_OK response code. Otherwise, a corresponding error code will be returned.
Function Purpose
MailCreate Create a message in the internal mail system.
MailSubscribe Subscribe to events associated with changes in the mail database.
MailUnsubscribe Undubscribe from events associated with changes in the mail database.
MailTotal Get the total number of emails in the manager's mailbox.
MailNext Get an email by a position in the mailbox.
MailDelete Delete an email by a position in the mailbox.
MailDeleteId Delete an email by an ID.
MailSend Send emails via the internal mail system.
MailBodyRequest Get an email body.
IMTAdminAPI::MailCreate
Create an object of a message in the internal mail system.
C++
IMTMail* IMTAdminAPI::MailCreate()
.NET
CIMTMail CIMTAdminAPI.MailCreate()
Return Value
It returns a pointer to the created object that implements the IMTMail interface. In case of failure, it returns NULL.
Note
The created object must be destroyed by calling the IMTMail::Release method of this object.
IMTAdminAPI::MailSubscribe
Subscribe to events associated with changes in the mail database.
C++
MTAPIRES IMTAdminAPI::MailSubscribe(
IMTMailSink* sink // A pointer at the IMTMailSink object
)
.NET
MTRetCode CIMTAdminAPI.MailSubscribe(
CIMTMailSink sink // CIMTMailSink object
)
file:///C:/Users/Administrator/AppData/Local/Temp/~hh4BC4.htm 7/17/2025
Manager API Page 234 of 464
Parameters
sink
[in] A pointer to the object that implements the IMTMailSink interface.
Return Value
An indication of successful completion is the MT_RET_OK response code. Otherwise, an error has occurred that corresponds to the response code.
Note
Subscribing to events is thread safe. One and the same interface IMTMailSink cannot subscribe to an event twice - in this case the response code MT_RET_ERR_DUPLICATE is
returned.
The object at which sink points, must remain in the memory (must not be removed) until the call of IMTAdminAPI::MailUnsubscribe or until the administrator interface is deleted
using the IMTAdminAPI::Release method.
IMTAdminAPI::MailUnsubscribe
Undubscribe from events associated with changes in the mail database.
C++
MTAPIRES IMTAdminAPI::MailUnsubscribe(
IMTMailSink* sink // A pointer at the IMTMailSink object
)
.NET
MTRetCode CIMTAdminAPI.MailUnsubscribe(
CIMTMailSink sink // CIMTMailSink object
)
Parameters
sink
[in] A pointer to the object that implements the IMTMailSink interface.
Return Value
An indication of successful completion is the MT_RET_OK response code. Otherwise, an error code will be returned.
Note
This is a pair method to IMTAdminAPI::MailSubscribe. If an attempt is made to unsubscribe from the interface to which it has not subscribed, MT_RET_ERR_NOTFOUND error is
returned.
IMTAdminAPI::MailTotal
Get the total number of messages in the manager's mailbox.
C++
UINT IMTAdminAPI::MailTotal()
.NET
uint CIMTAdminAPI.MailTotal()
Return Value
The total number of messages in a mailbox of the manager whose account is used for connecting to the server.
Note
The method is valid only if the IMTAdminAPI::PUMP_MODE_MAIL pumping mode was specified during connection.
IMTAdminAPI::MailNext
Get an email by a position in the mailbox.
C++
MTAPIRES IMTAdminAPI::MailNext(
const UINT pos, // Mail position
IMTMail* mail // Mail object
)
.NET
MTRetCode CIMTAdminAPI.MailNext(
uint pos, // Mail position
CIMTMail mail // Mail object
)
Parameters
pos
[in] Position of a message in a mailbox ranging from 0.
mail
[out] An object of the mail. The mail object must be first created using the IMTAdminAPI::MailCreate method.
Return Value
An indication of successful completion is the MT_RET_OK response code. Otherwise, an error code will be returned.
file:///C:/Users/Administrator/AppData/Local/Temp/~hh4BC4.htm 7/17/2025
Manager API Page 235 of 464
Note
The method copies data of the mail at the specified position to the mail object. The method is valid only if the IMTAdminAPI::PUMP_MODE_MAIL pumping mode was specified
during connection.
To prevent from the slowdown of the API performance and from unnecessary traffic, the server sends large emails without bodies and attachments. If IMTMail::BodySize is equal
to 0, request the email body using the IMTAdminAPI::MailBodyRequest method and pass to it the ID of the received email IMTMail::Id.
Applications that use Manager API version below 1655, always receive a full email. IMTAdminAPI::MailBodyRequest is not supported in such applications.
IMTAdminAPI::MailDelete
Delete a mail by a position in the mailbox.
C++
MTAPIRES IMTAdminAPI::MailDelete(
const UINT pos // Position of the mail
)
.NET
MTRetCode CIMTAdminAPI.MailDelete(
uint pos // Position of the mail
)
Parameters
pos
[in] Position of a mail in a mailbox ranging from 0.
Return Value
An indication of successful completion is the MT_RET_OK response code. Otherwise, an error code will be returned.
IMTAdminAPI::MailDeleteId
Delete a mail by an ID.
C++
MTAPIRES IMTAdminAPI::MailDeleteId(
const UINT64 id // Mail ID
)
.NET
MTRetCode CIMTAdminAPI.MailDeleteId(
ulong id // Mail ID
)
Parameters
id
[in] The ID of the email that should be deleted.
Return Value
An indication of successful completion is the MT_RET_OK response code. Otherwise, an error code will be returned.
Note
The IMTMail::Id value is used as the identifier.
IMTAdminAPI::MailSend
Send emails via the internal mail system.
C++
MTAPIRES IMTAdminAPI::MailSend(
IMTMail* mail // Mail object
)
.NET
MTRetCode CIMTAdminAPI.MailSend(
CIMTMail mail // Mail object
)
Python
AdminAPI.MailSend(
MTMail mail // Mail object
)
Parameters
mail
[in] Mail object. The mail object must be first created using the IMTAdminAPI::MailCreate method.
Return Value
An indication of successful completion is the MT_RET_OK response code. Otherwise, an error code will be returned.
file:///C:/Users/Administrator/AppData/Local/Temp/~hh4BC4.htm 7/17/2025
Manager API Page 236 of 464
Note
Before sending an email, its correctness is checked (presence of its subject and recipient). Sender field is automatically filled with the login of the manager account, which is
used by the Manager API application to connect to the server.
You can use macros in the email body, which allow substituting relevant data depending on the email recipient:
IMTAdminAPI::MailBodyRequest
Get an email body.
C++
MTAPIRES IMTAdminAPI::MailBodyRequest(
const UINT64 id, // email ID
IMTMail* mail // an email object
)
.NET
MTRetCode CIMTAdminAPI.MailBodyRequest(
ulong id, // email ID
CIMTMail mail // an email object
)
Function Purpose
NewsCreate Create an object of a news item.
NewsSubscribe Subscribe to events and hooks associated with changes in the news database.
NewsUnsubscribe Undubscribe from events and hooks associated with changes in the news database.
NewsSend Send news.
IMTAdminAPI::NewsCreate
Create an object of a news item.
C++
IMTNews* IMTAdminAPI::NewsCreate()
.NET
CIMTNews CIMTAdminAPI.NewsCreate()
Return Value
It returns a pointer to the created object that implements the IMTNews interface. In case of failure, it returns NULL.
file:///C:/Users/Administrator/AppData/Local/Temp/~hh4BC4.htm 7/17/2025
Manager API Page 237 of 464
Note
The created object must be deleted by calling the IMTNews::Release method of this object.
IMTAdminAPI::NewsSubscribe
Subscribe to events and hooks associated with changes in the news database.
C++
MTAPIRES IMTAdminAPI::NewsSubscribe(
IMTNewsSink* sink // A pointer to the IMTNewsSink object
)
.NET
MTRetCode CIMTAdminAPI.NewsSubscribe(
CIMTNewsSink sink // CIMTNewsSink object
)
Parameters
sink
[in] A pointer to the object that implements the IMTNewsSink interface.
Return Value
An indication of successful completion is the MT_RET_OK response code. Otherwise, an error has occurred that corresponds to the response code.
Note
Subscribing to events is thread safe. One and the same interface IMTNewsSink cannot subscribe to an event twice - in this case the response code MT_RET_ERR_DUPLICATE is
returned.
The object at which sink points, must remain in the memory (must not be removed) until the call of IMTAdminAPI::NewsUnsubscribe or until the administrator interface is
deleted using the IMTAdminAPI::Release method.
IMTAdminAPI::NewsUnsubscribe
Undubscribe from events and hooks associated with changes in the news database.
C++
MTAPIRES IMTAdminAPI::NewsUnsubscribe(
IMTNewsSink* sink // A pointer to the IMTNewsSink object
)
.NET
MTRetCode CIMTAdminAPI.NewsUnsubscribe(
CIMTNewsSink sink // CIMTNewsSink object
)
Parameters
sink
[in] A pointer to the object that implements the IMTNewsSink interface.
Return Value
An indication of successful completion is the MT_RET_OK response code. Otherwise, an error code will be returned.
Note
This is a pair method to IMTAdminAPI::NewsSubscribe. If an attempt is made to unsubscribe from the interface to which it has not subscribed, MT_RET_ERR_NOTFOUND error is
returned.
IMTAdminAPI::NewsSend
Send news.
C++
MTAPIRES IMTAdminAPI::NewsSend(
IMTNews* news // News object
)
.NET
MTRetCode CIMTAdminAPI.NewsSend(
CIMTNews news // News object
)
Parameters
news
[in] News object.
Return Value
An indication of successful completion is the MT_RET_OK response code. Otherwise, an error code will be returned.
Note
Before sending a news item, its correctness is checked (presence of the subject).
file:///C:/Users/Administrator/AppData/Local/Temp/~hh4BC4.htm 7/17/2025
Manager API Page 238 of 464
Function Purpose
ChartRequest Request minute bars for a symbol.
ChartDelete Delete a bar by the symbol.
ChartUpdate Change historical data of a symbol.
ChartReplace Full replacement of history data in the specified period with the passed data.
ChartSplit Split of the symbol's bar history.
Price data is stored on the history server in the form of one minute bars. Larger timeframes are formed on a client side from the minute bars according to the following
principle: bars from the first to the last second of a period are used for calculation. For example, a H1 bar for 13:00 consists of minute bars within the range from 13:00:00 to
13:59:59.
IMTAdminAPI::ChartRequest
Request minute bars for a symbol.
C++
MTAPIRES IMTAdminAPI::ChartRequest(
LPCWSTR symbol, // Symbol
const INT64 from, // Beginning of the period
const INT64 to, // End of the period
MTChartBar*& bars, // Array of bars
UINT& bars_total // Number of received bars
)
.NET
MTChartBar[] CIMTAdminAPI.ChartRequest(
string symbol, // Symbol
long from, // Beginning of the period
long to, // End of the period
MTRetCode res // Response code
)
Parameters
news
[in] The symbol for which you want to request historical data (bars).
from
[in] The beginning of the period for which you need to get data. The date is specified in seconds that have elapsed since 01.01.1970.
to
[in] The end of the period for which you need to get data. The date is specified in seconds that have elapsed since 01.01.1970.
bars
[out] An array of bars (MTChartBar structures).
bars_total
[out] The number of obtained bars.
Return Value
An indication of successful completion is the MT_RET_OK response code. Otherwise, a corresponding error code will be returned.
The MT_RET_OK_NONE code means that the access server used to connect the Manager API application has not yet synchronized the data with the history server. If that is the
case, perform one or several new data requests with a pause between them.
Note
Price data is stored on the history server in the form of one minute bars. Larger timeframes are formed on a client side from the minute bars according to the following principle:
bars from the first to the last second of a period are used for calculation. For example, a H1 bar for 13:00 consists of minute bars within the range from 13:00:00 to 13:59:59.
The bars array that is passed by the function is sorted by the datetime field of the MTChartBar structure.
After using, the bars array must be released using the IMTAdminAPI::Free method.
The manager account performing the request must have the IMTConManager::RIGHT_CFG_SYMBOLS and IMTConManager::RIGHT_CHARTS permissions. In addition, the group, to
which the manager belongs, must have access to the appropriate symbol (IMTConGroup::Symbol*). If the required permissions are not available, the method will return the
MT_RET_ERR_NOTFOUND error.
This method cannot be called from event handlers (any methods of IMT*Sink classes).
IMTAdminAPI::ChartDelete
Delete a bar by the symbol.
C++
file:///C:/Users/Administrator/AppData/Local/Temp/~hh4BC4.htm 7/17/2025
Manager API Page 239 of 464
MTAPIRES IMTAdminAPI::ChartDelete(
LPCWSTR symbol, // Symbol
const INT64* bars_dates, // Dates of bars to delete
const UINT bars_dates_total // The number of bars to delete
)
.NET
MTRetCode CIMTAdminAPI.ChartDelete(
string symbol, // Symbol
long bars_dates // Dates of bars to delete
)
Parameters
symbol
[in] The symbol, for which you want to delete historical data.
bars_dates
[in] An array of the dates of bars you want to delete. Dates are specified in seconds that have elapsed since 01.01.1970.
bars_dates_total
[in] The number of bars to delete.
Return Value
An indication of successful completion is the MT_RET_OK response code. Otherwise, an error code will be returned.
IMTAdminAPI::ChartUpdate
Change historical data of a symbol.
C++
MTAPIRES IMTAdminAPI::ChartUpdate(
LPCWSTR symbol, // Symbol
const MTChartBar* bars, // Bars to change
const UINT bars_total // The number of bars to change
)
.NET
MTRetCode CIMTAdminAPI.ChartUpdate(
string symbol, // Number of new bars
MTChartBar[] bars // Bars to change
)
Parameters
symbol
[in] The symbol, for which you want to update historical data.
bars
[in] Bars you want to update, described by the MTChartBar structure.
bars_total
[in] The number of bars to update.
Return Value
An indication of successful completion is the MT_RET_OK response code. Otherwise, an error code will be returned.
Note
If the open price of a bar (MTChartBar.open) passed in the structure is 0, the bar will be deleted.
The standard scheme of updating history data is to firstly request the available data using IMTAdminAPI::ChartRequest, then make changes and then pass changes to the server
using the IMTAdminAPI::ChartUpdate method.
IMTAdminAPI::ChartReplace
Full replacement of history data in the specified period with the passed data.
C++
MTAPIRES IMTAdminAPI::ChartReplace(
LPCWSTR symbol, // Symbol
const INT64 from, // Beginning of the period
const INT64 to, // End of the period
const MTChartBar* bars, // New bars
const UINT bars_total // Number of new bars
)
.NET
MTRetCode CIMTAdminAPI.ChartReplace(
string symbol, // Number of new bars
long from, // Beginning of the period
long to, // End of the period
MTChartBar[] bars // New bars
)
Parameters
symbol
[in] The symbol, for which you want to update historical data.
from
[in] The beginning of the period for which you need to replace data. The date is specified in seconds since January 1, 1970.
to
file:///C:/Users/Administrator/AppData/Local/Temp/~hh4BC4.htm 7/17/2025
Manager API Page 240 of 464
[in] The date is specified in seconds that have elapsed since 01.01.1970. The date is specified in seconds since January 1, 1970.
bars
[in] New bars, described by the MTChartBar structure.
bars_total
[in] The number of bars passed.
Return Value
An indication of successful completion is the MT_RET_OK response code. Otherwise, a corresponding error code is returned.
Note
This method totally replaces the history data in the specified time period with the data passed in the 'bars' parameter.
To delete an existing bar, specify the corresponding time (MTChartBar.datetime) and the zero price (MTChartBar.open) for the bar in the passed MTChartBar structure. If the bar
with the specified time does not exist in the platform, a new bar with a zero price will be added.
IMTAdminAPI::ChartSplit
Split of the symbol's bar history. For details please read the MetaTrader 5 Administrator Help files.
C++
MTAPIRES IMTAdminAPI::ChartSplit(
LPCWSTR symbol, // Symbol
const UINT new_shares, // Number of new shares
const UINT old_shares, // Number of old shares
const UINT rounding_rule, // Rounding rule
const INT64 datetime_from, // Beginning of interval for split
const INT64 datetime_to // End of interval for split
)
.NET
MTRetCode CIMTAdminAPI.ChartSplit(
string symbol, // Symbol
uint new_shares, // Number of new shares
uint old_shares, // Number of old shares
uint rounding_rule, // Rounding rule
long datetime_from, // Beginning of interval for split
long datetime_to // End of interval for split
)
Parameters
symbol
[in] The symbol for which you want to run split.
new_shares
[in] Number of new shares. Shares are split/consolidated in a certain ratio, while their prices are also converted accordingly.
old_shares
[in] Number of old shares. Shares are split/consolidated in a certain ratio, while their prices are also converted accordingly.
rounding_rule
[in] The rounding rule in case the number of digital places of a new price exceeds the value set in the symbol's Digits parameter (IMTConSymbol::Digits). The following three
options are available:
• 0 — standard rounding
• 1 — round down
• 2 — round up
For example, when transforming the price of 35.15 with the ratio of 2:1, we obtain 17.575. When rounded down, the final price is 17.57, when rounded up, it is 17.58. The
"Standard" rounding option (standard rounding to the nearest integer) is available as well. For example, if the Digits is 2, the rounding is performed as follows: 17.234 -> 17.23,
17.235 -> 17.24.
datetime_from
[in] The beginning date of the time interval in which split will be performed. If the parameter is not set, the split will be performed for the entire symbol price history.
datetime_to
[in] The end date of the time interval in which split will be performed. If the parameter is not set, the split will be performed for the entire symbol price history.
Return Value
An indication of successful command setting is the MT_RET_OK response code. Otherwise, an error code will be returned.
Note
The method is asynchronous and receiving of the MT_RET_OK response does not mean that the split has completed. The operation can take a long time.
If a split operation is running on the server has already split the specified tool, calling this method will not interrupt this process and will not start a new split.
The method only splits the symbol's bar history. Separate operations are provided for the split of trading positions and of the tick history.
Function Purpose
TickRequest Get quotes for a symbol in the specified time range.
TickRequestRaw Get the entire stream of quotes for a symbol (raw and processed prices in accordance with the configuration of the symbol) in the specified time range.
TickAdd Add tick data for a symbol.
file:///C:/Users/Administrator/AppData/Local/Temp/~hh4BC4.htm 7/17/2025
Manager API Page 241 of 464
Function Purpose
TickReplace Full replacement of tick data in the specified period with the passed data.
IMTAdminAPI::TickRequest
Get quotes for a symbol in the specified time range.
C++
MTAPIRES IMTAdminAPI::TickRequest(
LPCWSTR symbol, // Symbol
const INT64 from, // Start date
const INT64 to, // End date
MTTickShort*& ticks, // Reference to the array of structures of quotes
UINT& ticks_total // Number of quotes
)
.NET
MTTickShort[] CIMTAdminAPI.TickRequest(
string symbol, // Symbol
long from, // Start date
long to, // End date
out MTRetCode res // Response code
)
Python
AdminAPI.TickRequest(
symbol, # Symbol
from, # Start date
to # End date
)
Parameters
symbol
[in] The name of the symbol, for which you need to get quotes.
from
[in] The start date for requesting quotes. The date is specified in seconds since January 1, 1970.
to
[in] The end date for requesting quotes. The date is specified in seconds since January 1, 1970.
ticks
[out] A reference to the array of structures that describe quotes (MTTickShort).
ticks_total
[out] The total number of received quotes.
Return Value
An indication of successful completion is the MT_RET_OK response code. Otherwise, an error has occurred that corresponds to the response code.
Note
After being used, the array of structures MTTickShort must be released using the IMTAdminAPI::Free method.
This method cannot be called from event handlers (any methods of IMT*Sink classes).
IMTAdminAPI::TickRequestRaw
Get the entire stream of quotes for a symbol (raw and processed prices in accordance with the configuration of the symbol) in the specified time range.
C++
MTAPIRES IMTAdminAPI::TickRequestRaw(
LPCWSTR symbol, // Symbol
const INT64 from, // Start date
const INT64 to, // End date
MTTickShort*& ticks, // Reference to the array of structures of quotes
UINT& ticks_total // Number of quotes
)
.NET
MTTickShort[] CIMTAdminAPI.TickRequestRaw(
string symbol, // Symbol
long from, // Start date
long to, // End date
out MTRetCode res // Response code
)
Python
AdminAPI.TickRequestRaw(
symbol, # Symbol
from, # Start date
to # End date
)
Parameters
symbol
[in] The name of the symbol, for which you need to get quotes.
from
[in] The start date for requesting quotes. The date is specified in seconds since January 1, 1970.
file:///C:/Users/Administrator/AppData/Local/Temp/~hh4BC4.htm 7/17/2025
Manager API Page 242 of 464
to
[in] The end date for requesting quotes. The date is specified in seconds since January 1, 1970.
ticks
[out] A reference to the array of structures that describe quotes (MTTickShort).
ticks_total
[out] The total number of received quotes.
Return Value
An indication of successful completion is the MT_RET_OK response code. Otherwise, an error has occurred that corresponds to the response code.
Note
If the option of storing raw prices is disabled in symbol settings (IMTConSymbol::TickFlags), only quotes received by the server will be returned, which is similar to calling
IMTAdminAPI::TickRequest.
After being used, the array of structures MTTickShort must be released using the IMTAdminAPI::Free method.
This method cannot be called from event handlers (any methods of IMT*Sink classes).
IMTAdminAPI::TickAdd
Add tick data for a symbol.
C++
MTAPIRES IMTAdminAPI::TickAdd(
LPCWSTR symbol, // Symbol
const MTTickShort* ticks, // Ticks to add
const UINT ticks_total // The number of ticks to add
)
.NET
MTRetCode CIMTAdminAPI.TickAdd(
string symbol, // Symbol
MTTickShort[] ticks // Ticks to add
)
Python
AdminAPI.TickAdd(
symbol, # Symbol
ticks # Ticks to add
)
Parameters
symbol
[in] The symbol, for which you want to update historical data.
ticks
[in] An array of MTTickShort structures describing ticks to be added.
ticks_total
[in] The number of ticks to add.
Return Value
An indication of successful completion is the MT_RET_OK response code. Otherwise, an error code will be returned.
Note
Unlike IMTManagerAPI::TickAdd, this method directly adds quotes to the price history rather than adding them to the price stream.
IMTAdminAPI::TickReplace
Full replacement of tick data in the specified period with the passed data.
C++
MTAPIRES IMTAdminAPI::TickReplace(
LPCWSTR symbol, // Symbol
const INT64 from_msc, // Beginning of the period
const INT64 to_msc, // End of the period
const MTTickShort* ticks, // New ticks
const UINT ticks_total // Number of new ticks
)
.NET
MTRetCode CIMTAdminAPI.TickReplace(
string symbol, // Symbol
long from_msc, // Beginning of the period
long to_msc, // End of the period
MTTickShort[] ticks // New ticks
)
Python
AdminAPI.TickReplace(
symbol, # Symbol
from_msc, # Beginning of the period
to_msc, # End of the period
ticks # New ticks
)
Parameters
symbol
[in] The symbol, for which you want to update historical data.
file:///C:/Users/Administrator/AppData/Local/Temp/~hh4BC4.htm 7/17/2025
Manager API Page 243 of 464
from_msc
[in] The beginning of the period for which you need to replace data. The date is specified in milliseconds that have elapsed since 01.01.1970.
to_msc
[in] The date is specified in seconds that have elapsed since 01.01.1970. The date is specified in milliseconds that have elapsed since 01.01.1970.
ticks
[in] An array of MTTickShort structures describing new ticks.
ticks_total
[in] The number of ticks passed.
Return Value
An indication of successful completion is the MT_RET_OK response code. Otherwise, an error code will be returned.
Note
This method totally replaces the tick data in the specified time period with the data passed in the 'ticks' parameter.
Settings Files
The Manager API allows saving application settings on a trade server and accessing them at any time. Settings are stored in a special directory separately for each manager account,
which uses the application: [trade server directory]\settings\[manager login]\.
This option allows you to quickly configure the manager's workplace. For example, if the manager changes the computer, there will be no need to re-configure the application.
Instead, you can easily apply settings, which were saved previously on the trade server. It is also possible to create several sets of manager settings for performing certain tasks.
• Only one level of nesting and no more than 128 folders can be stored inside each manager directory. The maximum number of settings files is 1024. The size of each
configuration file is no more than 16 MB.
• Settings are saved and accessed on the server, to which the Manager API application is connected (on which the connected manager account is located). If you have
multiple servers, you need to save the settings on each server.
• This function is secure for the trade server: the Manager API does not allow sending potentially dangerous file types to the server (for example, *.exe). Only files with
the following extensions are allowed: ini, cfg, dat, json, config, sqlite, xml, conf, settings, key, db, txt and log, as well as files without extensions.
• The application receives the file with settings using the IMTAdminAPI::SettingGet method. For example, during the application launch or when the user executes an
appropriate command.
• The settings are read from the file and applied.
• If the user edits settings during the application operation, the application can update the settings file on the trade server via the IMTAdminAPI::SettingSet method.
Please note that settings comprise one whole file. You cannot update a separate setting on the server. To update a setting, it is necessary to generate a whole file with all settings.
The format of the settings file and its parsing methods are determined by the file creator. IMTAdminAPI::Setting* methods work with arbitrary data.
Settings should not be updated on the server too often, i.e. every time when settings are edited on the application side. After editing settings, the user can immediately change
some other settings or revert changes. It is recommended to send updates not more than once in 5 minutes.
Several applications can work with the same settings files. The Manager API does not track changes in files on the server side. Every call of IMTAdminAPI::SettingSet re-writes the
specified settings file, even if it has already been changed by another application. Only the last submitted version is always stored on the server.
IMTAdminAPI::SettingGet
Receives the settings file from the trade server.
C++
MTAPIRES IMTAdminAPI::SettingGet(
LPCWSTR section, // directory name
LPCWSTR key, // file name
LPVOID& outdata, // return data
UINT& outdata_len // the size of the return data
)
.NET
MTRetCode CIMTAdminAPI.SettingGet(
string section, // directory name
string key, // file name
byte[] outdata // return data
)
Python
AdminAPI.SettingGet(
section, # directory name
key # file name
)
Parameters
section
file:///C:/Users/Administrator/AppData/Local/Temp/~hh4BC4.htm 7/17/2025
Manager API Page 244 of 464
[in] The name of the subfolder in the manager account directory, from which you want to receive the settings file.
key
[in] The name of the settings file.
outdata
[out] A reference to the data returned in response to the request.
outdata_len
[out] A reference to the size of data returned in response to the request.
Return Value
An indication of successful completion is the MT_RET_OK response code. Otherwise, an error has occurred, which corresponds to the response code. For example:
• MT_RET_ERR_PARAMS — invalid parameters, for example the name of the folder or file.
• MT_RET_ERR_NOTFOUND — the requested file is not found.
• MT_RET_ERR_MEM — not enough memory to receive the file.
Note
The path to the settings file is formed as follows: [trade server directory]\settings\[manager login]\section\key. section and key — the first and the second parameters of the
IMTAdminAPI::SettingGet method, manager login is the manager's account, using which the application is connected to the trade server.
The format of the settings file and its parsing methods are determined by the file creator. IMTAdminAPI::Setting* methods work with arbitrary data.
After the use, the outdata data array must be released using the IMTAdminAPI::Free method.
IMTAdminAPI::SettingSet
Sends the settings file to the trade server.
C++
MTAPIRES IMTAdminAPI::SettingSet(
LPCWSTR section, // directory name
LPCWSTR key, // file name
const LPVOID& indata, // passed data
const UINT& indata_len // size of passed data
)
.NET
MTRetCode CIMTAdminAPI.SettingSet(
string section, // directory name
string key, // file name
byte[] indata // passed data
)
Python
AdminAPI.SettingSet(
section, # directory name
key, # file name
indata # passed data
)
Parameters
section
[in] The name of the subfolder in the manager account directory, to which you want to write the settings file.
key
[in] The name of the settings file. Only files with the following extensions are allowed: ini, cfg, dat, json, config, sqlite, xml, conf, settings, key, db, txt and log, as well as
files without extensions.
indata
[out] A reference to data to be sent.
indata_len
[out] A reference to the size of passed data in bytes.
Return Value
An indication of successful completion is the MT_RET_OK response code. Otherwise, an error has occurred, which corresponds to the response code. For example:
• MT_RET_ERR_PARAMS — invalid parameters, for example the name of the folder or file.
• MT_RET_CFG_LIMIT_REACHED — the maximum number of files or folders has been reached.
• MT_RET_ERR_DISK — writing the file to the disk failed.
Note
The path to the settings file is formed as follows: [trade server directory]\settings\[manager login]\section\key. section and key — the first and the second parameters of the
IMTAdminAPI::SettingSet method, manager login is the manager's account, using which the application is connected to the trade server.
The format of the settings file and its parsing methods are determined by the file creator. IMTAdminAPI::Setting* methods work with arbitrary data.
Only one level of nesting and no more than 128 folders can be stored inside each manager directory. The maximum number of settings files is 1024. The size of each configuration
file is no more than 16 MB.
The IMTAdminAPI::SettingSet method works with files, not with individual settings. Therefore, a whole settings file needs to be formed to send changes to the server.
The Manager API does not track changes in files on the server side. Every call of IMTAdminAPI::SettingSet re-writes the specified settings file, even if it has already been changed
by another application. Only the last submitted version is always stored on the server.
Settings should not be updated on the server too often, i.e. every time when settings are edited on the application side. After editing settings, the user can immediately change
some other settings or revert changes. It is recommended to send updates not more than once in 5 minutes.
IMTAdminAPI::SettingDelete
file:///C:/Users/Administrator/AppData/Local/Temp/~hh4BC4.htm 7/17/2025
Manager API Page 245 of 464
.NET
MTRetCode CIMTAdminAPI.SettingDelete(
string section, // directory name
string key // file name
)
Python
AdminAPI.SettingDelete(
section, # directory name
key # file name
)
Parameters
section
[in] The name of the subfolder in the manager account directory, from which you want to delete the settings file.
key
[in] The name of the settings file.
Return Value
An indication of successful completion is the MT_RET_OK response code. Otherwise, an error code is returned. The MT_RET_ERR_PARAMS response code means that invalid
parameters were passed: the name of the folder or the file.
Subscriptions
With the "Subscriptions" service, you can offer additional paid services to traders directly in the client terminals. For example, you can sell subscriptions for high-quality market
data from well-known providers, offer personal manager services to assist traders in understanding the basics of trading, deliver one-time services such as position transferring or
currency conversion, and much more. For further details, please read the MetaTrader 5 Administrator Help.
The functions described in this section enable the management of subscriptions on traders' accounts:
Function Purpose
SubscriptionCreate Create a subscription object.
SubscriptionCreateArray Create an object of the subscriptions array.
SubscriptionJoin Add a subscription for a user.
SubscriptionJoinBatch Bulk adding of subscriptions for users.
SubscriptionCancel Cancel a subscription for a user.
SubscriptionCancelBatch Bulk canceling of user subscriptions.
SubscriptionUpdate Edit a user subscription in the server database.
SubscriptionUpdateBatch Bulk change of user subscriptions in the server database.
SubscriptionUpdateBatchArray Bulk change of user subscriptions in the server database.
SubscriptionDelete Delete a user subscription from the server database.
SubscriptionDeleteBatch Delete a user subscription from the server database in bulk.
SubscriptionRequest Request all user subscriptions from the server.
SubscriptionRequestByID Request a subscription from the server by ID.
SubscriptionRequestByIDs Request subscriptions from the server by a list of IDs.
SubscriptionRequestByGroup Request subscriptions from the server by a client group.
SubscriptionRequestByLogins Request subscriptions from the server by a list of logins.
SubscriptionHistoryCreate Create a subscription action object.
SubscriptionHistoryCreateArray Create an object of an array of subscription actions.
SubscriptionHistoryUpdate Edit a user subscription action in the server database.
SubscriptionHistoryUpdateBatch Bulk change of user subscription actions in the server database.
SubscriptionHistoryUpdateBatchArray Bulk change of user subscription actions in the server database.
SubscriptionHistoryDelete Delete a user subscription action from the server database.
SubscriptionHistoryDeleteBatch Delete a batch of user subscription actions from the server database.
SubscriptionHistoryRequest Request user subscription action from the server for the specified date range.
SubscriptionHistoryRequestByID Request a subscription action from the server by its identifier.
SubscriptionHistoryRequestByIDs Request subscription actions from the server by a list of identifiers.
SubscriptionHistoryRequestByGroup Request subscription actions from the server by a client group.
SubscriptionHistoryRequestByLogins Request subscription actions from the server by a list of logins.
file:///C:/Users/Administrator/AppData/Local/Temp/~hh4BC4.htm 7/17/2025
Manager API Page 246 of 464
IMTAdminAPI::SubscriptionCreate
Create a subscription object.
C++
IMTSubscription* IMTAdminAPI::SubscriptionCreate()
.NET
CIMTSubscription CIMTAdminAPI.SubscriptionCreate()
Return Value
Returns a pointer to the created object that implements the IMTSubscription interface. Null is returned in case of failure.
Note
The created object must be destroyed by calling the IMTSubscription::Release method of this object.
IMTAdminAPI::SubscriptionCreateArray
Create an object of the subscriptions array.
C++
IMTSubscriptionArray* IMTAdminAPI::SubscriptionCreateArray()
.NET
CIMTSubscriptionArray CIMTAdminAPI.SubscriptionCreateArray()
Return Value
Returns a pointer to the created object that implements the IMTSubscriptionArray interface. Null is returned in case of failure.
Note
The created object must be destroyed by calling the IMTSubscriptionArray::Release method of this object.
IMTAdminAPI::SubscriptionJoin
Add a subscription for a user.
C++
MTAPIRES IMTAdminAPI::SubscriptionJoin(
const UINT64 login, // User
const UINT64 subscription, // Subscription configuration ID
IMTSubscription* record, // Subscription description
IMTSubscriptionHistory* history // Description of a subscription action
)
Parameters
login
[in] The login of the user, for whom the subscription is added.
subscription
[in] ID of subscription configuration to be added.
record
[out] Description of the created subscription.
history
[out] Description of the action which was performed to create the subscription.
Return Value
An indication of successful completion is the MT_RET_OK response code. Otherwise, an error code will be returned.
Note
When the method is called, it is checked whether subscription adding is allowed according to the IMTConSubscription::ControlMode parameter. If necessary, the subscription cost
is debited from the corresponding account. Thus, subscribing by this method is similar to how a trader subscribes.
When a subscription is added by this method, both handlers are called: IMTSubscriptionSink::OnSubscriptionJoin and IMTSubscriptionSink::OnSubscriptionAdd.
IMTAdminAPI::SubscriptionJoinBatch
Bulk adding of subscriptions for users.
C++
MTAPIRES IMTAdminAPI::SubscriptionJoinBatch(
const UINT64* logins, // Array of users
const UINT64* subscriptions, // Array of configuration IDs
const UINT total, // Number
MTAPIRES* results // Array of results
IMTSubscriptionArray* records, // Description of subscriptions
IMTSubscriptionHistoryArray* history // Description of subscription actions
)
file:///C:/Users/Administrator/AppData/Local/Temp/~hh4BC4.htm 7/17/2025
Manager API Page 247 of 464
Parameters
logins
[in] An array of user logins for which the subscriptions are added. The array size must match the array of the 'subscriptions' array.
subscriptions
[in] An array of IDs of subscription configurations which are added. The array size must match the array of the 'logins' array.
total
[in] The number of logins/subscriptions.
results
[out] an array with subscription adding results. The size of the 'results' array must not be less than that of 'logins'.
records
[out] An array of descriptions of created subscriptions.
history
[out] An array of descriptions of actions which were performed to create subscriptions
Return Value
The MT_RET_OK response code indicates that all orders have been updated. The MT_RET_ERR_PARTIAL response code means that only some of the subscriptions have been
added. Analyze the 'results' array for a detailed information on execution results. The result of adding of each subscription from the 'subscriptions' array is added to 'results'. The
result index corresponds to the subscription index in the source array.
Note
When the method is called, it is checked whether subscription adding is allowed according to the IMTConSubscription::ControlMode parameter. If necessary, the subscription cost
is debited from the corresponding account. Thus, subscribing by this method is similar to how a trader subscribes.
When a subscription is added by this method, both handlers are called: IMTSubscriptionSink::OnSubscriptionJoin and IMTSubscriptionSink::OnSubscriptionAdd.
Sorting of logins and subscriptions added for them in the 'logins' and 'subscriptions' arrays must match.
IMTAdminAPI::SubscriptionCancel
Cancel a subscription for a user.
C++
MTAPIRES IMTAdminAPI::SubscriptionCancel(
const UINT64 login, // User
const UINT64 subscription, // Subscription configuration ID
IMTSubscription* record, // Subscription description
IMTSubscriptionHistory* history // Description of a subscription action
)
Parameters
login
[in] The login of the user, for whom the subscription is canceled.
subscription
[in] ID of subscription configuration to be canceled.
record
[out] Description of the canceled subscription.
history
[out] Description of the action which was performed to cancel the subscription.
Return Value
An indication of successful completion is the MT_RET_OK response code. Otherwise, an error code will be returned.
Note
When the method is called, it is checked whether unsubscription is allowed according to the IMTConSubscription::ControlMode parameter.
When a subscription is canceled by this method, both handlers are called: IMTSubscriptionSink::OnSubscriptionCancel and IMTSubscriptionSink::OnSubscriptionDelete.
IMTAdminAPI::SubscriptionCancelBatch
Bulk canceling of user subscriptions.
C++
file:///C:/Users/Administrator/AppData/Local/Temp/~hh4BC4.htm 7/17/2025
Manager API Page 248 of 464
MTAPIRES IMTAdminAPI::SubscriptionCancelBatch(
const UINT64* logins, // Array of users
const UINT64* subscriptions, // Array of configuration IDs
const UINT total, // Number
MTAPIRES* results, // Array of results
IMTSubscriptionArray* records, // Description of subscriptions
IMTSubscriptionHistoryArray* history // Description of subscription actions
)
Parameters
logins
[in] An array of user logins for which the subscriptions are canceled. The array size must match the array of the 'subscriptions' array.
subscriptions
[in] An array of IDs of subscription configurations which are canceled. The array size must match the array of the 'logins' array.
total
[in] The number of logins/subscriptions.
results
[out] an array with subscription canceling results. The size of the 'results' array must not be less than that of 'logins'.
records
[out] An array of descriptions of canceled subscriptions.
history
[out] An array of descriptions of actions which were performed to canceled subscriptions
Return Value
The MT_RET_OK response code indicates that all orders have been updated. The MT_RET_ERR_PARTIAL response code means that only some of the subscriptions have been
added. To obtain further details, you can check subscription statuses in the returned 'records' array (IMTSubscription::Status).
Note
When the method is called, it is checked whether unsubscription is allowed according to the IMTConSubscription::ControlMode parameter.
When a subscription is added by this method, both handlers are called: IMTSubscriptionSink::OnSubscriptionJoin and IMTSubscriptionSink::OnSubscriptionAdd.
Sorting of logins and subscriptions added for them in the 'logins' and 'subscriptions' arrays must match.
IMTAdminAPI::SubscriptionUpdate
Edit a user subscription in the server database.
C++
MTAPIRES IMTAdminAPI::SubscriptionUpdate(
IMTSubscription* record // Subscription description
)
Parameters
record
[in] Subscription description. The key field for finding an exiting record is IMTSubscription::ID.
Return Value
An indication of successful completion is the MT_RET_OK response code. Otherwise, an error code will be returned. For example, if the specified subscription does not exist, the
response code MT_RET_ERR_NOTFOUND will be returned.
Note
When the method is called, it is NOT checked whether subscription change is allowed according to the IMTConSubscription::ControlMode parameter. Changes take place directly
in the database.
A subscription can only be updated from the applications connected to the trade server, on which the subscription has been created. For all other applications, the response code
MT_RET_ERR_NOTMAIN is returned. If the object is not found, the response code MT_RET_ERR_NOTFOUND is returned.
All required fields of subscriptions must be filled in, not only the ones that need to be changed. It is recommended that you first receive a subscription from the server, change
the required fields, and then send it back to the server.
The manager account requires the RIGHT_SUBSCRIPTIONS_EDIT permission in order to be able to use this function.
IMTAdminAPI::SubscriptionUpdateBatch
Bulk change of user subscriptions in the server database.
C++
MTAPIRES IMTAdminAPI::SubscriptionUpdateBatch(
IMTSubscriptionArray* records, // Array of subscriptions
MTAPIRES* results // Array of results
)
.NET
file:///C:/Users/Administrator/AppData/Local/Temp/~hh4BC4.htm 7/17/2025
Manager API Page 249 of 464
MTRetCode CIMTAdminAPI.SubscriptionUpdateBatch(
CIMTSubscriptionArray records, // Array of subscriptions
MTRetCode[] res // Array of results
)
Parameters
records
[in] Array of subscriptions. The key field for finding exiting records is IMTSubscription::ID.
results
[out] an array with subscription changing results. The size of the 'results' array must not be less than that of 'records'.
Return Value
The MT_RET_OK response code indicates that all subscriptions have been updated. The MT_RET_ERR_PARTIAL response code means that only some of the subscriptions have been
updated. Analyze the 'results' array for a detailed information on execution results. The result of update of each subscription from the 'records' array is added to 'results'. The
result index corresponds to the subscription index in the source array.
Note
When the method is called, it is NOT checked whether subscription change is allowed according to the IMTConSubscription::ControlMode parameter. Changes take place directly
in the database.
A subscription can only be updated from the applications connected to the trade server, on which the subscription has been created. For all other applications, the response code
MT_RET_ERR_NOTMAIN is returned. If the object is not found, the response code MT_RET_ERR_NOTFOUND is returned.
All required fields of subscriptions must be filled in, not only the ones that need to be changed. It is recommended that you first receive subscriptions from the server, change
the required fields, and then send them back to the server.
The manager account requires the RIGHT_SUBSCRIPTIONS_EDIT permission in order to be able to use this function.
IMTAdminAPI::SubscriptionUpdateBatchArray
Bulk change of user subscriptions in the server database.
C++
MTAPIRES IMTAdminAPI::SubscriptionUpdateBatchArray(
IMTSubscription** records, // Array of subscriptions
MTAPIRES* results // Array of results
)
.NET
MTRetCode CIMTAdminAPI.SubscriptionUpdateBatchArray(
CIMTSubscription[] records, // Array of subscriptions
MTRetCode[] res // Array of results
)
Parameters
records
[in] A pointer to the array of subscriptions. The key field for finding exiting records is IMTSubscription::ID.
results
[out] an array with subscription changing results. The size of the 'results' array must not be less than that of 'records'.
Return Value
The MT_RET_OK response code indicates that all subscriptions have been updated. The MT_RET_ERR_PARTIAL response code means that only some of the subscriptions have been
updated. Analyze the 'results' array for a detailed information on execution results. The result of update of each subscription from the 'records' array is added to 'results'. The
result index corresponds to the subscription index in the source array.
Note
When the method is called, it is NOT checked whether subscription change is allowed according to the IMTConSubscription::ControlMode parameter. Changes take place directly
in the database.
A subscription can only be updated from the applications connected to the trade server, on which the subscription has been created. For all other applications, the response code
MT_RET_ERR_NOTMAIN is returned. If the object is not found, the response code MT_RET_ERR_NOTFOUND is returned.
All required fields of subscriptions must be filled in, not only the ones that need to be changed. It is recommended that you first receive subscriptions from the server, change
the required fields, and then send them back to the server.
The manager account requires the RIGHT_SUBSCRIPTIONS_EDIT permission in order to be able to use this function.
IMTAdminAPI::SubscriptionDelete
Delete a user subscription from the server database.
C++
MTAPIRES IMTAdminAPI::SubscriptionDelete(
const UINT64 id // Subscription ID
)
Parameters
id
[in] Subscription ID. The IMTSubscription::ID value is used as the identifier.
Return Value
An indication of successful completion is the MT_RET_OK response code. Otherwise, an error code will be returned. For example, if the specified subscription does not exist, the
response code MT_RET_ERR_NOTFOUND will be returned.
Note
file:///C:/Users/Administrator/AppData/Local/Temp/~hh4BC4.htm 7/17/2025
Manager API Page 250 of 464
When the method is called, it is NOT checked whether subscription change is allowed according to the IMTConSubscription::ControlMode parameter. Changes take place directly
in the database.
A subscription can only be deleted from the applications connected to the trade server, on which the subscription has been created. For all other applications, the response code
MT_RET_ERR_NOTMAIN is returned. If the object is not found, the response code MT_RET_ERR_NOTFOUND is returned.
When a deleting a subscription by this method, the IMTSubscriptionSink::OnSubscriptionDelete handler is called, while the IMTSubscriptionSink::OnSubscriptionCancel handler is
not called.
The manager account requires the RIGHT_SUBSCRIPTIONS_EDIT permission in order to be able to use this function.
IMTAdminAPI::SubscriptionDeleteBatch
Delete a user subscription from the server database.
MTAPIRES IMTAdminAPI::SubscriptionDeleteBatch(
const UINT64* ids, // Array of IDs
const UINT ids_total, // Number of IDs in the array
MTAPIRES* results // Array of results
)
.NET
MTRetCode CIMTAdminAPI.SubscriptionDeleteBatch(
ulong[] ids, // Array of IDs
MTRetCode[] retcodes // Array of results
)
Parameters
ids
[in] A pointer to an array of IDs of subscriptions which you want to delete. The IMTSubscription::ID value is used as the identifier.
ids_total
[in] The number of identifiers in the 'ids' array.
results
[out] an array with subscription deletion results. The size of the 'results' array must not be less than that of 'ids'.
Return Value
The MT_RET_OK response code indicates that all subscriptions have been deleted. The MT_RET_ERR_PARTIAL response code means that only some of the subscriptions have been
deleted. Analyze the 'results' array for a detailed information on execution results. The result of deletion of each subscription from the 'ids' array is added to 'results'. The result
index corresponds to the id index in the source array.
Note
When the method is called, it is NOT checked whether subscription deletion is allowed according to the IMTConSubscription::ControlMode parameter. Changes take place directly
in the database.
A subscription can only be deleted from the applications connected to the trade server, on which the subscription has been created. For all other applications, the response code
MT_RET_ERR_NOTMAIN is returned. If the object is not found, the response code MT_RET_ERR_NOTFOUND is returned.
When a deleting a subscription by this method, the IMTSubscriptionSink::OnSubscriptionDelete handler is called, while the IMTSubscriptionSink::OnSubscriptionCancel handler is
not called.
The manager account requires the RIGHT_SUBSCRIPTIONS_EDIT permission in order to be able to use this function.
IMTAdminAPI::SubscriptionRequest
Request all user subscriptions from the server.
C++
MTAPIRES IMTAdminAPI::SubscriptionRequest(
const UINT64 login, // Login
IMTSubscriptionArray* records // Array of subscriptions
)
.NET
MTRetCode CIMTAdminAPI.SubscriptionRequest(
ulong login, // Login
CIMTSubscriptionArray records // Array of subscriptions
)
Parameters
login
[in] The login of the user whose subscriptions you want to obtain.
records
[out] An object of the array of subscriptions. The 'records' object must be previously created via the IMTAdminAPI::SubscriptionCreateArray method.
Return Value
An indication of successful completion is the MT_RET_OK response code. Otherwise, an error code will be returned.
Note
The method cannot be called from event handlers (any IMT*Sink class methods).
IMTAdminAPI::SubscriptionRequestByID
Request a subscription from the server by ID.
C++
file:///C:/Users/Administrator/AppData/Local/Temp/~hh4BC4.htm 7/17/2025
Manager API Page 251 of 464
MTAPIRES IMTAdminAPI::SubscriptionRequestByID(
const UINT64 id, // ID
IMTSubscription* record // Subscription object
)
.NET
MTRetCode CIMTAdminAPI.SubscriptionRequestByID(
ulong id, // ID
CIMTSubscription record // Subscription object
)
Parameters
id
[in] Subscription ID. The IMTSubscription::ID value is used as the identifier.
record
[out] Subscription object. The 'record' object must be previously created via the IMTAdminAPI::SubscriptionCreate method.
Return Value
An indication of successful completion is the MT_RET_OK response code. Otherwise, an error code will be returned.
Note
The method cannot be called from event handlers (any IMT*Sink class methods).
IMTAdminAPI::SubscriptionRequestByIDs
Request subscriptions from the server by a list of IDs.
C++
MTAPIRES IMTAdminAPI::SubscriptionRequestByIDs(
const UINT64* ids, // IDs
const UINT ids, // Number of IDs
IMTSubscriptionArray* records // Object of array of subscriptions
)
.NET
MTRetCode CIMTAdminAPI.SubscriptionRequestByIDs(
ulong[] ids, // IDs
CIMTSubscriptionArray records // Object of array of subscriptions
)
Parameters
ids
[in] Array of subscription identifiers. The IMTSubscription::ID value is used as the identifier.
ids_total
[in] The number of identifiers in the 'ids' array.
records
[out] An object of the array of subscriptions. The 'records' object must be previously created via the IMTAdminAPI::SubscriptionCreateArray method.
Return Value
An indication of successful completion is the MT_RET_OK response code. Otherwise, an error code will be returned.
Note
The method cannot be called from event handlers (any IMT*Sink class methods).
IMTAdminAPI::SubscriptionRequestByGroup
Request subscriptions from the server by a client group.
C++
MTAPIRES IMTAdminAPI::SubscriptionRequestByGroup(
LPCWSTR group, // Group
IMTSubscriptionArray* records // Object of array of subscriptions
)
.NET
MTRetCode CIMTAdminAPI.SubscriptionRequestByGroup(
string mask, // Group
CIMTSubscriptionArray records // Object of array of subscriptions
)
Parameters
group
[in] The groups for which the subscriptions are requested. You can specify one group, several groups (comma separated) or a group mask. The mask is specified using
characters "*" (any value) and "!" (exception). For example: "demo*,!demoforex" - all groups whose names begin with 'demo', except for the group demoforex.
records
[out] An object of the array of subscriptions. The 'records' object must be previously created via the IMTAdminAPI::SubscriptionCreateArray method.
Return Value
An indication of successful completion is the MT_RET_OK response code. Otherwise, an error code will be returned.
Note
The method cannot be called from event handlers (any IMT*Sink class methods).
file:///C:/Users/Administrator/AppData/Local/Temp/~hh4BC4.htm 7/17/2025
Manager API Page 252 of 464
IMTAdminAPI::SubscriptionRequestByLogins
Request subscriptions from the server by a list of logins.
C++
MTAPIRES IMTAdminAPI::SubscriptionRequestByLogins(
const UINT64* logins, // Logins
const UINT logins_total, // Number of logins
IMTSubscriptionArray* records // Object of array of subscriptions
)
.NET
MTRetCode CIMTAdminAPI.SubscriptionRequestByLogins(
ulong[] logins, // Logins
CIMTSubscriptionArray records // Object of array of subscriptions
)
Parameters
logins
[in] Array of client logins.
logins_total
[in] Number of logins in the 'logins' array.
records
[out] An object of the array of subscriptions. The 'records' object must be previously created via the IMTAdminAPI::SubscriptionCreateArray method.
Return Value
An indication of successful completion is the MT_RET_OK response code. Otherwise, an error code will be returned.
Note
The method cannot be called from event handlers (any IMT*Sink class methods).
IMTAdminAPI::SubscriptionHistoryCreate
Create a subscription action object.
C++
IMTSubscriptionHistory* IMTAdminAPI::SubscriptionHistoryCreate()
.NET
CIMTSubscriptionHistory CIMTAdminAPI.SubscriptionHistoryCreate()
Return Value
Returns a pointer to the created object that implements the IMTSubscriptionHistory interface. Null is returned in case of failure.
Note
The created object must be destroyed by calling the IMTSubscriptionHistory::Release method of this object.
IMTAdminAPI::SubscriptionHistoryCreateArray
Create an object of an array of subscription actions.
C++
IMTSubscriptionHistoryArray* IMTAdminAPI::SubscriptionHistoryCreateArray()
.NET
CIMTSubscriptionHistoryArray CIMTAdminAPI.SubscriptionHistoryCreateArray()
Return Value
Returns a pointer to the created object that implements the IMTSubscriptionHistoryArray interface. Null is returned in case of failure.
Note
The created object must be destroyed by calling the IMTSubscriptionHistoryArray::Release method of this object.
IMTAdminAPI::SubscriptionHistoryUpdate
Edit a user subscription action in the server database.
C++
MTAPIRES IMTAdminAPI::SubscriptionHistoryUpdate(
IMTSubscriptionHistory* record // Action description
)
Parameters
file:///C:/Users/Administrator/AppData/Local/Temp/~hh4BC4.htm 7/17/2025
Manager API Page 253 of 464
record
[in] Subscription action description. The key field for finding an exiting record is IMTSubscriptionHistory::ID.
Return Value
An indication of successful completion is the MT_RET_OK response code. Otherwise, an error code will be returned. For example, if the specified subscription does not exist, the
response code MT_RET_ERR_NOTFOUND will be returned.
Note
An action can only be edited from the applications connected to the trade server, on which the action has been created. For all other applications, the response code
MT_RET_ERR_NOTMAIN is returned. If the object is not found, the response code MT_RET_ERR_NOTFOUND is returned.
All required action fields must be filled in, not only the ones that need to be changed. It is recommended that you first receive an action description from the server, change the
required fields in them and then send it back to the server.
The manager account must have the RIGHT_SUBSCRIPTIONS_EDIT permission to use this function.
IMTAdminAPI::SubscriptionHistoryUpdateBatch
Bulk change of user subscription actions in the server database.
C++
MTAPIRES IMTAdminAPI::SubscriptionHistoryUpdateBatch(
IMTSubscriptionHistoryArray* records, // Array of actions
MTAPIRES* results // Array of results
)
.NET
MTRetCode CIMTAdminAPI.SubscriptionHistoryUpdateBatch(
CIMTSubscriptionHistoryArray records, // Array of actions
MTRetCode[] res // Array of reasults
)
Parameters
records
[in] Array of subscription actions. The key field for finding exiting records is IMTSubscriptionHistory::ID.
results
[out] An array with action editing results. The size of the 'results' array must not be less than that of 'records'.
Return Value
The MT_RET_OK response code means that all specified actions have been updated. The MT_RET_ERR_PARTIAL response code means that only some of the actions have been
updated. Analyze the 'results' array for a detailed information on execution results. The result of update of each subscription action from the 'records' array is added to 'results'.
The index of a result corresponds to the index of a subscription in the source array.
Note
An action can only be edited from the applications connected to the trade server, on which the action has been created. For all other applications, the response code
MT_RET_ERR_NOTMAIN is returned. If the object is not found, the response code MT_RET_ERR_NOTFOUND is returned.
All required action fields must be filled in, not only the ones that need to be changed. It is recommended that you first receive action descriptions from the server, change the
required fields in them and then send them back to the server.
The manager account must have the RIGHT_SUBSCRIPTIONS_EDIT permission to use this function.
IMTAdminAPI::SubscriptionHistoryUpdateBatchArray
Bulk change of user subscription actions in the server database.
C++
MTAPIRES IMTAdminAPI::SubscriptionHistoryUpdateBatchArray(
IMTSubscriptionHistory** records, // Array of actions
MTAPIRES* results // Array of results
)
.NET
MTRetCode CIMTAdminAPI.SubscriptionHistoryUpdateBatchArray(
CIMTSubscriptionHistory[] records, // Array of actions
MTRetCode[] res // Array of results
)
Parameters
records
[in] A pointer to an array of subscription actions. The key field for finding exiting records is IMTSubscriptionHistory::ID.
results
[out] An array with action editing results. The size of the 'results' array must not be less than that of 'records'.
Return Value
The MT_RET_OK response code means that all specified actions have been updated. The MT_RET_ERR_PARTIAL response code means that only some of the actions have been
updated. Analyze the 'results' array for a detailed information on execution results. The result of update of each subscription action from the 'records' array is added to 'results'.
The index of a result corresponds to the index of a subscription in the source array.
Note
An action can only be edited from the applications connected to the trade server, on which the action has been created. For all other applications, the response code
MT_RET_ERR_NOTMAIN is returned. If the object is not found, the response code MT_RET_ERR_NOTFOUND is returned.
All required action fields must be filled in, not only the ones that need to be changed. It is recommended that you first receive action descriptions from the server, change the
required fields in them and then send them back to the server.
The manager account must have the RIGHT_SUBSCRIPTIONS_EDIT permission to use this function.
file:///C:/Users/Administrator/AppData/Local/Temp/~hh4BC4.htm 7/17/2025
Manager API Page 254 of 464
IMTAdminAPI::SubscriptionHistoryDelete
Delete a user subscription action from the server database.
C++
MTAPIRES IMTAdminAPI::SubscriptionHistoryDelete(
const UINT64 id // Action identifier
)
Parameters
id
[in] Action identifier. The IMTSubscriptionHistory::ID value is used for the identifier.
Return Value
An indication of successful completion is the MT_RET_OK response code. Otherwise, an error code will be returned. For example, if the specified subscription does not exist, the
response code MT_RET_ERR_NOTFOUND will be returned.
Note
An action can only be deleted from the applications connected to the trade server, on which the action has been created. For all other applications, the response code
MT_RET_ERR_NOTMAIN is returned. If the object is not found, the response code MT_RET_ERR_NOTFOUND is returned.
The manager account must have the RIGHT_SUBSCRIPTIONS_EDIT permission to use this function.
IMTAdminAPI::SubscriptionHistoryDeleteBatch
Delete a batch of user subscription actions from the server database.
MTAPIRES IMTAdminAPI::SubscriptionHistoryDeleteBatch(
const UINT64* ids, // Array of IDs
const UINT ids_total, // The number of IDs in the array
MTAPIRES* results // Array of results
)
.NET
MTRetCode CIMTAdminAPI.SubscriptionHistoryDeleteBatch(
ulong[] ids, // Array of IDs
MTRetCode[] retcodes // Array of results
)
Parameters
ids
[in] A pointer to an array of IDs of subscription actions which you want to delete. The IMTSubscriptionHistory::ID value is used for the identifier.
ids_total
[in] The number of identifiers in the 'ids' array.
results
[out] An array with action deletion results. The size of the 'results' array must not be less than that of 'ids'.
Return Value
The MT_RET_OK response code indicates that all actions have been deleted. The MT_RET_ERR_PARTIAL response code means that only some of the actions have been deleted.
Analyze the 'results' array for a detailed information on execution results. The result of deletion of each action from the 'ids' array is added to 'results'. The result index
corresponds to the action index in the source array.
Note
An action can only be deleted from the applications connected to the trade server, on which the action has been created. For all other applications, the response code
MT_RET_ERR_NOTMAIN is returned. If the object is not found, the response code MT_RET_ERR_NOTFOUND is returned.
The manager account must have the RIGHT_SUBSCRIPTIONS_EDIT permission to use this function.
IMTAdminAPI::SubscriptionHistoryRequest
Request user subscription action from the server for the specified date range.
C++
MTAPIRES IMTAdminAPI::SubscriptionHistoryRequest(
const UINT64 login, // Login
const INT64 from, // Period start
const INT64 to, // Period end
IMTSubscriptionHistoryArray* records // Array of actions
)
.NET
MTRetCode CIMTAdminAPI.SubscriptionHistoryRequest(
ulong login, // Login
long from, // Period start
long to, // Period end
CIMTSubscriptionHistoryArray records // Array of actions
)
Parameters
login
[in] The login of the user whose actions you want to obtain.
from
[in] The beginning of the period for which you need to get actions. The date is specified in seconds since 01.01.1970.
to
file:///C:/Users/Administrator/AppData/Local/Temp/~hh4BC4.htm 7/17/2025
Manager API Page 255 of 464
[in] The end of the period for which you need to get actions. The date is specified in seconds since 01.01.1970.
records
[out] Object of an array of subscription actions. The 'records' object must be pre-created by the IMTAdminAPI::SubscriptionHistoryCreateArray method.
Return Value
An indication of successful completion is the MT_RET_OK response code. Otherwise, an error code will be returned.
Note
The method cannot be called from event handlers (any IMT*Sink class methods).
IMTAdminAPI::SubscriptionHistoryRequestByID
Request a subscription action from the server by its identifier.
C++
MTAPIRES IMTAdminAPI::SubscriptionHistoryRequestByID(
const UINT64 id, // Identifier
IMTSubscriptionHistory* record // Action object
)
.NET
MTRetCode CIMTAdminAPI.SubscriptionHistoryRequestByID(
ulong id, // Identifier
CIMTSubscriptionHistory record // Action object
)
Parameters
id
[in] Subscription action identifier. The IMTSubscriptionHistory::ID value is used for the identifier.
record
[out] Subscription action object. The 'record' object must be previously created via the IMTAdminAPI::SubscriptionHistoryCreate method.
Return Value
An indication of successful completion is the MT_RET_OK response code. Otherwise, an error code will be returned.
Note
The method cannot be called from event handlers (any IMT*Sink class methods).
IMTAdminAPI::SubscriptionHistoryRequestByIDs
Request subscription actions from the server by a list of identifiers.
C++
MTAPIRES IMTAdminAPI::SubscriptionHistoryRequestByIDs(
const UINT64* ids, // IDs
const UINT ids, // Number of IDs
IMTSubscriptionHistoryArray* records // Object of the actions array
)
.NET
MTRetCode CIMTAdminAPI.SubscriptionHistoryRequestByIDs(
ulong[] ids, // IDs
CIMTSubscriptionHistoryArray records // Object of an array of actions
)
Parameters
ids
[in] Array of action identifiers. The IMTSubscriptionHistory::ID value is used for the identifier.
ids_total
[in] The number of identifiers in the 'ids' array.
records
[out] Object of an array of subscription actions. The 'records' object must be pre-created by the IMTAdminAPI::SubscriptionHistoryCreateArray method.
Return Value
An indication of successful completion is the MT_RET_OK response code. Otherwise, an error code will be returned.
Note
The method cannot be called from event handlers (any IMT*Sink class methods).
IMTAdminAPI::SubscriptionHistoryRequestByGroup
Request subscription actions from the server by a client group.
C++
MTAPIRES IMTAdminAPI::SubscriptionHistoryRequestByGroup(
LPCWSTR group, // Group
const INT64 from, // Period start
const INT64 to, // Period end
IMTSubscriptionHistoryArray* records // Object of the actions array
)
.NET
file:///C:/Users/Administrator/AppData/Local/Temp/~hh4BC4.htm 7/17/2025
Manager API Page 256 of 464
MTRetCode CIMTAdminAPI.SubscriptionHistoryRequestByGroup(
string mask, // Group
long from, // Period start
long to, // Period end
CIMTSubscriptionHistoryArray records // Action array object
)
Parameters
group
[in] The groups the actions are requested for. You can specify one group, several groups (comma separated) or a group mask. The mask is specified using characters "*" (any
value) and "!" (exception). For example: "demo*,!demoforex" - all groups with the names beginning with 'demo', except for the group demoforex.
from
[in] The beginning of the period for which you need to get actions. The date is specified in seconds since 01.01.1970.
to
[in] The end of the period for which you need to get actions. The date is specified in seconds since 01.01.1970.
records
[out] Object of an array of subscription actions. The 'records' object must be pre-created by the IMTAdminAPI::SubscriptionHistoryCreateArray method.
Return Value
An indication of successful completion is the MT_RET_OK response code. Otherwise, an error code will be returned.
Note
The method cannot be called from event handlers (any IMT*Sink class methods).
IMTAdminAPI::SubscriptionHistoryRequestByLogins
Request subscription actions from the server by a list of logins.
C++
MTAPIRES IMTAdminAPI::SubscriptionHistoryRequestByLogins(
const UINT64* logins, // Logins
const UINT logins_total, // Number of logins
const INT64 from, // Period start
const INT64 to, // Period end
IMTSubscriptionHistoryArray* records // Action array object
)
.NET
MTRetCode CIMTAdminAPI.SubscriptionHistoryRequestByLogins(
ulong[] logins, // Logins
long from, // Period start
long to, // Period end
CIMTSubscriptionHistoryArray records // Action array object
)
Parameters
logins
[in] Array of client logins.
logins_total
[in] Number of logins in the 'logins' array.
from
[in] The beginning of the period for which you need to get actions. The date is specified in seconds since 01.01.1970.
to
[in] The end of the period for which you need to get actions. The date is specified in seconds since 01.01.1970.
records
[out] Object of an array of subscription actions. The 'records' object must be pre-created by the IMTAdminAPI::SubscriptionHistoryCreateArray method.
Return Value
An indication of successful completion is the MT_RET_OK response code. Otherwise, an error code will be returned.
Note
The method cannot be called from event handlers (any IMT*Sink class methods).
Custom Functions
MetaTrader 5 Manager API provides the possibility of extending the protocol for running custom commands on the server. Currently, there are two functions for this purpose:
Function Purpose
CustomCommand Sends a custom command to the server.
CustomCreateStream Creation of an object of a byte stream.
IMTAdminAPI::CustomCommand
Sends a custom command to the server.
C++
file:///C:/Users/Administrator/AppData/Local/Temp/~hh4BC4.htm 7/17/2025
Manager API Page 257 of 464
.NET
byte[] CIMTAdminAPI.CustomCommand(
byte[] indata, // Input data
out MTRetCode res // Response code
)
Parameters
indata
[in] Data returned to the server.
indata_len
[in] Size of data to pass in bytes.
outdata
[out] A reference to the data returned in response to the command.
outdata_len
[out] A reference to the size of data returned in response to the command.
Return Value
An indication of successful completion is the MT_RET_OK response code. Otherwise, an error has occurred that corresponds to the response code.
Note
An appropriate plugin must be installed in the server for processing custom commands (IMTCustomSink::HookManagerCommand).
It is recommended to use this variant of the function only when working with small and infrequent data transmissions. The second variant of the function described below is
adapted for transmission of large amount of data.
IMTAdminAPI::CustomCommand
Sends a custom command to the server.
C++
virtual MTAPIRES IMTAdminAPI::CustomCommand(
IMTByteStream* indata, // Input data
IMTByteStream* outdata, // Output data
)
.NET
MTRetCode CIMTAdminAPI.CustomCommand(
CIMTByteStream indata, // Input data
CIMTByteStream outdata, // Output data
)
Parameters
indata
[in] A pointer to the object of a byte stream passed to the server.
outdata
[out] A pointer to the object of a byte stream returned in response to the command.
Return Value
An indication of successful completion is the MT_RET_OK response code. Otherwise, an error has occurred that corresponds to the response code.
Note
An appropriate plugin must be installed in the server for processing custom commands. (IMTCustomSink::HookManagerCommand).
For transmission of large amount of data and for frequent transmissions it is recommended to use this exact variant of the function.
IMTManagerAPI::CustomCreateStream
Creation of an object of a byte stream.
C++
IMTByteStream* IMTManagerAPI::CustomCreateStream()
.NET
CIMTByteStream CIMTManagerAPI.CustomCreateStream()
Return Value
It returns a pointer to the created object that implements the IMTByteStream interface. In case of failure, it returns NULL.
Note
The created object must be deleted by calling the IMTByteStream::Release method of this object.
ECN
MetaTrader 5 API provides access to built-in ECN databases. Functions from these section enable the detailed analysis of the current matching queue and history, of operations with
liquidity providers and other data.
Function Purpose
file:///C:/Users/Administrator/AppData/Local/Temp/~hh4BC4.htm 7/17/2025
Manager API Page 258 of 464
Function Purpose
ECNCreateMatching Create a matching order object.
ECNCreateMatchingArray Create an array of matching order objects.
ECNCreateFilling Create a filling order object.
ECNCreateFillingArray Create an array of filling objects.
ECNCreateProvider Create an object of a provider via which orders are executed.
ECNCreateProviderArray Create an object of the array of providers via which orders are executed.
ECNCreateHistoryMatching Create an object of a matching order from history.
ECNCreateHistoryMatchingArray Create an array of matching order objects from history.
ECNCreateHistoryFilling Create an object of a filling order from history.
ECNCreateHistoryFillingArray Create an array of filling order objects from history.
ECNCreateHistoryDeal Create an object of a deal from the ECN history.
ECNCreateHistoryDealArray Create an object of an array of deals from the ECN history.
ECNRequestByGroup Request the current state of matching for the specified client groups.
ECNRequestByLogins Request the current state of matching for the specified logins.
ECNRequestByTickets Request the current state of matching for the specified order tickets.
ECNRequestHistoryByGroup Request the matching history for the specified client groups.
ECNRequestHistoryByLogins Request the matching history for the specified logins.
ECNRequestHistoryByTickets Request the matching history for the specified order tickets.
IMTAdminAPI::ECNCreateMatching
Create a matching order object.
C++
IMTECNMatching* IMTAdminAPI::ECNCreateMatching()
.NET
CIMTECNMatching CIMTAdminAPI.ECNCreateMatching()
Return Value
The function returns a pointer to the created object that implements the IMTECNMatching interface. Null is returned in case of failure.
Note
The created object must be destroyed by calling the IMTECNMatching::Release method of this object.
IMTAdminAPI::ECNCreateMatchingArray
Create an array of matching order objects.
C++
IMTECNMatchingArray* IMTAdminAPI::ECNCreateMatchingArray()
.NET
CIMTECNMatchingArray CIMTAdminAPI.ECNCreateMatchingArray()
Return Value
The function returns a pointer to the created object that implements the IMTECNMatchingArray interface. Null is returned in case of failure.
Note
The created object must be destroyed by calling the IMTECNMatchingArray::Release method of this object.
IMTAdminAPI::ECNCreateFilling
Create a filling order object.
C++
IMTECNFilling* IMTAdminAPI::ECNCreateFilling()
.NET
CIMTECNFilling CIMTAdminAPI.ECNCreateFilling()
Return Value
The function returns a pointer to the created object that implements the IMTECNFilling interface. Null is returned in case of failure.
Note
The created object must be destroyed by calling the IMTECNFilling::Release method of this object.
file:///C:/Users/Administrator/AppData/Local/Temp/~hh4BC4.htm 7/17/2025
Manager API Page 259 of 464
IMTAdminAPI::ECNCreateFillingArray
Create an array of filling objects.
C++
IMTECNFillingArray* IMTAdminAPI::ECNCreateFillingArray()
.NET
CIMTECNFillingArray CIMTAdminAPI.ECNCreateFillingArray()
Return Value
The function returns a pointer to the created object that implements the IMTECNFillingArray interface. Null is returned in case of failure.
Note
The created object must be destroyed by calling the IMTECNFillingArray::Release method of this object.
IMTAdminAPI::ECNCreateProvider
Create an object of a provider via which orders are executed.
C++
IMTECNProvider* IMTAdminAPI::ECNCreateProvider()
.NET
CIMTECNProvider CIMTAdminAPI.ECNCreateProvider()
Return Value
The function returns a pointer to the created object that implements the IMTECNProvider interface. Null is returned in case of failure.
Note
The created object must be destroyed by calling the IMTECNProvider::Release method of this object.
IMTAdminAPI::ECNCreateProviderArray
Create an object of the array of providers via which orders are executed.
C++
IMTECNProviderArray* IMTAdminAPI::ECNCreateProviderArray()
.NET
CIMTECNProviderArray CIMTAdminAPI.ECNCreateProviderArray()
Return Value
The function returns a pointer to the created object that implements the IMTECNProviderArray interface. Null is returned in case of failure.
Note
The created object must be destroyed by calling the IMTECNProviderArray::Release method of this object.
IMTAdminAPI::ECNCreateHistoryMatching
Create an object of a matching order from history.
C++
IMTECNHistoryMatching* IMTAdminAPI::ECNCreateHistoryMatching()
.NET
CIMTECNHistoryMatching CIMTAdminAPI.ECNCreateHistoryMatching()
Return Value
The function returns a pointer to the created object that implements the IMTECNHistoryFillingArray interface. Null is returned in case of failure.
Note
The created object must be destroyed by calling the IMTECNHistoryMatching::Release method of this object.
IMTAdminAPI::ECNCreateHistoryMatchingArray
Create an array of matching order objects from history.
C++
IMTECNHistoryMatchingArray* IMTAdminAPI::ECNCreateHistoryMatchingArray()
.NET
CIMTECNHistoryMatchingArray CIMTAdminAPI.ECNCreateHistoryMatchingArray()
Return Value
The function returns a pointer to the created object that implements the IMTECNHistoryMatchingArray interface. Null is returned in case of failure.
Note
file:///C:/Users/Administrator/AppData/Local/Temp/~hh4BC4.htm 7/17/2025
Manager API Page 260 of 464
The created object must be destroyed by calling the IMTECNHistoryMatchingArray::Release method of this object.
IMTAdminAPI::ECNCreateHistoryFilling
Create an object of a filling order from history.
C++
IMTECNHistoryFilling* IMTAdminAPI::ECNCreateHistoryFilling()
.NET
CIMTECNHistoryFilling CIMTAdminAPI.ECNCreateHistoryFilling()
Return Value
The function returns a pointer to the created object that implements the IMTECNHistoryFilling interface. Null is returned in case of failure.
Note
The created object must be destroyed by calling the IMTECNHistoryFilling::Release method of this object.
IMTAdminAPI::ECNCreateHistoryFillingArray
Create an array of filling order objects from history.
C++
IMTECNHistoryFillingArray* IMTAdminAPI::ECNCreateHistoryFillingArray()
.NET
CIMTECNHistoryFillingArray CIMTAdminAPI.ECNCreateHistoryFillingArray()
Return Value
The function returns a pointer to the created object that implements the IMTECNHistoryFillingArray interface. Null is returned in case of failure.
Note
The created object must be destroyed by calling the IMTECNHistoryFillingArray::Release method of this object.
IMTAdminAPI::ECNCreateHistoryDeal
Create an object of a deal from the ECN history.
C++
IMTECNHistoryDeal* IMTAdminAPI::ECNCreateHistoryDeal()
.NET
CIMTECNHistoryDeal CIMTAdminAPI.ECNCreateHistoryDeal()
Return Value
The function returns a pointer to the created object that implements the IMTECNHistoryFilling interface. Null is returned in case of failure.
Note
The created object must be destroyed by calling the IMTECNHistoryDeal::Release method of this object.
IMTAdminAPI::ECNCreateHistoryDealArray
Create an object of an array of deals from the ECN history.
C++
IMTECNHistoryDealArray* IMTAdminAPI::ECNCreateHistoryDealArray()
.NET
IMTECNHistoryDealArray CIMTAdminAPI.ECNCreateHistoryDealArray()
Return Value
The function returns a pointer to the created object that implements the IMTECNHistoryFilling interface. Null is returned in case of failure.
Note
The created object must be destroyed by calling the IMTECNHistoryDealArray::Release method of this object.
IMTAdminAPI::ECNRequestByGroup
Request the current state of matching for the specified client groups.
C++
MTAPIRES IMTAdminAPI::ECNRequestByGroup(
LPCWSTR mask, // groups
IMTECNMatchingArray* matching, // array of matching orders
IMTECNFillingArray* filling, // array of filling orders
IMTECNProviderArray* providers // array of providers
)
file:///C:/Users/Administrator/AppData/Local/Temp/~hh4BC4.htm 7/17/2025
Manager API Page 261 of 464
.NET
MTRetCode CIMTAdminAPI.ECNRequestByGroup(
string mask, // groups
CIMTECNMatchingArray matching, // array of matching orders
CIMTECNFillingArray filling, // array of filling orders
CIMTECNProviderArray providers // array of providers
)
Parameters
groups
[in] Client group the data is requested for. You can specify one group, several groups (comma separated) or a group mask. The mask is specified using characters "*" (any value)
and "!" (exception). For example: "demo*,!demoforex" - all groups whose names begin with 'demo', except for the group demoforex.
matching
[out] An object of the array of matching orders. The 'matching' object must be previously created via the IMTAdminAPI::ECNCreateMatchingArray method.
filling
[out] An object of the array of filling orders. The 'filling' object must be previously created via the IMTAdminAPI::ECNCreateFillingArray method.
providers
[out] An object of the array of providers. The 'providers' object must be previously created via the IMTAdminAPI::ECNCreateProvidersArray method.
Return Value
An indication of a successful execution is the MT_RET_OK response code. Otherwise, an error code is returned.
Note
The method cannot be called from event handlers (any IMT*Sink class methods).
IMTAdminAPI::ECNRequestByLogins
Request the current state of matching for the specified logins.
C++
MTAPIRES IMTAdminAPI::ECNRequestByLogins(
const UINT64* logins, // logins
const UINT logins_total, // number of logins
IMTECNMatchingArray* matching, // array of matching orders
IMTECNFillingArray* filling, // array of filling orders
IMTECNProviderArray* providers // array of providers
)
.NET
MTRetCode CIMTAdminAPI.ECNRequestByLogins(
ulong[] logins, // logins
CIMTECNMatchingArray matching, // array of matching orders
CIMTECNFillingArray filling, // array of filling orders
CIMTECNProviderArray providers // array of providers
)
Parameters
logins
[in] An array of logins the data is requested for.
logins_total
[in] The number of logins in the 'logins' array.
matching
[out] An object of the array of matching orders. The 'matching' object must be previously created via the IMTAdminAPI::ECNCreateMatchingArray method.
filling
[out] An object of the array of filling orders. The 'filling' object must be previously created via the IMTAdminAPI::ECNCreateFillingArray method.
providers
[out] An object of the array of providers. The 'providers' object must be previously created via the IMTAdminAPI::ECNCreateProvidersArray method.
Return Value
An indication of a successful execution is the MT_RET_OK response code. Otherwise, an error code is returned.
Note
The method cannot be called from event handlers (any IMT*Sink class methods).
IMTAdminAPI::ECNRequestByTickets
Request the current state of matching for the specified order tickets.
C++
MTAPIRES IMTAdminAPI::ECNRequestByTickets(
const UINT64* tickets, // tickets
const UINT tickets_total, // number of tickets
IMTECNMatchingArray* matching, // array of matching orders
IMTECNFillingArray* filling, // array of filling orders
IMTECNProviderArray* providers // array of providers
)
.NET
MTRetCode CIMTAdminAPI.ECNRequestByTickets(
ulong[] tickets, // tickets
CIMTECNMatchingArray matching, // array of matching orders
CIMTECNFillingArray filling, // array of filling orders
CIMTECNProviderArray providers // array of providers
)
Parameters
file:///C:/Users/Administrator/AppData/Local/Temp/~hh4BC4.htm 7/17/2025
Manager API Page 262 of 464
tickets
[in] An array of tickets the data is requested for.
tickets_total
[in] The number of tickets in the 'tickets' array.
matching
[out] An object of the array of matching orders. The 'matching' object must be previously created via the IMTAdminAPI::ECNCreateMatchingArray method.
filling
[out] An object of the array of filling orders. The 'filling' object must be previously created via the IMTAdminAPI::ECNCreateFillingArray method.
providers
[out] An object of the array of providers. The 'providers' object must be previously created via the IMTAdminAPI::ECNCreateProvidersArray method.
Return Value
An indication of a successful execution is the MT_RET_OK response code. Otherwise, an error code is returned.
Note
The method cannot be called from event handlers (any IMT*Sink class methods).
IMTAdminAPI::ECNRequestHistoryByGroup
Request the matching history for the specified client groups.
C++
MTAPIRES IMTAdminAPI::ECNRequestHistoryByGroup(
LPCWSTR mask, // groups
const INT64 from, // period beginning
const INT64 to, // period end
IMTECNHistoryMatchingArray* matching, // array of matching orders
IMTECNHistoryFillingArray* filling, // array of filling orders
IMTECNHistoryDealArray* deals, // array of deals
IMTECNProviderArray* providers // array of providers
)
.NET
MTRetCode CIMTAdminAPI.ECNRequestHistoryByGroup(
string mask, // groups
long from, // period beginning
long to, // period end
CIMTECNMatchingArray matching, // array of matching orders
CIMTECNFillingArray filling, // array of filling orders
CIMTECNHistoryDealArray deals, // array of deals
CIMTECNProviderArray providers // array of providers
)
Parameters
groups
[in] Client group the data is requested for. You can specify one group, several groups (comma separated) or a group mask. The mask is specified using characters "*" (any value)
and "!" (exception). For example: "demo*,!demoforex" - all groups whose names begin with 'demo', except for the group demoforex.
from
[in] The beginning of the period for which you need to get data. The date is specified in seconds since 01.01.1970.
to
[in] The end of the period for which you need to get data. The date is specified in seconds since 01.01.1970.
matching
[out] An object of the array of matching orders from history. The 'matching' object must be previously created via the IMTAdminAPI::ECNCreateHistoryMatchingArray method.
filling
[out] An object of the array of filling orders from history. The 'filling' object must be previously created via the IMTAdminAPI::ECNCreateHistoryFillingArray method.
deals
[out] An object of the array of deals from history. The 'deals' object must be previously created via the IMTAdminAPI::ECNCreateHistoryDealArray method.
providers
[out] An object of the array of providers. The 'providers' object must be previously created via the IMTAdminAPI::ECNCreateProvidersArray method.
Return Value
An indication of a successful execution is the MT_RET_OK response code. Otherwise, an error code is returned.
Note
The method cannot be called from event handlers (any IMT*Sink class methods).
IMTAdminAPI::ECNRequestByLogins
Request the matching history for the specified logins.
C++
MTAPIRES IMTAdminAPI::ECNRequestByLogins(
const UINT64* logins, // logins
const UINT logins_total, // the number of logins
const INT64 from, // period beginning
const INT64 to, // period end
IMTECNHistoryMatchingArray* matching, // array of matching orders
IMTECNHistoryFillingArray* filling, // array of filling objects
IMTECNHistoryDealArray* deals, // array of deals
IMTECNProviderArray* providers // array of providers
)
.NET
file:///C:/Users/Administrator/AppData/Local/Temp/~hh4BC4.htm 7/17/2025
Manager API Page 263 of 464
MTRetCode CIMTAdminAPI.ECNRequestByLogins(
ulong[] logins, // logins
long from, // period beginning
long to, // period end
CIMTECNMatchingArray matching, // array of matching orders
CIMTECNFillingArray filling, // array of filling orders
CIMTECNHistoryDealArray deals, // array of deals
CIMTECNProviderArray providers // array of providers
)
Parameters
logins
[in] An array of logins the data is requested for.
logins_total
[in] The number of logins in the 'logins' array.
from
[in] The beginning of the period for which you need to get data. The date is specified in seconds since 01.01.1970.
to
[in] The end of the period for which you need to get data. The date is specified in seconds since 01.01.1970.
matching
[out] An object of the array of matching orders from history. The 'matching' object must be previously created via the IMTAdminAPI::ECNCreateHistoryMatchingArray method.
filling
[out] An object of the array of filling orders from history. The 'filling' object must be previously created via the IMTAdminAPI::ECNCreateHistoryFillingArray method.
deals
[out] An object of the array of deals from history. The 'deals' object must be previously created via the IMTAdminAPI::ECNCreateHistoryDealArray method.
providers
[out] An object of the array of providers. The 'providers' object must be previously created via the IMTAdminAPI::ECNCreateProvidersArray method.
Return Value
An indication of a successful execution is the MT_RET_OK response code. Otherwise, an error code is returned.
Note
The method cannot be called from event handlers (any IMT*Sink class methods).
IMTAdminAPI::ECNRequestByTickets
Request the matching history for the specified order tickets.
C++
MTAPIRES IMTAdminAPI::ECNRequestByTickets(
const UINT64* tickets, // tickets
const UINT tickets_total, // number of tickets
const INT64 from, // period beginning
const INT64 to, // period end
IMTECNHistoryMatchingArray* matching, // array of matching orders
IMTECNHistoryFillingArray* filling, // array of filling orders
IMTECNHistoryDealArray* deals, // array of deals
IMTECNProviderArray* providers // array of providers
)
.NET
MTRetCode CIMTAdminAPI.ECNRequestByTickets(
ulong[] tickets, // tickets
long from, // period beginning
long to, // period end
CIMTECNMatchingArray matching, // array of matching orders
CIMTECNFillingArray filling, // array of filling orders
CIMTECNHistoryDealArray deals, // array of deals
CIMTECNProviderArray providers // array of providers
)
Parameters
tickets
[in] An array of tickets the data is requested for.
tickets_total
[in] The number of tickets in the 'tickets' array.
from
[in] The beginning of the period for which you need to get data. The date is specified in seconds since 01.01.1970.
to
[in] The end of the period for which you need to get data. The date is specified in seconds since 01.01.1970.
matching
[out] An object of the array of matching orders from history. The 'matching' object must be previously created via the IMTAdminAPI::ECNCreateHistoryMatchingArray method.
filling
[out] An object of the array of filling orders from history. The 'filling' object must be previously created via the IMTAdminAPI::ECNCreateHistoryFillingArray method.
deals
[out] An object of the array of deals from history. The 'deals' object must be previously created via the IMTAdminAPI::ECNCreateHistoryDealArray method.
providers
[out] An object of the array of providers. The 'providers' object must be previously created via the IMTAdminAPI::ECNCreateProvidersArray method.
Return Value
An indication of a successful execution is the MT_RET_OK response code. Otherwise, an error code is returned.
Note
The method cannot be called from event handlers (any IMT*Sink class methods).
file:///C:/Users/Administrator/AppData/Local/Temp/~hh4BC4.htm 7/17/2025
Manager API Page 264 of 464
Geo-services
The methods described in this section provide access to the GeoIP database information on the trading server. These methods enable access to the information about visitors'
country, city, coordinates and Internet providers, based on their IP addresses. The database is automatically updated on the server once a week, keeping the relevant information
up to date.
By using these methods, you can generate user activity reports and create maps, among others.
Function Purpose
GeoCreate Create an IP address description object.
GeoResolve Resolve an IPv4 or IPv6 address.
GeoResolveBatch Resolve a list of IP addresses of any type: IPv4 or IPv6.
IMTAdminAPI::GeoCreate
Create an IP address description object.
C++
IMTGeo* IMTAdminAPI::GeoCreate()
.NET
CIMTGeo CIMTAdminAPI.GeoCreate()
Return Value
Returns a pointer to the created object that implements the IMTGeo interface. NULL is returned in case of failure.
Note
The created object should be destroyed by calling the IMTGeo::Release method of this object.
IMTAdminAPI::GeoResolve
Resolve an IPv4 or IPv6 address.
C++
MTAPIRES IMTAdminAPI::GeoResolve(
LPCWSTR address, // IP address
const UINT flags, // flags
IMTGeo record // IP address description
)
.NET
MTRetCode CIMTAdminAPI.GeoResolve(
string address, // IP address
CIMTGeo.EnGeoRequestFlags flags, // flags
CIMTGeo record // IP address description
)
Python
AdminAPI.GeoResolve(
address, # IP address
flags # flags
)
Parameters
address
[in] IPv4 or IPv6 address.
flags
[in] Additional resolution parameters in the form of flags from the IMTGeo::EnGeoRequestFlags enumeration.
record
[out] IP address description as an IMTGeo object. The object must be first created by the IMTAdminAPI::GeoCreate method.
Return Value
An indication of a successful performance is the MT_RET_OK response code. Otherwise, an error has occurred that corresponds to the response code.
IMTAdminAPI::GeoResolveAny
Resolve a list of IP addresses of any type: IPv4 or IPv6.
C++
MTAPIRES IMTAdminAPI::GeoResolveAny(
LPCWSTR* addresses, // array of IP addresses
const UINT addresses_total, // number of addresses
const UINT flags, // flags
IMTGeo** records, // description of IP addresses
MTAPIRES* results // array of results
)
.NET
file:///C:/Users/Administrator/AppData/Local/Temp/~hh4BC4.htm 7/17/2025
Manager API Page 265 of 464
MTRetCode CIMTAdminAPI.GeoResolveAny(
string[] addresses, // array of IP addresses
CIMTGeo.EnGeoRequestFlags flags, // flags
CIMTGeo[] records, // description of IP addresses
MTRetCode[] retcodes // array of results
)
Python
AdminAPI.GeoResolveAny(
addresses, # list of IP addresses
flags # flags
)
Parameters
addresses
[in] Array of addresses of any type: IPv4 or IPv6.
addresses_total
[in] Number of addresses in the 'addresses' array.
flags
[in] Additional resolution parameters in the form of flags from the IMTGeo::EnGeoRequestFlags enumeration.
records
[out] Description of IP addresses as an array of IMTGeo objects. The objects must be first created by the IMTAdminAPI::GeoCreate method.
results
[out] Array with the address resolution results. The size of the 'results' array must not be less than that of 'addresses'.
Return Value
The MT_RET_OK response code indicates that all specified addresses have been processed. The MT_RET_ERR_PARTIAL response code indicates that resolution results are only
available for some of the addresses. Analyze the 'results' array for more details on the execution results. It contains the result of processing of each address from the 'addresses'
array. The result index corresponds to the address index in the source array.
Note
In 'addresses' you can simultaneously transfer IP addresses of both types.
To be able to use the IMTManagerAPI interface, a manager account that is used for connecting to the server must have the "Connect using MetaTrader 5 Manager" permission
(IMTConManager::RIGHT_MANAGER).
Description of functions of the manager interface is divided into the following sections:
• Common Functions
• Connection to the Server
• Operations with Connection
• Configuration Databases
• Selected Symbols
• Clients
• Users
• Online Connections
• Trade Databases
• History Data
• Tick Data
• Mail Database
• News Database
• Trade Activity
• Depth of Market
• Summary Positions
• Exposure
• Daily Reports
• Settings Files
• Subscriptions
• Custom Functions
• ECN
• Geo Services
Common Functions
The common functions of the IMTManagerAPI interface include general purpose functions that do not control any of the platform configurations or information on the server, but
are required for developing applications.
Memory Management
The MetaTrader 5 Manager API allows managing the memory used by applications.
Function Purpose
Allocate Memory allocation by an application.
Free Free memory allocated previously using the Allocate method.
file:///C:/Users/Administrator/AppData/Local/Temp/~hh4BC4.htm 7/17/2025
Manager API Page 266 of 464
Journal
The MetaTrader 5 Manager API provides access to server logs. The API includes functions for working with the logs. The IMTManagerAPI interface allows to output messages in the
log, as well as to request server logs.
Function Purpose
LoggerOut Log messages.
LoggerOutString Fast output method which prints unformatted logs to the Manager API local journal.
LoggerFlush Flush the file buffer of the server journal to a disk.
LoggerServerRequest Request the server logs.
The MetaTrader 5 Manager API contains a number of constants for working with logs. They are described in a separate section.
Service Functions
The following additional functions are available in the MetaTrader 5 Manager API:
Function Purpose
Release Delete the IMTManagerAPI object.
LicenseCheck Check the application license.
PasswordChange Change password of an account that is used to connect the application to the server.
IMTManagerAPI::Allocate
Memory allocation by an application. This is a pair method to IMTManagerAPI::Free.
void* IMTManagerAPI::Allocate(
const UINT bytes // Amount of allocated memory
)
Parameters
bytes
[in] Amount of allocated memory in bytes.
Return Value
If successful, it returns a pointer to the allocated memory block, otherwise it returns Null.
IMTManagerAPI::Free
Free memory allocated earlier by IMTManagerAPI::Allocate. It is used to free memory allocated by the functions and interfaces of the MetaTrader 5 Manager API.
void IMTManagerAPI::Free(
void* ptr // Pointer to a memory block
)
Parameters
ptr
[in] A pointer to the released memory block allocated earlier by IMTManagerAPI::Allocate.
IMTManagerAPI::LoggerOut
The functions for adding messages to the local journal of the manager interface.
C++
MTAPIRES IMTManagerAPI::LoggerOut(
const UINT code, // Message code
LPCWSTR format, // Message string
... // Optional arguments
)
.NET
MTRetCode CIMTManagerAPI.LoggerOut(
EnMTLogCode code, // Message code
string format, // Message string
params object[] args // Optional arguments
)
Python
ManagerAPI.LoggerOut(
code, // Message code
format // Message string
)
Parameters
code
[in] Message code that is passed using the EnMTLogCode enumeration.
format
[in] A message string with optional arguments.
file:///C:/Users/Administrator/AppData/Local/Temp/~hh4BC4.htm 7/17/2025
Manager API Page 267 of 464
Return Value
An indication of successful completion is the MT_RET_OK response code. Otherwise, an error has occurred that corresponds to the response code.
Note
Each string is limited to 16KB without the standard string header.
The requirements for the format string are the same as applied in C++: http://www.cplusplus.com/reference/cstdio/printf/
Do not use the line feed characters \r and \n as it leads to an incorrect calculation of the check sum of the log.
IMTManagerAPI::LoggerOutString
Fast output method which prints unformatted logs to the Manager API local journal.
C++
MTAPIRES IMTManagerAPI::LoggerOutString(
const UINT code, // log code
LPCWSTR string // log string
)
.NET
MTRetCode CIMTManagerAPI.LoggerOutString(
EnMTLogCode code, // log code
string string // log string
)
Parameters
code
[in] Log code which is passed using the EnMTLogCode enumerations.
string
[in] Log string with optional arguments.
Return Value
An indication of a successful execution is the MT_RET_OK response code. Otherwise, an error has occurred, which corresponds to the response code.
Note
Compared to IMTManagerAPI::LoggerOut, which formats the output, this method consumes less resources.
Each string is limited to 16KB, not including the standard string header.
Do not use the newline characters \r and \n, as this will lead to incorrect calculation of the checksum for the log lines.
IMTManagerAPI::LoggerFlush
The function for flushing the file buffer of the local journal of the manager interface to a disk.
C++
void IMTManagerAPI::LoggerFlush()
.NET
void CIMTManagerAPI.LoggerFlush()
Python
ManagerAPI.LoggerFlush()
IMTManagerAPI::LoggerServerRequest
Request the journal of a trade server to which an application is connected.
C++
MTAPIRES IMTManagerAPI::LoggerServerRequest(
const UINT mode, // Request mode
const UINT type, // Event type
const INT64 from, // Start date
const INT64 to, // End date
LPCWSTR filter, // Keyword
MTLogRecord*& records, // Array of entries
UINT& records_total // The number of received entries
)
.NET
MTLogRecord[] CIMTManagerAPI.LoggerServerRequest(
EnMTLogRequestMode mode, // Request mode
EnMTLogType type, // Event type
long from, // Start date
long to, // End date
string filter, // Keyword
out MTRetCode res // Response code
)
Python
file:///C:/Users/Administrator/AppData/Local/Temp/~hh4BC4.htm 7/17/2025
Manager API Page 268 of 464
ManagerAPI.LoggerServerRequest(
mode, # Request mode
type, # Event type
from, # Start date
to, # End date
filter # Keyword
)
Parameters
mode
[in] The mode of journal requesting. To pass the mode, the EnMTLogRequestMode enumeration is used.
type
[in] Type of events that should be requested from the server journal. To pass the type of events, the EnMTLogType enumeration is used.
from
[in] The start date for requesting logs. The date is specified in seconds that have elapsed since 01.01.1970. Only the date is taken into account, while the exact time is
ignored.
to
[in] The end date for requesting logs. The date is specified in seconds that have elapsed since 01.01.1970. Only the date is taken into account, while the exact time is ignored.
filter
[in] A key word for searching logs.
records
[out] A reference to the array of structures that describe logs (MTLogRecord).
records_total
[out] The total number of received journal entries.
Return Value
An indication of successful completion is the MT_RET_OK response code. Otherwise, a corresponding error code will be returned.
Note
After using, the records array must be released using the IMTManagerAPI::Free method.
This method cannot be called from event handlers (any methods of IMT*Sink classes).
IMTManagerAPI::Release
A standard method for deleting the IMTManagerAPI object. After the method call, the object cannot be accessed, because it has been deleted.
C++
void IMTManagerAPI::Release()
.NET
void CIMTManagerAPI.Release()
IMTManagerAPI::LicenseCheck
Check the application license.
C++
MTAPIRES IMTManagerAPI::LicenseCheck(
MTLicenseCheck& check // Reference to the license
)
.NET
MTRetCode CIMTManagerAPI.LicenseCheck(
ref MTLicenseCheck check // Reference to the license
)
Parameters
check
[in] A reference to the MTLicenseCheck structure that describes the license.
Return Value
An indication of successful completion is the MT_RET_OK response code. Otherwise, an error has occurred, which corresponds to the response code.
Note
License verification can only be performed after connection to a server, otherwise the method will return the MT_RET_ERR_DATA error.
file:///C:/Users/Administrator/AppData/Local/Temp/~hh4BC4.htm 7/17/2025
Manager API Page 269 of 464
• The server checks if the use of the application with the specified name is authorized in the license.
• The server sends the MTLicenseCheck structure back with the following additional fields filled:
• retcode — verification result code;
• sign — the digital signature of the response code, name and random sequence. The server signs the data with its own private key;
• sign_size — data size in the sign field.
• The application signs the same data (retcode+name+random) with its own public key and compares the result with the signature ('sign') received from the server. Thus, the
authenticity of the received data is checked.
For easier license check, the Manager API factory provides a special CMTManagerAPIFactory::LicenseCheckManager method. The main steps of the above license verification
algorithm are already implemented in that method. When using the factory method, a programmer only needs to pass a pointer to the Manager API and the application name to
it.
IMTManagerAPI::PasswordChange
Change password of an account that is used to connect the application to the server.
C++
MTAPIRES IMTManagerAPI::PasswordChange(
const UINT type, // Type of password
LPCWSTR password // New password
)
.NET
MTRetCode CIMTManagerAPI.PasswordChange(
uint type, // Type of password
string password // New password
)
Python
ManagerAPI.PasswordChange(
type, # Type of password
password # New password
)
Parameters
type
[in] The type of a password to change is specified using the IMTUSer::EnUsersPasswords enumeration.
password
[in] A new password.
Return Value
An indication of successful completion is the MT_RET_OK response code. Otherwise, an error code will be returned.
Note
The password must contain at least two of three types of characters (lower case, upper case and digits) and meet the minimum length requirements set for the group
(IMTConGroup::AuthPasswordMin).
Method Purpose
Connect Connect to the trading platform.
Disconnect Disconnect from the trading platform.
Subscribe Subscribe to common events of the IMTManagerAPI interface.
Unsubscribe Unsubscribe from common events of the IMTManagerAPI interface.
ProxySet Set parameters of connection to the trading platform through a proxy server.
Pumping Mode
Enabled pumping mode means that the application will synchronize the appropriate server database with a locally created database. Thus, to obtain information the application
can access a local database using the Get and Next methods (for example, IMTManagerAPI::SymbolGet, IMTManagerAPI::GroupNext, etc.). Since databases can be quite large,
pumping should only be enabled for information that requires frequent and rapid access. Local databases are loaded into RAM, therefore enabling pumping directly affects RAM
usage. When pumping is disabled, required information can be requested directly from the server using Request methods (for example, IMTManagerAPI::SymbolRequest,
IMTManagerAPI::GroupRequest).
Possible pumping modes are enumerated in IMTManagerAPI::EnPumpModes. The pumping mode in which we want to connect is specified in the pump_mode parameter of the
IMTManagerAPI::Connect method.
ID Value Description
PUMP_MODE_USERS 0x00000001 Pumping of users.
PUMP_MODE_ACTIVITY 0x00000002 Pumping of the online activity of users.
PUMP_MODE_MAIL 0x00000004 Mail pumping.
PUMP_MODE_ORDERS 0x00000008 Pumping of orders.
file:///C:/Users/Administrator/AppData/Local/Temp/~hh4BC4.htm 7/17/2025
Manager API Page 270 of 464
ID Value Description
PUMP_MODE_NEWS 0x00000020 News pumping.
PUMP_MODE_POSITIONS 0x00000080 Pumping of positions.
PUMP_MODE_GROUPS 0x00000100 Pumping of configurations of user groups.
PUMP_MODE_SYMBOLS 0x00000200 Pumping of symbol configurations.
PUMP_MODE_HOLIDAYS 0x00000800 Pumping of holiday configurations.
PUMP_MODE_TIME 0x00001000 Pumping of time configurations.
PUMP_MODE_GATEWAYS 0x00002000 Pumping of gateway configurations. It is used for displaying available gateways in the box of accounts in external systems on
the "Account" tab of a client in the administrator or manager terminal.
PUMP_MODE_REQUESTS 0x00004000 Pumping of the request queue and results of processing requests by other dealers. It is required for connecting a manager in
the "Supervisor" mode.
PUMP_MODE_PLUGINS 0x00008000 Pumping of the plugin configurations on the server. It is required for the possibility of setting up plugins through the Manager
API application. Additionally the plugin must have the IMTConPlugin::PLUGIN_FLAG_MAN_CONFIG flag enabled, and the
manager account must have the IMTConManager::RIGHT_CFG_PLUGINS permission granted.
PUMP_MODE_CLIENTS 0x00010000 Pumping of clients.
PUMP_MODE_SUBSCRIPTIONS 0x00020000 Pumping of subscription configurations.
PUMP_MODE_SUBSCRIPTIONS 0x00020000 Pumping of all the information listed above.
• When enabling the pumping of orders and positions, the pumping of accounts, groups and symbols is enabled automatically.
• The pumping mode does not affect the operation of those methods, which request data directly from the server (such as IMTManagerAPI::UserRequest,
IMTManagerAPI::OrderRequest etc.). Such methods can be used in any pumping mode.
• To use pumping, the manager account, which is used for connecting applications, needs the relevant permissions. For example, the
IMTConManager::RIGHT_TRADES_READ permission is required to pump orders and positions.
IMTManagerAPI::Connect
Connect to the trading platform.
C++
virtual MTAPIRES IMTManagerAPI::Connect(
LPCWSTR server, // Server address
UINT64 login, // Login
LPCWSTR password, // Password
LPCWSTR password_cert, // Certificate password
UINT64 pump_mode, // Pumping mode
UINT timeout=INFINITE // Timeout
)
.NET
MTRetCode CIMTManagerAPI.Connect(
string server, // Server address
ulong login, // Login
string password, // Password
string password_cert, // Certificate password
CIMTManagerAPI.EnPumpModes pump_mode, // Pumping mode
uint timeout // Timeout
)
Python
ManagerAPI.Connect(
server, # Server address
login, # Login
password, # Password
password_cert, # Certificate password
pump_mode, # Pumping mode
timeout # Timeout
)
Parameters
server
[in] Address and port of the Access server of the platform to which you are connecting. The values should be separated by a colon, for example: 192.168.0.1:443.
login
[in] The login of the manager for connection.
password
[in] The password of the manager for connection.
password_cert
[in] Certificate password. It is only used in the advanced server authentication mode. In this case, the certificate for the administrator account should be copied to [Manager
API data directory]\bases\[server name]\certificates\.
pump_mode
[in] The pumping mode, in which connection will be established. To pass the pumping mode, the IMTManagerAPI::EnPumpModes enumeration is used.
timeout=INFINITE
[in] Server connection timeout in milliseconds. If the application fails to connect to a server within this time, attempts will be terminated. By default there is no time limit.
Return Value
An indication of successful completion is the MT_RET_OK response code. Otherwise, a corresponding error code is returned.
The IMTManagerAPI::Connect methods is synchronous; when connecting to the server local data bases (use of which depends on the enabled modes of pumping) are synchronized
with data bases of the server. After a successful connection the corresponding *Get methods (for example, IMTManagerAPI::SymbolGet) will return actual data.
file:///C:/Users/Administrator/AppData/Local/Temp/~hh4BC4.htm 7/17/2025
Manager API Page 271 of 464
The MT_RET_AUTH_RESET_PASSWORD response code means that the master password (IMTUser::USER_PASS_MAIN) of the account that is used to connect to the server must be
changed. In this case, change the password using the IMTManagerAPI::PasswordChange method and connect again with the new password.
To be able to use the IMTManagerAPI interface, a manager account that is used for connecting to the server must have the "Connect using MetaTrader 5 Manager" permission
(IMTConManager::RIGHT_MANAGER).
Note
After establishing a connection to the server, Manager API will automatically keep it up. In case of connection loss, Manager API will automatically reconnect to the server.
In case of connection loss, the dealing mode in the Manager API application is disabled. This mode will not be enabled after reconnection. You need to handle this situation by
yourself and re-call IMTManagerAPI::DealerStart. Please note that this method cannot be called from a the IMTManagerSink :: OnConnect handler, while this can lead to deadlock.
After a successful connection using the address specified in the 'server' parameter, the application can switch to a more suitable access point (if such points are configured for
the platform). The best access point is selected automatically based on server priority settings. An application can only reconnect to public access points. If you manually
connect to a hidden point (for example, for testing), and the application loses connection, it will not be able to reconnect to that point but will try to connect to public access
servers.
To obtain the events of databases synchronization with the On*Sync trade server (for example, IMTPositionSink::OnPositionSync), subscribe to these events before calling the
IMTManagerAPI::Connect method.
IMTManagerAPI::Disconnect
Disconnect from the trading platform.
C++
virtual void IMTManagerAPI::Disconnect()
.NET
void CIMTManagerAPI.Disconnect()
Python
ManagerAPI.Disconnect()
IMTManagerAPI::Subscribe
Subscribe to common events of the IMTManagerAPI interface.
C++
virtual MTAPIRES IMTManagerAPI::Subscribe(
IMTManagerSink* sink // A pointer to the IMTManagerSink object
)
.NET
MTRetCode CIMTManagerAPI.Subscribe(
CIMTManagerSink sink // CIMTManagerSink object
)
Python
ManagerAPI.Subscribe(
sink # IMTManagerSink object
)
Parameters
sink
[in] A pointer to the object that implements the IMTManagerSink interface.
Return Value
An indication of successful completion is the MT_RET_OK response code. Otherwise, an error has occurred that corresponds to the response code.
Note
Subscribing to events is thread safe. One and the same interface IMTManagerSink cannot subscribe to an event twice - in this case the response code MT_RET_ERR_DUPLICATE is
returned.
The object at which sink points, must remain in the memory (must not be removed) until the call of Unsubscribe or until the administrator interface is deleted using the
IMTManagerAPI::Release method.
IMTManagerAPI::Unsubscribe
Unsubscribe from common events of the IMTManagerAPI interface.
C++
virtual MTAPIRES IMTManagerAPI::Unsubscribe(
IMTManagerSink* sink // A pointer to the IMTManagerSink object
)
.NET
MTRetCode CIMTManagerAPI.Unsubscribe(
CIMTManagerSink sink // CIMTManagerSink object
)
Python
ManagerAPI.Unsubscribe(
sink # IMTManagerSink object
)
file:///C:/Users/Administrator/AppData/Local/Temp/~hh4BC4.htm 7/17/2025
Manager API Page 272 of 464
Parameters
sink
[in] A pointer to the object that implements the IMTManagerSink interface.
Return Value
An indication of successful completion is the MT_RET_OK response code. Otherwise, an error code will be returned.
Note
This method is pared to IMTManagerAPI::Subscribe. If an attempt is made to unsubscribe from the interface to which it has not subscribed, MT_RET_ERR_NOTFOUND error is
returned.
IMTManagerAPI::ProxySet
Set parameters of connection to the trading platform through a proxy server.
C++
virtual void IMTManagerAPI::ProxySet(
const MTProxyInfo& proxy // Proxy server
)
.NET
void CIMTManagerAPI.ProxySet(
MTProxyInfo proxy // Proxy server
)
Parameters
proxy
[in] A reference to the MTProxyInfo structure that contains information about the parameters of connection via a proxy server.
Method Purpose
NetworkRescan Forced launch of scanning for access points and receiving the scanning results.
NetworkBytesSent Receive the number of bytes sent to the server via Manager API.
NetworkBytesRead Receive the number of bytes accepted from the server via Manager API.
NetworkServer Receive the name of the server Manager API is currently connected to.
NetworkAddress Receive IP address of the server Manager API is currently connected to.
IMTManagerAPI::NetworkRescan
Forced launch of scanning for access points and receiving the scanning results. Scanning includes obtaining a complete map of the network with the data on the access servers'
workload, as well as measuring ping to each access point. After obtaining the data, decision is made on whether the access point better than the current one is found.
C++
MTAPIRES IMTManagerAPI::NetworkRescan(
const UINT flags // Flags (for future use)
const UINT timeout // Timeout of waiting for scanning
)
.NET
MTRetCode CIMTManagerAPI.NetworkRescan(
uint flags // Flags (for future use)
uint timeout // Timeout of waiting for scanning
)
Python
ManagerAPI.NetworkRescan(
int flags # Flags (for future use)
int timeout # Timeout of waiting for scanning
)
Parameters
flags
[in] Flags. This parameter is not used at the moment.
timeout
[in] Time to wait for the completion of scanning in milliseconds. If scanning is not finished within the specified time, the check for the best access point is performed
nonetheless. If it is present, the method returns MT_RET_OK value. In order to check the availability of the best access point without waiting, this method can be called with
timeout parameter equal to 0.
Return Value
The method reports on scanning results using the following response codes:
• MT_RET_OK - the best access point found. To connect to it, IMTManagerAPI::Disconnect method can be called. It is followed by IMTManagerAPI::Connect passing the name
of the server, connection to which is to be performed. The server name can be received using IMTManagerAPI::NetworkServer method.
• MT_RET_NOTFOUND - the best access point not found.
file:///C:/Users/Administrator/AppData/Local/Temp/~hh4BC4.htm 7/17/2025
Manager API Page 273 of 464
• MT_RET_FREQUENT - too frequent requests. Requests can be made no more frequently than once per half an hour.
Note
In order to arrange selection of the best access point for connecting Manager API, the name of the server for connection instead of an IP address should be specified in
IMTManagerAPI::Connect method. The server name can be received using IMTManagerAPI::NetworkServer method.
IMTManagerAPI::NetworkBytesSent
Receive the number of bytes sent to the server via Manager API. All copies of IMTAdminAPI and IMTManagerAPI in the current process are considered.
C++
UINT64 IMTManagerAPI::NetworkBytesSent()
.NET
uint CIMTManagerAPI.NetworkBytesSent()
Python
ManagerAPI.NetworkBytesSent()
Return Value
Number of bytes sent to the server via Manager API. All copies of IMTAdminAPI and IMTManagerAPI in the current process are considered.
IMTManagerAPI::NetworkBytesRead
Receive the number of bytes accepted from the server via Manager API. All copies of IMTAdminAPI and IMTManagerAPI in the current process are considered.
C++
UINT64 IMTManagerAPI::NetworkBytesRead()
.NET
uint CIMTManagerAPI.NetworkBytesRead()
Python
ManagerAPI.NetworkBytesRead()
Return Value
Number of bytes accepted from the server via Manager API. All copies of IMTAdminAPI and IMTManagerAPI in the current process are considered.
IMTManagerAPI::NetworkServer
Receive the name of the server Manager API is currently connected to.
C++
MTAPIRES IMTManagerAPI::NetworkServer(
MTAPISTR& server // Server name
)
.NET
MTRetCode CIMTManagerAPI.NetworkServer(
out string server // Server name
)
Python
ManagerAPI.NetworkServer()
Parameters
server
[out] A reference to the name of the server Manager API is connected to.
Return Value
An indication of successful completion is the MT_RET_OK response code. Otherwise, an error code will be returned.
IMTManagerAPI::NetworkAddress
Receive IP address of the server Manager API is currently connected to.
C++
MTAPIRES IMTManagerAPI::NetworkAddress(
MTAPISTR& address // Server address
)
.NET
file:///C:/Users/Administrator/AppData/Local/Temp/~hh4BC4.htm 7/17/2025
Manager API Page 274 of 464
MTRetCode CIMTManagerAPI.NetworkAddress(
out string address // Server address
)
Python
ManagerAPI.NetworkAddress()
Parameters
address
[out] A reference to the IP address of the server Manager API is connected to.
Return Value
An indication of successful completion is the MT_RET_OK response code. Otherwise, an error code will be returned.
Configuration Functions
Functions described in this section provide access to some settings of a trading platform required for manager's activities. The allow receiving the current state of settings,
changing them and handle events associated with their change. Configuration databases are divided based on their purpose:
• Time
• Holidays
• Groups
• Symbols
• Floating Margin
• Spreads
• Plugins
• Managers
• Subscriptions
Time Configuration
Functions allow receiving time settings of the platform, as well subscribe and unsubscribe from events associated with their change.
The following functions are available for working with the time configurations:
Function Purpose
TimeCreate Create an object of the time configuration.
TimeSubscribe Subscribe to events associated with time configuration.
TimeUnsubscribe Unsubscribe from events associated with time configuration.
TimeGet Get the time configuration.
TimeServer Get the calculated current time of the trading server.
TimeServerRequest Get the current time of the trading server.
IMTManagerAPI::TimeCreate
Create an object of the time configuration.
C++
IMTConTime* IMTManagerAPI::TimeCreate()
.NET
CIMTConTime CIMTManagerAPI.TimeCreate()
Return Value
It returns a pointer to the created object that implements the IMTConTime interface. In case of failure, it returns NULL.
Note
The created object must be destroyed by calling the IMTConTime::Release method of this object.
IMTManagerAPI::TimeSubscribe
Subscribe to events associated with time configuration.
C++
MTAPIRES IMTManagerAPI::TimeSubscribe(
IMTConTimeSink* sink // A pointer to the IMTConTimeSink object
)
.NET
file:///C:/Users/Administrator/AppData/Local/Temp/~hh4BC4.htm 7/17/2025
Manager API Page 275 of 464
MTRetCode CIMTManagerAPI.TimeSubscribe(
CIMTConTimeSink obj // CIMTConTimeSink object
)
Python
ManagerAPI.TimeSubscribe(
sink # IMTConTimeSink object
)
Parameters
sink
[in] A pointer to the object that implements the IMTConTimeSink interface.
Return Value
An indication of successful completion is the MT_RET_OK response code. Otherwise, an error has occurred that corresponds to the response code.
Note
Subscribing to events is thread safe. One and the same interface IMTConTimeSink cannot subscribe to an event twice - in this case the response code MT_RET_ERR_DUPLICATE is
returned.
To receive IMTConTimeSink::OnTimeSync events, subscribe before calling the IMTManagerAPI::Connect method.
The object at which sink points, must remain in the memory (must not be removed) until the call of IMTManagerAPI::TimeUnsubscribe or until the administrator interface is
deleted using the IMTManagerAPI::Release method.
To receive events connected with time configuration changes, the pumping mode IMTManagerAPI::PUMP_MODE_TIME must be enabled.
IMTManagerAPI::TimeUnsubscribe
Unsubscribe from events associated with time configuration.
C++
MTAPIRES IMTManagerAPI::TimeUnsubscribe(
IMTConTimeSink* sink // A pointer to the IMTConTimeSink object
)
.NET
MTRetCode CIMTManagerAPI.TimeUnsubscribe(
CIMTConTimeSink obj // CIMTConTimeSink object
)
Python
ManagerAPI.TimeUnsubscribe(
sink # IMTConTimeSink object
)
Parameters
sink
[in] A pointer to the object that implements the IMTConTimeSink interface.
Return Value
An indication of successful completion is the MT_RET_OK response code. Otherwise, an error code will be returned.
Note
This method is pared to IMTManagerAPI::TimeSubscribe. If an attempt is made to unsubscribe from the interface to which it has not subscribed, MT_RET_ERR_NOTFOUND error is
returned.
IMTManagerAPI::TimeGet
Get the time configuration.
C++
MTAPIRES IMTManagerAPI::TimeGet(
IMTConTime* config // An object of time configuration
)
.NET
MTRetCode CIMTManagerAPI.TimeGet(
CIMTConTime config // An object of time configuration
)
Python
ManagerAPI.TimeGet()
Parameters
config
[out] An object of the time configuration. The config object must first be created using the IMTManagerAPI::TimeCreate method.
Return Value
An indication of successful completion is the MT_RET_OK response code. Otherwise, an error code will be returned.
Note
The method is valid only if the IMTManagerAPI::PUMP_MODE_TIME pumping mode was specified during connection.
file:///C:/Users/Administrator/AppData/Local/Temp/~hh4BC4.htm 7/17/2025
Manager API Page 276 of 464
IMTManagerAPI::TimeServer
Get the calculated current time of the trading server.
C++
INT64 IMTManagerAPI::TimeServer()
.NET
long CIMTManagerAPI.TimeServer()
Python
ManagerAPI.TimeServer()
Return Value
The current trading time of the platform in the number of seconds elapsed since 01.01.1970.
Note
Unlike the TimeServerRequest function, the trading time is calculated on the Manager API application side: the current local computer time is adjusted in accordance with the
server time zone.
In all configurations, databases and logs, the platform trading time is used, except where explicitly stated otherwise.
IMTManagerAPI::TimeServerRequest
Get the current time of the trading server.
C++
MTAPIRES IMTManagerAPI::TimeServerRequest(
INT64& time_msc // server time
)
.NET
MTRetCode CIMTManagerAPI.TimeServerRequest(
out long time_msc // server time
)
Python
ManagerAPI.TimeServerRequest()
Parameters
time_msc
[out] The current trading time of the platform in the number of milliseconds elapsed since 01.01.1970.
Return Value
An indication of successful completion is the MT_RET_OK response code. Otherwise, an error code will be returned.
Note
Unlike TimeServer, the TimeServerRequest section directly requests time from the trading server rather than calculating it.
In all configurations, databases and logs, the platform trading time is used, except where explicitly stated otherwise.
Holiday Configuration
Functions allow receiving holiday settings of the platform, as well subscribe and unsubscribe from events associated with their change.
The following functions are available for working with holiday settings:
Function Purpose
HolidayCreate Create an object of the configuration of holidays.
HolidaySubscribe Subscribe to events associated with the configuration of holidays.
HolidayUnsubscribe Unsubscribe from events associated with the configuration of holidays.
HolidayTotal The total number of configurations of holidays available in the platform.
HolidayNext Gets a holiday configuration with the specified index.
IMTManagerAPI::HolidayCreate
Create an object of the configuration of holidays.
C++
IMTConHoliday* IMTManagerAPI::HolidayCreate()
.NET
CIMTConHoliday CIMTManagerAPI.HolidayCreate()
Return Value
file:///C:/Users/Administrator/AppData/Local/Temp/~hh4BC4.htm 7/17/2025
Manager API Page 277 of 464
It returns a pointer to the created object that implements the IMTConHoliday interface. In case of failure, it returns NULL.
Note
The created object must be deleted by calling the IMTConHoliday::Release method of this object.
IMTManagerAPI::HolidaySubscribe
Subscribe to events associated with the configuration of holidays.
C++
MTAPIRES IMTManagerAPI::HolidaySubscribe(
IMTConHolidaySink* sink // A pointer to the IMTConHolidaySink object
)
.NET
MTRetCode CIMTManagerAPI.HolidaySubscribe(
CIMTConHolidaySink sink // CIMTConHolidaySink object
)
Python
ManagerAPI.HolidaySubscribe(
sink # IMTConHolidaySink object
)
Parameters
sink
[in] A pointer to the object that implements the IMTConHolidaySink interface.
Return Value
An indication of successful completion is the MT_RET_OK response code. Otherwise, an error has occurred that corresponds to the response code.
Note
Subscribing to events is thread safe. One and the same interface IMTConHolidaySink cannot subscribe to events twice - in this case the response code MT_RET_ERR_DUPLICATE is
returned.
To receive IMTConHolidaySink::OnHolidaySync events, subscribe before calling the IMTManagerAPI::Connect method.
The object at which sink points, must remain in the memory (must not be removed) until the call of IMTManagerAPI::HolidayUnsubscribe or until the administrator interface is
deleted using the IMTManagerAPI::Release method.
To receive events connected with time holiday changes, the pumping mode IMTManagerAPI::PUMP_MODE_HOLIDAYS must be enabled.
IMTManagerAPI::HolidayUnsubscribe
Unsubscribe from events associated with the configuration of holidays.
C++
MTAPIRES IMTManagerAPI::HolidayUnsubscribe(
IMTConHolidaySink* sink // A pointer to the IMTConHolidaySink object
)
.NET
MTRetCode CIMTManagerAPI.HolidayUnsubscribe(
CIMTConHolidaySink sink // CIMTConHolidaySink object
)
Python
ManagerAPI.HolidayUnsubscribe(
sink # IMTConHolidaySink object
)
Parameters
sink
[in] A pointer to the object that implements the IMTConHolidaySink interface.
Return Value
An indication of successful completion is the MT_RET_OK response code. Otherwise, an error code will be returned.
Note
This is a pair method to IMTManagerAPI::HolidaySubscribe. If an attempt is made to unsubscribe from the interface to which it has not subscribed, MT_RET_ERR_NOTFOUND error
is returned.
IMTManagerAPI::HolidayTotal
The total number of configurations of holidays available in the platform.
C++
UINT IMTManagerAPI::HolidayTotal()
.NET
uint CIMTManagerAPI.HolidayTotal()
file:///C:/Users/Administrator/AppData/Local/Temp/~hh4BC4.htm 7/17/2025
Manager API Page 278 of 464
Python
ManagerAPI.HolidayTotal()
Return Value
The number of configurations of holidays in the trading platform.
Note
The method is valid only if the IMTManagerAPI::PUMP_MODE_HOLIDAYS pumping mode was specified during connection.
IMTManagerAPI::HolidayNext
Gets a holiday configuration with the specified index.
C++
MTAPIRES IMTManagerAPI::HolidayNext(
const UINT pos, // Position of the configuration
IMTConHoliday* config // Holiday configuration object
)
.NET
MTRetCode CIMTManagerAPI.HolidayNext(
uint pos, // Position of the configuration
CIMTConHoliday obj // Holiday configuration object
)
Python
ManagerAPI.HolidayNext(
pos # Position of the configuration
)
Parameters
pos
[in] Position of the configuration, starting with 0.
config
[out] An object of holiday configuration. The config object must first be created using the IMTManagerAPI::HolidayCreate method.
Return Value
An indication of successful completion is the MT_RET_OK response code. Otherwise, an error code will be returned.
Note
This method copies the configuration data of a holiday with a specified index to the config object. The method is valid only if the IMTManagerAPI::PUMP_MODE_HOLIDAYS
pumping mode was specified during connection.
Configuration of Groups
Use these functions to obtain user group settings, as well to subscribe and unsubscribe from events associated with their change.
The following functions are available for working with group settings:
Function Purpose
GroupCreate Create an object of the group configuration.
GroupCreateArray Create a groups array object.
GroupSymbolCreate Create an object of symbol configuration for a group.
GroupCommissionCreate Create an object of commission configuration for a group.
GroupTierCreate Create an object of commission range configuration for a group.
GroupSubscribe Subscribe to events associated with the configuration of groups.
GroupUnsubscribe Unsubscribe from events associated with the configuration of groups.
GroupUpdate Update group configuration.
GroupUpdateBatch Update multiple group configurations.
GroupTotal The total number of group configurations available in the platform.
GroupNext Get the group configuration by the index.
GroupGet Get the group configuration by the name.
GroupRequest Request a group configuration from a server by the name.
GroupRequestArray Request from the server an array of groups by mask.
IMTManagerAPI::GroupCreate
Create an object of the group configuration.
C++
file:///C:/Users/Administrator/AppData/Local/Temp/~hh4BC4.htm 7/17/2025
Manager API Page 279 of 464
IMTConGroup* IMTManagerAPI::GroupCreate()
.NET
CIMTConGroup CIMTManagerAPI.GroupCreate()
Return Value
It returns a pointer to the created object that implements the IMTConGroup interface. In case of failure, it returns NULL.
Note
The created object must be destroyed by calling the IMTConGroup::Release method of this object.
IMTManagerAPI::GroupCreateArray
Create a groups array object.
C++
IMTConGroupArray* IMTManagerAPI::GroupCreateArray()
.NET
CIMTConGroupArray CIMTManagerAPI.GroupCreateArray()
Return Value
Returns a pointer to the created object that implements the IMTConGroupArray interface. Null is returned in case of failure.
Note
The created object must be destroyed by calling the IMTConGroupArray::Release method of this object.
IMTManagerAPI::GroupSymbolCreate
Create an object of symbol configuration for a group.
C++
IMTConGroupSymbol* IMTManagerAPI::GroupSymbolCreate()
.NET
CIMTConGroupSymbol CIMTManagerAPI.GroupSymbolCreate()
Return Value
It returns a pointer to the created object that implements the IMTConGroupSymbol interface. In case of failure, it returns NULL.
Note
The created object must be destroyed by calling the IMTConGroupSymbol::Release method of this object.
IMTManagerAPI::GroupCommissionCreate
Create an object of commission configuration for a group.
C++
IMTConCommission* IMTManagerAPI::GroupCommissionCreate()
.NET
CIMTConCommission CIMTManagerAPI.GroupCommissionCreate()
Return Value
It returns a pointer to the created object that implements the IMTConCommission interface. In case of failure, it returns NULL.
Note
The created object must be destroyed by calling the IMTConCommission::Release method of this object.
IMTManagerAPI::GroupTierCreate
Create an object of commission range configuration for a group.
C++
IMTConCommTier* IMTManagerAPI::GroupTierCreate()
.NET
CIMTConCommTier CIMTManagerAPI.GroupTierCreate()
Return Value
It returns a pointer to the created object that implements the IMTConCommTier interface. In case of failure, it returns NULL.
Note
file:///C:/Users/Administrator/AppData/Local/Temp/~hh4BC4.htm 7/17/2025
Manager API Page 280 of 464
The created object must be destroyed by calling the IMTConCommTier::Release method of this object.
IMTManagerAPI::GroupSubscribe
Subscribe to events associated with the configuration of groups.
C++
MTAPIRES IMTManagerAPI::GroupSubscribe(
IMTConGroupSink* sink // A pointer to the IMTConGroupSink object
)
.NET
MTRetCode CIMTManagerAPI.GroupSubscribe(
CIMTConGroupSink sink // CIMTConGroupSink object
)
Python
ManagerAPI.GroupSubscribe(
sink # IMTConGroupSink object
)
Parameters
sink
[in] A pointer to the object that implements the IMTConGroupSink interface.
Return Value
An indication of successful completion is the MT_RET_OK response code. Otherwise, an error has occurred that corresponds to the response code.
Note
Subscribing to events is thread safe. One and the same interface IMTConGroupSink cannot subscribe to an event twice - in this case the response code MT_RET_ERR_DUPLICATE is
returned.
To receive IMTConGroupSink::OnGroupSync events, subscribe before calling the IMTManagerAPI::Connect method.
The object at which sink points, must remain in the memory (must not be removed) until the call of IMTManagerAPI::GroupUnsubscribe or until the administrator interface is
deleted using the IMTManagerAPI::Release method.
To receive events connected with group configuration changes, the pumping mode IMTManagerAPI::PUMP_MODE_GROUPS must be enabled.
IMTManagerAPI::GroupUnsubscribe
Unsubscribe from events associated with the configuration of groups.
C++
MTAPIRES IMTManagerAPI::GroupUnsubscribe(
IMTConGroupSink* sink // A pointer to the IMTConGroupSink object
)
.NET
MTRetCode CIMTManagerAPI.GroupUnsubscribe(
CIMTConGroupSink sink // CIMTConGroupSink object
)
Python
ManagerAPI.GroupUnsubscribe(
sink # IMTConGroupSink object
)
Parameters
sink
[in] A pointer to the object that implements the IMTConGroupSink interface.
Return Value
An indication of successful completion is the MT_RET_OK response code. Otherwise, an error code will be returned.
Note
This is a pair method to IMTManagerAPI::GroupSubscribe. If an attempt is made to unsubscribe from the interface to which it has not subscribed, MT_RET_ERR_NOTFOUND error is
returned.
IMTManagerAPI::GroupUpdate
Update group configuration.
C++
MTAPIRES IMTManagerAPI::GroupUpdate(
IMTConGroup* group // Group configuration object
)
.NET
MTRetCode CIMTManagerAPI.GroupUpdate(
CIMTConGroup group // Group configuration object
)
file:///C:/Users/Administrator/AppData/Local/Temp/~hh4BC4.htm 7/17/2025
Manager API Page 281 of 464
Python
ManagerAPI.GroupUpdate(
group # Group configuration object
)
Parameters
group
[in] An object of group configuration.
Return Value
An indication of successful completion is the MT_RET_OK response code. Otherwise, a corresponding error code will be returned.
Note
A configuration can only be added or updated from the applications running on the main server. For all other applications, the response code MT_RET_ERR_NOTMAIN is returned.
Before adding, the correctness of the account is checked. If the record is incorrect, the error code MT_RET_ERR_PARAMS is returned.
To be able to work with this method, the manager needs to have the IMTConManager::RIGHT_GRP_DETAILS_MARGIN and IMTConManager::RIGHT_GRP_DETAILS_COMMISSION
permissions.
Only the following group parameters can be changed via the manager interface:
• IMTConGroup::MarginCall
• IMTConGroup::MarginStopOut
• IMTConGroup::MarginSOMode
• IMTConGroup::EnTradeFlags::TRADEFLAGS_SO_COMPENSATION
• IMTConGroup::Commission*:
• IMTConGroup::Symbol*:
• IMTConGroupSymbol::Path
• IMTConGroupSymbol::SpreadDiff
• IMTConGroupSymbol::SpreadDiffBalance
• IMTConGroupSymbol::MarginInitial
• IMTConGroupSymbol::MaringMaintenance
• IMTConGroupSymbol::MarginHedged
• IMTConGroupSymbol::MarginHedged
• IMTConGroupSymbol::MarginFlags
• IMTConGroupSymbol::MarginRateInitial
• IMTConGroupSymbol::MarginRateMaintenance
• IMTConGroupSymbol::MarginRateLiquidity
• IMTConGroupSymbol::MarginRateCurrency
• IMTConGroupSymbol::SwapMode
• IMTConGroupSymbol::SwapLong
• IMTConGroupSymbol::SwapShort
• IMTConGroupSymbol::Swap3Day
IMTManagerAPI::GroupUpdateBatch
Update multiple group configurations.
C++
MTAPIRES IMTManagerAPI::GroupUpdateBatch(
IMTConGroup** configs, // Array of configurations
const UINT config_total, // Number of settings in the array
MTAPIRES* results // Array of results
)
.NET
MTRetCode CIMTManagerAPI.GroupUpdateBatch(
CIMTConGroup[] configs, // Array of configurations
MTRetCode[] results // Array of results
)
Python
ManagerAPI.GroupUpdateBatch(
configs // Array of configurations
)
Parameters
configs
[in] A pointer to an array of configurations which you want to add/update.
config_total
[in] The number of configurations in the 'configs' array.
results
[out] An array with the results of each configuration applying on the server.
Return Value
An indication of successful completion is the MT_RET_OK response code. Otherwise, an error code will be returned. The MT_RET_OK response code is an indication of successful
change sending to a server; change applying results are passed in the 'results' parameter.
Note
A configuration can only be added or updated from the applications running on the main server. For all other applications, the response code MT_RET_ERR_NOTMAIN is returned.
Before adding, the correctness of the account is checked. If an entry is incorrect, the MT_RET_ERR_PARAMS error code is added to the 'results' array of this entry.
To be able to work with this method, the manager needs to have the IMTConManager::RIGHT_GRP_DETAILS_MARGIN and IMTConManager::RIGHT_GRP_DETAILS_COMMISSION
permissions.
Only the following group parameters can be changed via the manager interface:
file:///C:/Users/Administrator/AppData/Local/Temp/~hh4BC4.htm 7/17/2025
Manager API Page 282 of 464
• IMTConGroup::MarginCall
• IMTConGroup::MarginStopOut
• IMTConGroup::MarginSOMode
• IMTConGroup::EnTradeFlags::TRADEFLAGS_SO_COMPENSATION
• IMTConGroup::Commission*:
• IMTConGroup::Symbol*:
• IMTConGroupSymbol::Path
• IMTConGroupSymbol::SpreadDiff
• IMTConGroupSymbol::SpreadDiffBalance
• IMTConGroupSymbol::MarginInitial
• IMTConGroupSymbol::MaringMaintenance
• IMTConGroupSymbol::MarginHedged
• IMTConGroupSymbol::MarginHedged
• IMTConGroupSymbol::MarginFlags
• IMTConGroupSymbol::MarginRateInitial
• IMTConGroupSymbol::MarginRateMaintenance
• IMTConGroupSymbol::MarginRateLiquidity
• IMTConGroupSymbol::MarginRateCurrency
• IMTConGroupSymbol::SwapMode
• IMTConGroupSymbol::SwapLong
• IMTConGroupSymbol::SwapShort
• IMTConGroupSymbol::Swap3Day
IMTManagerAPI::GroupTotal
The total number of group configurations available in the platform.
C++
UINT IMTManagerAPI::GroupTotal()
.NET
uint CIMTManagerAPI.GroupTotal()
Python
ManagerAPI.GroupTotal()
Return Value
The number of group configurations in the trading platform.
Note
The method is valid only if the IMTManagerAPI::PUMP_MODE_GROUPS pumping mode was specified during connection.
IMTManagerAPI::GroupNext
Get the group configuration by the index.
C++
MTAPIRES IMTManagerAPI::GroupNext(
const UINT pos, // Position of the configuration
IMTConGroup* group // Group configuration object
)
.NET
MTRetCode CIMTManagerAPI.GroupNext(
uint pos, // Position of the configuration
CIMTConGroup group // Group configuration object
)
Python
ManagerAPI.GroupNext(
pos # Position of the configuration
)
Parameters
pos
[in] Position of the configuration, starting with 0.
group
[out] An object of group configuration. The group object must be first created using the IMTManagerAPI::GroupCreate method.
Return Value
An indication of successful completion is the MT_RET_OK response code. Otherwise, an error code will be returned.
Note
This method copies the configuration data of a group with a specified index to the group object. The method is valid only if the IMTManagerAPI::PUMP_MODE_GROUPS pumping
mode was specified during connection.
IMTManagerAPI::GroupGet
Get the group configuration by the name.
file:///C:/Users/Administrator/AppData/Local/Temp/~hh4BC4.htm 7/17/2025
Manager API Page 283 of 464
C++
MTAPIRES IMTManagerAPI::GroupGet(
LPCWSTR name, // Name of the configuration
IMTConGroup* group // Group configuration object
)
.NET
MTRetCode CIMTManagerAPI.GroupGet(
string name, // Name of the configuration
CIMTConGroup group // Group configuration object
)
Python
ManagerAPI.GroupGet(
name # Name of the configuration
)
Parameters
name
[in] The name of the configuration. The IMTConGroup::Group() value is used as the name..
group
[out] An object of group configuration. The group object must be first created using the IMTManagerAPI::GroupCreate method.
Return Value
An indication of successful completion is the MT_RET_OK response code. Otherwise, an error code will be returned.
Note
The method is valid only if the IMTManagerAPI::PUMP_MODE_GROUPS pumping mode was specified during connection.
IMTManagerAPI::GroupRequest
Request a group configuration from a server by the name.
C++
MTAPIRES IMTManagerAPI::GroupRequest(
LPCWSTR name, // Group name
IMTConGroup* group // Group configuration object
)
.NET
MTRetCode CIMTManagerAPI.GroupRequest(
string name, // Group name
CIMTConGroup group // Group configuration object
)
Python
ManagerAPI.GroupRequest(
name # Group name
)
Parameters
name
[in] Group name.
group
[out] An object of group configuration. The group object must be first created using the IMTManagerAPI::GroupCreate method.
Return Value
An indication of successful completion is the MT_RET_OK response code. Otherwise, an error code will be returned.
Note
The IMTConGroup::Group() value is used as the name.
This method cannot be called from event handlers (any methods of IMT*Sink classes).
IMTManagerAPI::GroupRequestArray
Request from the server an array of groups by mask.
C++
MTAPIRES IMTManagerAPI::GroupRequestArray(
LPCWSTR mask, // Mask
IMTConGroupArray* groups // Object of the group array
)
.NET
MTRetCode CIMTManagerAPI.GroupRequestArray(
string mask, // Mask
CIMTConGroupArray group // Object of the group array
)
Python
ManagerAPI.GroupRequestArray(
mask # Mask
)
file:///C:/Users/Administrator/AppData/Local/Temp/~hh4BC4.htm 7/17/2025
Manager API Page 284 of 464
Parameters
mask
[in] One or more groups separated by commas. Specify the full name of the group, including the path. For example, demo\demoforex. The group name can be obtained using
the IMTConGroup::Group method. Groups can also be specified using wildcard characters: "*" (any value) and "!" (exclude). For example: "demo*,!demoforex" — all groups whose
names begin with 'demo', except for the group demoforex.
groups
[out] Group array object IMTConGroupArray. Must be previously created by using the IMTManagerAPI::GroupCreateArray object.
Return Value
An indication of successful completion is the MT_RET_OK response code. Otherwise, an error code will be returned.
Note
The method cannot be called from event handlers (any IMT*Sink class methods).
Configuration of Symbols
Use these functions to obtain symbol settings, as well to subscribe and unsubscribe from events associated with their change.
The following functions are available for working with symbol settings:
Function Purpose
SymbolCreate Create an object of the symbol configuration.
SymbolCreateArray Create a symbols array object.
SymbolSessionCreate Create an object of configuration of a trading or quoting session of the symbol.
SymbolSubscribe Subscribe to events associated with the configuration of symbols.
SymbolUnsubscribe Unsubscribe from events associated with the configuration of symbols.
SymbolUpdate Update symbol configuration.
SymbolUpdateBatch Update multiple symbol configurations.
SymbolTotal The total number of symbol configurations available in the platform.
SymbolNext Get the symbol configuration by the index.
SymbolGet Get a symbol configuration or an individual configuration of a symbol for a group by the name of the symbol.
SymbolRequest Request a symbol configuration from a server by the name.
SymbolRequestArray Request from the server an array of symbols by mask.
SymbolExist Check the availability of a symbol for a specified group of clients.
IMTManagerAPI::SymbolCreate
Create an object of the symbol configuration.
C++
IMTConSymbol* IMTManagerAPI::SymbolCreate()
.NET
CIMTConSymbol CIMTManagerAPI.SymbolCreate()
Return Value
It returns a pointer to the created object that implements the IMTConSymbol interface. In case of failure, it returns NULL.
Note
The created object must be destroyed by calling the IMTConSymbol::Release method of this object.
IMTManagerAPI::SymbolCreateArray
Create a symbols array object.
C++
IMTConSymbolArray* IMTManagerAPI::SymbolCreateArray()
.NET
CIMTConSymbolArray CIMTManagerAPI.SymbolCreateArray()
Return Value
Returns a pointer to the created object that implements the IMTConSymbolArray interface. Null is returned in case of failure.
Note
The created object must be destroyed by calling the IMTConSymbolArray::Release method of this object.
IMTManagerAPI::SymbolSessionCreate
file:///C:/Users/Administrator/AppData/Local/Temp/~hh4BC4.htm 7/17/2025
Manager API Page 285 of 464
.NET
CIMTConSymbolSession CIMTManagerAPI.SymbolSessionCreate()
Return Value
It returns a pointer to the created object that implements the IMTConSymbolSession interface. In case of failure, it returns NULL.
Note
The created object must be deleted by calling the IMTManagerAPI::Release method of this object.
IMTManagerAPI::SymbolSubscribe
Subscribe to events associated with the configuration of symbols.
C++
MTAPIRES IMTManagerAPI::SymbolSubscribe(
IMTConSymbolSink* sink // A pointer to the IMTConSymbolSink object
)
.NET
MTRetCode CIMTManagerAPI.SymbolSubscribe(
CIMTConSymbolSink sink // CIMTConSymbolSink object
)
Python
ManagerAPI.SymbolSubscribe(
sink # IMTConSymbolSink object
)
Parameters
sink
[in] Pointer to the object that implements IMTConSymbolSink interface.
Return Value
An indication of successful completion is the MT_RET_OK response code. Otherwise, an error has occurred that corresponds to the response code.
Note
Subscribing to events is thread safe. One and the same interface IMTConSymbolSink cannot subscribe to an event twice - in this case the response code MT_RET_ERR_DUPLICATE
is returned.
To receive IMTConSymbolSink::OnSymbolSync events, subscribe before calling the IMTManagerAPI::Connect method.
The object at which sink points, must remain in the memory (must not be removed) until the call of IMTManagerAPI::SymbolUnsubscribe or until the administrator interface is
deleted using the IMTManagerAPI::Release method.
To receive events connected with symbol configuration changes, the pumping mode IMTManagerAPI::PUMP_MODE_SYMBOLS must be enabled.
IMTManagerAPI::SymbolUnsubscribe
Unsubscribe from events associated with the configuration of symbols.
C++
MTAPIRES IMTManagerAPI::SymbolUnsubscribe(
IMTConSymbolSink* sink // A pointer to the IMTConSymbolSink object
)
.NET
MTRetCode CIMTManagerAPI.SymbolUnsubscribe(
CIMTConSymbolSink sink // CIMTConSymbolSink object
)
Python
ManagerAPI.SymbolUnsubscribe(
sink // IMTConSymbolSink object
)
Parameters
sink
[in] Pointer to the object that implements IMTConSymbolSink interface.
Return Value
An indication of successful completion is the MT_RET_OK response code. Otherwise, an error code will be returned.
Note
This method is pared to IMTManagerAPI::SymbolSubscribe. If an attempt is made to unsubscribe from the interface to which it has not subscribed, MT_RET_ERR_NOTFOUND error
is returned.
file:///C:/Users/Administrator/AppData/Local/Temp/~hh4BC4.htm 7/17/2025
Manager API Page 286 of 464
IMTManagerAPI::SymbolUpdate
Update symbol configuration.
C++
MTAPIRES IMTManagerAPI::SymbolUpdate(
IMTConSymbol* symbol // Symbol configuration object
)
.NET
MTRetCode CIMTManagerAPI.SymbolUpdate(
CIMTConSymbol symbol // Symbol configuration object
)
Python
ManagerAPI.SymbolUpdate(
symbol // Symbol configuration object
)
Parameters
symbol
[in] An object of the symbol configuration.
Return Value
An indication of successful completion is the MT_RET_OK response code. Otherwise, an error code will be returned.
Note
A configuration can only be added or updated from the applications running on the main server. For all other applications, the response code MT_RET_ERR_NOTMAIN is returned.
Before adding, the correctness of the account is checked. If the record is incorrect, the error code MT_RET_ERR_PARAMS is returned.
To be able to work with this method, the manager needs to have the IMTConManager::RIGHT_SYMBOL_DETAILS permission.
Only the following symbol parameters can be changed via the manager interface:
• ExecMode
• Color
• StopsLevel
• SpreadBalance
• SpreadDiff
• SpreadDiffBalance
IMTManagerAPI::SymbolUpdateBatch
Update multiple symbol configurations.
C++
MTAPIRES IMTManagerAPI::SymbolUpdateBatch(
IMTConSymbol** configs, // Array of configurations
const UINT config_total, // Number of configurations in the array
MTAPIRES* results // Array of results
)
.NET
MTRetCode CIMTManagerAPI.SymbolUpdateBatch(
CIMTConSymbol[] configs, // Array of configurations
MTRetCode[] results // Array of results
)
Python
ManagerAPI.SymbolUpdateBatch(
configs # Array of configurations
)
Parameters
configs
[in] A pointer to an array of configurations which you want to add/update.
config_total
[in] The number of configurations in the 'configs' array.
results
[out] An array with the results of each configuration applying on the server.
Return Value
An indication of successful completion is the MT_RET_OK response code. Otherwise, an error code will be returned. The MT_RET_OK response code is an indication of successful
change sending to a server; change applying results are passed in the 'results' parameter.
Note
A configuration can only be added or updated from the applications running on the main server. For all other applications, the response code MT_RET_ERR_NOTMAIN is returned.
Before adding, the correctness of the account is checked. If an entry is incorrect, the MT_RET_ERR_PARAMS error code is added to the 'results' array of this entry.
To be able to work with this method, the manager needs to have the IMTConManager::RIGHT_SYMBOL_DETAILS permission.
Only the following symbol parameters can be changed via the manager interface:
• ExecMode
• Color
• StopsLevel
• SpreadBalance
• SpreadDiff
• SpreadDiffBalance
file:///C:/Users/Administrator/AppData/Local/Temp/~hh4BC4.htm 7/17/2025
Manager API Page 287 of 464
IMTManagerAPI::SymbolTotal
The total number of symbol configurations available in the platform.
C++
UINT IMTManagerAPI::SymbolTotal()
.NET
uint CIMTManagerAPI.SymbolTotal()
Python
ManagerAPI.SymbolTotal()
Return Value
The number of symbol configurations in the trading platform.
Note
The method is valid only if the IMTManagerAPI::PUMP_MODE_SYMBOLS pumping mode was specified during connection.
IMTManagerAPI::SymbolNext
Get the symbol configuration by the index.
C++
MTAPIRES IMTManagerAPI::SymbolNext(
const UINT pos, // Position of the configuration
IMTConSymbol* symbol // An object of the symbol configuration
)
.NET
MTRetCode CIMTManagerAPI.SymbolNext(
uint pos, // Position of the configuration
CIMTConSymbol obj // An object of the symbol configuration
)
Python
ManagerAPI.SymbolNext(
int pos # Position of the configuration
)
Parameters
pos
[in] Position of the configuration, starting with 0.
symbol
[out] An object of the symbol configuration. The symbol object must be first created using the IMTManagerAPI::SymbolCreate method.
Return Value
An indication of successful completion is the MT_RET_OK response code. Otherwise, an error code will be returned.
Note
This method copies the configuration data of a symbol with a specified index to the symbol object. The method is valid only if the IMTManagerAPI::PUMP_MODE_SYMBOLS
pumping mode was specified during connection.
IMTManagerAPI::SymbolGet
Gets the symbol configuration by the name.
C++
MTAPIRES IMTManagerAPI::SymbolGet(
LPCWSTR name, // Name of the configuration
IMTConSymbol* symbol // An object of the symbol configuration
)
.NET
MTRetCode CIMTManagerAPI.SymbolGet(
string name, // Name of the configuration
CIMTConSymbol obj // An object of the symbol configuration
)
Python
ManagerAPI.SymbolGet(
str name # Name of the configuration
)
Parameters
name
[in] The name of the configuration. The IMTConSymbol::Symbol value is used as the name..
symbol
file:///C:/Users/Administrator/AppData/Local/Temp/~hh4BC4.htm 7/17/2025
Manager API Page 288 of 464
[out] An object of the symbol configuration. The symbol object must be first created using the IMTManagerAPI::SymbolCreate method.
Return Value
An indication of successful completion is the MT_RET_OK response code. Otherwise, an error code will be returned.
Note
This method returns a symbol configuration with default trade settings. The method is valid only if the IMTManagerAPI::PUMP_MODE_SYMBOLS pumping mode was specified during
connection.
IMTManagerAPI::SymbolGet
Get symbol settings taking into account that they are overridden for the specified group.
C++
MTAPIRES IMTManagerAPI::SymbolGet(
LPCWSTR name, // Name of the configuration
LPCWSTR group, // Group name
IMTConSymbol* symbol // An object of the symbol configuration
)
.NET
MTRetCode CIMTManagerAPI.SymbolGet(
string name, // Name of the configuration
string group, // Group name
CIMTConSymbol obj // An object of the symbol configuration
)
Python
ManagerAPI.SymbolGet(
str name, # Name of the configuration
str group # Group name
)
Parameters
name
[in] The name of the configuration. The IMTConSymbol::Symbol value is used as the name..
group
[in] Name of a group. The IMTConGroup::Group value is used as the group name..
symbol
[out] An object of the symbol configuration. The symbol object must be first created using the IMTManagerAPI::SymbolCreate method.
Return Value
An indication of successful completion is the MT_RET_OK response code. Otherwise, an error code will be returned.
Note
This method returns a symbol configuration with trade settings for the specified group. The method is valid only if the IMTManagerAPI::PUMP_MODE_SYMBOLS pumping mode was
specified during connection.
IMTManagerAPI::SymbolRequest
Request a symbol configuration from a server by the name.
C++
MTAPIRES IMTManagerAPI::SymbolRequest(
LPCWSTR name, // Symbol name
IMTConSymbol* symbol // An object of the symbol configuration
)
.NET
MTRetCode CIMTManagerAPI.SymbolRequest(
string name, // Symbol name
CIMTConSymbol obj // An object of the symbol configuration
)
Python
ManagerAPI.SymbolRequest(
name # Symbol name
)
Parameters
name
[in] Symbol name.
symbol
[out] An object of the symbol configuration. The symbol object must be first created using the IMTManagerAPI::SymbolCreate method.
Return Value
An indication of successful completion is the MT_RET_OK response code. Otherwise, an error code will be returned.
Note
The IMTConSymbol::Symbol() value is used as the name. This method returns a symbol configuration with default trade settings.
This method cannot be called from event handlers (any methods of IMT*Sink classes).
IMTManagerAPI::SymbolRequest
Request from a server an individual configuration of a symbol for a group by the name of the symbol.
C++
file:///C:/Users/Administrator/AppData/Local/Temp/~hh4BC4.htm 7/17/2025
Manager API Page 289 of 464
MTAPIRES IMTManagerAPI::SymbolRequest(
LPCWSTR name, // Symbol name
LPCWSTR group, // Group name
IMTConSymbol* symbol // An object of the symbol configuration
)
.NET
MTRetCode CIMTManagerAPI.SymbolRequest(
string name, // Symbol name
string group, // Group name
CIMTConSymbol symbol // An object of the symbol configuration
)
Python
ManagerAPI.SymbolRequest(
name, # Symbol name
group # Group name
)
Parameters
name
[in] Symbol name.
group
[in] Group name.
symbol
[out] An object of the symbol configuration. The symbol object must be first created using the IMTManagerAPI::SymbolCreate method.
Return Value
An indication of successful completion is the MT_RET_OK response code. Otherwise, an error code will be returned.
Note
The IMTConSymbol::Symbol() value is used as the symbol name, IMTConGroup::Group() - as the group name.
This method returns a symbol configuration with trade settings for the specified group.
This method cannot be called from event handlers (any methods of IMT*Sink classes).
IMTManagerAPI::SymbolRequestArray
Request from the server an array of symbols by mask.
C++
MTAPIRES IMTManagerAPI::SymbolRequestArray(
LPCWSTR mask, // Mask
LPCWSTR group, // Group name
IMTConSymbolArray* symbols // Symbols array object
)
.NET
MTRetCode CIMTManagerAPI.SymbolRequestArray(
string mask, // Mask
string group, // Group name
CIMTConSymbolArray symbols // Symbols array object
)
Python
ManagerAPI.SymbolRequestArray(
mask, # Mask
group # Group name
)
Parameters
mask
[in] One or more symbols separated by commas. Specify the full name of the symbol, including the path. For example, Forex\EURUSD. The symbol name can be obtained by
using the IMTConSymbol::Symbol method. Symbols can also be specified using wildcard characters: "*" (any value) and "!" (exclude). For example, Forex\*,!Forex\EURUSD — all
symbols in the Forex subgroup except EURUSD. The maximum length of the mask is 512 characters (including the end-of-line character).
group
[in] The name of the group whose symbol settings should be used (IMTConGroupSymbol). The method will pass symbol configurations based on how they are redefined for the
specified group. If the parameter is null, the method will pass the basic symbol settings.
symbols
[out] Symbols array object IMTConSymbolArray. Must be previously created by using the IMTManagerAPI::SymbolCreateArray object.
Return Value
An indication of successful completion is the MT_RET_OK response code. Otherwise, a corresponding error code will be returned.
Note
The method cannot be called from event handlers (any IMT*Sink class methods).
IMTManagerAPI::SymbolExist
Check the availability of a symbol for a specified group of clients.
C++
MTAPIRES IMTManagerAPI::SymbolExist(
const IMTConSymbol* symbol, // An object of the symbol configuration
const IMTConGroup* group // An object of the group configuration
)
file:///C:/Users/Administrator/AppData/Local/Temp/~hh4BC4.htm 7/17/2025
Manager API Page 290 of 464
.NET
MTRetCode CIMTManagerAPI.SymbolExist(
CIMTConSymbol symbol, // An object of the symbol configuration
CIMTConGroup group // An object of the group configuration
)
Python
ManagerAPI.SymbolExist(
symbol, # An object of the symbol configuration
group # An object of the group configuration
)
Parameters
symbol
[in] An object of the symbol configuration.
group
[in] An object of the group configuration.
Return Value
An indication of successful completion is the MT_RET_OK response code. Otherwise, an error code will be returned.
Note
This method checks whether the parameters of a client group allow working with a specified symbol.
Floating Margin
In this section, you can configure a list of rules for quick adjustments of client leverages/margin. You can create several profiles and quickly switch between them in the group
settings. Thus, the platform enables the implementation of a dynamic leverage, often referred to as a floating leverage, which adjusts based on different conditions. For example,
leverage and margin values may vary depending on the volume of positions on the client account, on the day of the week or other conditions. For further details, please see
MetaTrader 5 Administrator documentation.
The functions described in this section enable the management of floating margin configurations:
Function Purpose
LeverageCreate Create a floating margin configuration object.
LeverageCreateArray Create an object for a floating margin configuration array.
LeverageRuleCreate Create an object for a floating margin configuration rule.
LeverageTierCreate Create an object for a floating margin rule rule.
LeverageSubscribe Subscribe to events and hooks related to a floating margin configuration.
LeverageUnsubscribe Unsubscribe from events and hooks related to a floating margin configuration.
LeverageTotal Get the total number of floating margin configurations present in the platform.
LeverageNext Get a floating margin configuration by index.
LeverageGet Get a subscription configuration by name.
LeverageRequest Request a floating margin configuration from the server by name.
LeverageRequestArray Request an array of floating margin configurations from the server by groups.
IMTManagerAPI::LeverageCreate
Create a floating margin configuration object.
C++
IMTConLeverage* IMTManagerAPI::LeverageCreate()
.NET
CIMTConLeverage CIMTManagerAPI.LeverageCreate()
Return Value
Returns a pointer to the created object that implements the IMTConLeverage interface. In case of failure, NULL is returned.
Note
The created object must be destroyed by calling the IMTConLeverage::Release method of this object.
IMTManagerAPI::LeverageCreateArray
Create an object for a floating margin configuration array.
C++
IMTConLeverageArray* IMTManagerAPI::LeverageCreateArray()
.NET
CIMTConLeverageArray CIMTManagerAPI.LeverageCreateArray()
Return Value
file:///C:/Users/Administrator/AppData/Local/Temp/~hh4BC4.htm 7/17/2025
Manager API Page 291 of 464
Returns a pointer to the created object that implements the IMTConLeverageArray interface. In case of failure, NULL is returned.
Note
The created object must be destroyed by calling the IMTConLeverageArray::Release method of this object.
IMTManagerAPI::LeverageRuleCreate
Create an object for a floating margin configuration rule.
C++
IMTConLeverageRule* IMTManagerAPI::LeverageRuleCreate()
.NET
CIMTConLeverageRule CIMTManagerAPI.LeverageRuleCreate()
Return Value
Returns a pointer to the created object that implements the IMTConLeverageRule interface. In case of failure, NULL is returned.
Note
The created object must be destroyed by calling the IMTConLeverageRule::Release method of this object.
IMTManagerAPI::LeverageTierCreate
Create an object for a floating margin rule rule.
C++
IMTConLeverageTier* IMTManagerAPI::LeverageTierCreate()
.NET
CIMTConLeverageTier CIMTManagerAPI.LeverageTierCreate()
Return Value
Returns a pointer to the created object that implements the IMTConLeverageTier interface. In case of failure, NULL is returned.
Note
The created object must be destroyed by calling the IMTConLeverageTier::Release method of this object.
IMTManagerAPI::LeverageSubscribe
Subscribe to events and hooks related to a floating margin configuration.
C++
MTAPIRES IMTManagerAPI::LeverageSubscribe(
IMTConLeverageSink* sink // Pointer to the IMTConLeverageSink object
)
.NET
MTRetCode CIMTManagerAPI.LeverageSubscribe(
CIMTConLeverageSink sink // The CIMTConLeverageSink object
)
Python
ManagerAPI.LeverageSubscribe(
sink # The IMTConLeverageSink object
)
Parameters
sink
[in] Pointer to the object that implements the IMTConLeverageSink interface.
Return Value
An indication of a successful completion is the MT_RET_OK response code. Otherwise, an error has occurred that corresponds to the response code.
Note
Subscribing to events is implemented in a thread-safe manner. The same IMTConLeverageSink interface cannot be subscribed to an event twice; in this case the response code
MT_RET_ERR_DUPLICATE is returned.
The object pointed by 'sink' must remain in memory (must not be removed) until IMTManagerAPI::LeverageUnsubscribe is called or until the administrator interface is deleted
using the IMTManagerAPI::Release method.
IMTManagerAPI::LeverageUnsubscribe
Unsubscribe from events and hooks related to a floating margin configuration.
C++
MTAPIRES IMTManagerAPI::LeverageUnsubscribe(
IMTConLeverageSink* sink // Pointer to the IMTConLeverageSink object
)
C++
file:///C:/Users/Administrator/AppData/Local/Temp/~hh4BC4.htm 7/17/2025
Manager API Page 292 of 464
MTRetCode CIMTManagerAPI.LeverageUnsubscribe(
CIMTConLeverageSink sink // The CIMTConLeverageSink object
)
Python
ManagerAPI.LeverageUnsubscribe(
sink # The IMTConLeverageSink object
)
Parameters
sink
[in] Pointer to the object that implements the IMTConLeverageSink interface.
Return Value
An indication of a successful completion is the MT_RET_OK response code. Otherwise, the code of the encountered error is returned.
Note
This method is a counterpart to the IMTAdminAPI::LeverageSubscribe method. When attempting to unsubscribe from an interface that was not previously subscribed, the error
MT_RET_ERR_NOTFOUND is returned.
IMTManagerAPI::LeverageTotal
Get the total number of floating margin configurations present in the platform.
C++
UINT IMTManagerAPI::LeverageTotal()
.NET
uint CIMTManagerAPI.LeverageTotal()
Python
ManagerAPI.LeverageTotal()
Return Value
The number of floating margin configurations in the trading platform.
IMTManagerAPI::LeverageNext
Get a floating margin configuration by index.
C++
MTAPIRES IMTManagerAPI::LeverageNext(
const UINT pos, // Configuration position
IMTConLeverage* config // Configuration object
)
.NET
MTRetCode CIMTManagerAPI.LeverageNext(
uint pos, // Configuration position
CIMTConLeverage config // Configuration object
)
Python
ManagerAPI.LeverageNext(
int pos # Configuration positi
)
Parameters
pos
[in] Configuration position starting from 0.
config
[out] Configuration object. The 'config' object must be created in advance using the IMTManagerAPI::LeverageCreate method.
Return Value
An indication of a successful completion is the MT_RET_OK response code. Otherwise, the code of the encountered error is returned.
Note
This method copies the subscription configuration with a specified index to the 'config' object.
IMTManagerAPI::LeverageGet
Get a floating margin configuration by name.
C++
MTAPIRES IMTManagerAPI::LeverageGet(
LPCWSTR name, // Configuration name
IMTConLeverage* config // Configuration object
)
.NET
MTRetCode CIMTManagerAPI.LeverageGet(
string name, // Configuration name
CIMTConLeverage config // Configuration object
)
file:///C:/Users/Administrator/AppData/Local/Temp/~hh4BC4.htm 7/17/2025
Manager API Page 293 of 464
Python
ManagerAPI.LeverageGet(
str name # Configuration name
)
Parameters
name
[in] Configuration name. The IMTConLeverage::Name value is used for the configuration name.
config
[out] Configuration object. The 'config' object must be created in advance using the IMTManagerAPI::LeverageCreate method.
Return Value
An indication of a successful completion is the MT_RET_OK response code. Otherwise, the code of the encountered error is returned.
IMTManagerAPI::LeverageRequest
Request a floating margin configuration from the server by name.
C++
MTAPIRES IMTManagerAPI::LeverageRequest(
LPCWSTR name, // Configuration name
IMTConLeverage* config // Configuration object
)
.NET
MTRetCode CIMTManagerAPI.LeverageRequest(
string name, // Configuration name
CIMTConLeverage config // Configuration object
)
Python
ManagerAPI.LeverageRequest(
name # Configuration name
)
Parameters
name
[in] Configuration name. The IMTConLeverage::Name value is used for the configuration name.
config
[out] Configuration object. The 'config' object must be created in advance using the IMTManagerAPI::LeverageCreate method.
Return Value
An indication of a successful completion is the MT_RET_OK response code. Otherwise, the code of the encountered error is returned.
Note
The method cannot be called from event handlers (any IMT*Sink class methods).
IMTManagerAPI::LeverageRequestArray
Request an array of floating margin configurations from the server by groups.
C++
MTAPIRES IMTManagerAPI::LeverageRequestArray(
LPCWSTR groups_mask, // Group mask
IMTConLeverageArray leverages // Configuration object
)
.NET
MTRetCode CIMTManagerAPI.LeverageRequestArray(
string groups_mask, // Group mask
CIMTConLeverageArray leverages // Object configuration
)
Python
ManagerAPI.LeverageRequestArray(
groups_mask # Group mask
)
Parameters
groups_mask
[in] Groups to which floating margin configurations are being applied. You can specify one group, several groups separated by commas, or a group mask. A mask is indicated
using "*" (any value) and "!" (exception). For example: "demo*,!demoforex" includes all groups with the names beginning with 'demo', except for the 'demoforex' group. The value
of 'nullptr' means "all groups".
leverages
[out] Object of the configurations array IMTConLeverageArray. The 'config' object must be created in advance using the IMTManagerAPI::LeverageCreateArray method.
Return Value
An indication of a successful completion is the MT_RET_OK response code. Otherwise, the code of the encountered error is returned.
Note
The method cannot be called from event handlers (any IMT*Sink class methods).
Configuration of Spreads
file:///C:/Users/Administrator/AppData/Local/Temp/~hh4BC4.htm 7/17/2025
Manager API Page 294 of 464
Functions allow getting spread configurations as well subscribing and unsubscribing from events associated with their change.
The following functions for working with spreads are available:
Function Purpose
SpreadCreate Create an object of the configuration of a spread.
SpreadLegCreate Create an object of the configuration of a spread leg.
SpreadSubscribe Subscribe to events and hooks associated with the configuration of spreads.
SpreadUnsubscribe Unsubscribe from events and hooks associated with spread configuration.
SpreadTotal The total number of spread configurations available in the platform.
SpreadNext Receiving a spread configuration by the index.
IMTManagerAPI::SpreadCreate
Create an object of the configuration of a spread.
C++
IMTConSpread* IMTManagerAPI::SpreadCreate()
.NET
CIMTConSpread CIMTManagerAPI.SpreadCreate()
Return Value
It returns a pointer to the created object that implements IMTConSpread interface. In case of failure, it returns NULL.
Note
The created object must be destroyed by calling IMTConSpread::Release method of this object.
IMTManagerAPI::SpreadLegCreate
Create an object of the configuration of a spread leg.
C++
IMTConSpreadLeg* IMTManagerAPI::SpreadLegCreate()
.NET
CIMTConSpreadLeg CIMTManagerAPI.SpreadLegCreate()
Return Value
It returns a pointer to the created object that implements IMTConSpreadLeg interface. In case of failure, it returns NULL.
Note
The created object must be destroyed by calling IMTConSpreadLeg::Release method of this object.
IMTManagerAPI::SpreadSubscribe
Subscribe to events and hooks associated with the configuration of spreads.
C++
MTAPIRES IMTManagerAPI::SpreadSubscribe(
IMTConSpreadSink* sink // pointer to IMTConSpreadSink object
)
.NET
MTRetCode CIMTManagerAPI.SpreadSubscribe(
CIMTConSpreadSink sink // CIMTConSpreadSink object
)
Python
ManagerAPI.SpreadSubscribe(
sink // IMTConSpreadSink object
)
Parameters
sink
[in] Pointer to the object that implements IMTConSpreadSink interface.
Return Value
An indication of successful completion is the MT_RET_OK response code. Otherwise, an error has occurred that corresponds to the response code.
Note
Subscribing to events is thread safe. One and the same IMTConSpreadSink interface cannot subscribe to an event twice - in this case, MT_RET_ERR_DUPLICATE response code is
returned.
To receive IMTConSpreadSink::OnSpreadSync events, subscribe before calling the IMTManagerAPI::Connect method.
file:///C:/Users/Administrator/AppData/Local/Temp/~hh4BC4.htm 7/17/2025
Manager API Page 295 of 464
The object at which sink points, must remain in the memory (must not be removed) until the call of IMTManagerAPI::SpreadUnsubscribe or until the administrator interface is
deleted using the IMTManagerAPI::Release method.
IMTManagerAPI::SpreadUnsubscribe
Unsubscribe from events and hooks associated with spread configuration.
C++
MTAPIRES IMTManagerAPI::SpreadUnsubscribe(
IMTConSpreadSink* sink // pointer to IMTConSpreadSink object
)
.NET
MTRetCode CIMTManagerAPI.SpreadUnsubscribe(
CIMTConSpreadSink sink // CIMTConSpreadSink object
)
Python
ManagerAPI.SpreadUnsubscribe(
sink // IMTConSpreadSink object
)
Parameters
sink
[in] Pointer to the object that implements IMTConSymbolSink interface.
Return Value
An indication of successful completion is the MT_RET_OK response code. Otherwise, an error code will be returned.
Note
This is a pair method to IMTManagerAPI::SpreadSubscribe. If an attempt is made to unsubscribe from the interface to which it has not subscribed, MT_RET_ERR_NOTFOUND error
is returned.
IMTManagerAPI::SpreadTotal
The total number of spread configurations available in the platform.
C++
UINT IMTManagerAPI::SpreadTotal()
.NET
uint CIMTManagerAPI.SpreadTotal()
Python
ManagerAPI.SpreadTotal()
Return Value
The number of configurations of spreads in the trading platform.
IMTManagerAPI::SpreadNext
Receiving a spread configuration by the index.
C++
MTAPIRES IMTManagerAPI::SpreadNext(
const UINT pos, // Position of the configuration
IMTConSymbol* spread // Spread configuration object
)
.NET
MTRetCode CIMTManagerAPI.SpreadNext(
uint pos, // Position of the configuration
CIMTConSymbol spread // Spread configuration object
)
Python
ManagerAPI.SpreadNext(
pos # configuration position
)
Parameters
pos
[in] Position of the configuration, starting with 0.
spread
[out] Spread configuration object. The spread object must be first created using IMTManagerAPI::SpreadCreate method.
Return Value
An indication of successful completion is the MT_RET_OK response code. Otherwise, an error code will be returned.
Note
file:///C:/Users/Administrator/AppData/Local/Temp/~hh4BC4.htm 7/17/2025
Manager API Page 296 of 464
This method copies the configuration data of a spread with a specified index to spread object.
Configuration of Plugins
Functions described in this section allow managing plugin configurations. The following functions for managing plugins are available:
Function Purpose
PluginCreate Create an object of the plugin configuration.
PluginModuleCreate Create an object of the plugin module configuration.
PluginParamCreate Create an object of the plugin parameter.
PluginUpdate Update a plugin configuration.
PluginTotal The total number of plugin configurations available on the trade server.
PluginNext Get the plugin configuration by the index.
PluginGet Get the plugin configuration by the name.
When working via the manager interface (IMTManagerAPI) the application only has access to the plugins, in which the "Configurable by managers" option is enabled
(IMTConPlugin::PLUGIN_FLAG_MAN_CONFIG). In addition:
• When connecting to the main trade server, the application only has access to the plugins, which are installed on the same server or on the history server
(IMTConPlugin::Server).
• When connecting to a regular trading server, the application can only access the plugins which are installed in the same server.
During operation via the administrator interface (IMTAdminAPI), the following plugins are available to the application:
• When connected to the main trade server: all plugins within the platform.
• When connected to a regular trading server: all plugins installed in the same server or on the history server.
To manage plugin configurations, the pumping mode IMTManagerAPI::PUMP_MODE_PLUGINS must be enabled for the Manager API application. Also, the
IMTConPlugin::PLUGIN_FLAG_MAN_CONFIG flag must be enabled for the plugin and the IMTConManager::RIGHT_CFG_PLUGINS permission must be enabled for the manager
account.
IMTManagerAPI::PluginCreate
Create an object of the plugin configuration.
C++
IMTConPlugin* IMTManagerAPI::PluginCreate()
.NET
CIMTConPlugin CIMTManagerAPI.PluginCreate()
Return Value
It returns a pointer to the created object that implements the IMTConPlugin interface. In case of failure, it returns NULL.
Note
The created object must be deleted by calling the IMTConPlugin::Release method of this object.
IMTManagerAPI::PluginModuleCreate
Create an object of the plugin module configuration.
C++
IMTConPluginModule* IMTManagerAPI::PluginModuleCreate()
.NET
CIMTConPluginModule CIMTManagerAPI.PluginModuleCreate()
Return Value
It returns a pointer to the created object that implements the IMTConPluginModule interface. In case of failure, it returns NULL.
Note
The created object must be deleted by calling the IMTConPluginModule::Release of this object.
IMTManagerAPI::PluginParamCreate
Create an object of the plugin parameter.
C++
file:///C:/Users/Administrator/AppData/Local/Temp/~hh4BC4.htm 7/17/2025
Manager API Page 297 of 464
IMTConParam* IMTManagerAPI::PluginParamCreate()
.NET
CIMTConParam CIMTManagerAPI.PluginParamCreate()
Return Value
It returns a pointer to the created object that implements the IMTConParam interface. In case of failure, it returns NULL.
Note
The created object must be destroyed by calling the IMTConParam::Release method of this object.
IMTManagerAPI::PluginUpdate
Update a plugin configuration.
C++
MTAPIRES IMTManagerAPI::PluginUpdate(
IMTConPlugin* plugin // An object of a plugin configuration
)
.NET
MTRetCode CIMTManagerAPI.PluginUpdate(
CIMTConPlugin plugin // An object of a plugin configuration
)
Python
ManagerAPI.PluginUpdate(
plugin # An object of a plugin configuration
)
Parameters
plugin
[in] An object of plugin configuration.
Return Value
An indication of successful completion is the MT_RET_OK response code. Otherwise, an error code will be returned.
Note
Before adding, the correctness of the record is checked. If the record is incorrect, the error code MT_RET_ERR_PARAMS is returned.
To be able to modify plugin configurations, the pumping mode IMTManagerAPI::PUMP_MODE_PLUGINS must be enabled. Additionally the plugin must have the
IMTConPlugin::PLUGIN_FLAG_MAN_CONFIG flag enabled, and the manager account must have the IMTConManager::RIGHT_CFG_PLUGINS permission granted.
IMTManagerAPI::PluginTotal
The total number of plugin configurations available on the trade server.
C++
UINT IMTManagerAPI::PluginTotal()
.NET
uint CIMTManagerAPI.PluginTotal()
Python
ManagerAPI.PluginTotal()
Return Value
The number of plugin configurations on the trade server.
IMTManagerAPI::PluginNext
Get the plugin configuration by the index.
C++
MTAPIRES IMTManagerAPI::PluginNext(
const UINT pos, // Position of the configuration
IMTConPlugin* plugin // An object of a plugin configuration
)
.NET
MTRetCode CIMTManagerAPI.PluginNext(
uint pos, // Position of the configuration
CIMTConPlugin plugin // An object of a plugin configuration
)
Python
ManagerAPI.PluginNext(
pos # Position of the configuration
)
file:///C:/Users/Administrator/AppData/Local/Temp/~hh4BC4.htm 7/17/2025
Manager API Page 298 of 464
Parameters
pos
[in] Position of the configuration, starting with 0.
plugin
[out] An object of plugin configuration. The created object must be deleted by calling the IMTManagerAPI::PluginCreate method of this object.
Return Value
An indication of successful completion is the MT_RET_OK response code. Otherwise, an error code will be returned.
Note
This method copies the configuration data of a plugin with a specified index to the plugin object.
IMTManagerAPI::PluginGet
Get the plugin configuration by the name.
C++
MTAPIRES IMTManagerAPI::PluginGet(
LPCWSTR name, // Plugin configuration name
IMTConPlugin* plugin // An object of a plugin configuration
)
.NET
MTRetCode CIMTManagerAPI.PluginGet(
string name, // Plugin configuration name
CIMTConPlugin plugin // An object of a plugin configuration
)
Python
ManagerAPI.PluginGet(
name # Plugin configuration name
)
Parameters
name
[in] Name of the plugin configuration. The IMTConPlugin::Name value is used as the name.
plugin
[out] An object of plugin configuration. The object must first be created using the IMTManagerAPI::PluginCreate method.
Return Value
An indication of successful completion is the MT_RET_OK response code. Otherwise, an error code will be returned.
Note
This method copies parameters of the specified plugin configuration to the plugin object.
Configuration of Managers
Functions from this section allow obtaining the description of own manager account, including access permissions for certain data and platform functions.
Function Purpose
ManagerCreate Create a manager configuration object.
ManagerAccessCreate Create an object of access list configuration by IP addresses for a manager.
ManagerReportCreate Create an object for the manager's permission to access the report.
ManagerCurrent Get the configuration of the current manager account.
IMTManagerAPI::ManagerCreate
Create a manager configuration object.
C++
IMTConManager* IMTManagerAPI::ManagerCreate()
.NET
CIMTConManager CIMTManagerAPI.ManagerCreate()
Return Value
It returns a pointer to the created object that implements the IMTConManager interface. Null is returned in case of failure.
Note
The created object must be destroyed by calling the IMTConManager::Release method of this object.
file:///C:/Users/Administrator/AppData/Local/Temp/~hh4BC4.htm 7/17/2025
Manager API Page 299 of 464
IMTManagerAPI::ManagerAccessCreate
Create an object of access list configuration by IP addresses for a manager.
C++
IMTConManagerAccess* IMTManagerAPI::ManagerAccessCreate()
.NET
CIMTConManagerAccess CIMTManagerAPI.ManagerAccessCreate()
Return Value
Returns a pointer to the created object that implements the IMTConManagerAccess interface. Null is returned in case of failure.
Note
The created object must be destroyed by calling the IMTConManagerAccess::Release method of this object.
IMTManagerAPI::ManagerReportCreate
Create an object for the manager's permission to access the report.
C++
IMTConManagerReport* IMTManagerAPI::ManagerReportCreate()
.NET
CIMTConManagerReport CIMTManagerAPI.ManagerReportCreate()
Return Value
Returns a pointer to the created object that implements the IMTConManagerReport interface. In case of failure, NULL is returned.
Note
The created object must be destroyed by calling the IMTConManagerReport::Release method of this object.
IMTManagerAPI::ManagerCurrent
Get the configuration of the current manager account.
C++
MTAPIRES IMTManagerAPI::ManagerCurrent(
IMTConManager* manager // Manager configuration object
)
.NET
MTRetCode CIMTManagerAPI.ManagerCurrent(
CIMTConManager manager // Manager configuration object
)
Python
ManagerAPI.ManagerCurrent()
Parameters
manager
[out] An object of manager configuration. The 'manager' object must be previously created using the IMTManagerAPI::ManagerCreate method.
Return Value
An indication of successful completion is the MT_RET_OK response code. Otherwise, an error code will be returned.
Note
The method returns the description of the manager account using which the Manager API application is currently connected to the server.
Subscriptions
With the "Subscriptions" service, you can offer additional paid services to traders directly in the client terminals. For example, you can sell subscriptions for high-quality market
data from well-known providers, offer personal manager services to assist traders in understanding the basics of trading, deliver one-time services such as position transferring or
currency conversion, and much more. For further details, please read the MetaTrader 5 Administrator Help.
The functions described in this section allow receiving subscription settings:
Function Purpose
SubscriptionCfgCreate Create a subscription configuration object.
SubscriptionCfgSymbolCreate Create a subscription configuration object.
SubscriptionCfgNewsCreate Create a subscription configuration object.
SubscriptionCfgSubscribe Subscribe to events and hooks associated with subscription configurations.
SubscriptionCfgUnsubscribe Unsubscribe from events and hooks associated with subscription configurations.
SubscriptionCfgTotal Get the total number of subscription configurations available in the platform.
SubscriptionCfgNext Get a subscription configuration by index.
SubscriptionCfgGet Get a subscription configuration by name.
file:///C:/Users/Administrator/AppData/Local/Temp/~hh4BC4.htm 7/17/2025
Manager API Page 300 of 464
Function Purpose
IMTManagerAPI::SubscriptionCfgCreate
Create a subscription configuration object.
C++
IMTConSubscription* IMTManagerAPI::SubscriptionCfgCreate()
.NET
CIMTConSubscription CIMTManagerAPI.SubscriptionCfgCreate()
Return Value
The function returns a pointer to the created object that implements the IMTConSubscription interface. Null is returned in case of failure.
Note
The created object must be destroyed by calling the IMTConSubscription::Release method of this object.
IMTManagerAPI::SubscriptionCfgSymbolCreate
Create a subscription configuration object.
C++
IMTConSubscriptionSymbol* IMTManagerAPI::SubscriptionCfgSymbolCreate()
.NET
CIMTConSubscriptionSymbol CIMTManagerAPI.SubscriptionCfgSymbolCreate()
Return Value
Returns a pointer to the created object that implements the IMTConSubscriptionSymbol interface. Null is returned in case of failure.
Note
The created object must be destroyed by calling the IMTConSubscriptionSymbol::Release method of this object.
IMTManagerAPI::SubscriptionCfgNewsCreate
Create a subscription configuration object.
C++
IMTConSubscriptionNews* IMTManagerAPI::SubscriptionCfgNewsCreate()
.NET
CIMTConSubscriptionNews CIMTManagerAPI.SubscriptionCfgNewsCreate()
Return Value
Returns a pointer to the created object that implements the IMTConSubscriptionNews interface. Null is returned in case of failure.
Note
The created object must be destroyed by calling the IMTConSubscriptionNews::Release method of this object.
IMTManagerAPI::SubscriptionCfgSubscribe
Subscribe to events and hooks associated with subscription configurations.
C++
MTAPIRES IMTManagerAPI::SubscriptionCfgSubscribe(
IMTConSubscriptionSink* sink // A pointer to the IMTConSubscriptionSink object
)
.NET
MTRetCode CIMTManagerAPI.SubscriptionCfgSubscribe(
CIMTConSubscriptionSink sink // The IMTConSubscriptionSink object
)
Parameters
sink
[in] A pointer to the object that implements the IMTConSubscriptionSink interface.
Return Value
An indication of successful completion is the MT_RET_OK response code. Otherwise, an error has occurred corresponding to the response code.
Note
Subscribing to events is thread safe. The same IMTConSubscriptionSink interface cannot subscribe to an event twice. The MT_RET_ERR_DUPLICATE response code is returned in
this case.
file:///C:/Users/Administrator/AppData/Local/Temp/~hh4BC4.htm 7/17/2025
Manager API Page 301 of 464
The object at which 'sink' points must remain in memory (must not be deleted) until IMTManagerAPI::SubscriptionCfgUnsubscribe is called or until the administrator interface is
deleted by the IMTManagerAPI::Release method.
IMTManagerAPI::SubscriptionCfgUnsubscribe
Unsubscribe from events and hooks associated with subscription configurations.
C++
MTAPIRES IMTManagerAPI::SubscriptionCfgUnsubscribe(
IMTConSubscriptionSink* sink // A pointer to the IMTConSubscriptionSink object
)
.NET
MTRetCode CIMTManagerAPI.SubscriptionCfgUnsubscribe(
CIMTConSubscriptionSink sink // The IMTConSubscriptionSink object
)
Parameters
sink
[in] A pointer to the object that implements the IMTConSubscriptionSink interface.
Return Value
An indication of successful completion is the MT_RET_OK response code. Otherwise, an error code will be returned.
Note
This method is paired with IMTManagerAPI::SubscriptionCfgSubscribe. If an attempt is made to unsubscribe from the interface to which it has not subscribed,
MT_RET_ERR_NOTFOUND error is returned.
IMTManagerAPI::SubscriptionCfgTotal
Get the total number of subscription configurations available in the platform.
C++
UINT IMTManagerAPI::SubscriptionCfgTotal()
.NET
uint CIMTManagerAPI.SubscriptionCfgTotal()
Return Value
The number of subscription configurations in the trading platform.
IMTManagerAPI::SubscriptionCfgNext
Get a subscription configuration by index.
C++
MTAPIRES IMTManagerAPI::SubscriptionCfgNext(
const UINT pos, // Configuration position
IMTConSubscription* config // Subscription configuration object
)
.NET
MTRetCode CIMTManagerAPI.SubscriptionCfgNext(
uint pos, // Configuration position
CIMTConSubscription config // Subscription configuration object
)
Parameters
pos
[in] Position of the configuration, starting with 0.
config
[out] Subscription configuration object. The 'config' object must be previously created using the IMTManagerAPI::SubscriptionCfgCreate method.
Return Value
An indication of successful completion is the MT_RET_OK response code. Otherwise, an error code will be returned.
Note
This method copies the subscription configuration with a specified index to the 'config' object.
IMTManagerAPI::SubscriptionCfgGet
Get a subscription configuration by name.
C++
MTAPIRES IMTManagerAPI::SubscriptionCfgGet(
LPCWSTR name, // Configuration name
IMTConSubscription* config // Subscription configuration object
)
.NET
file:///C:/Users/Administrator/AppData/Local/Temp/~hh4BC4.htm 7/17/2025
Manager API Page 302 of 464
MTRetCode CIMTManagerAPI.SubscriptionCfgGet(
string name, // Configuration name
CIMTConSubscription config // Subscription configuration object
)
Parameters
name
[in] Configuration name. The IMTConSubscription::Name value is used for the configuration name.
config
[out] Subscription configuration object. The 'config' object must be previously created using the IMTManagerAPI::SubscriptionCfgCreate method.
Return Value
An indication of successful completion is the MT_RET_OK response code. Otherwise, an error code will be returned.
Note
The method only works if the IMTManagerAPI::PUMP_MODE_SUBSCRIPTIONS pumping mode has been specified during the connection.
IMTManagerAPI::SubscriptionCfgGetByID
Get a subscription configuration by ID.
C++
MTAPIRES IMTManagerAPI::SubscriptionCfgGetByID(
LPCWSTR name, // Configuration name
IMTConSubscription* config // Subscription configuration object
)
.NET
MTRetCode CIMTManagerAPI.SubscriptionCfgGetByID(
string name, // Configuration name
CIMTConSubscription config // Subscription configuration object
)
Parameters
id
[in] Configuration ID. The IMTConSubscription::ID value is used for the identifier.
config
[out] Subscription configuration object. The 'config' object must be previously created using the IMTManagerAPI::SubscriptionCfgCreate method.
Return Value
An indication of successful completion is the MT_RET_OK response code. Otherwise, an error code will be returned.
Note
The method only works if the IMTManagerAPI::PUMP_MODE_SUBSCRIPTIONS pumping mode has been specified during the connection.
IMTManagerAPI::SubscriptionCfgRequest
Request a subscription configuration from the server by its name.
C++
MTAPIRES IMTManagerAPI::SubscriptionCfgRequest(
LPCWSTR name, // Configuration name
IMTConSubscription* config // Subscription configuration object
)
.NET
MTRetCode CIMTManagerAPI.SubscriptionCfgRequest(
string name, // Configuration name
CIMTConSubscription config // Subscription configuration object
)
Parameters
name
[in] Configuration name. The IMTConSubscription::Name value is used for the configuration name.
config
[out] Subscription configuration object. The 'config' object must be previously created using the IMTManagerAPI::SubscriptionCfgCreate method.
Return Value
An indication of successful completion is the MT_RET_OK response code. Otherwise, an error code will be returned.
IMTManagerAPI::SubscriptionCfgRequestByID
Request a subscription configuration from the server by its ID.
C++
MTAPIRES IMTManagerAPI::SubscriptionCfgRequestByID(
const UINT64 id, // Configuration ID
IMTConSubscription* config // Subscription configuration object
)
.NET
file:///C:/Users/Administrator/AppData/Local/Temp/~hh4BC4.htm 7/17/2025
Manager API Page 303 of 464
MTRetCode CIMTManagerAPI.SubscriptionCfgRequestByID(
uint id, // Configuration ID
CIMTConSubscription config // Subscription configuration object
)
Parameters
id
[in] Configuration ID. The IMTConSubscription::ID value is used for the identifier.
config
[out] Subscription configuration object. The 'config' object must be previously created using the IMTManagerAPI::SubscriptionCfgCreate method.
Return Value
An indication of successful completion is the MT_RET_OK response code. Otherwise, an error code will be returned.
The functions for managing the list of selected symbols perform the same actions as the context menu commands of Market Watch:
Function Purpose
SelectedAdd Add a symbol to the list by the name.
SelectedAddBatch Add a batch of symbols to the list of selected symbols.
SelectedAddAll Add all available symbols to the list of selected symbols.
SelectedDelete Remove a symbol from the list of selected symbols by the name or index.
SelectedDeleteBatch Delete a batch of symbols from the list of selected symbols.
SelectedDeleteAll Delete all symbols from the list of selected symbols
SelectedShift Shift a symbol in the list of selected symbols
SelectedTotal Get the total number of symbols in the list of selected symbols.
SelectedNext Get the name of a symbol by a position in the list of selected symbols.
• To work with the list of selected symbols, an application should be connected in the PUMP_MODE_SYMBOLS pumping mode.
• When enabling PUMP_MODE_ORDERS and PUMP_MODE_POSITIONS pumping modes, pumping of symbols is automatically enabled, while the symbols, for which there are
orders and positions, are automatically added to the list of selected symbols.
IMTManagerAPI::SelectedAdd
Add a symbol to the list by the name.
C++
MTAPIRES IMTManagerAPI::SelectedAdd(
LPCWSTR symbol // Symbol name
)
.NET
file:///C:/Users/Administrator/AppData/Local/Temp/~hh4BC4.htm 7/17/2025
Manager API Page 304 of 464
MTRetCode CIMTManagerAPI.SelectedAdd(
string symbol // Symbol name
)
Python
ManagerAPI.SelectedAdd(
symbol # Symbol name
)
Parameters
symbol
[in] Symbol name. The IMTConSymbol::Symbol value is used as the symbol name.
Return Value
An indication of successful completion is the MT_RET_OK response code. Otherwise, an error code will be returned.
IMTManagerAPI::SelectedAddBatch
Add a batch of symbols to the list of selected symbols.
C++
MTAPIRES IMTManagerAPI::SelectedAddBatch(
LPWSTR* symbols, // An array of symbols
UINT symbols_total // The number of symbols
)
.NET
MTRetCode CIMTManagerAPI.SelectedAddBatch(
array<String^>^ symbols // An array of symbols
)
Python
ManagerAPI.SelectedAddBatch(
symbols # An array of symbols
)
Parameters
symbols
[in] An array of pointers to symbol names.
symbols_total
[in] The number of elements in the 'symbols' array.
Return value
An indication of a successful execution is the MT_RET_OK response code. Otherwise, an error code is returned.
IMTManagerAPI::SelectedAddAll
Add all available symbols to the list of selected symbols.
C++
MTAPIRES IMTManagerAPI::SelectedAddAll()
.NET
MTRetCode CIMTManagerAPI.SelectedAddAll()
Python
ManagerAPI.SelectedAddAll()
Return Value
An indication of successful completion is the MT_RET_OK response code. Otherwise, an error code will be returned.
Note
This methods adds all the symbols available to a manager into the list of selected symbols.
IMTManagerAPI::SelectedDelete
Remove a symbol from the list of selected symbols by the name.
C++
MTAPIRES IMTManagerAPI::SelectedDelete(
LPCWSTR symbol // Symbol name
)
.NET
MTRetCode CIMIManagerAPI.SelectedDelete(
string symbol // Symbol name
)
Python
file:///C:/Users/Administrator/AppData/Local/Temp/~hh4BC4.htm 7/17/2025
Manager API Page 305 of 464
ManagerAPI.SelectedDelete(
str symbol # Symbol name
)
Parameters
symbol
[in] Symbol name. The IMTConSymbol::Symbol value is used as the symbol name.
Return Value
An indication of successful completion is the MT_RET_OK response code. Otherwise, an error code will be returned.
Note
Symbols for which there are unfulfilled orders pr open positions(in the appropriate pimping modes) cannot be deleted.
IMTManagerAPI::SelectedDelete
Remove a symbol from the list of selected symbols by the index.
C++
MTAPIRES IMTManagerAPI::SelectedDelete(
const UINT pos // Position of the symbol
)
.NET
MTRetCode CIMTManagerAPI.SelectedDelete(
uint pos // Position of the symbol
)
Python
ManagerAPI.SelectedDelete(
int pos # Position of the symbol
)
Parameters
pos
[in] Position of the symbol in the list of selected symbols, ranging from 0.
Return Value
An indication of successful completion is the MT_RET_OK response code. Otherwise, an error code will be returned.
Note
Symbols for which there are unfulfilled orders pr open positions(in the appropriate pimping modes) cannot be deleted.
IMTManagerAPI::SelectedDeleteBatch
Delete a batch of symbols from the list of selected symbols.
C++
MTAPIRES IMTManagerAPI::SelectedDeleteBatch(
LPWSTR* symbols, // An array of symbols
UINT symbols_total // The number of symbols
)
.NET
MTRetCode CIMTManagerAPI.SelectedDeleteBatch(
array<String^>^ symbols // An array of symbols
)
Python
ManagerAPI.SelectedDeleteBatch(
symbols # An array of symbols
)
Parameters
symbols
[in] An array of pointers to symbol names.
symbols_total
[in] The number of elements in the 'symbols' array.
Return value
An indication of a successful execution is the MT_RET_OK response code. Otherwise, an error code is returned.
Note
You cannot delete symbols, for which you currently have unfilled orders or open positions(in appropriate pumping modes).
IMTManagerAPI::SelectedDeleteAll
Delete all symbols from the list of selected symbols
C++
MTAPIRES IMTManagerAPI::SelectedDeleteAll()
.NET
MTRetCode CIMTManagerAPI.SelectedDeleteAll()
file:///C:/Users/Administrator/AppData/Local/Temp/~hh4BC4.htm 7/17/2025
Manager API Page 306 of 464
Python
ManagerAPI.SelectedDeleteAll()
Return Value
An indication of successful completion is the MT_RET_OK response code. Otherwise, an error code will be returned.
Note
Symbols for which there are unfulfilled orders pr open positions(in the appropriate pimping modes) cannot be deleted.
IMTManagerAPI::SelectedShift
Shift a symbol in the list of selected symbols
C++
MTAPIRES IMTManagerAPI::SelectedShift(
const UINT pos, // Position of the symbol
const int shift // Shift
)
.NET
MTRetCode CIMTManagerAPI.SelectedShift(
uint pos, // Position of the symbol
int shift // Shift
)
Python
ManagerAPI.SelectedShift(
pos, # Position of the symbol
shift # Shift
)
Parameters
pos
[in] Position of the symbol in the list of selected symbols, ranging from 0.
shift
[in] Shift of a symbol from its current position. A negative value means the shift to the top of the list, a positive value - to its end.
Return Value
An indication of successful completion is the MT_RET_OK response code. Otherwise, an error code will be returned.
IMTManagerAPI::SelectedTotal
Get the total number of symbols in the list of selected symbols.
C++
UINT IMTManagerAPI::SelectedTotal()
.NET
uint CIMTManagerAPI.SelectedTotal()
Python
ManagerAPI.SelectedTotal()
Return Value
The total number of symbols in the list of selected symbols.
IMTManagerAPI::SelectedNext
Get the name of a symbol by a position in the list of selected symbols.
C++
MTAPIRES IMTManagerAPI::SelectedNext(
const UINT pos, // Symbol position
MTAPISTR& symbol // Symbol name
)
.NET
MTRetCode CIMTManagerAPI.SelectedNext(
uint pos, // Symbol position
out string symbol // Symbol name
)
Python
ManagerAPI.SelectedNext(
pos # Symbol position
)
Parameters
pos
file:///C:/Users/Administrator/AppData/Local/Temp/~hh4BC4.htm 7/17/2025
Manager API Page 307 of 464
[in] Position of the symbol in the list of selected symbols, ranging from 0.
symbol
[out] Symbol name.
Return Value
An indication of successful completion is the MT_RET_OK response code. Otherwise, an error code will be returned.
Clients
The MetaTrader 5 Manager API allows managing a database of clients on a trade server. Using the API, you can add or remove records, edit data and handle database change
events. Use the API to expand the standard functionality of client management system in the platform, or to integrate it with external CRM systems.
A detailed description of operations with clients is provided in the MetaTrader 5 Administrator documentation.
The Manager API only allows managing the clients, which are available to the manager account used by the application to connect to the server. A client record is available to
the manager if one of the following conditions is met:
Functions Purpose
ClientCreate Create a client object.
ClientCreateArray Create an object of the client array.
ClientAdd Add a client to the server database.
ClientAddBatch Add a batch of clients to the server database.
ClientAddBatchArray Add a batch of clients to the server database.
ClientUpdate Update a client in the server database.
ClientUpdateBatch Update a batch of clients in the server database.
ClientUpdateBatchArray Update a batch of clients in the server database.
ClientDelete Delete a client from the server database.
ClientDeleteBatch Delete a batch of clients from the server database.
ClientRequest Get a client by identifier.
ClientRequestByGroup Get clients by groups.
ClientRequestHistory Get the history of client changes.
ClientUserAdd Bind a trading account to a client.
ClientUserAddBatch Bind a batch of trading accounts to a client.
ClientUserDelete Unbind a trading account from a client.
ClientUserDeleteBatch Unbind a batch of trading accounts from a client.
ClientUserRequest Get the list of client's trading accounts.
DocumentCreate Create a document object.
DocumentCreateArray Create an object of the array of documents.
DocumentAdd Add a document to a client record.
DocumentAddBatch Add a document to a client record.
DocumentAddBatchArray Add a document to a client record.
DocumentUpdate Change a document in the client record.
DocumentUpdateBatch Change a document in the client record.
DocumentUpdateBatchArray Change a document in the client record.
DocumentDelete Delete a document from a client record.
DocumentDeleteBatch Delete a document from a client record.
DocumentRequest Get a document by identifier.
DocumentRequestByClient Get client documents.
DocumentRequestHistory Get the history of client document changes.
CommentCreate Create a comment object.
CommentCreateArray Create an object of the array of comments.
CommentAdd Add a comment to a document or client.
CommentAddBatch Add a batch of comments to a document or client.
CommentAddBatchArray Add a batch of comments to a document or client.
CommentUpdate Change a comment to a document or client.
CommentUpdateBatch Update a batch of comments to a document or client.
CommentUpdateBatchArray Update a batch of comments to a document or client.
file:///C:/Users/Administrator/AppData/Local/Temp/~hh4BC4.htm 7/17/2025
Manager API Page 308 of 464
Functions Purpose
CommentDelete Delete a comment from a document or client.
CommentDeleteBatch Delete a batch of comments from a document or client.
CommentRequest Get a comment by identifier.
CommentRequestByClient Get comments on a client by position.
CommentRequestByDocument Get comments on client documents by position.
AttachmentCreate Create an attachment object.
AttachmentCreateArray Create an object of the array of attachments.
AttachmentAdd Create an attachment file for a document or a comment.
AttachmentAddBatch Create attachment files for documents or comments in batch.
AttachmentAddBatchArray Create attachment files for documents or comments in batch.
AttachmentRequest Get attachments by identifiers.
IMTManagerAPI::ClientCreate
Create a client object.
C++
IMTClient* IMTManagerAPI::ClientCreate()
.NET
CIMTClient CIMTManagerAPI.ClientCreate()
Return Value
Returns a pointer to the created object that implements the IMTClient interface. NULL is returned in case of failure.
Note
The created object must be destroyed by calling the IMTClient::Release method of this object.
IMTManagerAPI::ClientCreateArray
Create an object of the client array.
C++
IMTClientArray* IMTManagerAPI::ClientCreateArray()
.NET
CIMTClientArray CIMTManagerAPI.ClientCreateArray()
Return Value
Returns a pointer to the created object that implements the IMTClientArray interface. NULL is returned in case of failure.
Note
The created object must be destroyed by calling the IMTClientArray::Release method of this object.
IMTManagerAPI::ClientAdd
Add a client to the server database.
C++
MTAPIRES IMTManagerAPI::ClientAdd(
IMTClient* client // client object
)
.NET
MTRetCode CIMTManagerAPI.ClientAdd(
CIMTClient client // client object
)
Python
ManagerAPI.ClientAdd(
MTClient client # client object
)
Parameters
client
[in] Client object.
Return Value
An indication of successful completion is the MT_RET_OK response code. Otherwise, an error has occurred which corresponds to the response code.
Note
A client can only be added to the database of the server, to which the application is connected.
When creating a client, the server automatically assigns to this client a unique identifier IMTClient::RecordID.
During addition, the integrity of client records is checked. The IMTClient::PersonName field must be filled in the record.
file:///C:/Users/Administrator/AppData/Local/Temp/~hh4BC4.htm 7/17/2025
Manager API Page 309 of 464
IMTManagerAPI::ClientAddBatch
Add a batch of clients to the server database.
C++
MTAPIRES IMTManagerAPI::ClientAddBatch(
IMTClientArray* clients, // array of clients
MTAPIRES* results // array of results
)
.NET
MTRetCode CIMTManagerAPI.ClientAddBatch(
CIMTClientArray clients, // array of clients
MTRetCode[] retcodes // array of results
)
Python
ManagerAPI.ClientAddBatch(
list[MTClient] clients # array of clients
)
Parameters
clients
[in] A pointer to the object of the IMTClientArray array of clients.
results
[out] An array with the results of adding of clients. The size of the 'results' array must not be less than that of 'clients'.
Return Value
The MT_RET_OK response code indicates that all specified clients have been added. The MT_RET_ERR_PARTIAL response code means that only some of the clients have been
added. Analyze the 'results' array for more details of the execution results. The result of adding of each client from the 'clients' array is added to 'results'. The index of a result
corresponds to the index of a client in the source array.
Note
A client can only be added to the database of the server, to which the application is connected.
When creating a client, the server automatically assigns to this client a unique identifier IMTClient::RecordID.
During addition, the integrity of client records is checked. The IMTClient::PersonName field must be filled in the record.
IMTManagerAPI::ClientAddBatchArray
Add a batch of clients to the server database.
C++
MTAPIRES IMTManagerAPI::ClientAddBatchArray(
IMTClient** clients, // array of clients
const UINT clients_total, // number of clients in the array
MTAPIRES* results // array of results
)
.NET
MTRetCode CIMTManagerAPI.ClientAddBatchArray(
IMTClient[] clients, // array of clients
MTRetCode[] retcodes // array of results
)
Parameters
clients
[in] A pointer to the array of clients.
clients_total
[in] The number of clients in the 'clients' array.
results
[out] An array with the results of adding of clients. The size of the 'results' array must not be less than that of 'clients'.
Return Value
The MT_RET_OK response code indicates that all specified clients have been added. The MT_RET_ERR_PARTIAL response code means that only some of the clients have been
added. Analyze the 'results' array for more details of the execution results. The result of adding of each client from the 'clients' array is added to 'results'. The index of a result
corresponds to the index of a client in the source array.
Note
A client can only be added to the database of the server, to which the application is connected.
When creating a client, the server automatically assigns to this client a unique identifier IMTClient::RecordID.
During addition, the integrity of client records is checked. The IMTClient::PersonName field must be filled in the record.
IMTManagerAPI::ClientUpdate
Update a client in the server database.
C++
MTAPIRES IMTManagerAPI::ClientUpdate(
IMTClient* client // client object
)
.NET
file:///C:/Users/Administrator/AppData/Local/Temp/~hh4BC4.htm 7/17/2025
Manager API Page 310 of 464
MTRetCode CIMTManagerAPI.ClientUpdate(
CIMTClient client // client object
)
Python
ManagerAPI.ClientUpdate(
MTClient client # client object
)
Parameters
client
[in] Client object.
Return Value
An indication of successful completion is the MT_RET_OK response code. Otherwise, an error has occurred that corresponds to the response code.
Note
A client can only be updated from the applications connected to the trade server, on which the client has been created. For all other applications the response code
MT_RET_ERR_NOTMAIN will be returned. If the object is not found, the response code MT_RET_ERR_NOTFOUND is returned.
All required fields in the 'client' object must be filled, not only the ones that need to be changed. It is recommended that you first receive a client object from the server, change
the required fields in it, and then send the changed object back to the server.
During update, a client record is checked for integrity. The IMTClient::PersonName field must be filled in the record.
IMTManagerAPI::ClientUpdateBatch
Update a batch of clients in the server database.
C++
MTAPIRES IMTManagerAPI::ClientUpdateBatch(
IMTClientArray* clients, // array of clients
MTAPIRES* results // array of results
)
.NET
MTRetCode CIMTManagerAPI.ClientUpdateBatch(
CIMTClientArray clients, // array of clients
MTRetCode[] retcodes // array of results
)
Python
ManagerAPI.ClientUpdateBatch(
list[MTClient] clients # array of clients
)
Parameters
clients
[in] A pointer to the object of the IMTClientArray array of clients.
results
[out] An array with the results of adding of clients. The size of the 'results' array must not be less than that of 'clients'.
Return Value
The MT_RET_OK response code indicates that all specified clients have been updated. The MT_RET_ERR_PARTIAL response code means that only some of the clients have been
updated. Analyze the 'results' array for more details of the execution results. The result of update of each client from the 'clients' array is added to 'results'. The index of a result
corresponds to the index of a client in the source array.
Note
A client can only be updated from the applications connected to the trade server, on which the client has been created. For all other applications the response code
MT_RET_ERR_NOTMAIN will be returned. If the object is not found, the response code MT_RET_ERR_NOTFOUND is returned.
All required fields in the 'client' object must be filled, not only the ones that need to be changed. It is recommended that you first receive a client object from the server, change
the required fields in it, and then send the changed object back to the server.
During update, a client record is checked for integrity. The IMTClient::PersonName field must be filled in the record.
IMTManagerAPI::ClientUpdateBatchArray
Update a batch of clients in the server database.
C++
MTAPIRES IMTManagerAPI::ClientUpdateBatchArray(
IMTClient** clients, // array of clients
const UINT clients_total, // number of clients in the array
MTAPIRES* results // array of results
)
.NET
MTRetCode CIMTManagerAPI.ClientUpdateBatchArray(
CIMTClient[] clients, // array of clients
MTRetCode[] retcodes // array of results
)
Parameters
clients
[in] A pointer to the array of clients.
clients_total
[in] The number of clients in the 'clients' array.
results
file:///C:/Users/Administrator/AppData/Local/Temp/~hh4BC4.htm 7/17/2025
Manager API Page 311 of 464
[out] An array with the results of updating of clients. The size of the 'results' array must not be less than that of 'clients'.
Return Value
The MT_RET_OK response code indicates that all specified clients have been updated. The MT_RET_ERR_PARTIAL response code means that only some of the clients have been
updated. Analyze the 'results' array for more details of the execution results. The result of update of each client from the 'clients' array is added to 'results'. The index of a result
corresponds to the index of a client in the source array.
Note
A client can only be updated from the applications connected to the trade server, on which the client has been created. For all other applications the response code
MT_RET_ERR_NOTMAIN will be returned. If the object is not found, the response code MT_RET_ERR_NOTFOUND is returned.
All required fields in the 'client' object must be filled, not only the ones that need to be changed. It is recommended that you first receive a client object from the server, change
the required fields in it, and then send the changed object back to the server.
During update, a client record is checked for integrity. The IMTClient::PersonName field must be filled in the record.
IMTManagerAPI::ClientDelete
Delete a client from the server database.
C++
MTAPIRES IMTManagerAPI::ClientDelete(
const UINT64 client_id // identifier
)
.NET
MTRetCode IMTManagerAPI.ClientDelete(
ulong client_id // identifier
)
Python
ManagerAPI.ClientDelete(
int client_id # identifier
)
Parameters
client_id
[in] Client identifier (IMTClient::RecordID).
Return Value
An indication of successful completion is the MT_RET_OK response code. Otherwise, an error code is returned.
Note
A client can only be deleted from the applications connected to the trade server, on which the client has been created. For all other applications the response code
MT_RET_ERR_NOTMAIN will be returned. If the object is not found, the response code MT_RET_ERR_NOTFOUND is returned.
IMTManagerAPI::ClientDeleteBatch
Delete a batch of clients from the server database.
C++
MTAPIRES IMTManagerAPI::ClientDeleteBatch(
const UINT64* client_ids, // array of identifiers
const UINT client_ids_total, // number of identifiers
MTAPIRES* results // array of results
)
.NET
MTRetCode CIMTManagerAPI.ClientDeleteBatch(
ulong[] client_ids, // array of identifiers
MTRetCode[] results // array of results
)
Python
ManagerAPI.ClientDeleteBatch(
list[int] client_ids # array of identifiers
)
Parameters
client_ids
[in] An array with client identifiers in the server database (IMTClient::RecordID).
client_ids_total
[in] The number of identifiers in the 'client_ids' array.
results
[out] An array with the client deletion results. The size of the 'results' array must not be less than that of 'clients'.
Return Value
The MT_RET_OK response code indicates that all specified clients have been deleted. The MT_RET_ERR_PARTIAL response code means that only some of the clients have been
deleted. Analyze the 'results' array for more details of the execution results. The result of deletion of each client from the 'clients' array is added to 'results'. The index of a result
corresponds to the index of a client in the source array.
Note
A client can only be deleted from the applications connected to the trade server, on which the client has been created. For all other applications the response code
MT_RET_ERR_NOTMAIN will be returned. If the object is not found, the response code MT_RET_ERR_NOTFOUND is returned.
Bulk deletion is executed faster than deletion of the same number of clients in a cycle one by one, using IMTManagerAPI::ClientDelete.
file:///C:/Users/Administrator/AppData/Local/Temp/~hh4BC4.htm 7/17/2025
Manager API Page 312 of 464
IMTManagerAPI::ClientRequest
Get a client by identifier.
C++
MTAPIRES IMTManagerAPI::ClientRequest(
const UINT64 client_id, // identifier
IMTClient* client // client object
)
.NET
MTRetCode CIMTManagerAPI.ClientRequest(
ulong client_id, // identifier
CIMTClient client // client object
)
Python
ManagerAPI.ClientRequest(
int client_id # identifier
)
Parameters
client_id
[in] Client identifier (IMTClient::RecordID).
client
[out] Client object. The 'client' object must be previously created using the IMTManagerAPI::ClientCreate method.
Return Value
An indication of successful completion is the MT_RET_OK response code. Otherwise, an error code is returned.
Note
The method copies data of a client with the specified ID, to the 'client' object.
The method cannot be called from event handlers (any IMT*Sink class methods).
IMTManagerAPI::ClientRequestByGroup
Get clients by groups.
C++
MTAPIRES IMTManagerAPI::ClientRequestByGroup(
LPCWSTR groups, // groups
IMTClientArray* clients // object of clients array
)
.NET
MTRetCode CIMTManagerAPI.ClientRequestByGroup(
string groups, // groups
CIMTClientArray clients // object of clients array
)
Python
ManagerAPI.ClientRequestByGroup(
str groups # groups
)
Parameters
groups
[in] The preferred group (TradingGroup) specified for the client. You can specify one group, several groups (comma separated) or a group mask. The mask is specified using
"*" (any value) and "!" (exception). For example: "demo*,!demoforex" - all groups with the names beginning with 'demo', except for the group demoforex. The following clients
are returned when filter by groups is used:
• Clients for whom TradingGroup is specified and this group corresponds to the request mask
• Clients for whom TradingGroup is not specified, but there is at least one bound account from the requested group
• Clients for whom TradingGroup is not specified and there are no bound accounts (to prevent the clients from being lost)
clients
[out] An object of an array of clients. The 'clients' object must be previously created using the IMTManagerAPI::ClientCreateArray method.
Return Value
An indication of successful completion is the MT_RET_OK response code. Otherwise, an error code is returned.
Note
The method cannot be called from event handlers (any IMT*Sink class methods).
IMTManagerAPI::ClientRequestHistory
Get the history of client changes.
C++
MTAPIRES IMTManagerAPI::ClientRequestHistory(
const UINT64 client_id, // identifier
const UINT64 author, // author
const INT64 from, // period beginning
const UINT64 to, // period end
IMTClientArray* history // object of client array
)
.NET
file:///C:/Users/Administrator/AppData/Local/Temp/~hh4BC4.htm 7/17/2025
Manager API Page 313 of 464
MTRetCode CIMTManagerAPI.ClientRequestHistory(
ulong client_id, // identifier
ulong author, // author
long from, // period beginning
long to, // period end
CIMTClientArray history // object of client array
)
Python
ManagerAPI.ClientRequestHistory(
int client_id, # identifier
int author, # author
from, # period beginning
to # period end
)
Parameters
client_id
[in] Client identifier (IMTClient::RecordID).
author
[in] The login of the manager account by whom the client was changed. The login is equal to the IMTConManager::Login value.
from
[in] The beginning of the period for which you wish to get the history of client changes. The date is specified in seconds that have elapsed since 01.01.1970.
to
[in] The end of the period for which you wish to get the history of client changes. The date is specified in seconds that have elapsed since 01.01.1970.
history
[out] An object of an array of clients. The 'history' object must be previously created using the IMTManagerAPI::ClientCreateArray method.
Return Value
An indication of successful completion is the MT_RET_OK response code. Otherwise, an error code is returned.
Note
The method returns an array of client descriptions: all the client states after changes by the specified author, in the specified time period.
The method cannot be called from event handlers (any IMT*Sink class methods).
IMTManagerAPI::ClientUserAdd
Bind a trading account to a client.
C++
MTAPIRES IMTManagerAPI::ClientUserAdd(
const UINT64 client_id, // identifier
const UINT64 login // account number
)
.NET
MTRetCode CIMTManagerAPI.ClientUserAdd(
ulong client_id, // identifier
ulong login // account number
)
Python
ManagerAPI.ClientUserAdd(
int client_id, # identifier
int login # account number
)
Parameters
client_id
[in] The ID of the client (IMTClient::RecordID), to which the account should be linked.
login
[in] The login of the account (IMTUser::Login), which should be linked to the client.
Return Value
An indication of successful completion is the MT_RET_OK response code. Otherwise, an error code is returned.
Note
The method does not create a trading account. It binds an existing account to a client.
When binding, account data are not copied to the client record.
IMTManagerAPI::ClientUserAddBatch
Bind a batch of trading accounts to a client.
C++
MTAPIRES IMTManagerAPI::ClientUserAddBatch(
const UINT64 client_id, // identifier
const UINT64* logins, // array of accounts
const UINT logins_total, // number of accounts
MTAPIRES* results // results
)
.NET
file:///C:/Users/Administrator/AppData/Local/Temp/~hh4BC4.htm 7/17/2025
Manager API Page 314 of 464
MTRetCode CIMTManagerAPI.ClientUserAddBatch(
ulong client_id, // identifier
ulong[] logins, // array of accounts
MTRetCode[] retcodes // results
)
Python
ManagerAPI.ClientUserAddBatch(
int client_id, # identifier
list[int] logins # array of accounts
)
Parameters
client_id
[in] The ID of the client (IMTClient::RecordID), to which the accounts should be linked.
logins
[in] The array of account logins (IMTUser::Login), which should be bound to the client.
logins_total
[in] Number of accounts in the logins array.
results
[out] An array with account binding results. The size of the 'results' array must not be less than that of 'logins'.
Return Value
The MT_RET_OK response code indicates that all specified accounts have been bound. The MT_RET_ERR_PARTIAL response code means that only some of the clients have been
bound. Analyze the 'results' array for more details of the execution results. The result of binding of each account from the 'logins' array is added to 'results'. The index of a result
corresponds to the index of an account in the source array.
Note
The method does not create trading accounts. It only binds existing accounts to a client.
When binding, account data are not copied to the client record.
IMTManagerAPI::ClientUserDelete
Unbind a trading account from a client.
C++
MTAPIRES IMTManagerAPI::ClientUserDelete(
const UINT64 client_id, // identifier
const UINT64 login // account number
)
.NET
MTRetCode CIMTManagerAPI.ClientUserDelete(
ulong client_id, // identifier
ulong login // account number
)
Python
ManagerAPI.ClientUserDelete(
int client_id, # identifier
int login # account number
)
Parameters
client_id
[in] The ID of the client (IMTClient::RecordID), from which the account should be unbound.
login
[in] The login of the account (IMTUser::Login), which is unbound from the client.
Return Value
An indication of successful completion is the MT_RET_OK response code. Otherwise, an error code is returned.
Note
The request does not delete the trading account. It unbinds the account from the client.
IMTManagerAPI::ClientUserDeleteBatch
Unbind a batch of trading accounts from a client.
C++
MTAPIRES IMTManagerAPI::ClientUserDeleteBatch(
const UINT64 client_id, // identifier
const UINT64* logins, // array of accounts
const UINT logins_total, // number of accounts
MTAPIRES* results // results
)
.NET
MTRetCode CIMTManagerAPI.ClientUserDeleteBatch(
ulong client_id, // identifier
ulong[] logins, // array of accounts
MTRetCode[] retcodes // results
)
Python
file:///C:/Users/Administrator/AppData/Local/Temp/~hh4BC4.htm 7/17/2025
Manager API Page 315 of 464
ManagerAPI.ClientUserDeleteBatch(
int client_id, # identifier
list[int] logins # array of accounts
)
Parameters
client_id
[in] The ID of the client (IMTClient::RecordID), from which the accounts are unbound.
logins
[in] The array of account logins (IMTUser::Login), which are unbound from the client.
logins_total
[in] Number of accounts in the logins array.
results
[out] An array with account unbinding results. The size of the 'results' array must not be less than that of 'logins'.
Return Value
The MT_RET_OK response code indicates that all specified accounts have been unbound. The MT_RET_ERR_PARTIAL response code means that only some of the clients have been
unbound. Analyze the 'results' array for more details of the execution results. The result of unbinding of each account from the 'logins' array is added to 'results'. The index of a
result corresponds to the index of an account in the source array.
Note
The request does not delete trading accounts. It only unbinds accounts from the client.
IMTManagerAPI::ClientUserRequest
Get the list of client's trading accounts.
C++
MTAPIRES IMTManagerAPI::ClientUserRequest(
const UINT64 client_id, // identifier
UINT64*& logins, // array of accounts
UINT& logins_total // number of accounts
)
.NET
MTRetCode CIMTManagerAPI.ClientUserRequest(
ulong client_id, // identifier
ulong[] logins // array of accounts
)
Python
ManagerAPI.ClientUserRequest(
int client_id # identifier
)
Parameters
client_id
[in] Client identifier (IMTClient::RecordID).
logins
[out] Array with account logins. The login is equal to IMTUser::Login.
logins_total
[out] The number of accounts in the 'logins' array.
Return Value
An indication of successful completion is the MT_RET_OK response code. Otherwise, an error code is returned.
Note
The method allocates and fills an array of accounts. A pointer to the passed block is placed to the 'logins' parameter. After use, the array placed in the 'logins' variable must be
released using the IMTManagerAPI::Free method.
The method cannot be called from event handlers (any IMT*Sink class methods).
IMTManagerAPI::DocumentCreate
Create a document object.
C++
IMTClient* IMTManagerAPI::DocumentCreate()
.NET
CIMTClient CIMTManagerAPI.DocumentCreate()
Return Value
Returns a pointer to the created object that implements the IMTDocument interface. NULL is returned in case of failure.
Note
The created object must be destroyed by calling the IMTDocument::Release method of this object.
IMTManagerAPI::DocumentCreateArray
Create an object of the array of documents.
file:///C:/Users/Administrator/AppData/Local/Temp/~hh4BC4.htm 7/17/2025
Manager API Page 316 of 464
C++
IMTClientArray* IMTManagerAPI::DocumentCreateArray()
.NET
CIMTClientArray CIMTManagerAPI.DocumentCreateArray()
Return Value
Returns a pointer to the created object that implements the IMTDocumentArray interface. NULL is returned in case of failure.
Note
The created object must be destroyed by calling the IMTDocumentArray::Release method of this object.
IMTManagerAPI::DocumentAdd
Add a document to a client record.
C++
MTAPIRES IMTManagerAPI::DocumentAdd(
IMTDocument* document // document object
)
.NET
MTRetCode CIMTManagerAPI.DocumentAdd(
CIMTDocument document // document object
)
Parameters
document
[in] Document object.
Return Value
An indication of successful completion is the MT_RET_OK response code. Otherwise, an error has occurred that corresponds to the response code.
Note
A document can only be added from the applications connected to the trading server, on which the client has been created (IMTDocument::RelatedClient). The
MT_RET_ERR_NOTMAIN response code will be returned for all other applications. If the object is not found, the response code MT_RET_ERR_NOTFOUND will be returned.
IMTManagerAPI::DocumentAddBatch
Add a document to a client record.
C++
MTAPIRES IMTManagerAPI::DocumentAddBatch(
IMTDocumentArray* documents, // array of documents
MTAPIRES* results // array of results
)
.NET
MTRetCode CIMTManagerAPI.DocumentAddBatch(
CIMTDocumentArray documents, // array of documents
MTRetCode[] retcodes // array of results
)
Parameters
documents
[in] Document array object.
results
[out] An array with document addition results. The size of the 'results' array must not be less than that of 'documents'.
Return Value
The MT_RET_OK response code means that all the specified documents have been added. The MT_RET_ERR_PARTIAL response code means that only some of the documents have
been added. Analyze the 'results' array for more details of the execution results. The result of adding of each document from the 'documents' array is added to 'results'. The index
of a result corresponds to the index of a document in the source array.
Note
A document can only be added from the applications connected to the trading server, on which the client has been created (IMTDocument::RelatedClient). The
MT_RET_ERR_NOTMAIN response code will be returned for all other applications. If the object is not found, the response code MT_RET_ERR_NOTFOUND will be returned.
IMTManagerAPI::DocumentAddBatchArray
Add a document to a client record.
C++
MTAPIRES IMTManagerAPI::DocumentAddBatchArray(
IMTDocument** documents, // array documents
const UINT documents_total, // number of documents in the array
MTAPIRES* results // array of results
)
.NET
MTRetCode CIMTManagerAPI.DocumentAddBatchArray(
CIMTDocument[] documents, // array of documents
MTRetCode[] retcodes // array of results
)
file:///C:/Users/Administrator/AppData/Local/Temp/~hh4BC4.htm 7/17/2025
Manager API Page 317 of 464
Parameters
documents
[in] Array of document objects.
documents_total
[in] The number of documents in the 'documents' array.
results
[out] An array with document addition results. The size of the 'results' array must not be less than that of 'documents'.
Return Value
The MT_RET_OK response code means that all the specified documents have been added. The MT_RET_ERR_PARTIAL response code means that only some of the documents have
been added. Analyze the 'results' array for more details of the execution results. The result of adding of each document from the 'documents' array is added to 'results'. The index
of a result corresponds to the index of a document in the source array.
Note
A document can only be added from the applications connected to the trading server, on which the client has been created (IMTDocument::RelatedClient). The
MT_RET_ERR_NOTMAIN response code will be returned for all other applications. If the object is not found, the response code MT_RET_ERR_NOTFOUND will be returned.
IMTManagerAPI::DocumentUpdate
Change a document in the client record.
C++
MTAPIRES IMTManagerAPI::DocumentUpdate(
IMTDocument* document // document object
)
.NET
MTRetCode CIMTManagerAPI.DocumentUpdate(
CIMTDocument document // document object
)
Parameters
document
[in] Document object.
Return Value
An indication of successful completion is the MT_RET_OK response code. Otherwise, an error has occurred that corresponds to the response code.
Note
A document can only be changed from the applications connected to the trading server, on which the client has been created (IMTDocument::RelatedClient). The
MT_RET_ERR_NOTMAIN response code will be returned for all other applications. If the object is not found, the response code MT_RET_ERR_NOTFOUND will be returned.
IMTManagerAPI::DocumentUpdateBatch
Change a document in the client record.
C++
MTAPIRES IMTManagerAPI::DocumentUpdateBatch(
IMTDocumentArray* documents, // array of documents
MTAPIRES* results // array of results
)
.NET
MTRetCode CIMTManagerAPI.DocumentUpdateBatch(
CIMTDocumentArray documents, // array of documents
MTRetCode[] retcodes // array of results
)
Parameters
documents
[in] Document array object.
results
[out] An array with the document changing results. The size of the 'results' array must not be less than that of 'documents'.
Return Value
The MT_RET_OK response code means that all the specified documents have been updated. The MT_RET_ERR_PARTIAL response code means that only some of the documents
have been updated. Analyze the 'results' array for more details of the execution results. The result of update of each document from the 'documents' array is added to 'results'.
The index of a result corresponds to the index of a document in the source array.
Note
A document can only be changed from the applications connected to the trading server, on which the client has been created (IMTDocument::RelatedClient). The
MT_RET_ERR_NOTMAIN response code will be returned for all other applications. If the object is not found, the response code MT_RET_ERR_NOTFOUND will be returned.
IMTManagerAPI::DocumentUpdateBatchArray
Change a document in the client record.
C++
MTAPIRES IMTManagerAPI::DocumentUpdateBatchArray(
IMTDocument** documents, // array documents
const UINT documents_total, // number of documents in the array
MTAPIRES* results // array of results
)
file:///C:/Users/Administrator/AppData/Local/Temp/~hh4BC4.htm 7/17/2025
Manager API Page 318 of 464
.NET
MTRetCode CIMTManagerAPI.DocumentUpdateBatchArray(
CIMTDocument[] documents, // array of documents
MTRetCode[] retcodes // array of results
)
Parameters
documents
[in] Array of document objects.
documents_total
[in] The number of documents in the 'documents' array.
results
[out] An array with the document changing results. The size of the 'results' array must not be less than that of 'documents'.
Return Value
The MT_RET_OK response code means that all the specified documents have been updated. The MT_RET_ERR_PARTIAL response code means that only some of the documents
have been updated. Analyze the 'results' array for more details of the execution results. The result of update of each document from the 'documents' array is added to 'results'.
The index of a result corresponds to the index of a document in the source array.
Note
A document can only be changed from the applications connected to the trading server, on which the client has been created (IMTDocument::RelatedClient). The
MT_RET_ERR_NOTMAIN response code will be returned for all other applications. If the object is not found, the response code MT_RET_ERR_NOTFOUND will be returned.
IMTManagerAPI::DocumentDelete
Delete a document from a client record.
C++
MTAPIRES IMTManagerAPI::DocumentDelete(
const UINT64 document_id // document identifier
)
.NET
MTRetCode CIMTManagerAPI.DocumentDelete(
ulong document_id // document identifier
)
Parameters
document
[in] The identifier of the document (IMTDocument::RecordId) to be deleted.
Return Value
An indication of successful completion is the MT_RET_OK response code. Otherwise, an error code is returned.
Note
A document can only be deleted from the applications connected to the trading server, on which the client has been created (IMTDocument::RelatedClient). The
MT_RET_ERR_NOTMAIN response code will be returned for all other applications. If the object is not found, the response code MT_RET_ERR_NOTFOUND will be returned.
IMTManagerAPI::DocumentDeleteBatch
Delete a document from a client record.
C++
MTAPIRES IMTManagerAPI::DocumentDeleteBatch(
const UINT64* document_ids, // document identifiers
const UINT document_ids_total, // number of documents
MTAPIRES* results // results
)
.NET
MTRetCode CIMTManagerAPI.DocumentDeleteBatch(
ulong[] document_ids, // document identifiers
MTRetCode[] retcodes // results
)
Parameters
document_ids
[in] The identifiers of the documents (IMTDocument::RecordId) to be deleted.
document_ids_total
[in] The number of identifiers in the document_ids array.
results
[out] An array with document deletion results. The size of the 'results' array must not be less than that of 'document_ids'.
Return Value
The MT_RET_OK response code indicates that all specified documents have been deleted. The MT_RET_ERR_PARTIAL response code means that only some of the documents have
been deleted. Analyze the 'results' array for more details of the execution results. The result of deletion of each document from the 'document_ids' array is added to 'results'. The
index of a result corresponds to the index of a document in the source array.
Note
A document can only be deleted from the applications connected to the trading server, on which the client has been created (IMTDocument::RelatedClient). The
MT_RET_ERR_NOTMAIN response code will be returned for all other applications. If the object is not found, the response code MT_RET_ERR_NOTFOUND will be returned.
file:///C:/Users/Administrator/AppData/Local/Temp/~hh4BC4.htm 7/17/2025
Manager API Page 319 of 464
IMTManagerAPI::DocumentRequest
Get a document by identifier.
C++
MTAPIRES IMTManagerAPI::DocumentRequest(
const UINT64 document_id, // identifier
IMTDocument* document // document object
)
.NET
MTRetCode IMTManagerAPI::DocumentRequest(
ulong document_id, // identifier
CIMTDocument document // document object
)
Parameters
document_id
[in] Document ID (IMTDocument::RecordID).
document
[out] Document object. The 'document' object must be previously created using the IMTManagerAPI::DocumentCreate method.
Return Value
An indication of successful completion is the MT_RET_OK response code. Otherwise, an error code is returned.
Note
The method copies data of a document with the specified ID, to the 'document' object.
The method cannot be called from event handlers (any IMT*Sink class methods).
IMTManagerAPI::DocumentRequestByClient
Get client documents.
C++
MTAPIRES IMTManagerAPI::DocumentRequestByClient(
const UINT64 client_id, // client identifier
IMTDocumnentArray* documents // array of documents
)
.NET
MTRetCode CIMTManagerAPI.DocumentRequestByClient(
ulong client_id, // client identifier
CIMTDocumnentArray documents // array of documents
)
Parameters
client_id
[in] Client identifier (IMTClient::RecordID).
documents
[out] An object of an array of documents. The documents object must be previously created using the IMTManagerAPI::DocumentCreateArray method.
Return Value
An indication of successful completion is the MT_RET_OK response code. Otherwise, an error code is returned.
Note
The method cannot be called from event handlers (any IMT*Sink class methods).
IMTManagerAPI::DocumentRequestHistory
Get the history of client document changes.
C++
MTAPIRES IMTManagerAPI::DocumentRequestHistory(
const UINT64 document_id, // identifier
const UINT64 author, // author
const INT64 from, // period beginning
const UINT64 to, // period end
IMTClientArray* history // object of the array of clients
)
.NET
MTRetCode CIMTManagerAPI.DocumentRequestHistory(
ulong document_id, // identifier
ulong author, // author
long from, // period beginning
long to, // period end
CIMTClientArray history // object of the array of clients
)
Parameters
document_id
[in] Document ID (IMTDocument::RecordID).
author
[in] The login of the manager account by whom the document was changed. The login is equal to the IMTConManager::Login value.
from
[in] The beginning of the period for which you wish to get the history of document changes. The date is specified in seconds that have elapsed since 01.01.1970.
file:///C:/Users/Administrator/AppData/Local/Temp/~hh4BC4.htm 7/17/2025
Manager API Page 320 of 464
to
[in] The end of the period for which you wish to get the history of document changes. The date is specified in seconds that have elapsed since 01.01.1970.
history
[out] An object of an array of documents. The 'history' object must be previously created using the IMTServerAPI::DocumentCreateArray method.
Return Value
An indication of successful completion is the MT_RET_OK response code. Otherwise, an error code is returned.
Note
The method returns an array of document descriptions: all the document states after being changed by the specified author, in the specified time period.
The method cannot be called from event handlers (any IMT*Sink class methods).
IMTManagerAPI::CommentCreate
Create a comment object.
C++
IMTClient* IMTManagerAPI::CommentCreate()
.NET
CIMTClient CIMTManagerAPI.CommentCreate()
Return Value
Returns a pointer to the created object that implements the IMTComment interface. NULL is returned in case of failure.
Note
The created object must be destroyed by calling the IMTComment::Release method of this object.
IMTManagerAPI::CommentCreateArray
Create an object of the array of comments.
C++
IMTClientArray* IMTManagerAPI::CommentCreateArray()
.NET
CIMTClientArray CIMTManagerAPI.CommentCreateArray()
Return Value
Returns a pointer to the created object that implements the IMTCommentArray interface. NULL is returned in case of failure.
Note
The created object must be destroyed by calling the IMTCommentArray::Release method of this object.
IMTManagerAPI::CommentAdd
Add a comment to a document or client.
C++
MTAPIRES IMTManagerAPI::CommentAdd(
IMTComment* comment // comment object
)
.NET
MTRetCode CIMTManagerAPI.CommentAdd(
CIMTComment comment // comment object
)
Parameters
document
[in] Comment object.
Return Value
An indication of successful completion is the MT_RET_OK response code. Otherwise, an error has occurred that corresponds to the response code.
Note
To add a comment to a client, specify the client ID in IMTComment::RelatedClient. To add a comment to a document, specify appropriate identifiers both in
IMTComment::RelatedClient and in IMTComment::RelatedDocument.
Comments can only be added from the applications connected to the trading server, on which the client has been created (IMTComment::RelatedClient). The
MT_RET_ERR_NOTMAIN response code will be returned for all other applications. If the object is not found, the response code MT_RET_ERR_NOTFOUND will be returned.
IMTManagerAPI::CommentAddBatch
Add a batch of comments to a document or client.
C++
file:///C:/Users/Administrator/AppData/Local/Temp/~hh4BC4.htm 7/17/2025
Manager API Page 321 of 464
MTAPIRES IMTManagerAPI::CommentAddBatch(
IMTCommentArray* comments, // array of comments
MTAPIRES* results // array of results
)
.NET
MTRetCode CIMTManagerAPI.CommentAddBatch(
CIMTCommentArray comments, // array of comments
MTRetCode[] retcodes // array of results
)
Parameters
comments
[in] Object of the comments array.
results
[out] An array with the results of adding of comments. The size of the 'results' array must not be less than that of 'comments'.
Return Value
The MT_RET_OK response code means that all the specified comments have been added. The MT_RET_ERR_PARTIAL response code means that only some of the comments have
been added. Analyze the 'results' array for more details of the execution results. The result of adding of each comment from the 'comments' array is added to 'results'. The index
of a result corresponds to the index of a comment in the source array.
Note
To add a comment to a client, specify the client ID in IMTComment::RelatedClient. To add a comment to a document, specify appropriate identifiers both in
IMTComment::RelatedClient and in IMTComment::RelatedDocument.
Comments can only be added from the applications connected to the trading server, on which the client has been created (IMTComment::RelatedClient). The
MT_RET_ERR_NOTMAIN response code will be returned for all other applications. If the object is not found, the response code MT_RET_ERR_NOTFOUND will be returned.
IMTManagerAPI::CommentAddBatchArray
Add a batch of comments to a document or client.
C++
MTAPIRES IMTManagerAPI::CommentAdd(
IMTComment** comments, // array of documents
const UINT comments_total, // number of documents in the array
MTAPIRES* results // array of results
)
.NET
MTRetCode CIMTManagerAPI.CommentAdd(
CIMTComment[] comments, // array of documents
MTRetCode[] retcodes // array of results
)
Parameters
comments
[in] Array of comment objects.
comments_total
[in] The number of comments in the 'comments' object.
results
[out] An array with the results of adding of comments. The size of the 'results' array must not be less than that of 'comments'.
Return Value
The MT_RET_OK response code means that all the specified comments have been added. The MT_RET_ERR_PARTIAL response code means that only some of the comments have
been added. Analyze the 'results' array for more details of the execution results. The result of adding of each comment from the 'comments' array is added to 'results'. The index
of a result corresponds to the index of a comment in the source array.
Note
To add a comment to a client, specify the client ID in IMTComment::RelatedClient. To add a comment to a document, specify appropriate identifiers both in
IMTComment::RelatedClient and in IMTComment::RelatedDocument.
Comments can only be added from the applications connected to the trading server, on which the client has been created (IMTComment::RelatedClient). The
MT_RET_ERR_NOTMAIN response code will be returned for all other applications. If the object is not found, the response code MT_RET_ERR_NOTFOUND will be returned.
IMTManagerAPI::CommentUpdate
Change a comment to a document or client.
C++
MTAPIRES IMTManagerAPI::CommentUpdate(
IMTComment* comment // comment object
)
.NET
MTRetCode CIMTManagerAPI.CommentUpdate(
CIMTComment comment // comment object
)
Parameters
comment
[in] Comment object.
Return Value
An indication of successful completion is the MT_RET_OK response code. Otherwise, an error has occurred that corresponds to the response code.
Note
file:///C:/Users/Administrator/AppData/Local/Temp/~hh4BC4.htm 7/17/2025
Manager API Page 322 of 464
To update a comment to a client, specify the client ID in IMTComment::RelatedClient. To edit a comment to a document, specify appropriate identifiers both in
IMTComment::RelatedClient and in IMTComment::RelatedDocument.
A comment can only be changed from the applications connected to the trading server, on which the client has been created (IMTComment::RelatedClient). The
MT_RET_ERR_NOTMAIN response code will be returned for all other applications. If the object is not found, the response code MT_RET_ERR_NOTFOUND will be returned.
IMTManagerAPI::CommentUpdateBatch
Update a batch of comments to a document or client.
C++
MTAPIRES IMTManagerAPI::CommentUpdateBatch(
IMTCommentArray* comments, // array of comments
MTAPIRES* results // array of results
)
.NET
MTRetCode CIMTManagerAPI.CommentUpdateBatch(
CIMTCommentArray comments, // array of comments
MTRetCode[] retcodes // array of results
)
Parameters
comments
[in] Object of the comments array.
results
[out] An array with the results of updating of comments. The size of the 'results' array must not be less than that of 'comments'.
Return Value
The MT_RET_OK response code means that all the specified comments have been updated. The MT_RET_ERR_PARTIAL response code means that only some of the comments have
been updated. Analyze the 'results' array for more details of the execution results. The result of update of each comment from the 'comments' array is added to 'results'. The
index of a result corresponds to the index of a comment in the source array.
Note
To update a comment to a client, specify the client ID in IMTComment::RelatedClient. To edit a comment to a document, specify appropriate identifiers both in
IMTComment::RelatedClient and in IMTComment::RelatedDocument.
A comment can only be changed from the applications connected to the trading server, on which the client has been created (IMTComment::RelatedClient). The
MT_RET_ERR_NOTMAIN response code will be returned for all other applications. If the object is not found, the response code MT_RET_ERR_NOTFOUND will be returned.
IMTManagerAPI::CommentUpdateBatchArray
Update a batch of comments to a document or client.
C++
MTAPIRES IMTManagerAPI::CommentUpdateBatchArray(
IMTComment** comments, // array of documents
const UINT comments_total, // number of documents in the array
MTAPIRES* results // array of results
)
.NET
MTRetCode CIMTManagerAPI.CommentUpdateBatchArray(
CIMTComment[] comments, // array of documents
MTRetCode[] retcodes // array of results
)
Parameters
comments
[in] Array of comment objects.
comments_total
[in] The number of comments in the 'comments' object.
results
[out] An array with the results of updating of comments. The size of the 'results' array must not be less than that of 'comments'.
Return Value
The MT_RET_OK response code means that all the specified comments have been updated. The MT_RET_ERR_PARTIAL response code means that only some of the comments have
been updated. Analyze the 'results' array for more details of the execution results. The result of update of each comment from the 'comments' array is added to 'results'. The
index of a result corresponds to the index of a comment in the source array.
Note
To update a comment to a client, specify the client ID in IMTComment::RelatedClient. To edit a comment to a document, specify appropriate identifiers both in
IMTComment::RelatedClient and in IMTComment::RelatedDocument.
A comment can only be changed from the applications connected to the trading server, on which the client has been created (IMTComment::RelatedClient). The
MT_RET_ERR_NOTMAIN response code will be returned for all other applications. If the object is not found, the response code MT_RET_ERR_NOTFOUND will be returned.
IMTManagerAPI::CommentDelete
Delete a comment from a document or client.
C++
MTAPIRES IMTManagerAPI::CommentDelete(
IMTComment* comment // comment object
)
file:///C:/Users/Administrator/AppData/Local/Temp/~hh4BC4.htm 7/17/2025
Manager API Page 323 of 464
.NET
MTRetCode CIMTManagerAPI.CommentDelete(
CIMTComment comment // comment object
)
Parameters
comment
[in] Comment object.
Return Value
An indication of successful completion is the MT_RET_OK response code. Otherwise, an error code is returned.
Note
Comments can only be deleted from the applications connected to the trading server, on which the client has been created (IMTComment::RelatedClient). The
MT_RET_ERR_NOTMAIN response code will be returned for all other applications. If the object is not found, the response code MT_RET_ERR_NOTFOUND will be returned.
IMTManagerAPI::CommentDeleteBatch
Delete a batch of comments from a document or client.
C++
MTAPIRES IMTManagerAPI::CommentDeleteBatch(
const UINT64* comment_ids, // document identifiers
const UINT comment_ids_total, // number of documents
MTAPIRES* results // results
)
.NET
MTRetCode CIMTManagerAPI.CommentDeleteBatch(
ulong[] comment_ids, // document identifiers
MTRetCode[] retcodes // results
)
Parameters
comment_ids
[in] The identifiers of the documents (IMTDocument::RecordId) to be deleted.
comment_ids_total
[in] The number of identifiers in the comment_ids array.
results
[out] An array with document deletion results. The size of the 'results' array must not be less than that of 'comment_ids'.
Return Value
The MT_RET_OK response code indicates that all specified documents have been deleted. The MT_RET_ERR_PARTIAL response code means that only some of the documents have
been deleted. Analyze the 'results' array for more details of the execution results. The result of deletion of each document from the 'comment_ids' array is added to 'results'. The
index of a result corresponds to the index of a document in the source array.
Note
Comments can only be deleted from the applications connected to the trading server, on which the client has been created (IMTComment::RelatedClient). The
MT_RET_ERR_NOTMAIN response code will be returned for all other applications. If the object is not found, the response code MT_RET_ERR_NOTFOUND will be returned.
IMTManagerAPI::CommentRequest
Get a comment by identifier.
C++
MTAPIRES IMTManagerAPI::CommentRequest(
const UINT64 comment_id, // identifier
IMTComment* comment // comment object
)
.NET
MTRetCode CIMTManagerAPI.CommentRequest(
ulong comment_id, // identifier
CIMTComment comment // Comment object
)
Parameters
comment_id
[in] Comment object (IMTComment::RecordID).
comment
[out] Comment object. The 'comment' object must be previously created using the IMTManagerAPI::CommentCreate method.
Return Value
An indication of successful completion is the MT_RET_OK response code. Otherwise, an error code is returned.
Note
The method copies data of a comment with the specified ID, to the 'comment' object.
The method cannot be called from event handlers (any IMT*Sink class methods).
IMTManagerAPI::CommentRequestByClient
Get comments on a client by position.
file:///C:/Users/Administrator/AppData/Local/Temp/~hh4BC4.htm 7/17/2025
Manager API Page 324 of 464
C++
MTAPIRES IMTManagerAPI::CommentGetByClient(
const UINT64 client_id, // client identifier
const UINT position, // initial position
const UINT total, // number
IMTCommentArray* comments // array of comments
)
.NET
MTRetCode CIMTManagerAPI.CommentGetByClient(
ulong client_id, // client identifier
uint position, // initial position
uint total, // number
CIMTCommentArray comments // array of comments
)
Parameters
client_id
[in] Client identifier (IMTClient::RecordID).
position
[in] Position in the list of comments, starting with 0. The method returns comments starting with this position.
total
[in] The number of comments which should be received.
comments
[out] An object of an array of comments. The 'comments' object must be previously created using the IMTManagerAPI::CommentCreateArray method.
Return Value
An indication of successful completion is the MT_RET_OK response code. Otherwise, an error code is returned.
Note
The method cannot be called from event handlers (any IMT*Sink class methods).
IMTManagerAPI::CommentRequestByDocument
Get comments on client documents by position.
C++
MTAPIRES IMTManagerAPI::CommentRequestByDocument(
const UINT64 document_id, // document identifier
cost UINT position, // initial position
const UINT total, // number
IMTCommentArray* comments // array of documents
)
.NET
MTRetCode CIMTManagerAPI.CommentRequestByDocument(
ulong document_id, // document identifier
uint position, // initial position
uint total, // number
CIMTCommentArray comments // array of documents
)
Parameters
document_id
[in] Document ID (IMTDocument::RecordID).
position
[in] Position in the list of comments, starting with 0. The method returns comments starting with this position.
total
[in] The number of comments which should be received.
comments
[out] An object of an array of comments. The 'comments' object must be previously created using the IMTManagerAPI::CommentCreateArray method.
Return Value
An indication of successful completion is the MT_RET_OK response code. Otherwise, an error code is returned.
Note
The method cannot be called from event handlers (any IMT*Sink class methods).
IMTManagerAPI::AttachmentCreate
Create an attachment object.
C++
IMTClient* IMTManagerAPI::AttachmentCreate()
.NET
CIMTClient CIMTManagerAPI.AttachmentCreate()
Return Value
Returns a pointer to the created object that implements the IMTAttachment interface. NULL is returned in case of failure.
Note
The created object must be destroyed by calling the IMTAttachment::Release method of this object.
file:///C:/Users/Administrator/AppData/Local/Temp/~hh4BC4.htm 7/17/2025
Manager API Page 325 of 464
IMTManagerAPI::AttachmentCreateArray
Create an object of the array of attachments.
C++
IMTClient* IMTManagerAPI::AttachmentCreateArray()
.NET
CIMTClient CIMTManagerAPI.AttachmentCreateArray()
Return Value
Returns a pointer to the created object that implements the IMTAttachmentArray. NULL is returned in case of failure.
Note
The created object must be destroyed by calling the IMTAttachmentArray::Release method of this object.
IMTManagerAPI::AttachmentAdd
Create an attachment file for a document or a comment.
C++
MTAPIRES IMTManagerAPI::AttachmentAdd(
IMTAttachment* attachment // Attachment object
)
.NET
MTRetCode CIMTManagerAPI.AttachmentAdd(
CIMTAttachment attachment // Attachment object
)
Parameters
attachment
[in/out] Attachment object. A ready description of the attachment is input. At the output, the server fills the IMTAttachment::RecordID identifier in this description.
Return Value
An indication of successful completion is the MT_RET_OK response code. Otherwise, an error has occurred that corresponds to the response code.
Note
Once the attachment identifier is received, you can add the attachment to a document or a request by calling the IMTDocument::AttachmenAdd or IMTComment::AttachmentAdd
respectively.
IMTManagerAPI::AttachmentAddBatch
Create attachment files for documents or comments in batch.
C++
MTAPIRES IMTManagerAPI::AttachmentAddBatch(
IMTAttachmentArray* attachments, // array of attachments
MTAPIRES* results // array of results
)
.NET
MTRetCode CIMTManagerAPI.AttachmentAddBatch(
CIMTAttachmentArray attachments, // array of attachments
MTRetCode[] retcodes // array of results
)
Parameters
attachments
[in/out] Attachment array object. You input ready descriptions of attachments. At the output, the server fills the IMTAttachment::RecordID in these attachments.
results
[out] An array with attachment creation results. The size of the 'results' array must not be less than that of 'attachments'.
Return Value
The MT_RET_OK response code means that all the specified comments have been created. The MT_RET_ERR_PARTIAL response code means that only some of the comments have
been created. Analyze the 'results' array for more details of the execution results. The result of creation of each attachment from the 'attachments' array is added to 'results'. The
index of a result corresponds to the index of an attachment in the source array.
Note
Once the attachment identifier is received, you can add the attachment to a document or a request by calling the IMTDocument::AttachmenAdd or IMTComment::AttachmentAdd
respectively.
IMTManagerAPI::AttachmentAddBatchArray
Create attachment files for documents or comments in batch.
C++
file:///C:/Users/Administrator/AppData/Local/Temp/~hh4BC4.htm 7/17/2025
Manager API Page 326 of 464
MTAPIRES IMTManagerAPI::AttachmentAddBatchArray(
IMTAttachment** attachments, // array of attachments
const UINT comments_total, // number of attachments in the array
MTAPIRES* results // array of results
)
.NET
MTRetCode CIMTManagerAPI.AttachmentAddBatchArray(
CIMTAttachment[] attachments, // array of attachments
MTRetCode[] retcodes // array of results
)
Parameters
attachments
[in/out] Array of attachment objects. You input ready descriptions of attachments. At the output, the server fills the IMTAttachment::RecordID in these attachments.
attachments_total
[in] The number of attachments in the 'attachments' array.
results
[out] An array with attachment creation results. The size of the 'results' array must not be less than that of 'attachments'.
Return Value
The MT_RET_OK response code means that all the specified comments have been created. The MT_RET_ERR_PARTIAL response code means that only some of the comments have
been created. Analyze the 'results' array for more details of the execution results. The result of creation of each attachment from the 'attachments' array is added to 'results'. The
index of a result corresponds to the index of an attachment in the source array.
Note
Once the attachment identifier is received, you can add the attachment to a document or a request by calling the IMTDocument::AttachmenAdd or IMTComment::AttachmentAdd
respectively.
IMTManagerAPI::AttachmentRequest
Get attachments by identifiers.
C++
MTAPIRES IMTManagerAPI::AttachmentRequest(
const UINT64* attachment_ids, // array of identifiers
const UINT attachment_ids_total, // number of identifiers in the array
IMTAttachmentArray* attachments // array of attachments
)
.NET
MTRetCode CIMTManagerAPI.AttachmentRequest(
ulong[] attachment_ids, // array of identifiers
CIMTAttachmentArray attachments // array of attachments
)
Parameters
attachment_ids
[in] An array of attachment identifiers (IMTAttachment::RecordID).
attachment_ids_total
[in] The number of identifiers in the attachment_ids array.
attachments
[out] An array of attachment objects. The 'attachments' object must be previously created using the IMTManagerAPI::AttachmentCreateArray method.
Return Value
An indication of successful completion is the MT_RET_OK response code. Otherwise, an error code is returned.
Note
The method copies data of attachments with the specified IDs, to the 'attachments' object.
The method cannot be called from event handlers (any IMT*Sink class methods).
User Functions
Functions allow managing the server database of users and their access to the trading platform, as well subscribe and unsubscribe from events associated with changes in the user
base.
The following functions for managing users are available:
Functions Purpose
UserCreate Create an object of a client record.
UserCreateArray Create an object of an array of client records.
UserCreateAccount Create an object of a client's trading account.
UserCreateAccountArray Create an object of an array trading accounts.
UserSubscribe Subscribe to events associated with changes in the client base.
UserUnsubscribe Unsubscribe from events associated with changes in the client base.
UserAdd Add a client record.
UserDelete Delete a client record.
UserDeleteBatch Delete multiple accounts.
UserUpdate Update a client record.
file:///C:/Users/Administrator/AppData/Local/Temp/~hh4BC4.htm 7/17/2025
Manager API Page 327 of 464
Functions Purpose
UserUpdateBatch Update multiple accounts.
UserUpdateBatchArray Update multiple accounts.
UserTotal Get the total number of users on a trade server.
UserGet Get a client record by the login.
UserGetByGroup Get accounts by one or more groups.
UserGetByLogins Get accounts by the list of logins.
UserRequest Request a client record by the login from a server.
UserRequestArray Request an array of client records by the group name.
UserRequestByLogins Request accounts from the server by a list of logins.
UserGroup Get the group of a client by the login.
UserLogins Returns an array of logins of the clients who are included in the specified group.
UserPasswordCheck Check the user's password.
UserPasswordChange Change the user's password.
UserCertCreate Create an object of a certificate.
UserCertUpdate Add or update a client certificate.
UserCertGet Get the certificate of a client by the login.
UserCertDelete Reset the user certificate.
UserCertConfirm Confirm the user certificate.
UserAccountSubscribe Subscribe to receive events related to changes in the account trading state.
UserAccountUnsubscribe Unsubscribe from the events related to changes in the account trading state.
UserAccountGet Get client trading account by a login.
UserAccountGetByGroup Get trading accounts for one or several groups.
UserAccountGetByLogins Get trading accounts for a list of logins.
UserAccountRequest Request a client's account trade order from a server by the ticket.
UserAccountRequestByLogins Request accounts' trading statuses from the server by a list of logins.
UserAccountRequestArray Request an array of trade accounts from a server by the group name.
UserExternalGet Get a client record by the gateway identifier and/or the account number in an external trading system.
UserExternalRequest Request a client record from a server by the gateway identifier and/or the account number in an external trading system.
UserExternalSync Synchronizing client's trading status with an external trading system.
UserBalanceCheck Check and adjust a client's balance and credit assets.
UserBalanceCheckBatch Check and adjust balance and credit funds for multiple clients.
NotificationsSend Sends push notifications to mobile devices.
EmailSend Send an email to a selected address.
MessengerVerifyPhone Verify the validity of a passed phone number based on local phone number formation rules.
MessengerSend Send an SMS message.
Enumerations
The following enumerations are available for working with users in IMTManagerAPI:
• IMTManagerAPI::EnExternalSyncModes
IMTManagerAPI::EnExternalSyncModes
Modes of synchronizing client's trading status with an external system are enumerated in IMTManagerAPI::EnExternalSyncModes.
ID Value Description
EXTERNAL_SYNC_ALL 0 Full synchronization of trading status including current pending orders, open positions and balance.
EXTERNAL_SYNC_BALANCE 1 Synchronizing balance.
EXTERNAL_SYNC_POSITIONS 2 Synchronizing open positions.
EXTERNAL_SYNC_ORDERS 3 Synchronizing current pending orders.
EXTERNAL_SYNC_LAST End of enumeration. It corresponds to EXTERNAL_SYNC_ORDERS.
IMTManagerAPI::UserCreate
Create an object of a client record.
C++
file:///C:/Users/Administrator/AppData/Local/Temp/~hh4BC4.htm 7/17/2025
Manager API Page 328 of 464
IMTUser* IMTManagerAPI::UserCreate()
.NET
CIMTUser CIMTManagerAPI.UserCreate()
Return Value
It returns a pointer to the created object that implements the IMTUser interface. In case of failure, it returns NULL.
Note
The created object must be deleted by calling the IMTUser::Release method of this object.
IMTManagerAPI::UserCreateArray
Create an object of an array of client records.
C++
IMTUserArray* IMTManagerAPI::UserCreateArray()
.NET
CIMTUserArray CIMTManagerAPI.UserCreateArray()
Return Value
It returns a pointer to the created object that implements the IMTUserArray interface. In case of failure, it returns NULL.
Note
The created object must be deleted by calling the IMTUserArray::Release method of this object.
IMTManagerAPI::UserCreateAccount
Create an object of a client's trading account.
C++
IMTAccount* IMTManagerAPI::UserCreateAccount()
.NET
CIMTAccount CIMTManagerAPI.UserCreateAccount()
Return Value
It returns a pointer to the created object that implements the IMTAccount interface. In case of failure, it returns NULL.
Note
The created object must be deleted by calling the IMTAccount::Release method of this object.
IMTManagerAPI::UserCreateAccountArray
Create an object of an array trading accounts.
C++
IMTAccountArray* IMTManagerAPI::UserCreateAccountArray()
.NET
CIMTAccountArray CIMTManagerAPI.UserCreateAccountArray()
Return Value
It returns a pointer to the created object that implements the IMTAccountArray interface. In case of failure, it returns NULL.
Note
The created object must be deleted by calling the IMTAccountArray::Release method of this object.
IMTManagerAPI::UserSubscribe
Subscribe to events associated with changes in the client base.
C++
MTAPIRES IMTManagerAPI::UserSubscribe(
IMTUserSink* sink // A pointer to the IMTUserSink object
)
.NET
MTRetCode CIMTManagerAPI.UserSubscribe(
CIMTUserSink obj // CIMTUserSink object
)
file:///C:/Users/Administrator/AppData/Local/Temp/~hh4BC4.htm 7/17/2025
Manager API Page 329 of 464
Python
ManagerAPI.UserSubscribe(
sink # IMTUserSink object
)
Parameters
sink
[in] A pointer to the object that implements the IMTUserSink interface.
Return Value
An indication of successful completion is the MT_RET_OK response code. Otherwise, an error has occurred that corresponds to the response code.
Note
Subscribing to events is thread safe. One and the same interface IMTUserSink cannot subscribe to events twice - in this case the response code MT_RET_ERR_DUPLICATE is
returned.
To receive IMTUserSink::OnUserSync events, subscribe before calling the IMTManagerAPI::Connect method.
The object at which sink points, must remain in the memory (must not be removed) until the call of IMTManagerAPI::UserUnsubscribe or until the administrator interface is
deleted using the IMTManagerAPI::Release method.
To receive events connected with user database changes, the pumping mode IMTManagerAPI::PUMP_MODE_USERS must be enabled.
IMTManagerAPI::UserUnsubscribe
Unsubscribe from events associated with changes in the client base.
C++
MTAPIRES IMTManagerAPI::UserUnsubscribe(
IMTUserSink* sink // A pointer to the IMTUserSink object
)
.NET
MTRetCode CIMTManagerAPI.UserUnsubscribe(
CIMTUserSink obj // CIMTUserSink object
)
Python
ManagerAPI.UserUnsubscribe(
sink # IMTUserSink object
)
Parameters
sink
[in] A pointer to the object that implements the IMTUserSink interface.
Return Value
An indication of successful completion is the MT_RET_OK response code. Otherwise, an error code will be returned.
Note
This is a pair method to IMTManagerAPI::UserSubscribe. If an attempt is made to unsubscribe from the interface to which it has not subscribed, MT_RET_ERR_NOTFOUND error is
returned.
IMTManagerAPI::UserAdd
Add a client record.
C++
MTAPIRES IMTManagerAPI::UserAdd(
IMTUser* user, // An object of the client record
LPCWSTR master_pass, // The master password
LPCWSTR investor_pass // The investor password
)
.NET
MTRetCode CIMTManagerAPI.UserAdd(
CIMTUser user, // An object of the client record
string master_pass, // The master password
string investor_pass // The investor password
)
Python
ManagerAPI.UserAdd(
user, # An object of the client record
master_pass, # The master password
investor_pass # The investor password
)
Parameters
user
[in][out] An object of the client record.
master_pass
[in] The master password of an account. The password must contain four character types: lowercase letters, uppercase letters, numbers, and special characters (#, @, ! etc.).
For example, 1Ar#pqkj. The minimum password length is determined by group settings (IMTConGroup::AuthPasswordMin), while the lowest possible value is 8 characters. The
maximum length is 16 characters.
investor_pass
file:///C:/Users/Administrator/AppData/Local/Temp/~hh4BC4.htm 7/17/2025
Manager API Page 330 of 464
[in] The investor password of an account. The password must contain four character types: lowercase letters, uppercase letters, numbers, and special characters (#, @, ! etc.).
For example, 1Ar#pqkj. The minimum password length is determined by group settings (IMTConGroup::AuthPasswordMin), while the lowest possible value is 8 characters. The
maximum length is 16 characters.
Return Value
An indication of a successful execution is the MT_RET_OK response code. Otherwise, a corresponding error code will be returned.
Note
In case no login is specified for a record (is equal to 0), the server will automatically allocate a login from the available range and will assign it to the user record. In case there
are no more available ranges of logins, the MT_RET_USR_LOGIN_EXHAUSTED error is returned.
The following parameters must be filled in the user record you are adding: IMTUser::Group and IMTUser::Leverage, as well as IMTUser::FirstName or IMTUser::LastName. To allow
an account to be used in client terminals, enable the IMTUser::USER_RIGHT_ENABLED right for that account.
When calling the method, a check is made whether the entry already exists. If the account already exists, the MT_RET_USR_LOGIN_EXIST error is returned. A key field for
comparison is the user login IMTUser::Login.
A user can be added on a trade server only from the applications that run in the same trade server. For all other applications the response code MT_RET_USR_LOGIN_PROHIBITED
will be returned.
Before adding, the correctness of the record is checked. If the record is incorrect, the error code MT_RET_ERR_PARAMS is returned.
IMTManagerAPI::UserDelete
Delete a user.
C++
MTAPIRES IMTManagerAPI::UserDelete(
const UINT64 login // Login
)
.NET
MTRetCode CIMTManagerAPI.UserDelete(
ulong login // Login
)
Python
ManagerAPI.UserDelete(
login # Login
)
Parameters
login
[in] The login of a user.
Return Value
An indication of successful completion is the MT_RET_OK response code. Otherwise, an error code will be returned.
Note
A client record can be deleted only from the applications that run on the trade server where the record was created. For all other applications the response code
MT_RET_ERR_NOTFOUND will be returned.
IMTManagerAPI::UserDeleteBatch
Delete multiple accounts.
C++
MTAPIRES IMTManagerAPI::UserDeleteBatch(
const UINT64* logins, // Logins
const UINT logins_total, // Number of logins
MTAPIRES* results // Array of results
)
.NET
MTRetCode CIMTManagerAPI.UserDeleteBatch(
ulong[] logins, // Logins
MTRetCode[] res // Array of results
)
Python
ManagerAPI.UserDeleteBatch(
logins, # Logins
res # Array of results
)
Parameters
logins
[in] An array of account logins which should be deleted.
logins_total
[in] Number of logins in the 'logins' array.
results
[out] An array with account deleting results. The size of the 'results' array must be at least the size of the 'logins' array.
Return Value
The MT_RET_OK response code indicates that all specified accounts have been deleted. The MT_RET_ERR_PARTIAL response code means that only some of the accounts have
been deleted. Analyze the 'results' array for further details concerning the execution results. This array will contain the result of deleting of each individual account from the
'logins' array. The index of a result corresponds to the index of an account in the source array.
file:///C:/Users/Administrator/AppData/Local/Temp/~hh4BC4.htm 7/17/2025
Manager API Page 331 of 464
Note
It is only possible to delete accounts from applications running on the same trade server on which the accounts are created. The MT_RET_ERR_NOTFOUND response code will be
returned for all other applications.
IMTManagerAPI::UserUpdate
Update a user.
C++
MTAPIRES IMTManagerAPI::UserUpdate(
IMTUser* user // An object of the user
)
.NET
MTRetCode CIMTManagerAPI.UserUpdate(
CIMTUser obj // An object of the user
)
Python
ManagerAPI.UserUpdate(
user # An object of the user
)
Parameters
user
[in] An object of the user.
Return Value
An indication of successful completion is the MT_RET_OK response code. Otherwise, an error code will be returned.
Note
A client record can be updated only from the applications that run on the trade server where the record was created. For all other applications the response code
MT_RET_ERR_NOTFOUND will be returned.
IMTManagerAPI::UserUpdateBatch
Update multiple accounts.
C++
MTAPIRES IMTManagerAPI::UserUpdateBatch(
IMTUserArray* users, // Array of accounts
MTAPIRES* results // Array of results
)
.NET
MTRetCode CIMTManagerAPI.UserUpdateBatch(
CIMTUserArray users, // Array of accounts
MTRetCode[] res // Array of results
)
Parameters
users
[in] A pointer to the accounts array object IMTUserArray.
results
[out] An array with the account updating results. The size of the 'results' array must be at least the size of the 'users' array.
Return Value
Response code MT_RET_OK indicates that all specified accounts have been updated. Response code MT_RET_ERR_PARTIAL indicates that only some of them have been updated.
Analyze the 'results' array for further details concerning the execution results. This array will contain the result of updating of each individual account from the 'users' array. The
index of a result corresponds to the index of an account in the source array.
Note
It is only possible to update accounts from applications running on the same trade server on which the accounts are created. The MT_RET_ERR_NOTFOUND response code will be
returned for all other applications.
IMTManagerAPI::UserUpdateBatchArray
Update multiple client records.
C++
MTAPIRES IMTManagerAPI::UserUpdateBatchArray(
IMTUser** users, // Array of accounts
const UINT users_total, // Number of accounts in the array
MTAPIRES* results // Array of results
)
.NET
MTRetCode CIMTManagerAPI.UserUpdateBatchArray(
CIMTUser[] users, // Array of accounts
MTRetCode[] retcodes // Array of results
)
Parameters
users
file:///C:/Users/Administrator/AppData/Local/Temp/~hh4BC4.htm 7/17/2025
Manager API Page 332 of 464
IMTManagerAPI::UserTotal
Get the total number of users on a trade server.
C++
UINT IMTManagerAPI::UserTotal()
.NET
uint CIMTManagerAPI.UserTotal()
Python
ManagerAPI.UserTotal()
Return Value
The number of users on a trade server.
Note
The method is valid only if the IMTManagerAPI::PUMP_MODE_USERS pumping mode was specified during connection.
IMTManagerAPI::UserGet
Get a user by the login.
C++
MTAPIRES IMTManagerAPI::UserGet(
const UINT64 login, // Client login
IMTUser* user // An object of the client record
)
.NET
MTRetCode CIMTManagerAPI.UserGet(
ulong login, // Client login
CIMTUser user // An object of the client record
)
Python
ManagerAPI.UserGet(
int login # Client login
)
Parameters
login
[in] The login of a client.
user
[out] An object of the client login. The user object must first be created using the IMTManagerAPI::UserCreate method.
Return Value
An indication of successful completion is the MT_RET_OK response code. Otherwise, an error code will be returned.
Note
This method copies the data of a client with the specified login to the user object. The method is valid only if the IMTManagerAPI::PUMP_MODE_USERS pumping mode was
specified during connection.
IMTManagerAPI::UserGetByGroup
Get accounts by one or more groups.
C++
MTAPIRES IMTManagerAPI::UserGetByGroup(
LPCWSTR mask, // Groups
IMTUserArray* users // Array of accounts
)
.NET
file:///C:/Users/Administrator/AppData/Local/Temp/~hh4BC4.htm 7/17/2025
Manager API Page 333 of 464
MTRetCode CIMTManagerAPI.UserGetByGroup(
string mask, // Groups
CIMTUserArray users // Array of accounts
)
Python
ManagerAPI.UserGetByGroup(
str mask # Groups
)
ManagerAPI.UserGetByGroupCSV(
mask, # Groups
fields # Comma-separated list of required fields
)
ManagerAPI.UserGetByGroupNumPy(
mask, # Groups
fields # Comma-separated list of required fields
)
Parameters
mask
[in] Groups for which accounts are requested. You can specify one group, several groups (comma separated) or a group mask. The mask is specified using characters "*" (any
value) and "!" (exception). For example: "demo*,!demoforex" - all groups with the names beginning with 'demo', except for the group demoforex.
users
[out] An object of the accounts array. The 'users' object must be previously created using the IMTManagerAPI::UserCreateArray method.
Return Value
An indication of successful completion is the MT_RET_OK response code. Otherwise, an error has occurred that corresponds to the response code.
Note
The method only works if the IMTManagerAPI::PUMP_MODE_USERS pumping mode was specified during connection.
IMTManagerAPI::UserGetByLogins
Get accounts by the list of logins.
C++
MTAPIRES IMTManagerAPI::UserGetByLogins(
const UINT64* logins, // Logins
const UINT logins_total, // Number of logins
IMTUserArray* users // Array of accounts
)
.NET
MTRetCode CIMTManagerAPI.UserGetByLogins(
ulong[] logins, // Logins
CIMTUserArray users // Array of accounts
)
Python
ManagerAPI.UserGetByLogins(
logins # Logins
)
ManagerAPI.UserGetByLoginsCSV(
logins, # Logins
fields # Comma-separated list of required fields
)
ManagerAPI.UserGetByLoginsNumPy(
logins, # Logins
fields # Comma-separated list of required fields
)
Parameters
logins
[in] Array of client logins.
logins_total
[in] Number of logins in the 'logins' array.
users
[out] An object of the accounts array. The 'users' object must be previously created using the IMTManagerAPI::UserCreateArray method.
Return Value
An indication of successful completion is the MT_RET_OK response code. Otherwise, an error has occurred that corresponds to the response code.
Note
The method only works if the IMTManagerAPI::PUMP_MODE_USERS pumping mode was specified during connection.
IMTManagerAPI::UserRequest
Request a client record by the login from a server.
C++
MTAPIRES IMTManagerAPI::UserRequest(
const UINT64 login, // Client login
IMTUser* user // An object of the client record
)
.NET
file:///C:/Users/Administrator/AppData/Local/Temp/~hh4BC4.htm 7/17/2025
Manager API Page 334 of 464
MTRetCode CIMTManagerAPI.UserRequest(
ulong login, // Client login
CIMTUser obj // An object of the client record
)
Python
ManagerAPI.UserRequest(
login # Client login
)
Parameters
login
[in] The login of a client.
*user
[out] An object of the client login. The user object must first be created using the IMTManagerAPI::UserCreate method.
Return Value
An indication of successful completion is the MT_RET_OK response code. Otherwise, an error code will be returned.
Note
This method copies the data of a client with the specified login to the user object.
This method cannot be called from event handlers (any methods of IMT*Sink classes).
IMTManagerAPI::UserRequestArray
Request an array of client records by the group name.
C++
MTAPIRES IMTManagerAPI::UserRequestArray(
LPCWSTR group, // Client group
IMTUserArray* users // Array of client records
)
.NET
MTRetCode CIMTManagerAPI.UserRequestArray(
string group, // Client group
CIMTUserArray obj // Array of client records
)
Python
ManagerAPI.UserRequestByGroup(
str group # Client group
)
ManagerAPI.UserRequestByGroupCSV(
str group, # Client group
str fields # Comma-separated list of required fields
)
ManagerAPI.UserRequestByGroupNumPy(
str group, # Client group
str fields # Comma-separated list of required fields
)
Parameters
group
[in] One or more groups, separated by commas, from which accounts are requested. The full group name must be specified, including the path. For example, demo\demoforex.
The group name can be obtained using the IMTConGroup::Group method. Groups can also be specified using wildcard characters: "*" (any value) and "!" (exclude). For example:
"demo*,!demoforex" - all groups whose names begin with 'demo', except for the group demoforex.
user
[out] An array of objects of users. The object of array of users must first be created using the IMTManagerAPI::UserCreateArray method.
Return Value
An indication of successful completion is the MT_RET_OK response code. Otherwise, a corresponding error code will be returned.
Note
This method copies the data of users with the group to the users array object.
This method cannot be called from event handlers (any methods of IMT*Sink classes).
IMTManagerAPI::UserRequestByLogins
Request accounts from the server by a list of logins.
C++
MTAPIRES IMTManagerAPI::UserRequestByLogins(
const UINT64* logins, // logins
const UINT logins_total, // number of logins
IMTUserArray* users // array of accounts
)
.NET
MTRetCode CIMTManagerAPI.UserRequestByLogins(
ulong[] logins, // logins
CIMTUserArray users // array of accounts
)
file:///C:/Users/Administrator/AppData/Local/Temp/~hh4BC4.htm 7/17/2025
Manager API Page 335 of 464
Python
ManagerAPI.UserRequestByLogins(
logins # logins
)
ManagerAPI.UserRequestByLoginsCSV(
logins, # logins
fields # comma-separated list of required fields
)
ManagerAPI.UserRequestByLoginsNumPy(
logins, # logins
fields # comma-separated list of required fields
)
Parameters
logins
[in] Array of client logins.
logins_total
[in] Number of logins in the 'logins' array.
users
[out] An object of the accounts array. The 'users' object must be previously created using the IMTManagerAPI::UserCreateArray method.
Return Value
An indication of successful completion is the MT_RET_OK response code. Otherwise, an error has occurred that corresponds to the response code.
Note
The method cannot be called from event handlers (any IMT*Sink class methods).
IMTManagerAPI::UserGroup
Get the group of a client by the login.
C++
MTAPIRES IMTManagerAPI::UserGroup(
const UINT64 login, // Client login
MTAPISTR& group // Client group
)
.NET
MTRetCode CIMTManagerAPI.UserGroup(
ulong login, // Client login
out string group // Client group
)
Python
ManagerAPI.UserGroup(
login # Client login
)
Parameters
login
[in] The login of a client.
group
[out] The name of a user group to which the client belongs.
Return Value
An indication of successful completion is the MT_RET_OK response code. Otherwise, an error code will be returned.
Note
The method is valid only if the IMTManagerAPI::PUMP_MODE_USERS pumping mode was specified during connection.
IMTManagerAPI::UserLogins
Returns an array of logins of the clients who are included in the specified group.
C++
MTAPIRES IMTManagerAPI::UserLogins(
LPCWSTR group, // Group name
UINT64*& logins, // An array of client logins
UINT& logins_total // The number of logins
)
.NET
ulong[] CIMTManagerAPI.UserLogins(
string group, // Group name
out MTRetCode res // Response code
)
Python
ManagerAPI.UserLogins(
group # Group name
)
Parameters
group
[in] The name of a group of users. The entire name of the group must be specified including the path. For example, demo\demoforex. To get the name of a group, use the
IMTConGorup::Group.
file:///C:/Users/Administrator/AppData/Local/Temp/~hh4BC4.htm 7/17/2025
Manager API Page 336 of 464
logins
[out] An array of client logins.
logins_total
[out] The number of logins in the logins array.
Return Value
An indication of successful completion is the MT_RET_OK response code. Otherwise, an error code will be returned.
Note
The UserLogins method allocates and fills an array of logins that belong to the passed group, a pointer to the passed block is placed to the logins parameter After using, the array
placed in the logins variable must be released using the IMTManagerAPI::Free() method of the Manager API.
The method is valid only if the IMTManagerAPI::PUMP_MODE_USERS pumping mode was specified during connection.
IMTManagerAPI::UserPasswordCheck
Check the user's password.
C++
MTAPIRES IMTManagerAPI::UserPasswordCheck(
const UINT type, // Type of password
const UINT64 login, // User's login
LPCWSTR password // User's password
)
.NET
MTRetCode CIMTManagerAPI.UserPasswordCheck(
CIMTUser.EnUsersPasswords type, // Type of password
ulong login, // User's login
string password // User's password
)
Python
ManagerAPI.UserPasswordCheck(
type, # Type of password
login, # User's login
password # User's password
)
Parameters
type
[in] The type of a password to check is specified using the IMTUser::EnUsersPasswords enumeration.
login
[in] The login of a user whose password should be checked.
password
[in] A password to check.
Return Value
An indication of successful completion is the MT_RET_OK response code. Otherwise, an error code will be returned.
IMTManagerAPI::UserPasswordChange
Change the user's password.
C++
MTAPIRES IMTManagerAPI::UserPasswordChange(
const UINT type, // Type of password
const UINT64 login, // User's login
LPCWSTR password // New password
)
.NET
MTRetCode CIMTManagerAPI.UserPasswordChange(
CIMTUser.EnUsersPasswords type, // Type of password
ulong login, // User's login
string password // New password
)
Python
ManagerAPI.UserPasswordChange(
type, # Type of password
login, # User's login
password # New password
)
Parameters
type
[in] The type of a password to change is specified using the IMTUser::EnUsersPasswords enumeration.
login
[in] The login of a user whose password should be changed.
password
[in] A new password. The password must contain four character types: lowercase letters, uppercase letters, numbers, and special characters (#, @, ! etc.). For example,
1Ar#pqkj. The minimum password length is determined by group settings (IMTConGroup::AuthPasswordMin), while the lowest possible value is 8 characters. The maximum
length is 16 characters.
file:///C:/Users/Administrator/AppData/Local/Temp/~hh4BC4.htm 7/17/2025
Manager API Page 337 of 464
Return Value
An indication of a successful execution is the MT_RET_OK response code. Otherwise, a corresponding error code will be returned.
IMTManagerAPI::UserCertCreate
Create an object of a certificate.
C++
IMTCertificate* IMTManagerAPI::UserCertCreate()
.NET
CIMTCertificate CIMTManagerAPI.UserCertCreate()
Return Value
It returns a pointer to the created object that implements the IMTCertificate interface. In case of failure, it returns NULL.
Note
The created object must be deleted by calling the IMTCertificate::Release method of this object.
IMTManagerAPI::UserCertUpdate
Add or update a client certificate.
C++
MTAPIRES IMTManagerAPI::UserCertUpdate(
const UINT login // Login
IMTCertificate* certificate // The object of the certificate
)
.NET
MTRetCode CIMTManagerAPI.UserCertUpdate(
ulong login // Login
CIMTCertificate obj // The object of the certificate
)
Python
ManagerAPI.UserCertUpdate(
login # Login
certificate # The object of the certificate
)
Parameters
login
[in] The login of the client whose certificate needs to be replaced.
certificate
[in] The object of the certificate that will replace the current certificate of a client.
Return Value
An indication of successful completion is the MT_RET_OK response code. Otherwise, an error code will be returned.
Note
If a client already has a certificate, it is updated, otherwise a new certificate is added.
A certificate can be updated only from the applications that are connected to the same trade server where the client account was created. If the client with the specified login is
not found, the response code MT_RET_ERR_NOTFOUND is returned.
IMTManagerAPI::UserCertGet
Get the certificate of a client by the login.
C++
MTAPIRES IMTManagerAPI::UserCertGet(
const UINT64 login, // Client login
IMTCertificate* certificate // The object of the certificate
)
.NET
MTRetCode CIMTManagerAPI.UserCertGet(
ulong login, // Client login
CIMTCertificate obj // The object of the certificate
)
Python
ManagerAPI.UserCertGet(
login, # Client login
certificate # The object of the certificate
)
Parameters
login
file:///C:/Users/Administrator/AppData/Local/Temp/~hh4BC4.htm 7/17/2025
Manager API Page 338 of 464
IMTManagerAPI::UserCertDelete
Reset the user certificate.
C++
MTAPIRES IMTManagerAPI::UserCertDelete(
const UINT64 login // User's login
)
.NET
MTRetCode CIMTManagerAPI.UserCertDelete(
ulong login // User's login
)
Python
ManagerAPI.UserCertDelete(
login # User's login
)
Parameters
login
[in] The login of a user whose certificate needs to be reset.
Return Value
An indication of successful completion is the MT_RET_OK response code. Otherwise, an error code will be returned.
Note
If the extended authorization mode is used for the group to which the account belongs, then using this command the previously issued certificate can be reset. After that,
authorization with the certificate will be impossible, and a new certificate will be issued during the next attempt of the account to connect to the server.
IMTManagerAPI::UserCertConfirm
Confirm the user certificate.
C++
MTAPIRES IMTManagerAPI::UserCertConfirm(
const UINT64 login // User's login
)
.NET
MTRetCode CIMTManagerAPI.UserCertConfirm(
ulong login // User's login
)
Python
ManagerAPI.UserCertConfirm(
login # User's login
)
Parameters
login
[in] The login of a user whose certificate needs to be confirmed.
Return Value
An indication of successful completion is the MT_RET_OK response code. Otherwise, an error code will be returned.
Note
This function allows confirming certificates of accounts in the groups for which the appropriate mode is enabled. It is impossible to log in using a certificate until it is confirmed.
IMTManagerAPI::UserAccountSubscribe
Subscribe to receive events related to changes in the account trading state.
C++
MTAPIRES IMTManagerAPI::UserAccountSubscribe(
IMTAccountSink* sink // A pointer to the IMTAccountSink object
)
.NET
file:///C:/Users/Administrator/AppData/Local/Temp/~hh4BC4.htm 7/17/2025
Manager API Page 339 of 464
MTRetCode CIMTManagerAPI.UserAccountSubscribe(
CIMTAccountSink obj // the CIMTAccountSink object
)
Python
ManagerAPI.UserAccountSubscribe(
sink # IMTAccountSink object
)
Parameters
sink
[in] A pointer to the object that implements the IMTAccountSink interface.
Return Value
An indication of successful completion is the MT_RET_OK response code. Otherwise, an error has occurred that corresponds to the response code.
Note
Event subscriptions are thread safe. One and the same IMTAccountSink interface cannot subscribe to an event twice. In this case, the MT_RET_ERR_DUPLICATE response code is
returned.
The object at which 'sink' points, must remain in the memory (must not be removed) until the call of IMTManagerAPI::UserAccountUnsubscribe or until the manager interface is
deleted by using the IMTManagerAPI::Release method.
The method only works if the pumping modes PUMP_MODE_USERS, PUMP_MODE_ORDERS and PUMP_MODE_POSITIONS were specified when connecting.
IMTManagerAPI::UserAccountUnsubscribe
Unsubscribe from the events related to changes in the account trading state.
C++
MTAPIRES IMTManagerAPI::UserAccountUnsubscribe(
IMTAccountSink* sink // A pointer to the IMTAccountSink object
)
.NET
MTRetCode CIMTManagerAPI.UserAccountUnsubscribe(
CIMTAccountSink obj // the CIMTAccountSink object
)
Python
ManagerAPI.UserAccountUnsubscribe(
sink # IMTAccountSink object
)
Parameters
sink
[in] A pointer to the object that implements the IMTAccountSink interface.
Return Value
An indication of successful completion is the MT_RET_OK response code. Otherwise, an error code will be returned.
Note
This method is paired with IMTManagerAPI::UserAccountSubscribe. If an attempt is made to unsubscribe from the interface that has not been previously subscribed to, the
MT_RET_ERR_NOTFOUND error is returned.
IMTManagerAPI::UserAccountGet
Get client trading account by a login.
C++
MTAPIRES IMTManagerAPI::UserAccountGet(
const UINT64 login, // Client login
IMTAccount* account // An object of a trading account
)
.NET
MTRetCode CIMTManagerAPI.UserAccountGet(
ulong login, // Client login
CIMTAccount obj // An object of a trading account
)
Python
ManagerAPI.UserAccountGet(
login # Client login
)
Parameters
login
[in] The login of a client.
account
[out] An object of a client trading account. The account object must be created using the IMTManagerAPI::UserCreateAccount method.
Return Value
An indication of a successful execution is the MT_RET_OK response code. Otherwise, a corresponding error code will be returned.
Note
The method is valid only if the PUMP_MODE_USERS, PUMP_MODE_ORDERS and PUMP_MODE_POSITIONS pumping modes were specified during connection.
file:///C:/Users/Administrator/AppData/Local/Temp/~hh4BC4.htm 7/17/2025
Manager API Page 340 of 464
IMTManagerAPI::UserAccountGetByGroup
Get trading accounts for one or several groups.
C++
MTAPIRES IMTManagerAPI::UserAccountGetByGroup(
LPCWSTR mask, // Groups
IMTAccountArray* accounts // Array of accounts
)
.NET
MTRetCode CIMTManagerAPI.UserAccountGetByGroup(
string mask, // Groups
CIMTAccountArray accounts // Array of accounts
)
Python
ManagerAPI.UserAccountGetByGroup(
str mask # Groups
)
Parameters
mask
[in] Groups for which accounts are requested. You can specify one group, several groups (comma separated) or a group mask. The mask is specified using characters "*" (any
value) and "!" (exception). For example: "demo*,!demoforex" indicates all groups with the names beginning with 'demo', except for the group demoforex.
accounts
[out] Array of trading accounts. The 'accounts' object must first be created using the IMTManagerAPI::UserCreateAccountArray method.
Return Value
An indication of a successful completion is the MT_RET_OK response code. Otherwise, an error has occurred that corresponds to the response code.
Note
The method only works if the pumping modes PUMP_MODE_USERS, PUMP_MODE_ORDERS and PUMP_MODE_POSITIONS were specified when connecting.
IMTManagerAPI::UserAccountGetByLogins
Get trading accounts for a list of logins.
C++
MTAPIRES IMTManagerAPI::UserAccountGetByLogins(
const UINT64* logins, // Logins
const UINT logins_total, // Number of logins
IMTAccountArray* accounts // Array of accounts
)
.NET
MTRetCode CIMTManagerAPI.UserAccountGetByLogins(
ulong[] logins, // Logins
CIMTAccountArray accounts // Array of accounts
)
Python
ManagerAPI.UserAccountGetByLogins(
str logins_list # Logins
)
Parameters
logins
[in] Array of client logins.
logins_total
[in] Number of logins in the 'logins' array.
accounts
[out] Array of trading accounts. The 'accounts' object must first be created using the IMTManagerAPI::UserCreateAccountArray method.
Return Value
An indication of a successful completion is the MT_RET_OK response code. Otherwise, an error has occurred that corresponds to the response code.
Note
The method only works if the pumping modes PUMP_MODE_USERS, PUMP_MODE_ORDERS and PUMP_MODE_POSITIONS were specified when connecting.
IMTManagerAPI::UserAccountRequest
Request a client's account trade order from a server by the ticket.
C++
virtual MTAPIRES IMTManagerAPI::UserAccountRequest(
const UINT64 login, // Client login
IMTAccount* account // An object of a trading account
)
.NET
file:///C:/Users/Administrator/AppData/Local/Temp/~hh4BC4.htm 7/17/2025
Manager API Page 341 of 464
MTRetCode CIMTManagerAPI.UserAccountRequest(
ulong login, // Client login
CIMTAccount account // An object of a trading account
)
Python
ManagerAPI.UserAccountRequest(
login # Client login
)
Parameters
login
[in] The login of a client.
account
[out] An object of a client trading account. The account object must be created using the IMTManagerAPI::UserCreateAccount method.
Return Value
An indication of successful completion is the MT_RET_OK response code. Otherwise, an error code will be returned.
Note
This method cannot be called from event handlers (any methods of IMT*Sink classes).
IMTManagerAPI::UserAccountRequestByLogins
Request accounts' trading statuses from the server by a list of logins.
C++
virtual MTAPIRES IMTManagerAPI::UserAccountRequestByLogins(
const UINT64* logins, // list of logins
const UINT logins_total, // number of logins
IMTAccountArray* accounts // trading accounts array object
)
.NET
MTRetCode CIMTManagerAPI.UserAccountRequestByLogins(
ulong[] logins, // logins
CIMTAccountArray accounts // trading accounts array objects
)
Python
ManagerAPI.UserAccountRequestByLogins(
logins # logins
)
Parameters
logins
[in] Array of client logins.
logins_total
[in] Number of logins in the 'logins' array.
accounts
[out] Array of trading accounts. The 'accounts' object must first be created using the IMTManagerAPI::UserCreateAccountArray method.
Return Value
An indication of successful completion is the MT_RET_OK response code. Otherwise, an error code will be returned.
Note
The method cannot be called from event handlers (any IMT*Sink class methods).
IMTManagerAPI::UserAccountRequestArray
Request an array of trade accounts from a server by the group name.
C++
virtual MTAPIRES IMTManagerAPI::UserAccountRequestArray(
LPCWSTR group, // Client group
IMTAccountArray* accounts // An array of trading accounts
)
.NET
MTRetCode CIMTManagerAPI.UserAccountRequestArray(
string group, // Client group
CIMTAccountArray accounts // An array of trading accounts
)
Python
ManagerAPI.UserAccountRequestArray(
group # Client group
)
Parameters
group
[in] The name of a client group.
accounts
file:///C:/Users/Administrator/AppData/Local/Temp/~hh4BC4.htm 7/17/2025
Manager API Page 342 of 464
[out] An object of an array of trading accounts. The object of array of trading accounts must be created using the IMTManagerAPI::UserCreateAccountArray method.
Return Value
An indication of successful completion is the MT_RET_OK response code. Otherwise, an error code will be returned.
IMTManagerAPI::UserExternalGet
Get a client record by the gateway identifier and the account number in an external trading system.
C++
MTAPIRES IMTManagerAPI::UserExternalGet(
const UINT64 gateway_id, // Gateway ID
LPCWSTR account, // Account number in an external system
IMTUser* user // An object of the user record
)
.NET
MTRetCode CIMTManagerAPI.UserExternalGet(
ulong gateway_id, // Gateway ID
string account, // Account number in an external system
CIMTUser user // An object of the user record
)
Python
ManagerAPI.UserExternalGet(
gateway_id # Gateway ID
account # Account number in an external system
)
Parameters
gateway_id
[in] The identifier of a gateway.
account
[in] Client's account in an external system.
user
[out] An object of the client login. The user object must first be created using the IMTManagerAPI::UserCreate method.
Return Value
An indication of successful completion is the MT_RET_OK response code. Otherwise, an error code will be returned.
Note
This method copies the data of a client with the specified gateway identifier and account number. The method is valid only if the IMTManagerAPI::PUMP_MODE_USERS pumping
mode was specified during connection.
The number of account in an external system and the identifier of a gateway, to which that number refers, are stored in the client record as a string. The
IMTUser::ExternalAccount* methods are used to work with this data.
IMTManagerAPI::UserExternalGet
Get a client record by the the account number in an external trading system irrespective of a gateway identifier.
C++
MTAPIRES IMTManagerAPI::UserExternalGet(
LPCWSTR account, // Account number in an external system
IMTUser* user // An object of the user record
)
.NET
MTRetCode CIMTManagerAPI.UserExternalGet(
string account, // Account number in an external system
CIMTUser user // An object of the user record
)
Python
ManagerAPI.UserExternalGet(
account # Account number in an external system
)
Parameters
account
[in] Client's account in an external system.
user
[out] An object of the client login. The user object must first be created using the IMTManagerAPI::UserCreate method.
Return Value
An indication of successful completion is the MT_RET_OK response code. Otherwise, an error code will be returned.
Note
This method copies the data of a client with the specified and account number. The method is valid only if the IMTManagerAPI::PUMP_MODE_USERS pumping mode was specified
during connection.
If there are several clients that have the same number of account in a external system, the nearest client record will be obtained.
The number of account in an external system and the identifier of a gateway, to which that number refers, are stored in the client record as a string. The
IMTUser::ExternalAccount* methods are used to work with this data.
file:///C:/Users/Administrator/AppData/Local/Temp/~hh4BC4.htm 7/17/2025
Manager API Page 343 of 464
IMTManagerAPI::UserExternalRequest
Request a client record from a server by the gateway identifier and the account number in an external trading system.
C++
MTAPIRES IMTManagerAPI::UserExternalRequest(
const UINT64 gateway_id, // Gateway ID
LPCWSTR account, // Account number in an external system
IMTUser* user // An object of the user record
)
.NET
MTRetCode CIMTManagerAPI.UserExternalRequest(
ulong gateway_id, // Gateway ID
string account, // Account number in an external system
CIMTUser user // An object of the user record
)
Python
ManagerAPI.UserExternalRequest(
gateway_id, # Gateway ID
account # Account number in an external system
)
Parameters
gateway_id
[in] The identifier of a gateway.
account
[in] Client's account in an external system.
user
[out] An object of the client login. The user object must first be created using the IMTManagerAPI::UserCreate method.
Return Value
An indication of successful completion is the MT_RET_OK response code. Otherwise, an error code will be returned.
Note
This method copies the data of a client with the specified gateway identifier and account number.
The number of account in an external system and the identifier of a gateway, to which that number refers, are stored in the client record as a string. The
IMTUser::ExternalAccount* methods are used to work with this data.
This method cannot be called from event handlers (any methods of IMT*Sink classes).
IMTManagerAPI::UserExternalRequest
Request a client record from a server by the account number in an external trading system irrespective of a gateway identifier.
C++
MTAPIRES IMTManagerAPI::UserExternalRequest(
LPCWSTR account, // Account number in an external system
IMTUser* user // An object of the user record
)
.NET
MTRetCode CIMTManagerAPI.UserExternalRequest(
string account, // Account number in an external system
CIMTUser user // An object of the user record
)
Python
ManagerAPI.UserExternalRequest(
account # Account number in an external system
)
Parameters
account
[in] Client's account in an external system.
user
[out] An object of the client login. The user object must first be created using the IMTManagerAPI::UserCreate method.
Return Value
An indication of successful completion is the MT_RET_OK response code. Otherwise, an error code will be returned.
Note
This method copies the data of a client with the specified gateway identifier and account number.
If there are several clients that have the same number of account in a external system, the nearest client record will be obtained.
The number of account in an external system and the identifier of a gateway, to which that number refers, are stored in the client record as a string. The
IMTUser::ExternalAccount* methods are used to work with this data.
This method cannot be called from event handlers (any methods of IMT*Sink classes).
IMTManagerAPI::UserExternalSync
Synchronizing client's trading status with an external trading system. When calling this method, IMTGatewaySink::HookGatewayAccountRequest hook is called in Gateway API.
MetaTrader 5 client's trading status will be brought in line with an external trading system when this method is executed in case the gateway developer has provided such a
possibility.
C++
file:///C:/Users/Administrator/AppData/Local/Temp/~hh4BC4.htm 7/17/2025
Manager API Page 344 of 464
MTAPIRES IMTManagerAPI::UserExternalSync(
const UINT64 login, // Login
const UINT64 gateway_id, // Gateway ID
LPCWSTR account_id, // External system account
UINT sync_mode // Synchronization mode
)
.NET
MTRetCode CIMTManagerAPI.UserExternalSync(
ulong login, // Login
ulong gateway_id, // Gateway ID
string account_id, // External system account
CIMTManagerAPI.EnExternalSyncModes sync_mode // Synchronization mode
)
Python
ManagerAPI.UserExternalSync(
login, # Login
gateway_id, # Gateway ID
account_id, # External system account
sync_mode # Synchronization mode
)
Parameters
login
[in] Login of the client, for whom synchronization is performed.
gateway_id
[in] Gateway ID. Gateway ID is associated with an account number in an external system.
account_id
[in] Client's account in an external system.
sync_mode
[out] Synchronization mode. Transferred using IMTManagerAPI::EnExternalSyncModes enumeration.
Return Value
An indication of successful completion is the MT_RET_OK response code. Otherwise, an error code will be returned.
Note
This method works only if trading status synchronization is provided at the gateway used by the client.
Correcting operations are created as a result of trading data synchronization. These operations are displayed in the client's trading history.
No matter what data is sent by the gateway in response to the method call (orders, positions, balance), the server will apply the changes according to synchronization mode
specified in sync_mode parameter.
IMTManagerAPI::UserBalanceCheck
Check and correct the client's balance and credit funds.
C++
MTAPIRES IMTManagerAPI::UserBalanceCheck(
const UINT64 login, // Login
const UINT fixflag, // Balance correction flags
double& balance_user, // Balance at the moment of checking
double& balance_history // Balance based on the deals history
double& credit_user, // Credit funds at the moment of checking
double& credit_history // Credit funds based on the deals history
)
.NET
MTRetCode CIMTManagerAPI.UserBalanceCheck(
ulong login, // Login
bool fixflag, // Balance correction flags
out double balance_user, // Balance at the moment of checking
out double balance_history // Balance based on the deals history
out double credit_user, // Credit funds at the moment of checking
out double credit_history // Credit funds based on the deals history
)
Python
ManagerAPI.UserBalanceCheck(
login, # Login
fixflag # Balance correction flags
)
Parameters
login
[in] The login of the client whose balance and credit funds should be checked.
fixflag
[in] Flag of the need to correct a client's balance and credit funds after the check. If fixflag is equal to 1, the client's balance and credit funds are adjusted in accordance with
the history of deals. If the flag is 0, no correction will be made.
balance_user
[out] The value of the client's balance stored in the client record at the time of check.
balance_history
[out] The value of the client's balance calculated by analyzing the history of deals.
credit_user
[out] The client's credit funds, stored in the client record at the moment of checking.
credit_history
[out] The client's credit funds calculated by analyzing the history of deals.
file:///C:/Users/Administrator/AppData/Local/Temp/~hh4BC4.htm 7/17/2025
Manager API Page 345 of 464
Return Value
An indication of successful completion is the MT_RET_OK response code. Otherwise, a corresponding error code will be returned.
If the balance values do not match but balance correction is not performed (fixflag=0), the function returns the MT_RET_ERR_DATA response code.
Note
This function checks the client's balance on the basis of the history of his or her deals and makes corrections in the client's balance if necessary. The credit funds are checked
based on the IMTDeal::DEAL_CREDIT deals.
IMTManagerAPI::UserBalanceCheckBatch
Check and adjust balance and credit funds for multiple clients.
C++
MTAPIRES IMTManagerAPI::UserBalanceCheckBatch(
const UINT64* logins, // list of logins
const UINT logins_total, // number of logins
const UINT fixflag, // balance adjustment flag
MTAPIRES* results, // array of check results
double* balance_user, // array with balances as of the check time
double* balance_history // array with balances from the history of deals
double* credit_user, // array with credit funds as of the check time
double* credit_history // array with credit funds from the history of deals
)
.NET
MTRetCode CIMTManagerAPI.UserBalanceCheckBatch(
ulong[] logins, // list of logins
bool fixflag, // balance adjustment flag
MTRetCode[] res, // array of check results
out double[] balance_user, // array with balances as of the check time
out double[] balance_history // array with balances from the history of deals
out double[] credit_user, // array with credit funds as of the check time
out double[] credit_history // array with credit funds from the history of deals
)
Python
ManagerAPI.UserBalanceCheckBatch(
logins, # list of logins
fixflag # balance adjustment flag
)
Parameters
logins
[in] The array of client logins for which you want to check balances.
logins_total
[in] Number of logins in the 'logins' array.
fixflag
[in] Flag indicating the need to adjust the client's balance and credit funds after the check. If fixflag is equal to 1, the client's balance and credit funds are adjusted in
accordance with the history of deals. If the flag is 0, no correction will be made.
results
[out] Array with balance check results. The size of the 'results' array must not be less than that of 'logins'.
balance_user
[out] Array with balance values existing on the accounts at the check time. The index of the value corresponds to the index of the account in the source array.
balance_history
[out] Array with balance values calculated based on the history of deals on the accounts. The index of the value corresponds to the index of the account in the source array.
credit_user
[out] Array with credit values existing on the accounts at the check time. The index of the value corresponds to the index of the account in the source array.
credit_history
[out] Array with credit values calculated based on the history of deals on the accounts. The index of the value corresponds to the index of the account in the source array. The
credit funds are checked based on the deals with the IMTDeal::DEAL_CREDIT type.
Return Value
The MT_RET_OK response code indicates that all of the specified accounts have been checked. The MT_RET_ERR_PARTIAL code indicates that only some of the accounts have
been checked.
Analyze the 'results' array for further execution details. This array will contain check results for each account from the 'logins'. The index of the result corresponds to the index of
the account in the source array. If the balances mismatch but no adjustment is performed (fixflag=0), the MT_RET_ERR_DATA response code is written to the result.
Note
The method checks the clients' balances based on their trading history and adjust the balances if necessary.
IMTManagerAPI::NotificationsSend
Sends push-notifications to a list of MetaQuotes IDs.
C++
MTAPIRES IMTManagerAPI::NotificationsSend(
LPCWSTR metaquotest_ids, // The list of MetaQuotes IDs
LPCWSTR message // Message
)
.NET
MTRetCode CIMTManagerAPI.NotificationsSend(
string metaquotest_ids, // The list of MetaQuotes IDs
string message // Message
)
file:///C:/Users/Administrator/AppData/Local/Temp/~hh4BC4.htm 7/17/2025
Manager API Page 346 of 464
Python
ManagerAPI.NotificationsSend(
metaquotest_ids, # The list of MetaQuotes IDs
message # Message
)
Parameters
metaquotes_ids
[in] A comma separated list of MetaQuotes IDs.
message
[in] The text of the notification.
Return Value
An indication of successful completion is the MT_RET_OK response code. Otherwise, an error code will be returned.
Note
Push notifications are personal messages sent over the Internet. They do not depend on the phone number or mobile network operator. Messages are delivered instantly; no need
to run any applications on the receiver's device.
Messages are sent based on MetaQuotes ID, which is a unique user identifier. To obtain the ID, a user needs to install MetaTrader 5 Mobile for iPhone or Android.
The maximum message length is 1024 characters.
When sending to a list of MetaQuotes IDs, the company name from the Server License will be specified in the signature.
IMTManagerAPI::NotificationsSend
Sends push-notifications to a list of logins.
C++
MTAPIRES IMTManagerAPI::NotificationsSend(
const UINT64* logins, // Logins
const UNIT logins_total, // Number of logins
LPCWSTR message // Message
)
.NET
MTRetCode CIMTManagerAPI.NotificationsSend(
ulong[] logins, // Logins
string message // Message
)
Python
ManagerAPI.NotificationsSend(
logins, # Logins
message # Message
)
Parameters
logins
[in] An array of logins.
logins_total
[in] The total number of logins in logins.
message
[in] The text of the notification.
Return Value
An indication of successful completion is the MT_RET_OK response code. Otherwise, an error code will be returned.
Note
Push notifications are personal messages sent over the Internet. They do not depend on the phone number or mobile network operator. Messages are delivered instantly; no need
to run any applications on the receiver's device.
Messages are sent based on MetaQuotes ID, which is a unique user identifier. To obtain the ID, a user needs to install MetaTrader 5 Mobile for iPhone or Android.
The maximum message length is 1024 characters.
MetaQuotes ID must be specified in the settings of appropriate accounts (IMTUser::MQID) in order to send messages by specifying logins.
If you send messages specifying logins, the signature will contain the name of the Owner company from the settings of the group, to which the accounts belong. Use this type for
White Labels to add the correct company name in the signature.
IMTManagerAPI::EmailSend
Send an email to a selected address.
C++
MTAPIRES IMTManagerAPI::EmailSend(
LPCWSTR account, // Mail account used to send the email
LPCWSTR to, // Recipient address
LPCWSTR to_name, // Recipient name
LPCWSTR subject, // Email subject
LPCWSTR body // Email body
)
.NET
MTRetCode CIMTManagerAPI.EmailSend(
string account, // Mail account used to send the email
string to, // Recipient address
string to_name, // Recipient name
string subject, // Email subject
string body // Email body
)
file:///C:/Users/Administrator/AppData/Local/Temp/~hh4BC4.htm 7/17/2025
Manager API Page 347 of 464
Python
ManagerAPI.EmailSend(
account, # Mail account used to send the email
to, # Recipient address
to_name, # Recipient name
subject, # Email subject
body # Email body
)
Program Parameters
account
[in] The name of the mail server configuration, via which the email will be sent. The IMTConEmail::Name value is used for the name.
to
[in] Recipient's email address.
to_name
[in] Email recipient's name.
subject
[in] Email subject.
body
[in] Email body.
Return Value
An indication of successful completion is the MT_RET_OK response code. Otherwise, an error code is returned.
Note
All method parameters are required.
To be able to send emails, the platform must have pre-configured mail services.
IMTManagerAPI::MessengerVerifyPhone
Verify the validity of a passed phone number based on local phone number formation rules.
MTAPIRES IMTManagerAPI::MessengerVerifyPhone (
LPCWSTR phone_number // phone number
)
.NET
MTRetCode CIMTManagerAPI.MessengerVerifyPhone(
string phone_number // phone number
)
Python
ManagerAPI.MessengerVerifyPhone(
phone_number # phone number
)
Parameters
phone_number
[in] Verified phone number. The phone number should be passed in the international format: +[country code] [phone number].
Return Value
An indication of successful completion is the MT_RET_OK response code. Otherwise, an error code will be returned.
IMTManagerAPI::MessengerSend
Send an SMS message.
C++
MTAPIRES IMTManagerAPI::MessengerSend(
LPCWSTR destination, // Phone number
LPCWSTR group, // Group
LPCWSTR sender, // Sender
LPCWSTR text // Message text
)
.NET
MTRetCode CIMTManagerAPI.MessengerSend(
string destination, // Phone number
string group, // Group
string sender, // Sender
string text // Message text
)
Python
ManagerAPI.MessengerSend(
destination, # Phone number
group, # Group
sender, # Sender
text # Message text
)
Program Parameters
destination
[in] Recipient's phone number in the format +[country code][number], for example: +74951113594. The number is indicated without spaces.
group
[in] Here you can specify the group to which the message recipient's account belongs. In this case, the platform will send the message through the first provider, in whose
settings the specified group is found. The parameter is optional: is NULL is specified, the provider will be selected without regard to the group.
file:///C:/Users/Administrator/AppData/Local/Temp/~hh4BC4.htm 7/17/2025
Manager API Page 348 of 464
sender
[in] The name of the message sender. It is only used if the appropriate function is supported by the provider. This parameter is optional (NULL can be passed).
text
[in] The text of the notification. The maximum allowable length depends on the provider.
Return Value
An indication of successful completion is the MT_RET_OK response code. Otherwise, an error code is returned.
Code MT_RET_MESSENGER_INVALID_PHONE means that the specified phone number is invalid.
Code MT_RET_MESSENGER_NOT_MOBILE means that a landline phone number is specified instead of a mobile phone number.
Note
The MT_RET_OK does not indicate the successful message delivery.
To be able to send emails, the platform must have pre-configured integration with messengers.
Functions
The functions allow you to receive data concerning online connections to the trade server. The following functions are provided:
Function Purpose
OnlineCreate Create connection record object.
OnlineCreateArray Create connection record array object.
OnlineTotal Get the total amount of the current connections to the trade server.
OnlineNext Get connection record by index.
OnlineGet Get connection record by login.
OnlineDisconnect Forced disconnection of a client from the server.
IMTManagerAPI::OnlineCreate
Create connection record object.
C++
IMTOnline* IMTManagerAPI::OnlineCreate()
.NET
CIMTOnline CIMTManagerAPI::OnlineCreate()
Return Value
It returns a pointer to the created object that implements the IMTOnline interface. In case of failure, it returns NULL.
Note
The created object must be destroyed by calling IMTOnline::Release method of this object.
IMTManagerAPI::OnlineCreateArray
Create connection record array object.
C++
IMTOnlineArray* IMTManagerAPI::OnlineCreateArray()
.NET
CIMTOnlineArray CIMTManagerAPI.OnlineCreateArray()
Return Value
It returns a pointer to the created object that implements the IMTOnlineArray interface. In case of failure, it returns NULL.
Note
The created object must be destroyed by calling IMTOnlineArray::Release method of this object.
IMTManagerAPI::OnlineTotal
Get the total amount of the current connections to the trade server.
C++
UINT IMTManagerAPI::OnlineTotal()
.NET
file:///C:/Users/Administrator/AppData/Local/Temp/~hh4BC4.htm 7/17/2025
Manager API Page 349 of 464
uint CIMTManagerAPI.OnlineTotal()
Python
ManagerAPI.OnlineTotal()
Return Value
Amount of the current connections to the trade server.
Notes
All types of connection are considered, including client, manager and API ones with the exception of the cluster components' (platform servers') connections.
The method only works if the pumping modes PUMP_MODE_USERS and PUMP_MODE_ACTIVITY are enabled.
IMTManagerAPI::OnlineNext
Get connection record by index.
C++
MTAPIRES IMTManagerAPI::OnlineNext(
const UINT pos, // Connection record position
IMTOnline* online // Connection record object
)
.NET
MTRetCode CIMTManagerAPI.OnlineNext(
uint pos, // Connection record position
CIMTOnline online // Connection record object
)
Python
ManagerAPI.OnlineNext(
pos # Connection record position
)
Parameters
pos
[in] Position of the record, starting with 0.
online
[out] Connection record object. The online object should be first created using IMTManagerAPI::OnlineCreate method.
Return Value
An indication of successful completion is the MT_RET_OK response code. Otherwise, an error code will be returned.
Note
This method copies the data of a connection records with the specified index to the online object.
The method only works if the pumping modes PUMP_MODE_USERS and PUMP_MODE_ACTIVITY are enabled.
IMTManagerAPI::OnlineGet
Get connection record by login.
C++
MTAPIRES IMTManagerAPI::OnlineGet(
const UINT64 login, // Client login
IMTOnlineArray* online // Connection record array object
)
.NET
MTRetCode CIMTManagerAPI.OnlineGet(
ulong login, // Client login
CIMTOnlineArray online // Connection record array object
)
Python
ManagerAPI.OnlineGet(
login # Client login
)
ManagerAPI.OnlineGetArray()
Parameters
login
[in] The login of a client.
online
[out] Connection record array object. The online object should be first created using IMTManagerAPI::OnlineCreateArray method.
Return Value
An indication of successful completion is the MT_RET_OK response code. Otherwise, an error code will be returned.
Note
This method copies the data of a connection with the specified login to the online object.
The method only works if the pumping modes PUMP_MODE_USERS and PUMP_MODE_ACTIVITY are enabled.
file:///C:/Users/Administrator/AppData/Local/Temp/~hh4BC4.htm 7/17/2025
Manager API Page 350 of 464
IMTManagerAPI::OnlineDisconnect
Forced disconnection of a client from the server.
C++
MTAPIRES IMTManagerAPI::OnlineDisconnect(
IMTOnline* online // Connection record object
)
.NET
MTRetCode CIMTManagerAPI.OnlineDisconnect(
CIMTOnline online // Connection record object
)
Python
ManagerAPI.OnlineDisconnect(
online # Connection record object
)
Parameters
online
[out] Connection record object.
Return Value
An indication of successful completion is the MT_RET_OK response code. Otherwise, an error code will be returned.
Note
Forced disconnection is required to ensure that new account settings are activated. For example, after account password change, you can disconnect this account from the server
so that the user logs in with the new password.
After the connection is dropped, the client terminals attempt to reconnect to the server automatically.
The method only works if the pumping modes PUMP_MODE_USERS and PUMP_MODE_ACTIVITY are enabled.
IMTManagerAPI::OnlineDisconnectBatch
Forced disconnection of multiple clients from the server.
C++
MTAPIRES IMTManagerAPI::OnlineDisconnectBatch(
IMTOnlineArray* online, // Array of connection objects
MTAPIRES* results // Array of results
)
.NET
MTRetCode CIMTManagerAPI.OnlineDisconnectBatch(
CIMTOnlineArray online, // Array of connection objects
MTRetCode[] results // Array of results
)
Python
ManagerAPI.OnlineDisconnectBatch(
online # Array of connection objects
)
Parameters
online
[in] A pointer to the array of connections IMTOnlineArray.
results
[out] Array with connection drop results. The size of the 'results' array must not be less than that of the 'online' array.
Return Value
The MT_RET_OK response code indicates that all connections were dropped. The MT_RET_ERR_PARTIAL response code means that only some of the connections were dropped.
Analyze the 'results' array for more details concerning the execution results. The result of an attempt to drop each connection from the 'online' array is added to 'results'. The
index of a result corresponds to the index of a position in the source array.
Note
Connection drop can only be performed from the applications connected to the same server, to which the clients are connected. For all other applications the response code
MT_RET_ERR_NOTMAIN will be returned. If the object is not found, the response code MT_RET_ERR_NOTFOUND is returned.
IMTManagerAPI::OnlineDisconnectBatchArray
Forced disconnection of multiple clients from the server.
C++
MTAPIRES IMTManagerAPI::OnlineDisconnectBatch(
IMTOnline** online, // Array of connection objects
const UINT online_total, // Number of objects in the array
MTAPIRES* results // Array of results
)
.NET
file:///C:/Users/Administrator/AppData/Local/Temp/~hh4BC4.htm 7/17/2025
Manager API Page 351 of 464
MTRetCode CIMTManagerAPI.OnlineDisconnectBatch(
CIMTOnline[] online, // Array of connection objects
MTRetCode[] results // Array of results
)
Parameters
online
[in] A pointer to the array of connection objects IMTOnline.
online_total
[in] Number of object in the 'online' array.
results
[out] Array with connection drop results. The size of the 'results' array must not be less than that of the 'online' array.
Return Value
The MT_RET_OK response code indicates that all connections were dropped. The MT_RET_ERR_PARTIAL response code means that only some of the connections were dropped.
Analyze the 'results' array for more details concerning the execution results. The result of an attempt to drop each connection from the 'online' array is added to 'results'. The
index of a result corresponds to the index of a position in the source array.
Note
Connection drop can only be performed from the applications connected to the same server, to which the clients are connected. For all other applications the response code
MT_RET_ERR_NOTMAIN will be returned. If the object is not found, the response code MT_RET_ERR_NOTFOUND is returned.
• Orders
• Deals
• Positions
Orders
Functions allow to view the database of trade orders, as well subscribe and unsubscribe from events associated with changes in the order base.
The following functions are available for this purpose:
Function Purpose
OrderCreate Create an object of a trade order.
OrderCreateArray Create an object of the array of orders.
OrderSubscribe Subscribe to the events associated with changes in the database of orders.
OrderUnsubscribe Unsubscribe from the events associated with changes in the database of orders.
OrderGet Get a currently unfulfilled order by a ticket.
OrderGetOpen Get currently unfulfilled orders of a client.
OrderGetByGroup Request from the server open orders related to a client group.
OrderGetByLogins Receive currently open orders by the list of logins.
OrderGetByTickets Receive currently open orders by the list of tickets.
OrderGetBySymbol Receive currently open orders by groups and symbol.
OrderRequest Request a trade order from a server by the ticket.
OrderRequestOpen Request from the server currently unfulfilled orders of a client.
OrderRequestByGroup Request from the server open orders related to a client group.
OrderRequestByGroupSymbol Request open orders from the server by group and symbol.
OrderRequestByLogins Request from the server open orders related to the list of logins.
OrderRequestByLoginsSymbol Request open orders from the server by list of logins and symbol.
OrderRequestByTickets Request from the server open orders by the list of tickets.
OrderAdd Add an open order the server database.
OrderAddBatch Add a batch of open orders to the server database.
OrderAddBatchArray Add a batch of open orders to the server database.
OrderUpdate Update a trade order.
OrderUpdateBatch Update multiple orders in a server database.
OrderUpdateBatchArray Update multiple orders in a server database.
OrderDelete Delete a trade order.
OrderDeleteBatch Delete orders from the server database in bulk.
OrderCancel Move an open trading order to history.
OrderCancelBatch Move multiple open order to history.
HistoryRequest Request from the server the client's closed orders (history) in the specified date range.
HistoryRequestByGroup Request from the server closed orders (history) related to a client group.
file:///C:/Users/Administrator/AppData/Local/Temp/~hh4BC4.htm 7/17/2025
Manager API Page 352 of 464
Function Purpose
HistoryRequestByGroupSymbol Request closed orders (history) from the server by group and symbol.
HistoryRequestByLogins Request from the server the closed orders (history) related to the list of logins.
HistoryRequestByLoginsSymbol Request closed orders (history) from the server by list of logins and symbol.
HistoryRequestByTickets Request from the server the closed orders (history) related to the list of tickets.
HistoryRequestPage Request from the server client's closed orders (history) in a paged form.
IMTManagerAPI::OrderCreate
Create an object of a trade order.
C++
IMTOrder* IMTManagerAPI::OrderCreate()
.NET
CIMTOrder CIMTManagerAPI.OrderCreate()
Return Value
It returns a pointer to the created object that implements the IMTOrder interface. In case of failure, it returns NULL.
Note
The created object must be deleted by calling the IMTOrderAPI::Release method of this object.
IMTManagerAPI::OrderCreateArray
Create an object of the array of orders.
C++
IMTOrderArray* IMTManagerAPI::OrderCreateArray()
.NET
CIMTOrderArray CIMTManagerAPI.OrderCreateArray()
Return Value
It returns a pointer to the created object that implements the IMTOrderArray interface. In case of failure, it returns NULL.
Note
The created object must be destroyed by calling IMTOrderArray::Release method of this object.
IMTManagerAPI::OrderSubscribe
Subscribe to the events associated with changes in the database of orders.
C++
MTAPIRES IMTManagerAPI::OrderSubscribe(
IMTOrderSink* sink // A pointer to the IMTOrderSink object
)
.NET
MTRetCode CIMTManagerAPI.OrderSubscribe(
CIMTOrderSink sink // CIMTOrderSink object
)
Python
ManagerAPI.OrderSubscribe(
sink # IMTOrderSink object
)
Parameters
sink
[in] A pointer to the object that implements the IMTOrderSink interface.
Return Value
An indication of successful completion is the MT_RET_OK response code. Otherwise, an error has occurred that corresponds to the response code.
Note
Subscribing to events is thread safe. One and the same interface IMTOrderSink cannot subscribe to an event twice - in this case the response code MT_RET_ERR_DUPLICATE is
returned.
To receive IMTOrderSink::OnOrderSync events, subscribe before calling the IMTManagerAPI::Connect method.
The object at which sink points, must remain in the memory (must not be removed) until the call of IMTManagerAPI::OrderUnsubscribe or until the manager interface is deleted
using the IMTManagerAPI::Release method.
To receive events connected with order database changes, the pumping mode IMTManagerAPI::PUMP_MODE_ORDERS must be enabled.
file:///C:/Users/Administrator/AppData/Local/Temp/~hh4BC4.htm 7/17/2025
Manager API Page 353 of 464
IMTManagerAPI::OrderUnsubscribe
Unsubscribe from the events associated with changes in the database of orders.
C++
MTAPIRES IMTManagerAPI::OrderUnsubscribe(
IMTOrderSink* sink // A pointer to the IMTOrderSink object
)
.NET
MTRetCode CIMTManagerAPI.OrderUnsubscribe(
CIMTOrderSink sink // CIMTOrderSink object
)
Python
TManagerAPI.OrderUnsubscribe(
sink # IMTOrderSink object
)
Parameters
sink
[in] A pointer to the object that implements the IMTOrderSink interface.
Return Value
An indication of successful completion is the MT_RET_OK response code. Otherwise, an error code will be returned.
Note
This is a pair method to IMTManagerAPI::OrderSubscribe. If an attempt is made to unsubscribe from the interface to which it has not subscribed, MT_RET_ERR_NOTFOUND error is
returned.
IMTManagerAPI::OrderGet
Get a currently unfulfilled order by a ticket.
C++
MTAPIRES IMTManagerAPI::OrderGet(
const UINT64 ticket, // Ticket
IMTOrder* order // An order object
)
.NET
MTRetCode CIMTManagerAPI.OrderGet(
ulong ticket, // Ticket
CIMTOrder order // An order object
)
Python
ManagerAPI.OrderGet(
int ticket # Ticket
)
Parameters
ticket
[in] The number (ticket) of an order.
order
[out] An object of a trade order. The 'order' object must be first created using the IMTManagerAPI::OrderCreate method.
Return Value
An indication of successful completion is the MT_RET_OK response code. Otherwise, an error code will be returned.
Note
This method copies data of an order with the specified ticket to the order object. The method is valid only if the IMTManagerAPI::PUMP_MODE_ORDERS pumping mode was
specified during connection.
IMTManagerAPI::OrderGetOpen
Get currently unfulfilled orders of a client.
C++
MTAPIRES IMTManagerAPI::OrderGetOpen(
const UINT64 login, // Client login
IMTOrderArray* orders // An object of the array of orders
)
.NET
MTRetCode CIMTManagerAPI.OrderGetOpen(
ulong login, // Client login
CIMTOrderArray orders // An object of the array of orders
)
Python
file:///C:/Users/Administrator/AppData/Local/Temp/~hh4BC4.htm 7/17/2025
Manager API Page 354 of 464
ManagerAPI.OrderGetOpen(
login # Client login
)
ManagerAPI.OrderGetOpenCSV(
login, # Client login
fields # Comma-separated list of required fields
)
ManagerAPI.OrderGetOpenNumPy(
login, # Client login
fields # Comma-separated list of required fields
)
Parameters
login
[in] The login of the client, whose open orders you need to get.
orders
[out] An object of the array of orders. The orders object must be first created using the IMTManagerAPI::OrderCreateArray method.
Return Value
An indication of successful completion is the MT_RET_OK response code. Otherwise, an error code will be returned.
Note
The method is valid only if the IMTManagerAPI::PUMP_MODE_ORDERS pumping mode was specified during connection.
IMTManagerAPI::OrderGetByGroup
Request from the server open orders related to a client group.
C++
MTAPIRES IMTManagerAPI::OrderGetByGroup(
LPCWSTR mask, // group mask
IMTOrderArray* orders // object of the array of orders
)
.NET
MTRetCode CIMTManagerAPI.OrderGetByGroup(
String^ mask, // group mask
CIMTOrderArray orders // object of the array of orders
)
Python
ManagerAPI.OrderGetByGroup(
mask # group mask
)
ManagerAPI.OrderGetByGroupCSV(
mask, # group mask
fields # comma-separated list of required fields
)
ManagerAPI.OrderGetByGroupNumPy(
mask, # group mask
fields # comma-separated list of required fields
)
Parameters
mask
[in] The groups the orders are requested for. You can specify one group, several groups (comma separated) or a group mask. The mask is specified using characters "*" (any
value) and "!" (exception). For example: "demo*,!demoforex" - all groups whose names begin with 'demo', except for the group demoforex.
orders
[out] An object of the array of orders. The 'orders' object should be first created using the IMTManagerAPI::OrderCreateArray method.
Return Value
An indication of successful completion is the MT_RET_OK response code. Otherwise, an error code will be returned.
Note
The method copies the data on all open orders belonging to clients in the specified groups to the 'orders' object. The method works only if the
IMTManagerAPI::PUMP_MODE_ORDERS pumping mode has been specified during the connection.
IMTManagerAPI::OrderGetByLogins
Receive currently open orders by the list of logins.
C++
MTAPIRES IMTManagerAPI::OrderGetByLogins(
const UINT64* logins, // Logins
const UINT logins_total, // Number of logins
IMTOrderArray* orders // Object of the orders array
)
.NET
MTRetCode CIMTManagerAPI.OrderGetByLogins(
ulong[] logins, // Logins
CIMTOrderArray orders // Object of the orders array
)
file:///C:/Users/Administrator/AppData/Local/Temp/~hh4BC4.htm 7/17/2025
Manager API Page 355 of 464
Python
ManagerAPI.OrderGetByLogins(
logins # Logins
)
ManagerAPI.OrderGetByLoginsCSV(
logins, # Logins
fields # Comma-separated list of required fields
)
ManagerAPI.OrderGetByLoginsNumPy(
logins, # Logins
fields # Comma-separated list of required fields
)
Parameters
logins
[in] Array of client logins.
logins_total
[in] Number of logins in the 'logins' array.
orders
[out] An object of the array of orders. The 'orders' object should be first created using the IMTManagerAPI::OrderCreateArray method.
Return Value
An indication of successful completion is the MT_RET_OK response code. Otherwise, an error code will be returned.
Note
The method copies to the 'orders' object the data of all open orders belonging to the specified accounts. The method works only if the IMTManagerAPI::PUMP_MODE_ORDERS
pumping mode has been specified during the connection.
IMTManagerAPI::OrderGetByTickets
Receive currently open orders by the list of tickets.
C++
MTAPIRES IMTManagerAPI::OrderGetByTickets(
const UINT64* tickets, // Tickets
const UINT tickets_total,// Number of tickets
IMTOrderArray* orders // Array of orders
)
.NET
MTRetCode CIMTManagerAPI.OrderGetByTickets(
ulong[] tickets, // Tickets
CIMTOrderArray orders // Array of orders
)
Python
ManagerAPI.OrderGetByTickets(
tickets # Tickets
)
ManagerAPI.OrderGetByTicketsCSV(
tickets, # Tickets
fields # Comma-separated list of required fields
)
ManagerAPI.OrderGetByTicketsNumPy(
tickets, # Tickets
fields # Comma-separated list of required fields
)
Parameters
tickets
[in] The list of order tickets.
tickets_total
[in] The number of tickets in the 'tickets' array.
orders
[out] An object of the array of orders. The 'orders' object should be first created using the IMTManagerAPI::OrderCreateArray method.
Return Value
An indication of successful completion is the MT_RET_OK response code. Otherwise, an error code will be returned.
Note
This method copies to the 'orders' object the data of open orders with the specified tickets. The method works only if the IMTManagerAPI::PUMP_MODE_ORDERS pumping mode
has been specified during the connection.
IMTManagerAPI::OrderGetBySymbol
Get currently open orders by group and symbol.
C++
file:///C:/Users/Administrator/AppData/Local/Temp/~hh4BC4.htm 7/17/2025
Manager API Page 356 of 464
MTAPIRES IMTManagerAPI::OrderGetBySymbol(
LPCWSTR groups, // Group mask
LPCWSTR symbol, // Symbol
IMTOrderArray* orders // Orders array object
)
.NET
MTRetCode CIMTManagerAPI.OrderGetBySymbol(
String^ groups, // Group mask
String^ symbol, // Symbol
CIMTOrderArray orders // Orders array object
)
Python
ManagerAPI.OrderGetBySymbol(
groups, # Group mask
symbol, # Symbol
)
ManagerAPI.OrderGetBySymbolCSV(
groups, # Group mask
symbol, # Symbol
fields # Comma-separated list of required fields
)
ManagerAPI.OrderGetBySymbolNumPy(
groups, # Group mask
symbol, # символ
fields # Comma-separated list of required fields
)
Parameters
groups
[in] The groups the orders are requested for. You can specify one group, several groups (comma separated) or a group mask. The mask is specified using characters "*" (any
value) and "!" (exception). For example: "demo*,!demoforex" - all groups with the names beginning with 'demo', except for the group demoforex. The 'nullptr' value means "all
groups".
news
[in] The symbol, for which you wish to obtain orders.
orders
[out] An object of the array of orders. The 'orders' object should be first created using the IMTManagerAPI::OrderCreateArray method.
Return Value
An indication of successful completion is the MT_RET_OK response code. Otherwise, an error code will be returned.
Note
The method only works if the IMTManagerAPI::PUMP_MODE_ORDERS pumping mode has been specified during connection.
IMTManagerAPI::OrderRequest
Request a trade order from a server by the ticket.
C++
MTAPIRES IMTManagerAPI::OrderRequest(
const UINT64 ticket, // Ticket
IMTOrder* order // An order object
)
.NET
MTRetCode CIMTManagerAPI.OrderRequest(
ulong ticket, // Ticket
CIMTOrder order // An order objec
)
OrderGetBySymbol
ManagerAPI.OrderRequest(
int ticket # Ticket
)
Parameters
ticket
[in] The number (ticket) of an order.
order
[out] An object of a trade order. The 'order' object must be first created using the IMTManagerAPI::OrderCreate method.
Return Value
An indication of successful completion is the MT_RET_OK response code. Otherwise, an error code will be returned.
Note
This method copies data of an order (no matter already fulfilled or not) with the specified ticket to the order object.
This method cannot be called from event handlers (any methods of IMT*Sink classes).
IMTManagerAPI::OrderRequestOpen
Request from the server currently unfulfilled orders of a client.
C++
file:///C:/Users/Administrator/AppData/Local/Temp/~hh4BC4.htm 7/17/2025
Manager API Page 357 of 464
MTAPIRES IMTManagerAPI::OrderRequestOpen(
const UINT64 login, // Client login
IMTOrderArray* orders // An object of the array of orders
)
.NET
MTAPIRES CIMTManagerAPI.OrderRequestOpen(
ulong login, // Client login
CIMTOrderArray orders // An object of the array of orders
)
Python
ManagerAPI.OrderRequestOpen(
login # Client login
)
ManagerAPI.OrderRequestOpenCSV(
login, # Client login
fields # Comma-separated list of required fields
)
ManagerAPI.OrderRequestOpenNumPy(
login, # Client login
fields # Comma-separated list of required fields
)
Parameters
login
[in] The login of the client, whose open orders you need to get.
orders
[out] An object of the array of orders. The orders object must be first created using the IMTManagerAPI::OrderCreateArray method.
Return Value
An indication of successful completion is the MT_RET_OK response code. Otherwise, an error code will be returned.
Note
This method cannot be called from event handlers (any methods of IMT*Sink classes).
IMTManagerAPI::OrderRequestByGroup
Request from the server open orders related to a client group.
C++
MTAPIRES IMTManagerAPI::OrderRequestByGroup(
LPCWSTR group, // Group
IMTOrderArray* orders // Object of the orders array
)
.NET
MTRetCode CIMTManagerAPI.OrderRequestByGroup(
string mask, // Group
CIMTOrderArray orders // Object of the orders array
)
Python
ManagerAPI.OrderRequestByGroup(
mask # Group
)
ManagerAPI.OrderRequestByGroupCSV(
mask, # Group
fields # Comma-separated list of required fields
)
ManagerAPI.OrderRequestByGroupNumPy(
mask, # Group
fields # Comma-separated list of required fields
)
Parameters
group
[in] The groups for which the orders are requested. You can specify one group, several groups (comma separated) or a group mask. The mask is specified using "*" (any value)
and "!" (exception). For example: "demo*,!demoforex" - all groups with the names beginning with 'demo', except for the group demoforex.
orders
[out] An object of the array of orders. The 'orders' object should be first created using the IMTManagerAPI::OrderCreateArray method.
Return Value
An indication of successful completion is the MT_RET_OK response code. Otherwise, an error code will be returned.
Note
The method copies to the 'orders' object the data on all open orders belonging to clients in the specified groups.
The method cannot be called from event handlers (any IMT*Sink class methods).
IMTManagerAPI::OrderRequestByGroupSymbol
Request open orders from the server by group and symbol.
C++
file:///C:/Users/Administrator/AppData/Local/Temp/~hh4BC4.htm 7/17/2025
Manager API Page 358 of 464
MTAPIRES IMTManagerAPI::OrderRequestByGroupSymbol(
LPCWSTR group, // group
LPCWSTR symbol, // symbol
IMTOrderArray* orders // order array object
)
.NET
MTRetCode CIMTManagerAPI.OrderRequestByGroupSymbol(
string mask, // group
string symbol, // symbol
CIMTOrderArray orders // order array object
)
Python
ManagerAPI.OrderRequestByGroupSymbol(
mask, # group
symbol # symbol
)
ManagerAPI.OrderRequestByGroupSymbolCSV(
mask, # group
symbol, # symbol
fields # comma-separated list of required fields
)
ManagerAPI.OrderRequestByGroupSymbolNumPy(
mask, # group
symbol, # symbol
fields # comma-separated list of required fields
)
Parameters
group
[in] The groups for which the orders are requested. You can specify one group, several groups (comma separated) or a group mask. The mask is specified using characters
"*" (any value) and "!" (exception). For example: "demo*,!demoforex" - all groups whose names begin with 'demo', except for the group demoforex.
symbol
[in] The symbol, for which you wish to get orders. You can specify multiple symbols separated by commas as well as symbol masks. The maximum length of the string is 127
characters.
orders
[out] An object of the array of orders. The 'orders' object should be first created using the IMTManagerAPI::OrderCreateArray method.
Return Value
An indication of successful completion is the MT_RET_OK response code. Otherwise, an error code will be returned.
Note
The method copies to the 'orders' object the data on all open orders belonging to clients in the specified groups.
The method cannot be called from event handlers (any IMT*Sink class methods).
IMTManagerAPI::OrderRequestByLogins
Request from the server open orders related to the list of logins.
C++
MTAPIRES IMTManagerAPI::OrderRequestByLogins(
const UINT64* logins, // Logins
const UINT logins_total, // Number of logins
IMTOrderArray* orders // Object of the orders array
)
.NET
MTRetCode CIMTManagerAPI.OrderRequestByLogins(
ulong[] logins, // Logins
CIMTOrderArray orders // Object of the orders array
)
Python
ManagerAPI.OrderRequestByLogins(
logins # Logins
)
ManagerAPI.OrderRequestByLoginsCSV(
logins, # Logins
fields # Object of the orders array
)
ManagerAPI.OrderRequestByLoginsNumPy(
logins, # Logins
fields # Object of the orders array
)
Parameters
logins
[in] Array of client logins.
logins_total
[in] Number of logins in the 'logins' array.
orders
[out] An object of the array of orders. The 'orders' object should be first created using the IMTManagerAPI::OrderCreateArray method.
Return Value
An indication of successful completion is the MT_RET_OK response code. Otherwise, an error code will be returned.
Note
file:///C:/Users/Administrator/AppData/Local/Temp/~hh4BC4.htm 7/17/2025
Manager API Page 359 of 464
The method copies to the 'orders' object the data of all open orders belonging to the specified accounts.
The method cannot be called from event handlers (any IMT*Sink class methods).
IMTManagerAPI::OrderRequestByLoginsSymbol
Request open orders from the server by list of logins and symbol.
C++
MTAPIRES IMTManagerAPI::OrderRequestByLoginsSymbol(
const UINT64* logins, // logins
const UINT logins_total, // number of logins
LPCWSTR symbol, // symbol
IMTOrderArray* orders // order array object
)
.NET
MTRetCode CIMTManagerAPI.OrderRequestByLoginsSymbol(
ulong[] logins, // logins
string symbol, // symbol
CIMTOrderArray orders // order array object
)
Python
ManagerAPI.OrderRequestByLoginsSymbol(
logins, # logins
symbol # symbol
)
ManagerAPI.OrderRequestByLoginsSymbolCSV(
logins, # logins
symbol, # symbol
fields # comma-separated list of required fields
)
ManagerAPI.OrderRequestByLoginsSymbolNumPy(
logins, # logins
symbol, # symbol
fields # comma-separated list of required fields
)
Parameters
logins
[in] Array of client logins.
logins_total
[in] Number of logins in the 'logins' array.
symbol
[in] The symbol, for which you wish to get orders.
orders
[out] An object of the array of orders. The 'orders' object should be first created using the IMTManagerAPI::OrderCreateArray method.
Return Value
An indication of successful completion is the MT_RET_OK response code. Otherwise, an error code will be returned.
Note
The method cannot be called from event handlers (any IMT*Sink class methods).
IMTManagerAPI::OrderRequestByTickets
Request from the server open orders by the list of tickets.
C++
MTAPIRES IMTManagerAPI::OrderRequestByTickets(
const UINT64* tickets, // Tickets
const UINT tickets_total,// Number of tickets
IMTOrderArray* orders // Array of orders
)
.NET
MTRetCode CIMTManagerAPI.OrderRequestByTickets(
ulong[] tickets, // Tickets
CIMTOrderArray orders // Array of orders
)
Python
ManagerAPI.OrderRequestByTickets(
tickets # Tickets
)
ManagerAPI.OrderRequestByTicketsCSV(
tickets, # Tickets
fields # Comma-separated list of required fields
)
ManagerAPI.OrderRequestByTicketsNumPy(
tickets, # Tickets
fields # Comma-separated list of required fieldss
)
Parameters
file:///C:/Users/Administrator/AppData/Local/Temp/~hh4BC4.htm 7/17/2025
Manager API Page 360 of 464
tickets
[in] List of order tickets.
tickets_total
[in] The number of tickets in the 'tickets' array.
orders
[out] An object of the array of orders. The 'orders' object should be first created using the IMTManagerAPI::OrderCreateArray method.
Return Value
An indication of successful completion is the MT_RET_OK response code. Otherwise, an error code will be returned.
Note
This method copies data of orders with the specified tickets to the 'orders' object.
The method cannot be called from event handlers (any IMT*Sink class methods).
IMTManagerAPI::OrderAdd
Add an open order the server database.
C++
MTAPIRES IMTManagerAPI::OrderAdd(
IMTOrder* order // Order object
)
.NET
MTRetCode CIMTManagerAPI.OrderAdd(
CIMTOrder order // Order object
)
Python
ManagerAPI.OrderAdd(
order # Order object
)
Parameters
order
[in] Order object.
Return Value
An indication of successful completion is the MT_RET_OK response code. Otherwise, an error code will be returned.
Note
An order can only be added to the database of the server, to which the application is connected.
The manager account requires the RIGHT_TRADE_MANAGER permission in order to use the function.
The ticket of the order you are adding (IMTOrder::OrderSet) must fall within the orders range on the trading server (IMTConServerTrade::OrdersRange*), and it must be greater
than the last used ticket.
Note that the server allocates new tickets starting from the last used ticket in the range. For example, if you create an order with a ticket of 5000, the server will allocate for
further orders the tickets 5001, 5002, etc. (even if tickets before 5000 are not busy).
If an order is added with a zero ticket, the server will assign the ticket automatically.
The integrity of the order being added is checked. The following fields must be filled:
• IMTOrder::Login (an account with this login must exist on the server)
• IMTOrder::Symbol
• IMTOrder::Type
• IMTOrder::Digits
• IMTOrder::DigitsCurrency
• IMTOrder::ContractSize
• IMTOrder::VolumeInitial (must be less than IMTOrder::VolumeCurrent)
• IMTOrder::VolumeCurrent (must not be greater than IMTOrder::VolumeInitial)
• IMTOrder::PriceOrder
• IMTOrder::State (the state must correspond to an open order; it cannot be ORDER_STATE_CANCELED, ORDER_STATE_PARTIAL, ORDER_STATE_FILLED,
ORDER_STATE_REJECTED, ORDER_STATE_EXPIRED)
• IMTOrder::TimeSetupMsc
The IMTOrder::TimeDone and IMTOrder::TimeDoneMsc fields must not be filled in the order.
IMTManagerAPI::OrderAddBatch
Add a batch of open orders to the server database.
C++
MTAPIRES IMTManagerAPI::OrderAddBatch(
IMTOrderArray* orders, // Array of orders
MTAPIRES* results // Array of results
)
.NET
MTRetCode CIMTManagerAPI.OrderAddBatch(
CIMTOrderArray orders, // Array of orders
MTRetCode[] res // Array of results
)
Python
file:///C:/Users/Administrator/AppData/Local/Temp/~hh4BC4.htm 7/17/2025
Manager API Page 361 of 464
ManagerAPI.OrderAddBatch(
orders # Array of orders
)
Parameters
orders
[in] A pointer to the array of orders IMTOrderArray.
results
[out] An array with the order addition results. The size of the 'results' array must not be less than that of 'orders'.
Return Value
The MT_RET_OK response code indicates that all the specified orders have been added. The MT_RET_ERR_PARTIAL response code means that only some of the orders have been
added. Analyze the 'results' array for more details on the execution results. The result of adding of each order from the 'orders' array is added to 'results'. The index of a result
corresponds to the index of an order in the source array.
Note
Orders can only be added to the database of the server, to which the application is connected.
The manager account requires the RIGHT_TRADE_MANAGER permission in order to use the function.
The tickets of the orders you are adding (IMTOrder::OrderSet) must fall within the orders range on the trading server (IMTConServerTrade::OrdersRange*), and they must be
greater than the last used ticket.
Note that the server allocates new tickets starting from the last used ticket in the range. For example, if you create an order with a ticket of 5000, the server will allocate for
further orders the tickets 5001, 5002, etc. (even if tickets before 5000 are not busy).
If orders are added with a zero ticket, the server will assign the tickets automatically.
Orders being added are checked for integrity. The following fields must be filled:
• IMTOrder::Login (an account with this login must exist on the server)
• IMTOrder::Symbol
• IMTOrder::Type
• IMTOrder::Digits
• IMTOrder::DigitsCurrency
• IMTOrder::ContractSize
The IMTOrder::TimeDone and IMTOrder::TimeDoneMsc fields must not be filled in the orders.
To improve performance, it is recommended to create arrays and perform group operations separately for each trading account.
IMTManagerAPI::OrderAddBatchArray
Add a batch of open orders to the server database.
C++
MTAPIRES IMTManagerAPI::OrderAddBatchArray(
IMTOrder** order, // Array of orders
const UINT orders_total, // Number of orders in the array
MTAPIRES* results // Array of results
)
.NET
MTRetCode CIMTManagerAPI.OrderAddBatchArray(
CIMTOrder[] orders, // Array of orders
MTRetCode[] retcodes // Array of results
)
Parameters
orders
[in] A pointer to the array of orders.
orders_total
[in] The number of orders in the 'orders' array.
results
[out] An array with the results of update of orders. The size of the 'results' array must not be less than that of 'orders'.
Return Value
The MT_RET_OK response code indicates that all the specified orders have been added. The MT_RET_ERR_PARTIAL response code means that only some of the orders have been
added. Analyze the 'results' array for more details on the execution results. The result of adding of each order from the 'orders' array is added to 'results'. The index of a result
corresponds to the index of an order in the source array.
Note
Orders can only be added to the database of the server, to which the application is connected.
The manager account requires the RIGHT_TRADE_MANAGER permission in order to use the function.
The tickets of the orders you are adding (IMTOrder::OrderSet) must fall within the orders range on the trading server (IMTConServerTrade::OrdersRange*), and they must be
greater than the last used ticket.
Note that the server allocates new tickets starting from the last used ticket in the range. For example, if you create an order with a ticket of 5000, the server will allocate for
further orders the tickets 5001, 5002, etc. (even if tickets before 5000 are not busy).
If orders are added with a zero ticket, the server will assign the tickets automatically.
Orders being added are checked for integrity. The following fields must be filled:
• IMTOrder::Login
• IMTOrder::Symbol
file:///C:/Users/Administrator/AppData/Local/Temp/~hh4BC4.htm 7/17/2025
Manager API Page 362 of 464
• IMTOrder::Type
• IMTOrder::Digits
• IMTOrder::DigitsCurrency
• IMTOrder::ContractSize
The IMTOrder::TimeDone and IMTOrder::TimeDoneMsc fields must not be filled in the orders.
To improve performance, it is recommended to create arrays and perform group operations separately for each trading account.
IMTManagerAPI::OrderUpdate
Updates a trade order.
C++
MTAPIRES IMTManagerAPI::OrderUpdate(
IMTOrder* order // An order object
)
.NET
MTRetCode CIMTManagerAPI.OrderUpdate(
CIMTOrder order // An order object
)
Python
ManagerAPI.OrderUpdate(
order # An order object
)
Parameters
*order
[in] Order object.
Return Value
An indication of successful completion is the MT_RET_OK response code. Otherwise, an error code will be returned.
Note
An order can only be updated from the applications connected to the trade server, on which the order has been created. For all other applications the response code
MT_RET_ERR_NOTMAIN will be returned. If the object is not found, the response code MT_RET_ERR_NOTFOUND will be returned.
The manager account requires the RIGHT_TRADE_MANAGER permission in order to use the function.
IMTManagerAPI::OrderUpdateBatch
Update multiple orders in a server database.
C++
MTAPIRES IMTManagerAPI::OrderUpdateBatch(
IMTOrderArray* orders, // Array of orders
MTAPIRES* results // Array of results
)
.NET
MTRetCode CIMTManagerAPI.OrderUpdateBatch(
CIMTOrderArray orders, // Array of orders
MTRetCode[] res // Array of results
)
Python
ManagerAPI.OrderUpdateBatch(
orders # Array of orders
)
Parameters
orders
[in] A pointer to the array of orders IMTOrderArray.
results
[out] An array with order update results. The size of the 'results' array must not be less than that of 'orders'.
Return Value
The MT_RET_OK response code indicates that all orders have been updated. The MT_RET_ERR_PARTIAL response code means that only some of the orders have been updated.
Analyze the 'results' array for more details concerning the execution results. The result of update of each order from the 'orders' array is added to 'results'. The index of a result
corresponds to the index of an order in the source array.
Note
Orders can only be updated from the applications connected to the trade server, on which the orders have been created. For all other applications, the response code
MT_RET_ERR_NOTMAIN is returned. If the object is not found, the response code MT_RET_ERR_NOTFOUND is returned.
All required fields of orders must be filled in, not only the ones which you want to change It is recommended that you first receive orders from the server, change the required
fields in them and then send them back to the server.
The server checks the correctness of the updated orders. The following fields must be filled:
file:///C:/Users/Administrator/AppData/Local/Temp/~hh4BC4.htm 7/17/2025
Manager API Page 363 of 464
• IMTOrder::Login
• IMTOrder::Symbol
• IMTOrder::Type
• IMTOrder::Digits
• IMTOrder::DigitsCurrency
• IMTOrder::ContractSize
• IMTOrder::VolumeInitial
• IMTOrder::VolumeCurrent
• IMTOrder::PriceOrder
• IMTOrder::State
• IMTOrder::TimeSetupMsc
• IMTOrder::TimeDone or IMTOrder::TimeDoneMsc (for closed orders)
To improve performance, it is recommended to create arrays and perform group operations separately for each trading account.
IMTManagerAPI::OrderUpdateBatchArray
Update multiple orders in a server database.
C++
MTAPIRES IMTManagerAPI::OrderUpdateBatchArray(
IMTOrder** order, // Array of orders
const UINT orders_total, // Number of orders in the array
MTAPIRES* results // Array of results
)
.NET
MTRetCode CIMTManagerAPI.OrderUpdateBatchArray(
CIMTOrder[] orders, // Array of orders
MTRetCode[] retcodes // Array of results
)
Parameters
orders
[in] A pointer to the array of orders.
orders_total
[in] The number of orders in the 'orders' array.
results
[out] An array with order update results. The size of the 'results' array must not be less than that of 'orders'.
Return Value
The MT_RET_OK response code indicates that all orders have been updated. The MT_RET_ERR_PARTIAL response code means that only some of the orders have been updated.
Analyze the 'results' array for more details concerning the execution results. The result of update of each order from the 'orders' array is added to 'results'. The index of a result
corresponds to the index of an order in the source array.
Note
Orders can only be updated from the applications connected to the trade server, on which the orders have been created. For all other applications, the response code
MT_RET_ERR_NOTMAIN is returned. If the object is not found, the response code MT_RET_ERR_NOTFOUND is returned.
All required fields of orders must be filled in, not only the ones which you want to change It is recommended that you first receive orders from the server, change the required
fields in them and then send them back to the server.
The server checks the correctness of the updated orders. The following fields must be filled:
• IMTOrder::Login
• IMTOrder::Symbol
• IMTOrder::Type
• IMTOrder::Digits
• IMTOrder::DigitsCurrency
• IMTOrder::ContractSize
• IMTOrder::VolumeInitial
• IMTOrder::VolumeCurrent
• IMTOrder::PriceOrder
• IMTOrder::State
• IMTOrder::TimeSetupMsc
• IMTOrder::TimeDone or IMTOrder::TimeDoneMsc (for closed orders)
To improve performance, it is recommended to create arrays and perform group operations separately for each trading account.
IMTManagerAPI::OrderDelete
Deletes a trade order.
C++
MTAPIRES IMTManagerAPI::OrderDelete(
const UINT64 ticket // Order number
)
.NET
MTRetCode CIMTManagerAPI.OrderDelete(
ulong ticket // Order number
)
Python
file:///C:/Users/Administrator/AppData/Local/Temp/~hh4BC4.htm 7/17/2025
Manager API Page 364 of 464
ManagerAPI.OrderDelete(
ticket # Order number
)
Parameters
ticket
[in] Order number.
Return Value
An indication of successful completion is the MT_RET_OK response code. Otherwise, an error code will be returned.
Note
An order can only be deleted from the applications connected to the trade server, on which the order has been created. For all other applications the response code
MT_RET_ERR_NOTMAIN will be returned. If the object is not found, the response code MT_RET_ERR_NOTFOUND will be returned.
The manager account requires the RIGHT_TRADE_DELETE and RIGHT_TRADES_MANAGER permissions in order to use the function.
IMTManagerAPI::OrderDeleteBatch
Delete orders from the server database in bulk.
C++
MTAPIRES IMTManagerAPI::OrderDeleteBatch(
const UINT64* tickets, // Array of tickets
const UINT tickets_total, // Number of tickets in the array
MTAPIRES* results // Array of results
)
.NET
MTRetCode CIMTManagerAPI.OrderDeleteBatch(
ulong[] tickets, // Deal ticket
MTRetCode[] retcodes // Array of results
)
Python
ManagerAPI.OrderDeleteBatch(
tickets # Deal ticket
)
Parameters
tickets
[in] A pointer to an array of tickets of the orders which you want to delete.
tickets_total
[in] The number of tickets in the 'tickets' array.
results
[out] The array with the order deletion results. The size of the 'results' array must not be less than that of 'tickets'.
Return Value
The MT_RET_OK response code indicates that all orders have been deleted. The MT_RET_ERR_PARTIAL response code means that only some of the orders have been deleted.
Analyze the 'results' array for more details concerning the execution results. The result of deletion of each order from the 'tickets' array is added to 'results'. The result index
corresponds to the ticket index in the source array.
Note
Orders can only be deleted from the applications connected to the trade server, on which the orders have been created. For all other applications, the response code
MT_RET_ERR_NOTMAIN is returned. If the object is not found, the response code MT_RET_ERR_NOTFOUND is returned.
Bulk deletion is executed faster than deletion of the same number of orders in a cycle one by one, using IMTManagerAPI::OrderDelete. The acceleration can be especially
noticeable when deleting orders belonging to one account.
To improve performance, it is recommended to create arrays and perform group operations separately for each trading account.
IMTManagerAPI::OrderCancel
Move an open trading order to history.
C++
MTAPIRES IMTManagerAPI::OrderCancel(
const UINT64 ticket // order ticket
)
.NET
MTRetCode CIMTManagerAPI.OrderCancel(
ulong ticket // order number
)
Python
ManagerAPI.OrderCancel(
ticket # order number
)
Parameters
ticket
[in] Order number (ticket).
Return Value
The MT_RET_OK response code indicates success. Otherwise, an error code will be returned.
Note
file:///C:/Users/Administrator/AppData/Local/Temp/~hh4BC4.htm 7/17/2025
Manager API Page 365 of 464
When an order is transferred, its state changes to IMTOrder::ORDER_STATE_CANCELED. Such orders are not executed or triggered, and no margin is charged for them.
An order can be moved only from the plugins running on the same trade server where the order was created. For all other plugins, the response code MT_RET_ERR_NOTMAIN will
be returned. If the object is not found, the response code MT_RET_ERR_NOTFOUND will be returned.
IMTManagerAPI::OrderCancelBatch
Move multiple open order to history.
C++
MTAPIRES IMTManagerAPI::OrderCancelBatch(
const UINT64* tickets, // array of tickets
const UINT tickets_total, // number of tickets in the array
MTAPIRES* results // array of results
)
.NET
MTRetCode CIMTManagerAPI.OrderCancelBatch(
ulong[] tickets, // deal ticket
MTRetCode[] retcodes // array of results
)
Python
ManagerAPI.OrderCancelBatch(
tickets # deal ticket
)
Parameters
tickets
[in] A pointer to an array of order tickets which you want to move to history.
tickets_total
[in] The number of tickets in the 'tickets' array.
results
[out] An array with the order transferring result. The size of the 'results' array must not be less than that of 'tickets'.
Return Value
The MT_RET_OK response code indicates that all specified accounts have been moved to history. The MT_RET_ERR_PARTIAL response code means that only some of the orders
have been moved. Analyze the 'results' array for a detailed information on execution results. The result of transfer of each order from the 'tickets' array is added to 'results'. The
result index corresponds to the ticket index in the source array.
Note
When an order is transferred, its state changes to IMTOrder::ORDER_STATE_CANCELED. Such orders are not executed or triggered, and no margin is charged for them.
An order can be moved only from the plugins running on the same trade server where the orders were created. For all other plugins, the response code MT_RET_ERR_NOTMAIN
will be returned. If the object is not found, the response code MT_RET_ERR_NOTFOUND will be returned.
The bulk transfer is executed faster than moving the same number of orders in a loop one by one, using IMTManagerAPI::OrderCancel. The acceleration can be especially
noticeable when moving orders belonging to one account.
To improve performance, it is recommended to create arrays and perform group operations separately for each trading account.
IMTManagerAPI::HistoryRequest
Request from the server the client's closed orders (history) in the specified date range.
C++
MTAPIRES IMTManagerAPI::HistoryRequest(
const UINT64 login, // Login
const INT64 from, // Beginning of period
const INT64 to, // End of period
IMTOrderArray* orders // Array of orders
)
.NET
MTRetCode CIMTManagerAPI.HistoryRequest(
ulong login, // Login
long from, // Beginning of period
long to, // End of period
CIMTOrderArray orders // Array of orders
)
Python
ManagerAPI.HistoryRequest(
login, # Login
from, # Beginning of period
to # End of period
)
Parameters
login
[in] The login of the client, whose orders you need to get.
from
[in] The beginning of the period you want to receive orders for. The date is specified in seconds that have elapsed since 01.01.1970.
to
[in] The end of the period for which you need to get orders. The date is specified in seconds that have elapsed since 01.01.1970.
orders
[out] An object of the array of orders. The orders object must be first created using the IMTManagerAPI::OrderCreateArray method.
file:///C:/Users/Administrator/AppData/Local/Temp/~hh4BC4.htm 7/17/2025
Manager API Page 366 of 464
Return Value
An indication of successful completion is the MT_RET_OK response code. Otherwise, an error code will be returned.
Note
This method cannot be called from event handlers (any methods of IMT*Sink classes).
The method was previously called OrderRequestHistory.
IMTManagerAPI::HistoryRequestByGroup
Request from the server closed orders (history) related to a client group.
C++
MTAPIRES IMTManagerAPI::HistoryRequestByGroup(
LPCWSTR group, // Group
const INT64 from, // Beginning of the period
const INT64 to, // End of the period
IMTOrderArray* orders // Object of the orders array
)
.NET
MTRetCode CIMTManagerAPI.HistoryRequestByGroup(
string mask, // Group
long from, // Beginning of the period
long to, // End of the period
CIMTOrderArray orders // Object of the orders array
)
Python
ManagerAPI.HistoryRequestByGroup(
mask, # Group
from, # Beginning of the period
to # End of the period
)
ManagerAPI.HistoryRequestByGroupCSV(
mask, # Group
from, # Beginning of the period
to, # End of the period
fields # Comma-separated list of required fields
)
ManagerAPI.HistoryRequestByGroupNumPy(
mask, # Group
from, # Beginning of the period
to, # End of the period
fields # Comma-separated list of required fields
)
Parameters
group
[in] The groups for which the orders are requested. You can specify one group, several groups (comma separated) or a group mask. The mask is specified using "*" (any value)
and "!" (exception). For example: "demo*,!demoforex" - all groups with the names beginning with 'demo', except for the group demoforex.
from
[in] The beginning of the period for which you need to receive orders. The date is specified in seconds which have elapsed since 01.01.1970.
to
[in] The end of the period for which you need to receive orders. The date is specified in seconds which have elapsed since 01.01.1970.
orders
[out] An object of the array of orders. The 'orders' object should be first created using the IMTManagerAPI::OrderCreateArray method.
Return Value
An indication of successful completion is the MT_RET_OK response code. Otherwise, an error code will be returned.
Note
The method copies to the 'orders' object the data of all closed orders belonging to clients in the specified groups.
The method cannot be called from event handlers (any IMT*Sink class methods).
IMTManagerAPI::HistoryRequestByGroupSymbol
Request closed orders (history) from the server by group and symbol.
C++
MTAPIRES IMTManagerAPI::HistoryRequestByGroupSymbol(
LPCWSTR group, // group
LPCWSTR symbol, // symbol
const INT64 from, // beginning of period
const INT64 to, // end of period
IMTOrderArray* orders // order array object
)
.NET
MTRetCode CIMTManagerAPI.HistoryRequestByGroupSymbol(
string mask, // group
string symbol, // symbol
long from, // beginning of period
long to, // end of period
CIMTOrderArray orders // order array object
)
file:///C:/Users/Administrator/AppData/Local/Temp/~hh4BC4.htm 7/17/2025
Manager API Page 367 of 464
Python
ManagerAPI.HistoryRequestByGroupSymbol(
mask, # group
symbol, # symbol
from, # beginning of period
to # end of period
)
ManagerAPI.HistoryRequestByGroupSymbolCSV(
mask, # group
symbol, # symbol
from, # beginning of period
to, # end of period
fields # comma-separated list of required fields
)
ManagerAPI.HistoryRequestByGroupSymbolNumPy(
mask, # group
symbol, # symbol
from, # beginning of period
to, # end of period
fields # comma-separated list of required fields
)
Parameters
group
[in] The groups for which the orders are requested. You can specify one group, several groups (comma separated) or a group mask. The mask is specified using characters
"*" (any value) and "!" (exception). For example: "demo*,!demoforex" - all groups whose names begin with 'demo', except for the group demoforex.
symbol
[in] The symbol, for which you wish to get orders.
from
[in] The beginning of the period for which you need to get orders. The date is specified in seconds since 01.01.1970.
to
[in] The end of the period for which you need to get orders. The date is specified in seconds since 01.01.1970.
orders
[out] An object of the array of orders. The 'orders' object should be first created using the IMTManagerAPI::OrderCreateArray method.
Return Value
An indication of successful completion is the MT_RET_OK response code. Otherwise, an error code will be returned.
Note
The method cannot be called from event handlers (any IMT*Sink class methods).
IMTManagerAPI::HistoryRequestByLogins
Request from the server the closed orders (history) related to the list of logins.
C++
MTAPIRES IMTManagerAPI::HistoryRequestByLogins(
const UINT64* logins, // Logins
const UINT logins_total, // Number of logins
const INT64 from, // Beginning of the period
const INT64 to, // End of the period
IMTOrderArray* orders // Object of the orders array
)
.NET
MTRetCode CIMTManagerAPI.HistoryRequestByLogins(
ulong[] logins, // Logins
long from, // Beginning of the period
long to, // End of the period
CIMTOrderArray orders // Object of the orders array
)
Python
ManagerAPI.HistoryRequestByLogins(
logins, # Logins
from, # Beginning of the period
to # End of the period
)
ManagerAPI.HistoryRequestByLoginsCSV(
logins, # Logins
from, # Beginning of the period
to, # End of the period
fields # Comma-separated list of required fields
)
ManagerAPI.HistoryRequestByLoginsNumPy(
logins, # Logins
from, # Beginning of the period
to, # End of the period
fields # Comma-separated list of required fields
)
Parameters
logins
[in] Array of client logins.
logins_total
[in] Number of logins in the 'logins' array.
from
[in] The beginning of the period for which you need to receive orders. The date is specified in seconds which have elapsed since 01.01.1970.
file:///C:/Users/Administrator/AppData/Local/Temp/~hh4BC4.htm 7/17/2025
Manager API Page 368 of 464
to
[in] The end of the period for which you need to receive orders. The date is specified in seconds which have elapsed since 01.01.1970.
orders
[out] An object of the array of orders. The 'orders' object should be first created using the IMTManagerAPI::OrderCreateArray method.
Return Value
An indication of successful completion is the MT_RET_OK response code. Otherwise, an error code will be returned.
Note
The method copies to the 'orders' object the data of all closed orders belonging to the specified accounts.
The method cannot be called from event handlers (any IMT*Sink class methods).
IMTManagerAPI::HistoryRequestByLoginsSymbol
Request closed orders (history) from the server by list of logins and symbol.
C++
MTAPIRES IMTManagerAPI::HistoryRequestByLoginsSymbol(
const UINT64* logins, // logins
const UINT logins_total, // number of logins
const INT64 from, // beginning of period
const INT64 to, // end of period
IMTOrderArray* orders // order array object
)
.NET
MTRetCode CIMTManagerAPI.HistoryRequestByLoginsSymbol(
ulong[] logins, // logins
string symbol, // symbol
long from, // beginning of period
long to, // end of period
CIMTOrderArray orders // order array object
)
Python
ManagerAPI.HistoryRequestByLoginsSymbol(
logins, # logins
symbol, # symbol
from, # beginning of period
to # end of period
)
ManagerAPI.HistoryRequestByLoginsSymbolCSV(
logins, # logins
symbol, # symbol
from, # beginning of period
to, # end of period
fields # comma-separated list of required fields
)
ManagerAPI.HistoryRequestByLoginsSymbolNumPy(
logins, # logins
symbol, # symbol
from, # beginning of period
to, # end of period
fields # comma-separated list of required fields
)
Parameters
logins
[in] Array of client logins.
logins_total
[in] Number of logins in the 'logins' array.
symbol
[in] The symbol, for which you wish to get orders.
from
[in] The beginning of the period for which you need to get orders. The date is specified in seconds since 01.01.1970.
to
[in] The end of the period for which you need to get orders. The date is specified in seconds since 01.01.1970.
orders
[out] An object of the array of orders. The 'orders' object should be first created using the IMTManagerAPI::OrderCreateArray method.
Return Value
An indication of successful completion is the MT_RET_OK response code. Otherwise, an error code will be returned.
Note
The method cannot be called from event handlers (any IMT*Sink class methods).
IMTManagerAPI::HistoryRequestByTickets
Request from the server the closed orders (history) related to the list of tickets.
C++
file:///C:/Users/Administrator/AppData/Local/Temp/~hh4BC4.htm 7/17/2025
Manager API Page 369 of 464
MTAPIRES IMTManagerAPI::HistoryRequestByTickets(
const UINT64* tickets, // Tickets
const UINT tickets_total,// Number of tickets
IMTOrderArray* orders // Array of orders
)
.NET
MTRetCode CIMTManagerAPI.HistoryRequestByTickets(
ulong[] tickets, // Tickets
CIMTOrderArray orders // Array of orders
)
Python
ManagerAPI.HistoryRequestByTickets(
tickets # Tickets
)
ManagerAPI.HistoryRequestByTicketsCSV(
tickets, # Tickets
fields # Comma-separated list of required fields
)
ManagerAPI.HistoryRequestByTicketsNumPy(
tickets, # Tickets
fields # Comma-separated list of required fields
)
Parameters
tickets
[in] List of position tickets.
tickets_total
[in] The number of tickets in the 'tickets' array.
orders
[out] An object of the array of orders. The 'orders' object should be first created using the IMTManagerAPI::OrderCreateArray method.
Return Value
An indication of successful completion is the MT_RET_OK response code. Otherwise, an error code will be returned.
Note
This method copies data of orders with the specified tickets to the 'orders' object.
The method cannot be called from event handlers (any IMT*Sink class methods).
IMTManagerAPI::HistoryRequestPage
Request from the server client's closed orders (history) in a paged form.
C++
MTAPIRES IMTManagerAPI::HistoryRequestPage(
const UINT64 login, // login
const INT64 from, // beginning of period
const INT64 to, // end of period
const UINT offset, // order index
const UINT total, // number of orders
IMTOrderArray* orders // array of orders
)
.NET
MTRetCode CIMTManagerAPI.HistoryRequestPage(
ulong login, // login
long from, // beginning of period
long to, // end of period
uint offset, // order index
uint total, // number of orders
CIMTOrderArray orders // array of orders
)
Python
ManagerAPI.HistoryRequestPage(
login, # login
from, # beginning of period
to, # end of period
offset, # order index
total # number of orders
)
ManagerAPI.HistoryRequestPageCSV(
login, # login
from, # beginning of period
to, # end of period
offset, # order index
total, # number of orders
fields # comma-separated list of required fields
)
ManagerAPI.HistoryRequestPageNumPy(
login, # login
from, # beginning of period
to, # end of period
offset, # order index
total, # number of orders
fields # comma-separated list of required fields
)
Parameters
login
[in] The login of the client, whose orders you need to get.
file:///C:/Users/Administrator/AppData/Local/Temp/~hh4BC4.htm 7/17/2025
Manager API Page 370 of 464
from
[in] The beginning of the period for which you need to get orders. The date is specified in seconds since 01.01.1970.
to
[in] The end of the period for which you need to get orders. The date is specified in seconds since 01.01.1970.
offset
[in] The index of the order starting from which you need to get orders. Numbering starts from 0.
total
[in] The number of orders that should be obtained.
orders
[out] An object of the array of orders. The 'orders' object must be previously created using the IMTManagerAPI::OrderCreateArray method.
Return Value
An indication of successful completion is the MT_RET_OK response code. Otherwise, an error code will be returned.
Note
This method allows to easily arrange a paged output of resulting orders. Determine the number of orders that should be displayed on one page by setting it in the 'total'
parameter. Then find the 'offset' parameter for each page, starting with 0 for the first page.
The method cannot be called from event handlers (any IMT*Sink class methods).
Deals
Using the functions, you can view a server database of deals. The following functions are available for working with deals:
Function Purpose
DealCreate Create an object of a deal.
DealCreateArray Create an object of the array of deals.
DealSubscribe Subscribe to events associated with changes in the database of deals.
DealUnsubscribe Unsubscribe from the events associated with changes in the database of deals.
DealRequest Get a deal by a ticket and login.
DealRequestByGroup Receive deals related to a group of accounts.
DealRequestByGroupSymbol Get deals by group and symbol.
DealRequestByLogins Receive deals by the list of logins.
DealRequestByLoginsSymbol Get deals by a list of logins and symbol.
DealRequestByTickets Receive deals by the list of tickets.
DealRequestPage Get client deals with a paged output.
DealAdd Add a deal to the server database.
DealAddBatch Add a batch of deals to the server database.
DealAddBatchArray Add a batch of deals to the server database.
DealUpdate Update a deal.
DealUpdateBatch Update deals in a server database in bulk.
DealUpdateBatchArray Update deals in a server database in bulk.
DealDelete Delete a deal.
DealDeleteBatch Delete deals from the server database in bulk.
DealPerform Perform a deal on the client's account. This method performs a market buy or sell operation on the account as if it were performed by the
client through the terminal.
DealPerformBatch Perform multiple deals on the client's account. This method performs market buy or sell operations on the account as if they were performed
by the client through the terminal.
DealPerformBatchArray Perform multiple deals on the client's account. This method performs market buy or sell operations on the account as if they were performed
by the client through the terminal.
IMTManagerAPI::DealCreate
Create an object of a deal.
C++
IMTDeal* IMTManagerAPI::DealCreate()
.NET
CIMTDeal CIMTManagerAPI.DealCreate()
Return Value
It returns a pointer to the created object that implements the IMTDeal interface. In case of failure, it returns NULL.
Note
The created object must be deleted by calling the IMTDeal::Release method of this object.
file:///C:/Users/Administrator/AppData/Local/Temp/~hh4BC4.htm 7/17/2025
Manager API Page 371 of 464
IMTManagerAPI::DealCreateArray
Create an object of the array of deals.
C++
IMTDealArray* IMTManagerAPI::DealCreateArray()
.NET
CIMTDealArray CIMTManagerAPI.DealCreateArray()
Return Value
It returns a pointer to the created object that implements the IMTDealArray interface. In case of failure, it returns NULL.
Note
The created object must be deleted by calling the IMTDealArray::Release method of this object.
IMTManagerAPI::DealSubscribe
Subscribe to events associated with changes in the database of deals.
C++
MTAPIRES IMTManagerAPI::DealSubscribe(
IMTDealSink* sink // A pointer to the IMTDealSink object
)
.NET
MTRetCode CIMTManagerAPI.DealSubscribe(
CIMTDealSink sink // CIMTDealSink object
)
Python
ManagerAPI.DealSubscribe(
sink # IMTDealSink object
)
Parameters
sink
[in] A pointer to the object that implements the IMTDealSink interface.
Return Value
An indication of successful completion is the MT_RET_OK response code. Otherwise, an error has occurred that corresponds to the response code.
Note
Subscribing to events is thread safe. One and the same interface IMTDealSink cannot subscribe to an event twice - in this case the response code MT_RET_ERR_DUPLICATE is
returned.
To receive IMTDealSink::OnDealSync events, subscribe before calling the IMTManagerAPI::Connect method.
The object at which sink points, must remain in the memory (must not be removed) until the call of IMTManagerAPI::DealUnsubscribe or until the manager interface is deleted
using the IMTManagerAPI::Release method.
To receive events connected with deal database changes, the pumping mode IMTManagerAPI::PUMP_MODE_ORDERS and IMTManagerAPI::PUMP_MODE_POSITIONS must be enabled.
IMTManagerAPI::DealUnsubscribe
Unsubscribe from the events associated with changes in the database of deals.
C++
MTAPIRES IMTManagerAPI::DealUnsubscribe(
IMTDealSink* sink // A pointer to the IMTDealSink object
)
.NET
MTRetCode CIMTManagerAPI.DealUnsubscribe(
CIMTDealSink sink // CIMTDealSink object
)
Python
ManagerAPI.DealUnsubscribe(
sink # IMTDealSink object
)
Parameters
sink
[in] A pointer to the object that implements the IMTDealSink interface.
Return Value
An indication of successful completion is the MT_RET_OK response code. Otherwise, an error has occurred that corresponds to the response code.
Note
This is a pair method to IMTManagerAPI::DealSubscribe. If an attempt is made to unsubscribe from the interface to which it has not subscribed, MT_RET_ERR_NOTFOUND error is
returned.
file:///C:/Users/Administrator/AppData/Local/Temp/~hh4BC4.htm 7/17/2025
Manager API Page 372 of 464
IMTManagerAPI::DealRequest
Get a deal by a ticket.
C++
MTAPIRES IMTManagerAPI::DealRequest(
const UINT64 ticket, // The ticket of a deal
IMTDeal* deal // An object of a deal
)
.NET
MTRetCode CIMTManagerAPI.DealRequest(
ulong ticket, // The ticket of a deal
CIMTDeal deal // An object of a deal
)
Python
ManagerAPI.DealRequest(
ticket # The ticket of a deal
)
Parameters
ticket
[in] The number (ticket) of a deal.
deal
[out] An object of a deal. The deal object must be first created using the IMTManagerAPI::DealCreate method.
Return Value
An indication of successful completion is the MT_RET_OK response code. Otherwise, an error has occurred that corresponds to the response code.
Note
This method copies the data of a deal with the specified ticket to the deal object.
This method cannot be called from event handlers (any methods of IMT*Sink classes).
IMTManagerAPI::DealRequest
Get the deals of a client in the specified date range.
C++
MTAPIRES IMTManagerAPI::DealRequest(
const UINT64 login, // Login
const INT64 from, // Beginning of period
const INT64 to, // End of period
IMTDealArray* deals // An object of the array of deals
)
.NET
MTRetCode CIMTManagerAPI.DealRequest(
ulong login, // Login
long from, // Beginning of period
long to, // End of period
CIMTDealArray deals // An object of the array of deals
)
Python
ManagerAPI.DealRequest(
login, # Login
from, # Beginning of period
to # End of period
)
Parameters
login
[in] The login of the client, whose deals you need to get.
from
[in] The beginning of the period for which you need to get deals. The date is specified in seconds that have elapsed since 01.01.1970.
to
[in] The end of the period for which you need to get deals. The date is specified in seconds that have elapsed since 01.01.1970.
deals
[out] An object of the array of deals. The deals object must be first created using the IMTManagerAPI::DealCreateArray method.
Return Value
An indication of successful completion is the MT_RET_OK response code. Otherwise, an error has occurred that corresponds to the response code.
Note
This method cannot be called from event handlers (any methods of IMT*Sink classes).
IMTManagerAPI::DealRequestByGroup
Receive deals related to a group of accounts.
C++
file:///C:/Users/Administrator/AppData/Local/Temp/~hh4BC4.htm 7/17/2025
Manager API Page 373 of 464
MTAPIRES IMTManagerAPI::DealRequestByGroup(
LPCWSTR group, // Group
const INT64 from, // Beginning of the period
const INT64 to, // End of the period
IMTDealArray* deals // Array of deals
)
.NET
MTRetCode CIMTManagerAPI.DealRequestByGroup(
string mask, // Group
long from, // Beginning of the period
long to, // End of the period
CIMTDealArray deals // Array of deals
)
Python
ManagerAPI.DealRequestByGroup(
mask # Group
from, # Beginning of the period
to, # End of the period
)
ManagerAPI.DealRequestByGroupCSV(
mask # Group
from, # Beginning of the period
to, # End of the period
fields # Comma-separated list of required fields
)
ManagerAPI.DealRequestByGroupNumPy(
mask # Group
from, # Beginning of the period
to, # End of the period
fields # Comma-separated list of required fields
)
Parameters
group
[in] The groups for which deals are requested. You can specify one group, several groups (comma separated) or a group mask. The mask is specified using "*" (any value) and
"!" (exception). For example: "demo*,!demoforex" - all groups with the names beginning with 'demo', except for the group demoforex.
from
[in] The beginning of the period for which you need to receive deals. The date is specified in seconds which have elapsed since 01.01.1970.
to
[in] The end of the period for which you need to receive deals. The date is specified in seconds which have elapsed since 01.01.1970.
deals
[out] An object of the deals array. The 'deals' object must be first created using IMTManagerAPI::DealCreateArray.
Return Value
An indication of successful completion is the MT_RET_OK response code. Otherwise, an error has occurred, which corresponds to the response code.
Note
The method copies to the 'deals' object data of all deals, which belong to clients in the specified groups and which were executed in the specified time range.
The method cannot be called from event handlers (any IMT*Sink class methods).
IMTManagerAPI::DealRequestByGroupSymbol
Get deals by group and symbol.
C++
MTAPIRES IMTManagerAPI::DealRequestByGroupSymbol(
LPCWSTR group, // group
LPCWSTR symbol, // symbol
const INT64 from, // beginning of period
const INT64 to, // end of period
IMTDealArray* deals // array of deals
)
.NET
MTRetCode CIMTManagerAPI.DealRequestByGroupSymbol(
string mask, // group
string symbol, // symbol
long from, // beginning of period
long to, // end of period
CIMTDealArray deals // array of deals
)
Python
ManagerAPI.DealRequestByGroupSymbol(
mask, # group
symbol, # symbol
from, # beginning of period
to # end of period
)
ManagerAPI.DealRequestByGroupSymbolCSV(
mask, # group
symbol, # symbol
from, # beginning of period
to, # end of period
fields # comma-separated list of required fields
)
file:///C:/Users/Administrator/AppData/Local/Temp/~hh4BC4.htm 7/17/2025
Manager API Page 374 of 464
ManagerAPI.DealRequestByGroupSymbolNumPy(
mask, # group
symbol, # symbol
from, # beginning of period
to, # end of period
fields # comma-separated list of required fields
)
Parameters
group
[in] The groups for which deals are requested. You can specify one group, several groups (comma separated) or a group mask. The mask is specified using characters "*" (any
value) and "!" (exception). For example: "demo*,!demoforex" - all groups whose names begin with 'demo', except for the group demoforex.
symbol
[in] The symbol for which you need to get deals.
from
[in] The beginning of the period for which you need to get deals. The date is specified in seconds since 01.01.1970.
to
[in] The end of the period for which you need to receive deals. The date is specified in seconds since 01.01.1970.
deals
[out] An object of the deals array. The 'deals' object must be first created using IMTManagerAPI::DealCreateArray.
Return Value
An indication of successful completion is the MT_RET_OK response code. Otherwise, an error has occurred that corresponds to the response code.
Note
The method cannot be called from event handlers (any IMT*Sink class methods).
IMTManagerAPI::DealRequestByLogins
Receive deals by the list of logins.
C++
MTAPIRES IMTManagerAPI::DealRequestByLogins(
const UINT64* logins, // Logins
const UINT logins_total, // Number of logins
const INT64 from, // Beginning of the period
const INT64 to, // End of the period
IMTDealArray* deals // Array of deals
)
.NET
MTRetCode CIMTManagerAPI.DealRequestByLogins(
ulong[] logins, // Logins
long from, // Beginning of the period
long to, // End of the period
CIMTDealArray deals // Array of deals
)
Python
ManagerAPI.DealRequestByLogins(
logins, # Logins
from, # Beginning of the period
to # End of the period
)
ManagerAPI.DealRequestByLoginsCSV(
logins, # Logins
from, # Beginning of the period
to, # End of the period
fields # Comma-separated list of required fields
)
ManagerAPI.DealRequestByLoginsNumPy(
logins, # Logins
from, # Beginning of the period
to, # End of the period
fields # Comma-separated list of required fields
)
Parameters
logins
[in] Array of client logins.
logins_total
[in] Number of logins in the 'logins' array.
from
[in] The beginning of the period for which you need to receive deals. The date is specified in seconds which have elapsed since 01.01.1970.
to
[in] The end of the period for which you need to receive deals. The date is specified in seconds which have elapsed since 01.01.1970.
deals
[out] An object of the deals array. The 'deals' object must be first created using IMTManagerAPI::DealCreateArray.
Return Value
An indication of successful completion is the MT_RET_OK response code. Otherwise, an error has occurred, which corresponds to the response code.
Note
The method copies to the 'deals' object data of all deals, which belong to the specified accounts and which were executed in the specified time range.
The method cannot be called from event handlers (any IMT*Sink class methods).
file:///C:/Users/Administrator/AppData/Local/Temp/~hh4BC4.htm 7/17/2025
Manager API Page 375 of 464
IMTManagerAPI::DealRequestByLoginsSymbol
Get deals by a list of logins and symbol.
C++
MTAPIRES IMTManagerAPI::DealRequestByLoginsSymbol(
const UINT64* logins, // logins
const UINT logins_total, // number of logins
LPCWSTR symbol, // symbol
const INT64 from, // beginning of period
const INT64 to, // end of period
IMTDealArray* deals // array of deals
)
.NET
MTRetCode CIMTManagerAPI.DealRequestByLoginsSymbol(
ulong[] logins, // logins
string symbol, // symbol
long from, // beginning of period
long to, // end of period
CIMTDealArray deals // array of deals
)
Python
ManagerAPI.DealRequestByLoginsSymbol(
logins, # logins
symbol, # symbol
from, # beginning of period
to # end of period
)
ManagerAPI.DealRequestByLoginsSymbolCSV(
logins, # logins
symbol, # symbol
from, # beginning of period
to, # end of period
fields # comma-separated list of required fields
)
ManagerAPI.DealRequestByLoginsSymbolNumPy(
logins, # logins
symbol, # symbol
from, # beginning of period
to, # end of period
fields # comma-separated list of required fields
)
Parameters
logins
[in] Array of client logins.
logins_total
[in] Number of logins in the 'logins' array.
symbol
[in] The symbol for which you need to get deals.
from
[in] The beginning of the period for which you need to get deals. The date is specified in seconds since 01.01.1970.
to
[in] The end of the period for which you need to receive deals. The date is specified in seconds since 01.01.1970.
deals
[out] An object of the deals array. The 'deals' object must be first created using IMTManagerAPI::DealCreateArray.
Return Value
An indication of successful completion is the MT_RET_OK response code. Otherwise, an error has occurred that corresponds to the response code.
Note
The method cannot be called from event handlers (any IMT*Sink class methods).
IMTManagerAPI::DealRequestByTickets
Receive deals by the list of tickets.
C++
MTAPIRES IMTManagerAPI::DealRequestByTickets(
const UINT64* tickets, // Tickets
const UINT tickets_total,// Number of tickets
IMTDealArray* deals // Array of deals
)
.NET
MTRetCode CIMTManagerAPI.DealRequestByTickets(
ulong[] tickets, // Tickets
CIMTDealArray deals // Array of deals
)
Python
ManagerAPI.DealRequestByTickets(
tickets # Tickets
)
ManagerAPI.DealRequestByTicketsCSV(
tickets, # Tickets
fields # Comma-separated list of required fields
)
file:///C:/Users/Administrator/AppData/Local/Temp/~hh4BC4.htm 7/17/2025
Manager API Page 376 of 464
ManagerAPI.DealRequestByTicketsNumPy(
tickets, # Tickets
fields # Comma-separated list of required fields
)
Parameters
tickets
[in] Array of tickets of the deals which you want to receive.
tickets_total
[in] The number of tickets in the 'tickets' array.
deals
[out] An object of the deals array. The 'deals' object must be first created using IMTManagerAPI::DealCreateArray.
Return Value
An indication of successful completion is the MT_RET_OK response code. Otherwise, an error has occurred, which corresponds to the response code.
Note
The method copies deals with the specified tickets into the 'deals' object.
The method cannot be called from event handlers (any IMT*Sink class methods).
IMTManagerAPI::DealRequestPage
Get client deals with a paged output.
C++
MTAPIRES IMTManagerAPI::DealRequestPage(
const UINT64 login, // login
const INT64 from, // beginning of period
const INT64 to, // end of period
const UINT offset, // deal index
const UINT total, // number of deals
IMTDealArray* deals // object of deals array
)
.NET
MTRetCode CIMTManagerAPI.DealRequestPage(
ulong login, // login
long from, // beginning of period
long to, // end of period
uint offset, // deal index
uint total, // number of deals
CIMTDealArray deals // object of deals array
)
Python
ManagerAPI.DealRequestPage(
login, # login
from, # beginning of period
to, # end of period
offset, # deal index
total # number of deals
)
ManagerAPI.DealRequestPageCSV(
login, # login
from, # beginning of period
to, # end of period
offset, # deal index
total, # number of deals
fields # comma-separated list of required fields
)
ManagerAPI.DealRequestPageNumPy(
login, # login
from, # beginning of period
to, # end of period
offset, # deal index
total, # number of deals
fields # comma-separated list of required fields
)
Parameters
login
[in] The login of the client, whose deals you wish to receive.
from
[in] The beginning of the period for which you wish to receive deals. The date is specified in seconds that have elapsed since 01.01.1970.
to
[in] The end of the period for which you wish to receive deals. The date is specified in seconds that have elapsed since 01.01.1970.
offset
[in] The index of the deal starting from which you wish to receive deals. Numbering starts from 0.
total
[in] The number of deals that should be received.
deals
[out] An object of the deals array. The 'deals' object must be previously created using IMTManagerAPI::DealCreateArray.
Return Value
An indication of successful completion is the MT_RET_OK response code. Otherwise, an error has occurred that corresponds to the response code.
Note
This request allows to easily arrange a paged output of resulting deals. Determine the number of deals that should be displayed on one page by setting it in the 'total' parameter.
Then find the 'offset' parameter for each page, starting with 0 for the first page.
file:///C:/Users/Administrator/AppData/Local/Temp/~hh4BC4.htm 7/17/2025
Manager API Page 377 of 464
The method cannot be called from event handlers (any IMT*Sink class methods).
IMTManagerAPI::DealAdd
Add a deal to the server database.
C++
MTAPIRES IMTManagerAPI::DealAdd(
IMTDeal* deal // Deal object
)
.NET
MTRetCode CIMTManagerAPI.DealAdd(
CIMTDeal deal // Deal object
)
Python
ManagerAPI.DealAdd(
deal # Deal object
)
Parameters
deal
[in] An object of a deal.
Return Value
An indication of successful completion is the MT_RET_OK response code. Otherwise, an error corresponding to the response code has occurred.
Note
A deal can only be added to the database of the server, to which the application is connected.
The manager account requires the RIGHT_TRADE_MANAGER permission in order to use the function.
Use this method very carefully. The deal is added directly to client's trading history. The addition of a deal does not affect the client's balance and positions. Therefore,
IMTAdminAPI::PositionCheck will show that the client's positions do not match the history of deals. Note that further correction of balance (IMTAdminAPI::UserBalanbceCheck)
and positions (IMTAdminAPI::PositionFix) will require a lot of resources and time, because these methods analyze the entire trading history of the client.
The ticket of the deal you are adding (IMTDeal::DealSet) must fall within the deals range on the trading server (IMTConServerTrade::DealsRange*), and it must be greater than
the last used ticket.
Note that the server allocates new tickets starting from the last used ticket in the range. For example, if you create a deal with a ticket of 5000, the server will allocate tickets
5001, 5002, etc. for further deals (even if tickets before 5000 are not busy).
If a deal is added with a zero ticket, the server will assign the ticket automatically.
The deal being added is checked for integrity. The following fields must be filled in that deal:
• IMTDeal::Login (an account with this login must exist on the server)
• IMTDeal::Symbol
• IMTDeal::Action
• IMTDeal::Volume
• IMTDeal::Price
• IMTDeal::TimeMsc
• IMTDeal::Digits
• IMTDeal::DigitsCurrency
• IMTDeal::ContractSize
IMTManagerAPI::DealAddBatch
Add a batch of deals to the server database.
C++
MTAPIRES IMTManagerAPI::DealAddBatch(
IMTDealArray* deals, // Array of deals
MTAPIRES* results // Array of results
)
.NET
MTRetCode CIMTManagerAPI.DealAddBatch(
CIMTDealArray deals, // Array of deals
MTRetCode[] res // Array of results
)
Python
ManagerAPI.DealAddBatch(
deals # Array of deals
)
Parameters
deals
[in] A pointer to the array of deals IMTDealArray.
results
[out] An array with the deal addition results. The size of the 'results' array must not be less than the size of the 'deals' array.
Return Value
The MT_RET_OK response code indicates that all deals have been added. The MT_RET_ERR_PARTIAL response code means that only some of the deals have been added. Analyze
the 'results' array for more details on the execution results. This array features the results of adding of each individual deal from the 'deals' array. The result index corresponds to
the deal index in the source array.
file:///C:/Users/Administrator/AppData/Local/Temp/~hh4BC4.htm 7/17/2025
Manager API Page 378 of 464
Note
Deals can only be added to the database of the server, to which the application is connected.
The manager account requires the RIGHT_TRADE_MANAGER permission in order to use the function.
Use this method very carefully. The deals are added directly to clients' trading histories. The addition of deals does not affect clients' balances and positions. Therefore,
IMTAdminAPI::PositionCheck will show that the clients' positions do not match their history of deals. Note that further correction of balances (IMTAdminAPI::UserBalanbceCheck)
and positions (IMTAdminAPI::PositionFix) will require a lot of resources and time, since these methods analyze clients' entire trading histories.
The tickets of the deals you are adding (IMTDeal::DealSet) must fall within the deals range on the trading server (IMTConServerTrade::DealsRange*), and they must be greater
than the last used ticket.
Note that the server allocates new tickets starting from the last used ticket in the range. For example, if you create a deal with a ticket of 5000, the server will allocate tickets
5001, 5002, etc. for further deals (even if tickets before 5000 are not busy).
If deals are added with zero tickets, the server will assign the tickets automatically.
Deals being added are checked for integrity. The following fields must be filled:
• IMTDeal::Login (an account with this login must exist on the server)
• IMTDeal::Symbol
• IMTDeal::Action
• IMTDeal::Volume
• IMTDeal::Price
• IMTDeal::TimeMsc
• IMTDeal::Digits
• IMTDeal::DigitsCurrency
• IMTDeal::ContractSize
To improve performance, it is recommended to create arrays and perform group operations separately for each trading account.
IMTManagerAPI::DealAddBatchArray
Add a batch of deals to the server database.
C++
MTAPIRES IMTManagerAPI::DealAddBatchArray(
IMTDeal** deals, // Array of deals
const UINT deals_total, // Number of deals in the array
MTAPIRES* results // Array of results
)
.NET
MTRetCode CIMTManagerAPI.DealAddBatchArray(
CIMTDeal[] deals, // Array of deals
MTRetCode[] retcodes // Array of results
)
Parameters
deals
[in] A pointer to the array of deals.
deals_total
[in] The number of deals in the 'deals' array.
results
[out] An array with deal addition results. The size of the 'results' array must not be less than the size of the 'deals' array.
Return Value
The MT_RET_OK response code indicates that all deals have been added. The MT_RET_ERR_PARTIAL response code means that only some of the deals have been added. Analyze
the 'results' array for more details on the execution results. The result of addition of each deal from the 'deals' array is added to 'results'. The result index corresponds to the deal
index in the source array.
Note
Deals can only be added to the database of the server, to which the application is connected.
The manager account requires the RIGHT_TRADE_MANAGER permission in order to use the function.
Use this method very carefully. Deals are added directly to clients' trading histories. The addition of deals does not affect clients' balances and positions. Therefore,
IMTAdminAPI::PositionCheck will show that the clients' positions do not match their history of deals. Note that further correction of balances (IMTAdminAPI::UserBalanbceCheck)
and positions (IMTAdminAPI::PositionFix) will require a lot of resources and time, since these methods analyze clients' entire trading histories.
The tickets of the deals you are adding (IMTDeal::DealSet) must fall within the deals range on the trading server (IMTConServerTrade::DealsRange*), and they must be greater
than the last used ticket.
Note that the server allocates new tickets starting from the last used ticket in the range. For example, if you create a deal with a ticket of 5000, the server will allocate tickets
5001, 5002, etc. for further deals (even if tickets before 5000 are not busy).
If deals are added with zero tickets, the server will assign the tickets automatically.
Deals being added are checked for integrity. The following fields must be filled:
• IMTDeal::Login (an account with this login must exist on the server)
• IMTDeal::Symbol
• IMTDeal::Action
• IMTDeal::Volume
• IMTDeal::Price
• IMTDeal::TimeMsc
• IMTDeal::Digits
• IMTDeal::DigitsCurrency
• IMTDeal::ContractSize
To improve performance, it is recommended to create arrays and perform group operations separately for each trading account.
file:///C:/Users/Administrator/AppData/Local/Temp/~hh4BC4.htm 7/17/2025
Manager API Page 379 of 464
IMTManagerAPI::DealUpdate
Updates a deal.
C++
MTAPIRES IMTManagerAPI::DealUpdate(
IMTDeal* deal // Deal object
)
.NET
MTRetCode CIMTManagerAPI.DealUpdate(
CIMTDeal deal // Deal object
)
Python
ManagerAPI.DealUpdate(
deal # Deal object
)
Parameters
deal
[in] An object of a deal.
Return Value
An indication of successful completion is the MT_RET_OK response code. Otherwise, an error has occurred that corresponds to the response code.
Note
A deal can only be updated from the applications connected to the trade server, on which the deal has been created. For all other applications the response code
MT_RET_ERR_NOTMAIN will be returned. If the object is not found, the response code MT_RET_ERR_NOTFOUND will be returned.
The manager account requires the RIGHT_TRADE_MANAGER permission in order to use the function.
IMTManagerAPI::DealUpdateBatch
Update deals in a server database in bulk.
C++
MTAPIRES IMTManagerAPI::DealUpdateBatch(
IMTDealArray* deals, // Array of deals
MTAPIRES* results // Array of results
)
.NET
MTRetCode CIMTManagerAPI.DealUpdateBatch(
CIMTDealArray deals, // Array of deals
MTRetCode[] res // Array of results
)
Python
ManagerAPI.DealUpdateBatch(
deals # Array of deals
)
Parameters
deals
[in] A pointer to the array of deals IMTDealArray.
results
[out] An array with deal update results. The size of the 'results' array must not be less than that of 'deals'.
Return Value
The MT_RET_OK response code indicates that all deals have been updated. The MT_RET_ERR_PARTIAL response code means that only some of the deals have been updated.
Analyze the 'results' array for more details concerning the execution results. The update result of each deal from the 'deals' array is added to 'results'. The result index
corresponds to the deal index in the source array.
Note
A deal can only be updated from the applications connected to the trade server, on which the deals have been created. For all other applications, the response code
MT_RET_ERR_NOTMAIN is returned. If the object is not found, the response code MT_RET_ERR_NOTFOUND is returned.
Make sure to fill in all the required fields of the deals, not only the ones which you want to change. It is recommended that you first receive deals from the server, change the
required fields in them and then send them back to the server.
The server checks the correctness of the updated deals. The following fields must be filled:
• IMTDeal::Login (an account with this login must exist on the server)
• IMTDeal::Symbol
• IMTDeal::Action
• IMTDeal::Volume
• IMTDeal::Price
• IMTDeal::TimeMsc
• IMTDeal::Digits
• IMTDeal::DigitsCurrency
• IMTDeal::ContractSize
To improve performance, it is recommended to create arrays and perform group operations separately for each trading account.
IMTManagerAPI::DealUpdateBatchArray
file:///C:/Users/Administrator/AppData/Local/Temp/~hh4BC4.htm 7/17/2025
Manager API Page 380 of 464
.NET
MTRetCode CIMTManagerAPI.DealUpdateBatch(
CIMTDeal[] deals, // Array of deals
MTRetCode[] retcodes // Array of results
)
Parameters
deals
[in] A pointer to the array of deals.
deals_total
[in] The number of deals in the 'deals' array.
results
[out] An array with deal update results. The size of the 'results' array must not be less than that of 'deals'.
Return Value
The MT_RET_OK response code indicates that all deals have been updated. The MT_RET_ERR_PARTIAL response code means that only some of the deals have been updated.
Analyze the 'results' array for more details concerning the execution results. The update result of each deal from the 'deals' array is added to 'results'. The result index
corresponds to the deal index in the source array.
Note
A deal can only be updated from the applications connected to the trade server, on which the deals have been created. For all other applications, the response code
MT_RET_ERR_NOTMAIN is returned. If the object is not found, the response code MT_RET_ERR_NOTFOUND is returned.
Make sure to fill in all the required fields of the deals, not only the ones which you want to change. It is recommended that you first receive deals from the server, change the
required fields in them and then send them back to the server.
The server checks the correctness of the updated deals. The following fields must be filled:
• IMTDeal::Login (an account with this login must exist on the server)
• IMTDeal::Symbol
• IMTDeal::Action
• IMTDeal::Volume
• IMTDeal::Price
• IMTDeal::TimeMsc
• IMTDeal::Digits
• IMTDeal::DigitsCurrency
• IMTDeal::ContractSize
To improve performance, it is recommended to create arrays and perform group operations separately for each trading account.
IMTManagerAPI::DealDelete
Deletes a deal.
C++
MTAPIRES IMTManagerAPI::DealDelete(
const UINT64 ticket // The ticket of a deal
)
.NET
MTRetCode CIMTManagerAPI.DealDelete(
ulong ticket // The ticket of a deal
)
Python
ManagerAPI.DealDelete(
ticket # The ticket of a deal
)
Parameters
ticket
[in] The number (ticket) of a deal.
Return Value
An indication of successful completion is the MT_RET_OK response code. Otherwise, an error has occurred that corresponds to the response code.
Note
A deal can only be deleted from the applications connected to the trade server, on which the deal has been created. For all other applications the response code
MT_RET_ERR_NOTMAIN will be returned. If the object is not found, the response code MT_RET_ERR_NOTFOUND will be returned.
The manager account requires the RIGHT_TRADE_DELETE and RIGHT_TRADES_MANAGER permissions in order to use the function.
IMTManagerAPI::DealDeleteBatch
Delete deals from the server database in bulk.
C++
file:///C:/Users/Administrator/AppData/Local/Temp/~hh4BC4.htm 7/17/2025
Manager API Page 381 of 464
MTAPIRES IMTManagerAPI::DealDeleteBatch(
const UINT64* tickets, // Array of tickets
const UINT tickets_total, // Number of tickets in the array
MTAPIRES* results // Array of results
)
.NET
MTRetCode CIMTManagerAPI.DealDeleteBatch(
ulong[] tickets, // Deal ticket
MTRetCode[] res // Array of results
)
Python
ManagerAPI.DealDeleteBatch(
tickets # Deal ticket
)
Parameters
tickets
[in] A pointer to an array of tickets of the deal which you want to delete.
tickets_total
[in] The number of tickets in the 'tickets' array.
results
[out] The array with the deal deletion results. The size of the 'results' array must not be less than that of 'tickets'.
Return Value
The MT_RET_OK response code means that all the specified deals were deleted. The MT_RET_ERR_PARTIAL response code means that only some of the deals have been deleted.
Analyze the 'results' array for more details concerning the execution results. The result of deletion of each deal from the 'tickets' array is added to 'results'. The result index
corresponds to the ticket index in the source array.
Note
A deal can only be deleted from the applications connected to the trade server, on which the deals have been created. For all other applications, the response code
MT_RET_ERR_NOTMAIN is returned. If the object is not found, the response code MT_RET_ERR_NOTFOUND is returned.
Please note that deletion of deals does not affect the client's balance and current positions. Therefore, IMTAdmin::PositionCheck and IMTManagerAPI::UserBalanbceCheckwill
show that the client's positions and balance do not match the relevant deals history.
Bulk deletion is executed faster than deletion of the same number of deals in a cycle one by one, using IMTManagerAPI::DealDelete. The acceleration can be especially noticeable
when deleting deals belonging to one account.
To improve performance, it is recommended to create arrays and perform group operations separately for each trading account.
IMTManagerAPI::DealPerform
Perform a deal on the client's account. This method performs a market buy or sell operation on the account as if it were performed by the client through the terminal. The only
difference is that no trade request and no order is created to perform the deal, and thus routing rules are not applied to the operation. In all other respects, the behavior is the
same: the deal execution result is applied to the position and the account trading state; commission is calculated and charged for the deal in accordance with the relevant account
group settings.
C++
MTAPIRES IMTManagerAPI::DealPerform(
IMTDeal* deal // deal object
)
.NET
MTRetCode CIMTManagerAPI.DealPerform(
CIMTDeal deal // deal object
)
Python
ManagerAPI.DealPerform(
deal # deal object
)
Parameters
deal
[in/out] Deal object. The deal object must be first created using the IMTManagerAPI::DealCreate method.
Return Value
The MT_RET_OK response code means that the deals has been successfully performed. The object of the performed deal from the server database is added to the 'deal' array. If
the deal could not be performed, the method will return the relevant error code.
Note
A deal can only be performed on the account that is opened on the same server to which the application is connected.
The ticket of the deal you are performing (IMTDeal::DealSet) must fall within the deals range on the trading server (IMTConServerTrade::DealsRange*), and it must be greater
than the last used ticket.
Note that the server allocates new tickets starting from the last used ticket in the range. For example, if you create a deal with a ticket of 5000, the server will allocate tickets
5001, 5002, etc. for further deals (even if tickets before 5000 are not busy).
If no ticket is specified in the deal, the server will assign the ticket automatically.
If to execution time (IMTDeal::Time or IMTDeal::TimeMsc) is specified in the deal, the server will automatically assign the current time.
The deal is checked for integrity during the operation execution. The following fields must be filled in that deal:
• IMTDeal::Login
• IMTDeal::Symbol
• IMTDeal::Action (only IMTDeal::DEAL_BUY and IMTDeal::DEAL_SELL values are allowed)
• IMTDeal::Volume
• IMTDeal::Price
• IMTDeal::PositionID (when closing a position on a hedging account)
You can additionally specify individual margin (IMTDeal::RateMargin) and profit (IMTDeal::RateProfit) recalculation rates in the deal. If not specified, calculated rates will be used.
file:///C:/Users/Administrator/AppData/Local/Temp/~hh4BC4.htm 7/17/2025
Manager API Page 382 of 464
If commission (IMTDeal::Commission) is specified in the deal, it will be applied to the client account. However, it does not replace the commission charged in accordance with the
trader's group settings (IMTConGroup::Commission*). Therefore, the commission specified in the deal is summed up with the calculated commission.
The deal profit is always calculated by the server even if you specify it in the IMTDeal::Profit field. If necessary, the server charges the deal commission automatically (in
accordance with the commission settings).
It is not recommended to call the IMTManagerAPI::DealPerform method from the IMTDealSink::OnDealAdd, IMTDealSink::OnDealUpdate and IMTDealSink::OnDealPerform handlers.
An example of closing positions (even if trading is disabled for an instrument)
//+------------------------------------------------------------------+
//| Close client's all positions at the current price |
//+------------------------------------------------------------------+
MTAPIRES CPluginInstance::CloseAll(UINT64 login)
{
IMTPositionArray* positions={0};
IMTDeal* deal_tmp ={0};
IMTPosition* pos_tmp={0};
MTAPIRES res;
//--- check
if(m_api)
{
positions=m_api->PositionCreateArray();
deal_tmp=m_api->DealCreate();
pos_tmp=m_api->PositionCreate();
}
else return(MT_RET_ERR_PARAMS);
//--- get positions
if(res=m_api->PositionGet(login, positions)!=MT_RET_OK)
{
m_api->LoggerOut(MTLogOK, L"PositionGet failed [%d]", res);
return(MT_RET_ERR_PARAMS);
}
else
{
m_api->LoggerOut(MTLogOK, L"client '%I64u' has %d positions, try to close them", login, positions->Total());
//---
for(UINT index=0;index<positions->Total();index++)
{
pos_tmp=positions->Next(index);
if(pos_tmp)
{
//--- fill the deal object
deal_tmp->Login(pos_tmp->Login());
deal_tmp->Symbol(pos_tmp->Symbol());
//--- set the direction of the closing deal depending on the position direction
if(pos_tmp->Action() == IMTPosition::POSITION_BUY)
deal_tmp->Action(IMTDeal::DEAL_SELL);
else
deal_tmp->Action(IMTDeal::DEAL_BUY);
//--- fill other deal parameters
deal_tmp->Volume(pos_tmp->Volume());
deal_tmp->Price(pos_tmp->PriceCurrent());
deal_tmp->PositionID(pos_tmp->Position()); // only filled for hedging accounts
//--- close the position
if(res=m_api->DealPerform(deal_tmp)!=MT_RET_OK)
m_api->LoggerOut(MTLogOK, L"DealPerform failed [%d]", res);
}
}
}
//--- clear the objects
if(positions)
positions->Release();
//--- clear the objects
if(pos_tmp)
pos_tmp->Release();
//--- clear the objects
if(deal_tmp)
deal_tmp->Release();
}
//+------------------------------------------------------------------+
IMTManagerAPI::DealPerformBatch
Perform multiple deals on the client's account. This method performs market buy or sell operations on the account as if they were performed by the client through the terminal.
The only difference is that trade requests and orders are not created to perform the deals, and thus routing rules are not applied to the operations. In all other respects, the
behavior the same: deal execution results are applied to positions and to the account trading state; commissions are calculated and charged for the deals in accordance with the
relevant account group settings.
C++
MTAPIRES IMTManagerAPI::DealPerformBatch(
IMTDealArray* deals, // Array of deals
MTAPIRES* results // Array of results
)
.NET
MTRetCode CIMTManagerAPI.DealPerformBatch(
CIMTDealArray deals, // Array of deals
MTRetCode[] res // Array of results
)
Python
ManagerAPI.DealPerformBatch(
deals # Array of deals
)
Parameters
deals
[in] A pointer to the array of deals IMTDealArray.
results
[out] An array with deal execution results. The size of the 'results' array must not be less than the size of the 'deals' array.
Return Value
file:///C:/Users/Administrator/AppData/Local/Temp/~hh4BC4.htm 7/17/2025
Manager API Page 383 of 464
The MT_RET_OK response code indicates that all the specified deals have been executed. The MT_RET_ERR_PARTIAL response code means that only some of the deals have been
executed. Analyze the 'results' array for more details on the execution results. This array features the results of execution of each individual deal from the 'deals' array. The
result index corresponds to the deal index in the source array.
Note
Deals can only be performed on the account that is opened on the same server to which the application is connected.
The tickets of the deals you are performing (IMTDeal::DealSet) must fall within the deals range on the trading server (IMTConServerTrade::DealsRange*), and they must be
greater than the last used ticket.
Note that the server allocates new tickets starting from the last used ticket in the range. For example, if you create a deal with a ticket of 5000, the server will allocate tickets
5001, 5002, etc. for further deals (even if tickets before 5000 are not busy).
If no ticket is specified in the deal, the server will assign the ticket automatically.
If to execution time (IMTDeal::Time or IMTDeal::TimeMsc) is specified in the deal, the server will automatically assign the current time.
The deal is checked for integrity during the operation execution. The following fields must be filled in that deal:
• IMTDeal::Login
• IMTDeal::Symbol
• IMTDeal::Action (only IMTDeal::DEAL_BUY and IMTDeal::DEAL_SELL values are allowed)
• IMTDeal::Volume
• IMTDeal::Price
• IMTDeal::PositionID (when closing a position on a hedging account)
You can additionally specify individual margin (IMTDeal::RateMargin) and profit (IMTDeal::RateProfit) recalculation rates in the deal. If not specified, calculated rates will be used.
If commission (IMTDeal::Commission) is specified in the deal, it will be applied to the client account. However, it does not replace the commission charged in accordance with the
trader's group settings (IMTConGroup::Commission*). Therefore, the commission specified in the deal is summed up with the calculated commission.
The deal profit is always calculated by the server even if you specify it in the IMTDeal::Profit field. If necessary, the server charges the deal commission automatically (in
accordance with the commission settings).
It is not recommended to call the IMTManagerAPI::DealPerformBatch method from the IMTDealSink::OnDealAdd, IMTDealSink::OnDealUpdate and IMTDealSink::OnDealPerform
handlers.
IMTManagerAPI::DealPerformBatchArray
Perform multiple deals on the client's account. This method performs market buy or sell operations on the account as if they were performed by the client through the terminal.
The only difference is that trade requests and orders are not created to perform the deals, and thus routing rules are not applied to the operations. In all other respects, the
behavior the same: deal execution results are applied to positions and to the account trading state; commissions are calculated and charged for the deals in accordance with the
relevant account group settings.
C++
MTAPIRES IMTManagerAPI::DealPerformBatchArray(
IMTDeal** deals, // Array of deals
const UINT deals_total, // Number of deals in the array
MTAPIRES* results // Array of results
)
.NET
MTRetCode CIMTManagerAPI.DealPerformBatchArray(
CIMTDealArray deals, // Array of deals
MTRetCode[] res // Array of results
)
Parameters
deals
[in] A pointer to the array of deals.
deals_total
[in] The number of deals in the 'deals' array.
results
[out] An array with deal update results. The size of the 'results' array must not be less than the size of the 'deals' array.
Return Value
The MT_RET_OK response code indicates that all the specified deals have been executed. The MT_RET_ERR_PARTIAL response code means that only some of the deals have been
executed. Analyze the 'results' array for more details on the execution results. This array features the results of execution of each individual deal from the 'deals' array. The
result index corresponds to the deal index in the source array.
Note
Deals can only be performed on the account that is opened on the same server to which the application is connected.
The tickets of the deals you are performing (IMTDeal::DealSet) must fall within the deals range on the trading server (IMTConServerTrade::DealsRange*), and they must be
greater than the last used ticket.
Note that the server allocates new tickets starting from the last used ticket in the range. For example, if you create a deal with a ticket of 5000, the server will allocate tickets
5001, 5002, etc. for further deals (even if tickets before 5000 are not busy).
If no ticket is specified in the deal, the server will assign the ticket automatically.
If to execution time (IMTDeal::Time or IMTDeal::TimeMsc) is specified in the deal, the server will automatically assign the current time.
The deal is checked for integrity during the operation execution. The following fields must be filled in that deal:
• IMTDeal::Login
• IMTDeal::Symbol
• IMTDeal::Action (only IMTDeal::DEAL_BUY and IMTDeal::DEAL_SELL values are allowed)
• IMTDeal::Volume
• IMTDeal::Price
• IMTDeal::PositionID (when closing a position on a hedging account)
You can additionally specify individual margin (IMTDeal::RateMargin) and profit (IMTDeal::RateProfit) recalculation rates in the deal. If not specified, calculated rates will be used.
If commission (IMTDeal::Commission) is specified in the deal, it will be applied to the client account. However, it does not replace the commission charged in accordance with the
trader's group settings (IMTConGroup::Commission*). Therefore, the commission specified in the deal is summed up with the calculated commission.
The deal profit is always calculated by the server even if you specify it in the IMTDeal::Profit field. If necessary, the server charges the deal commission automatically (in
accordance with the commission settings).
file:///C:/Users/Administrator/AppData/Local/Temp/~hh4BC4.htm 7/17/2025
Manager API Page 384 of 464
It is not recommended to call the IMTManagerAPI::DealPerformBatchArray method from the IMTDealSink::OnDealAdd, IMTDealSink::OnDealUpdate and IMTDealSink::OnDealPerform
handlers.
Positions
Functions allow to view the database of positions, as well subscribe and unsubscribe from events associated with changes in the database of positions.
The following functions are available for this purpose:
Function Purpose
PositionCreate Create an object of a trade position.
PositionCreateArray Create an object of the array of trade positions.
PositionSubscribe Subscribe to the events associated with changes in the database of positions.
PositionUnsubscribe Unsubscribe from the events associated with changes in the database of positions.
PositionGet Get an open trade position or an array of positions.
PositionGetByGroup Get all currently opened positions for one or several client groups.
PositionGetByLogins Receive open positions by the list of logins.
PositionGetByTicket Get an open trade position by the ticket.
PositionGetByTickets Receive open positions by the list of tickets.
PositionGetBySymbol Receive currently open positions by groups and symbol.
PositionRequest Request from the server open positions by login.
PositionRequestByGroup Request from the server open positions related to a client group.
PositionRequestByGroupSymbol Request open positions from the server by group and symbol.
PositionRequestByLogins Request from the server open positions by the list of logins.
PositionRequestByLoginsSymbol Request open positions from the server by list of logins and symbol.
PositionRequestByTickets Request from the server open positions by the list of tickets.
PositionUpdate Update a position.
PositionUpdateBatch Update positions in a server database in bulk.
PositionUpdateBatchArray Update positions in a server database in bulk.
PositionDelete Delete a position.
PositionDeleteByTicket Delete a position by ticket.
PositionDeleteBatch Delete positions from the server database in bulk.
PositionSplit Split trading positions.
IMTManagerAPI::PositionCreate
Create an object of a trade position.
C++
IMTPosition* IMTManagerAPI::PositionCreate()
.NET
CIMTPosition CIMTManagerAPI.PositionCreate()
Return Value
It returns a pointer to the created object that implements the IMTPosition interface. In case of failure, it returns NULL.
Note
The created object must be deleted by calling the IMTPosition::Release method of this object.
IMTManagerAPI::PositionCreateArray
Create an object of the array of trade positions.
C++
IMTPositionArray* IMTManagerAPI::PositionCreateArray()
.NET
CIMTPositionArray CIMTManagerAPI.PositionCreateArray()
Return Value
It returns a pointer to the created object that implements the IMTPositionArray interface. In case of failure, it returns NULL.
Note
The created object must be destroyed by calling the IMTPositionArray::Release method of this object.
file:///C:/Users/Administrator/AppData/Local/Temp/~hh4BC4.htm 7/17/2025
Manager API Page 385 of 464
IMTManagerAPI::PositionSubscribe
Subscribe to the events associated with changes in the database of positions.
C++
MTAPIRES IMTManagerAPI::PositionSubscribe(
IMTPositionSink* sink // A pointer to the IMTPositionSink object
)
.NET
MTRetCode CIMTManagerAPI.PositionSubscribe(
CIMTPositionSink sink // CIMTPositionSink object
)
Python
ManagerAPI.PositionSubscribe(
sink # IMTPositionSink object
)
Parameters
sink
[in] A pointer to the object that implements the IMTPositionSink interface.
Return Value
An indication of successful completion is the MT_RET_OK response code. Otherwise, an error has occurred that corresponds to the response code.
Note
Subscribing to events is thread safe. One and the same interface IMTPositionSink cannot subscribe to an event twice - in this case the response code MT_RET_ERR_DUPLICATE is
returned.
To receive IMTPositionSink::OnPositionSync events, subscribe before calling the IMTManagerAPI::Connect method.
The object at which sink points, must remain in the memory (must not be removed) until the call of IMTManagerAPI::PositionUnsubscribe or until the administrator interface is
deleted using the IMTManagerAPI::Release method.
To receive events connected with position database changes, the pumping mode IMTManagerAPI::PUMP_MODE_POSITIONS must be enabled.
IMTManagerAPI::PositionUnsubscribe
Unsubscribe from the events associated with changes in the database of positions.
C++
MTAPIRES IMTManagerAPI::PositionUnsubscribe(
IMTPositionSink* sink // A pointer to the IMTPositionSink object
)
.NET
MTRetCode CIMTManagerAPI.PositionUnsubscribe(
CIMTPositionSink sink // CIMTPositionSink object
)
Python
ManagerAPI.PositionUnsubscribe(
sink # IMTPositionSink object
)
Parameters
sink
[in] A pointer to the object that implements the IMTPositionSink interface.
Return Value
An indication of successful completion is the MT_RET_OK response code. Otherwise, an error code will be returned.
Note
This is a pair method to IMTManagerAPI::PositionSubscribe. If an attempt is made to unsubscribe from the interface to which it has not subscribed, MT_RET_ERR_NOTFOUND error
is returned.
IMTManagerAPI::PositionGet
Get an open trade position.
C++
MTAPIRES IMTManagerAPI::PositionGet(
const UINT64 login, // User's login
LPCWSTR symbol, // Symbol
IMTPosition* position // Position object
)
.NET
MTRetCode CIMTManagerAPI.PositionGet(
ulong login, // User's login
string symbol, // Symbol
CIMTPosition position // Position object
)
file:///C:/Users/Administrator/AppData/Local/Temp/~hh4BC4.htm 7/17/2025
Manager API Page 386 of 464
Python
ManagerAPI.PositionGet(
int login, # User's login
str symbol # Symbol
)
Parameters
login
[in] The login of a user whose position should be deleted.
symbol
[in] The symbol, for which you need to get a position.
position
[out] An object of a trade position. The 'position' object must be first created using the IMTManagerAPI::PositionCreate method.
Return Value
An indication of successful completion is the MT_RET_OK response code. Otherwise, an error code will be returned.
Note
This method copies the data of a position of specified client and the specified symbol to the position object. The method is valid only if the
IMTManagerAPI::PUMP_MODE_POSITIONS pumping mode was specified during connection.
To get a position when using the hedging accounting system (EnMarginMode::MARGIN_MODE_RETAIL_HEDGED), use the IMTManagerAPI::PositionGetByTicket method as a position
in that case is identified by the ticket, not by the login and symbol.
IMTManagerAPI::PositionGet
Get an array of open positions of all symbols for the specified login.
C++
MTAPIRES IMTManagerAPI::PositionGet(
const UINT64 login, // User's login
IMTPositionArray* position // An object of the array of positions
)
.NET
MTRetCode CIMTManagerAPI.PositionGet(
ulong login, // User's login
CIMTPositionArray position // An object of the array of positions
)
Python
ManagerAPI.PositionGet(
int login # User's login
)
Parameters
login
[in] The login of a user.
position
[out] An object of the array of trade positions. The position object must be first created using the IMTManagerAPI::PositionArrayCreate method.
Return Value
An indication of successful completion is the MT_RET_OK response code. Otherwise, an error code will be returned.
Note
This method copies the array of positions of a client with the specified login to the position object. The method is valid only if the IMTManagerAPI::PUMP_MODE_POSITIONS
pumping mode was specified during connection.
IMTManagerAPI::PositionGetByGroup
Get all currently opened positions for one or several client groups.
C++
MTAPIRES IMTManagerAPI::PositionGetByGroup(
LPCWSTR mask, // group mask
IMTPositionArray* positions // object of the array of positions
)
.NET
MTRetCode CIMTManagerAPI.PositionGetByGroup(
String^ mask, // group mask
CIMTPositionArray positions // object of the array of positions
)
Python
ManagerAPI.PositionGetByGroup(
mask # group mask
)
ManagerAPI.PositionGetByGroupCSV(
mask, # group mask
fields # comma-separated list of required fields
)
ManagerAPI.PositionGetByGroupNumPy(
mask, # group mask
fields # comma-separated list of required fields
)
Parameters
mask
file:///C:/Users/Administrator/AppData/Local/Temp/~hh4BC4.htm 7/17/2025
Manager API Page 387 of 464
[in] The groups the positions are requested for. You can specify one group, several groups (comma separated) or a group mask. The mask is specified using characters "*" (any
value) and "!" (exception). For example: "demo*,!demoforex" - all groups whose names begin with 'demo', except for the group demoforex.
positions
[out] An object of positions array. The 'positions' object should be first created using IMTManagerAPI::PositionCreateArray.
Return Value
An indication of successful completion is the MT_RET_OK response code. Otherwise, an error code will be returned.
Note
The method copies the data on all open positions belonging to clients in the specified groups to the 'positions' object. The method works only if the
IMTManagerAPI::PUMP_MODE_POSITIONS pumping mode has been specified during the connection.
IMTManagerAPI::PositionGetByLogins
Receive open positions by the list of logins.
C++
MTAPIRES IMTManagerAPI::PositionGetByLogins(
const UINT64* logins, // Logins
const UINT logins_total, // Number of logins
IMTPositionArray* positions // An object of positions array
)
.NET
MTRetCode CIMTManagerAPI.PositionGetByLogins(
ulong[] logins, // Logins
CIMTPositionArray positions // An object of positions array
)
Python
ManagerAPI.PositionGetByLogins(
logins # Logins
)
ManagerAPI.PositionGetByLoginsCSV(
logins, # Logins
fields # Comma-separated list of required fields
)
ManagerAPI.PositionGetByLoginsNumPy(
logins, # Logins
fields # Comma-separated list of required fields
)
Parameters
logins
[in] Array of client logins.
logins_total
[in] Number of logins in the 'logins' array.
positions
[out] An object of positions array. The 'positions' object should be first created using IMTManagerAPI::PositionCreateArray.
Return Value
An indication of successful completion is the MT_RET_OK response code. Otherwise, an error code will be returned.
Note
The method copies to the 'positions' object the data of all open positions belonging to the specified accounts. The method works only if the
IMTManagerAPI::PUMP_MODE_POSITIONS pumping mode has been specified during the connection.
IMTManagerAPI::PositionGetByTicket
Get an open trade position by the ticket.
C++
MTAPIRES IMTManagerAPI::PositionGetByTicket(
const UINT64 ticket, // Ticket
IMTPosition* position // Position object
)
.NET
MTRetCode CIMTManagerAPI.PositionGetByTicket(
ulong ticket, // Ticket
CIMTPosition position // Position object
)
Python
ManagerAPI.PositionGetByTicket(
int ticket # Ticket
)
Parameters
ticket
[in] The ticket of a position. Corresponds to IMTPosition::Position.
position
[out] An object of a trade position. The 'position' object must be first created using the IMTManagerAPI::PositionCreate method.
file:///C:/Users/Administrator/AppData/Local/Temp/~hh4BC4.htm 7/17/2025
Manager API Page 388 of 464
Return Value
An indication of successful completion is the MT_RET_OK response code. Otherwise, an error code will be returned.
Note
This method copies the data of a position with specified ticket to the position object. The method is valid only if the IMTManagerAPI::PUMP_MODE_POSITIONS pumping mode was
specified during connection.
IMTManagerAPI::PositionGetByTickets
Receive open positions by the list of tickets.
C++
MTAPIRES IMTManagerAPI::PositionGetByTickets(
const UINT64* tickets, // Tickets
const UINT tickets_total,// Number of tickets
IMTPositionArray* positions // An array of positions
)
.NET
MTRetCode CIMTManagerAPI.PositionGetByTickets(
ulong[] tickets, // Tickets
CIMTPositionArray positions // An array of positions
)
Python
ManagerAPI.PositionGetByTickets(
tickets # Tickets
)
ManagerAPI.PositionGetByTicketsCSV(
tickets, # Tickets
fields # Comma-separated list of required fields
)
ManagerAPI.PositionGetByTicketsNumPy(
tickets, # Tickets
fields # Comma-separated list of required fields
)
Parameters
tickets
[in] List of position tickets.
tickets_total
[in] The number of tickets in the 'tickets' array.
positions
[out] An object of positions array. The 'positions' object should be first created using IMTManagerAPI::PositionCreateArray.
Return Value
An indication of successful completion is the MT_RET_OK response code. Otherwise, an error code will be returned.
Note
This method copies data of positions with the specified tickets to the 'positions' object. The method works only if the IMTManagerAPI::PUMP_MODE_POSITIONS pumping mode has
been specified during the connection.
IMTManagerAPI::PositionGetBySymbol
Receive open positions by the groups and login.
C++
MTAPIRES IMTManagerAPI::PositionGetBySymbol(
LPCWSTR group, // Group mask
LPCWSTR symbol, // Symbol
IMTPositionArray* positions // Array of positions
)
.NET
MTRetCode CIMTManagerAPI.PositionGetBySymbol(
String^ group, // Group mask
String^ symbol, // Symbol
CIMTPositionArray positions // Array of positions
)
Python
ManagerAPI.PositionGetBySymbol(
group, # Group mask
symbol # Symbol
)
ManagerAPI.PositionGetBySymbolCSV(
group, # Group mask
symbol, # Symbol
fields # Comma-separated list of required fields
)
file:///C:/Users/Administrator/AppData/Local/Temp/~hh4BC4.htm 7/17/2025
Manager API Page 389 of 464
ManagerAPI.PositionGetBySymbolNumPy(
group, # Group mask
symbol, # Symbol
fields # Comma-separated list of required fields
)
Parameters
group
[in] The groups for which the positions are requested. You can specify one group, several groups (comma separated) or a group mask. The mask is specified using characters
"*" (any value) and "!" (exception). For example: "demo*,!demoforex" - all groups with the names beginning with 'demo', except for the group demoforex. The 'nullptr' value
means "all groups".
symbol
[in] The symbol, for which you need to get positions.
positions
[out] An object of positions array. The 'positions' object should be first created using IMTManagerAPI::PositionCreateArray.
Return Value
An indication of successful completion is the MT_RET_OK response code. Otherwise, an error code will be returned.
Note
The method works only if the IMTManagerAPI::PUMP_MODE_POSITIONS pumping mode has been specified during the connection.
IMTManagerAPI::PositionRequest
Request from the server open positions by login.
C++
MTAPIRES IMTManagerAPI::PositionRequest(
const UINT64 login, // User's login
IMTPositionArray* positions // An object of the array of positions
)
.NET
MTRetCode CIMTManagerAPI.PositionRequest(
ulong login, // User's login
CIMTPositionArray positions // An object of the array of positions
)
Python
ManagerAPI.PositionRequest(
int login # User's login
)
Parameters
login
[in] The login of a user.
positions
[out] An object of the array of trade positions. The position object must be first created using the IMTManagerAPI::PositionCreateArray method.
Return Value
An indication of successful completion is the MT_RET_OK response code. Otherwise, an error code will be returned.
Note
This method copies the array of positions of a client with the specified login to the position object.
This method cannot be called from event handlers (any methods of IMT*Sink classes).
IMTManagerAPI::PositionRequestByGroup
Request from the server open positions related to a client group.
C++
MTAPIRES IMTManagerAPI::PositionRequestByGroup(
LPCWSTR group, // Group
IMTPositionArray* positions // An object of positions array
)
.NET
MTRetCode CIMTManagerAPI.PositionRequestByGroup(
string mask, // Group
CIMTPositionArray positions // An object of positions array
)
Python
ManagerAPI.PositionRequestByGroup(
mask # Group
)
ManagerAPI.PositionRequestByGroupCSV(
mask, # Group
fields # An object of positions array
)
ManagerAPI.PositionRequestByGroupNumPy(
mask, # Group
fields # An object of positions array
)
file:///C:/Users/Administrator/AppData/Local/Temp/~hh4BC4.htm 7/17/2025
Manager API Page 390 of 464
Parameters
group
[in] The groups the positions are requested for. You can specify one group, several groups (comma separated) or a group mask. The mask is specified using "*" (any value) and
"!" (exception). For example: "demo*,!demoforex" - all groups with the names beginning with 'demo', except for the group demoforex. The maximum length of the string is 127
characters.
positions
[out] An object of the array of trade positions. The 'position' object must be first created using the IMTManagerAPI::PositionCreateArray method.
Return Value
An indication of successful completion is the MT_RET_OK response code. Otherwise, an error code will be returned.
Note
The method copies to the 'positions' object the data of all open positions belonging to clients in the specified groups.
The method cannot be called from event handlers (any IMT*Sink class methods).
IMTManagerAPI::PositionRequestByGroupSymbol
Request open positions from the server by group and symbol.
C++
MTAPIRES IMTManagerAPI::PositionRequestByGroupSymbol(
LPCWSTR group, // group
LPCWSTR symbol, // symbol
IMTPositionArray* positions // object of positions array
)
.NET
MTRetCode CIMTManagerAPI.PositionRequestByGroupSymbol(
string mask, // group
string symbol, // symbol
CIMTPositionArray positions // object of positions array
)
Python
ManagerAPI.PositionRequestByGroupSymbol(
mask, # group
symbol # symbol
)
ManagerAPI.PositionRequestByGroupSymbolCSV(
mask, # group
symbol, # symbol
fields # comma-separated list of required fields
)
ManagerAPI.PositionRequestByGroupSymbolNumPy(
mask, # group
symbol, # symbol
fields # comma-separated list of required fields
)
Parameters
group
[in] The groups for which the positions are requested. You can specify one group, several groups (comma separated) or a group mask. The mask is specified using characters
"*" (any value) and "!" (exception). For example: "demo*,!demoforex" - all groups whose names begin with 'demo', except for the group demoforex.
symbol
[in] The symbol, for which you need to get positions.
positions
[out] An object of the array of trade positions. The 'position' object must be first created using the IMTManagerAPI::PositionCreateArray method.
Return Value
An indication of successful completion is the MT_RET_OK response code. Otherwise, an error code will be returned.
Note
The method cannot be called from event handlers (any IMT*Sink class methods).
IMTManagerAPI::PositionRequestByLogins
Request from the server open positions by the list of logins.
C++
MTAPIRES IMTManagerAPI::PositionRequestByLogins(
const UINT64* logins, // Logins
const UINT logins_total, // Number of logins
IMTPositionArray* positions // An object of positions array
)
.NET
MTRetCode CIMTManagerAPI.PositionRequestByLogins(
ulong[] logins, // Logins
CIMTPositionArray positions // An object of positions array
)
Python
file:///C:/Users/Administrator/AppData/Local/Temp/~hh4BC4.htm 7/17/2025
Manager API Page 391 of 464
ManagerAPI.PositionRequestByLogins(
logins # Logins
)
ManagerAPI.PositionRequestByLoginsCSV(
logins, # Logins
fields # Comma-separated list of required fields
)
ManagerAPI.PositionRequestByLoginsNumPy(
logins, # Logins
fields # Comma-separated list of required fields
)
Parameters
logins
[in] Array of client logins.
logins_total
[in] Number of logins in the 'logins' array.
positions
[out] An object of positions array. The 'positions' object should be first created using IMTManagerAPI::PositionCreateArray.
Return Value
An indication of successful completion is the MT_RET_OK response code. Otherwise, an error code will be returned.
Note
The method copies to the 'positions' object the data of all open positions belonging to the specified accounts.
The method cannot be called from event handlers (any IMT*Sink class methods).
IMTManagerAPI::PositionRequestByLoginsSymbol
Request open positions from the server by list of logins and symbol.
C++
MTAPIRES IMTManagerAPI::PositionRequestByLoginsSymbol(
const UINT64* logins, // logins
const UINT logins_total, // number of logins
LPCWSTR symbol, // symbol
IMTPositionArray* positions // object of positions array
)
.NET
MTRetCode CIMTManagerAPI.PositionRequestByLoginsSymbol(
ulong[] logins, // logins
string symbol, // symbol
CIMTPositionArray positions // object of positions array
)
Python
ManagerAPI.PositionRequestByLoginsSymbol(
logins, # logins
symbol # symbol
)
ManagerAPI.PositionRequestByLoginsSymbolCSV(
logins, # logins
symbol, # symbol
fields # comma-separated list of required fields
)
ManagerAPI.PositionRequestByLoginsSymbolNumPy(
logins, # logins
symbol, # symbol
fields # comma-separated list of required fields
)
Parameters
logins
[in] Array of client logins.
logins_total
[in] Number of logins in the 'logins' array.
symbol
[in] The symbol, for which you need to get positions.
positions
[out] An object of positions array. The 'positions' object should be first created using IMTManagerAPI::PositionCreateArray.
Return Value
An indication of successful completion is the MT_RET_OK response code. Otherwise, an error code will be returned.
Note
The method cannot be called from event handlers (any IMT*Sink class methods).
IMTManagerAPI::PositionRequestByTickets
Request from the server open positions by the list of tickets.
file:///C:/Users/Administrator/AppData/Local/Temp/~hh4BC4.htm 7/17/2025
Manager API Page 392 of 464
C++
MTAPIRES IMTManagerAPI::PositionRequestByTickets(
const UINT64* tickets, // Tickets
const UINT tickets_total,// Number of tickets
IMTPositionArray* positions // An array of positions
)
.NET
MTRetCode CIMTManagerAPI.PositionRequestByTickets(
ulong[] tickets, // Tickets
CIMTPositionArray positions // An array of positions
)
Python
ManagerAPI.PositionRequestByTickets(
tickets # Tickets
)
ManagerAPI.PositionRequestByTicketsCSV(
tickets, # Tickets
fields # Comma-separated list of required fields
)
ManagerAPI.PositionRequestByTicketsNumPy(
tickets, # Tickets
fields # Comma-separated list of required fields
)
Parameters
tickets
[in] List of position tickets.
tickets_total
[in] The number of tickets in the 'tickets' array.
positions
[out] An object of positions array. The 'positions' object should be first created using IMTManagerAPI::PositionCreateArray.
Return Value
An indication of successful completion is the MT_RET_OK response code. Otherwise, an error code will be returned.
Note
This method copies data of positions with the specified tickets to the 'positions' object.
The method cannot be called from event handlers (any IMT*Sink class methods).
IMTManagerAPI::PositionUpdate
Update a position.
C++
MTAPIRES IMTManagerAPI::PositionUpdate(
IMTPosition* position // Position object
)
.NET
MTRetCode CIMTManagerAPI.PositionUpdate(
CIMTPosition position // Position object
)
Python
ManagerAPI.PositionUpdate(
position # Position object
)
Parameters
position
[in] An object of a trade position.
Return Value
An indication of successful completion is the MT_RET_OK response code. Otherwise, an error code is returned.
Note
A position can only be updated from the applications connected to the trade server, on which the position has been created. For all other applications the response code
MT_RET_ERR_NOTMAIN will be returned. If the object is not found, the response code MT_RET_ERR_NOTFOUND will be returned.
The manager account requires the RIGHT_TRADE_MANAGER permission in order to use the function.
Make sure to fill in all the required fields of the positions, not only the ones which you want to change. It is recommended that you first receive positions from the server, edit
the required fields in them, and then send them back to the server. However, please note that while you are working with the position in the API, the position price may change
on the server, and the previously received IMTPosition::PriceCurrent value may no longer be valid. If you send the value back as is, a price jump can be observed on the client
side: an outdated value will be set for positions, and the price will be updated to the relevant one at the next tick. To avoid such price jumps, retrieve the current symbol price
just before sending position changes to the server, and place it in IMTPosition::PriceCurrent.
IMTManagerAPI::PositionUpdateBatch
Update positions in a server database in bulk.
C++
file:///C:/Users/Administrator/AppData/Local/Temp/~hh4BC4.htm 7/17/2025
Manager API Page 393 of 464
MTAPIRES IMTManagerAPI::PositionUpdateBatch(
IMTPositionArray* position, // Array of positions
MTAPIRES* results // Array of results
)
.NET
MTRetCode CIMTManagerAPI.PositionUpdateBatch(
CIMTPositionArray positions, // Array of positions
MTRetCode[] res // Array of results
)
Python
ManagerAPI.PositionUpdateBatch(
positions # Array of positions
)
Parameters
positions
[in] A pointer to the object of the positions array IMTPositionArray.
results
[out] An array with position update results. The size of the 'results' array must not be less than that of 'positions'.
Return Value
The MT_RET_OK response code indicates that all positions have been updated. The MT_RET_ERR_PARTIAL response code means that only some of the positions have been
updated. Analyze the 'results' array for more details concerning the execution results. The result of update of each position from the 'positions' array is added to 'results'. The
index of a result corresponds to the index of a position in the source array.
Note
Positions can only be updated from the applications connected to the trade server, on which the positions have been created. For all other applications, the response code
MT_RET_ERR_NOTMAIN is returned. If the object is not found, the response code MT_RET_ERR_NOTFOUND is returned.
Make sure to fill in all the required fields of the positions, not only the ones which you want to change. It is recommended that you first receive positions from the server, edit
the required fields in them, and then send them back to the server. However, please note that while you are working with the position in the API, the position price may change
on the server, and the previously received IMTPosition::PriceCurrent value may no longer be valid. If you send the value back as is, a price jump can be observed on the client
side: an outdated value will be set for positions, and the price will be updated to the relevant one at the next tick. To avoid such price jumps, retrieve the current symbol price
just before sending position changes to the server, and place it in IMTPosition::PriceCurrent.
The server checks the correctness of the updated positions. The following fields must be filled:
• IMTPosition::Login (an account with this login must exist on the server)
• IMTPosition::Symbol
• IMTPosition::Action
• IMTPosition::Volume or IMTPosition::VolumeExt
• IMTPosition::PriceOpen
• IMTPosition::Digits
• IMTPosition::DigitsCurrency
• IMTPosition::ContractSize
• IMTPosition::TimeCreate
• IMTPosition::RateMargin
To improve performance, it is recommended to create arrays and perform group operations separately for each trading account.
IMTManagerAPI::PositionUpdateBatchArray
Update positions in a server database in bulk.
C++
MTAPIRES IMTManagerAPI::PositionUpdateBatchArray(
IMTPosition** positions, // An array of positions
const UINT positions_total, // Number of positions in the array
MTAPIRES* results // Array of results
)
.NET
MTRetCode CIMTManagerAPI.PositionUpdateBatchArray(
CIMTPosition[] positions, // Array of positions
MTRetCode[] retcodes // Array of results
)
Parameters
positions
[in] A pointer to the array of positions.
positions_total
[in] The number of positions in the 'positions' array.
results
[out] An array with position update results. The size of the 'results' array must not be less than that of 'positions'.
Return Value
The MT_RET_OK response code indicates that all positions have been updated. The MT_RET_ERR_PARTIAL response code means that only some of the positions have been
updated. Analyze the 'results' array for more details concerning the execution results. The result of update of each position from the 'positions' array is added to 'results'. The
index of a result corresponds to the index of a position in the source array.
Note
Positions can only be updated from the applications connected to the trade server, on which the positions have been created. For all other applications, the response code
MT_RET_ERR_NOTMAIN is returned. If the object is not found, the response code MT_RET_ERR_NOTFOUND is returned.
Make sure to fill in all the required fields of the positions, not only the ones which you want to change. It is recommended that you first receive positions from the server, edit
the required fields in them, and then send them back to the server. However, please note that while you are working with the position in the API, the position price may change
on the server, and the previously received IMTPosition::PriceCurrent value may no longer be valid. If you send the value back as is, a price jump can be observed on the client
side: an outdated value will be set for positions, and the price will be updated to the relevant one at the next tick. To avoid such price jumps, retrieve the current symbol price
just before sending position changes to the server, and place it in IMTPosition::PriceCurrent.
file:///C:/Users/Administrator/AppData/Local/Temp/~hh4BC4.htm 7/17/2025
Manager API Page 394 of 464
The server checks the correctness of the updated positions. The following fields must be filled:
• IMTPosition::Login (an account with this login must exist on the server)
• IMTPosition::Symbol
• IMTPosition::Action
• IMTPosition::Volume or IMTPosition::VolumeExt
• IMTPosition::PriceOpen
• IMTPosition::Digits
• IMTPosition::DigitsCurrency
• IMTPosition::ContractSize
• IMTPosition::TimeCreate
• IMTPosition::RateMargin
To improve performance, it is recommended to create arrays and perform group operations separately for each trading account.
IMTManagerAPI::PositionDelete
Deletes a position.
C++
MTAPIRES IMTManagerAPI::PositionDelete(
IMTPosition* position // Position object
)
.NET
MTRetCode CIMTManagerAPI.PositionDelete(
CIMTPosition position // Position object
)
Python
ManagerAPI.PositionDelete(
position # Position object
)
Parameters
position
[in] The object of the position that you want to delete.
Return Value
An indication of successful completion is the MT_RET_OK response code. Otherwise, an error has occurred that corresponds to the response code.
Note
A position can only be deleted from the applications connected to the trade server, on which the position has been created. For all other applications the response code
MT_RET_ERR_NOTMAIN will be returned. If the object is not found, the response code MT_RET_ERR_NOTFOUND will be returned.
The manager account requires the RIGHT_TRADE_DELETE and RIGHT_TRADES_MANAGER permissions in order to use the function.
IMTManagerAPI::PositionDeleteByTicket
Delete a position by ticket.
C++
MTAPIRES IMTManagerAPI::PositionDeleteByTicket(
UINT64 ticket // Position object
)
.NET
MTRetCode CIMTManagerAPI.PositionDeleteByTicket(
ulong ticket // Position object
)
Python
ManagerAPI.PositionDeleteByTicket(
ticket # Position object
)
Parameters
ticket
[in] The ticket of the position you want to delete.
Return Value
An indication of successful completion is the MT_RET_OK response code. Otherwise, an error has occurred, which corresponds to the response code.
Note
A position can only be deleted from the applications connected to the trade server, on which the position has been created. For all other applications, the response code
MT_RET_ERR_NOTMAIN is returned. If the object is not found, the response code MT_RET_ERR_NOTFOUND is returned.
To be able to use the function, the manager account requires the RIGHT_TRADE_DELETE and RIGHT_TRADES_MANAGER permissions.
IMTManagerAPI::PositionDeleteBatch
file:///C:/Users/Administrator/AppData/Local/Temp/~hh4BC4.htm 7/17/2025
Manager API Page 395 of 464
.NET
MTRetCode CIMTManagerAPI.PositionDeleteBatch(
ulong[] tickets, // Array of tickets
MTRetCode[] retcodes // Array of results
)
Python
ManagerAPI.PositionDeleteBatch(
tickets # Array of tickets
)
Parameters
tickets
[in] A pointer to an array of tickets of the position which you want to delete.
tickets_total
[in] The number of tickets in the 'tickets' array.
results
[out] The array with the position deletion results. The size of the 'results' array must not be less than that of 'tickets'.
Return Value
The MT_RET_OK response code indicates that all positions have been deleted. The MT_RET_ERR_PARTIAL response code means that only some of the positions have been deleted.
Analyze the 'results' array for more details concerning the execution results. The result of deletion of each position from the 'tickets' array is added to 'results'. The result index
corresponds to the ticket index in the source array.
Note
Positions can only be deleted from the applications connected to the trade server, on which the positions have been created. For all other applications, the response code
MT_RET_ERR_NOTMAIN is returned. If the object is not found, the response code MT_RET_ERR_NOTFOUND is returned.
Please note that deletion of positions does not affect the client's current deals. Therefore, IMTAdmin::PositionCheck will show that the client's positions do not match the history
of deals.
Bulk deletion is executed faster than deletion of the same number of positions in a cycle one by one, using IMTManagerAPI::PositionDelete. The acceleration can be especially
noticeable when deleting positions belonging to one account.
To improve performance, it is recommended to create arrays and perform group operations separately for each trading account.
IMTManagerAPI::PositionSplit
Split trading positions. For details please read the MetaTrader 5 Manager Help.
C++
MTAPIRES IMTManagerAPI::PositionSplit(
UINT64* tickets, // Tickets of positions
const UINT tickets_total, // Number of tickets
const double* adjustments, // Balance adjustments
const UINT new_shares, // Number of new shares
const UINT old_shares, // Number of old shares
const UINT round_rule_price, // Price rounding rule
const UINT round_rule_volume, // Volume rounding rule
const UINT flags, // Additional split options
MTAPIRES* results // Array of results
)
.NET
MTRetCode CIMTManagerAPI.PositionSplit(
ulong[] tickets, // Tickets of positions
ulong[] adjustments, // Balance adjustments
uint new_shares, // Number of new shares
uint old_shares, // Number of old shares
uint round_rule_price, // Price rounding rule
uint round_rule_volume, // Volume rounding rule
uint flags, // Additional split options
MTRetCode[] results // Array of results
)
Python
ManagerAPI.PositionSplit(
tickets, # Tickets of positions
adjustments, # Balance adjustments
new_shares, # Number of new shares
old_shares, # Number of old shares
round_rule_price, # Price rounding rule
round_rule_volume, # Volume rounding rule
flags # Additional split options
)
Parameters
tickets
[in] An array of tickets of the positions for which you want to perform the split operation.
ticket_total
[in] The number of tickets in the 'tickets' array.
adjustments
[in] Adjustment calculation mode:
file:///C:/Users/Administrator/AppData/Local/Temp/~hh4BC4.htm 7/17/2025
Manager API Page 396 of 464
• To use custom adjustment values, pass the filled 'double' array. the array must be filled in accordance with the passed array of position tickets.
• If no adjustment should be calculated, pass an array of zeros.
new_shares
[in] Number of new shares. Shares are split/consolidated in a certain ratio, while their prices are also converted accordingly.
old_shares
[in] Number of old shares. Shares are split/consolidated in a certain ratio, while their prices are also converted accordingly.
round_rule_price
[in] The price rounding rule in case the number of digital places of a new price exceeds the value set in the symbol's Digits parameter (IMTConSymbol::Digits). The following
three options are available:
• 0 — standard rounding
• 1 — round down
• 2 — round up
For example, when transforming the price of 35.15 with the ratio of 2:1, we obtain 17.575. When rounded down, the final price is 17.57, when rounded up, it is 17.58. The
"Standard" rounding option (standard rounding to the nearest integer) is available as well. For example, if the Digits is 2, the rounding is performed as follows: 17.234 -> 17.23,
17.235 -> 17.24.
round_rule_volume
[in] The volume rounding rule in case the client will have a fractional number of shares after the split. The following three options are available:
• 0 — standard rounding
• 1 — round down
• 2 — round up
For example, dividing 35 stocks using the 3:2 ratio results in 52.5 stocks. In this case, the number may be rounded down (against a trader) or up (in a trader's favor).
flags
[in] Additional split options as flags:
• 1 — it is recommended to clear trading positions' stop levels to avoid their activation after a split. This can be done by setting flag 1.
• 2 — if the split operation will cause a position volume to become less than one contract, the split operation will be not performed. You can close such positions
automatically by using this flag.
results
[in] An array of each position split results.
Return Value
An indication of successful command setting is the MT_RET_OK response code. Otherwise, a corresponding error code will be returned.
Function Purpose
ChartRequest Request minute bars for a symbol.
ChartDelete Delete a bar by the symbol.
ChartUpdate Change historical data of a symbol.
ChartReplace Full replacement of history data in the specified period with the passed data.
ChartSplit Split the symbol bar history.
Price data is stored on the history server in the form of one minute bars. Larger timeframes are formed on a client side from the minute bars according to the following
principle: bars from the first to the last second of a period are used for calculation. For example, a H1 bar for 13:00 consists of minute bars within the range from 13:00:00 to
13:59:59.
IMTManagerAPI::ChartRequest
Request minute bars for a symbol.
C++
MTAPIRES IMTManagerAPI::ChartRequest(
LPCWSTR symbol, // Symbol
const INT64 from, // Beginning of the period
const INT64 to, // End of the period
MTChartBar*& bars, // Array of bars
UINT& bars_total // Number of received bars
)
.NET
MTChartBar[] CIMTManagerAPI.ChartRequest(
string symbol, // Symbol
long from, // Beginning of the period
long to, // End of the period
MTRetCode res // Response code
)
Python
file:///C:/Users/Administrator/AppData/Local/Temp/~hh4BC4.htm 7/17/2025
Manager API Page 397 of 464
ManagerAPI.ChartRequest(
symbol, # Symbol
from, # Beginning of the period
to # End of the period
)
Parameters
news
[in] The symbol for which you want to request historical data (bars).
from
[in] The beginning of the period for which you need to get data. The date is specified in seconds that have elapsed since 01.01.1970.
to
[in] The end of the period for which you need to get data. The date is specified in seconds that have elapsed since 01.01.1970.
bars
[out] An array of bars (MTChartBar structures).
bars_total
[out] The number of obtained bars.
Return Value
An indication of successful completion is the MT_RET_OK response code. Otherwise, a corresponding error code will be returned.
The MT_RET_OK_NONE code indicates that the access server through which the Manager API application is connected has not yet synchronized data with the historical server. In
this case, you should perform another one or more data queries, making a pause between them.
Note
Price data on a History server is stored as 1-minute bars. Higher timeframes are created on the client side, based on the 1-minute bars according to the general principle: bars
are used from the first to the last second of the period. For example, the one-hour bar for 13:00 consists of 1-minute bars from 13:00:00 to 13:59:59.
The passed array of bars is sorted by the datetime field of the MTChartBar structure.
After use, the 'bars' array must be released using the IMTManagerAPI::Free method.
The manager account performing the request must have the IMTConManager::RIGHT_CFG_SYMBOLS and IMTConManager::RIGHT_CHARTS permissions. In addition, the group, to
which the manager belongs, must have access to the appropriate symbol (IMTConGroup::Symbol*). If the required permissions are not available, the method will return the
MT_RET_ERR_NOTFOUND error.
The method is valid only if the IMTManagerAPI::PUMP_MODE_SYMBOLS pumping mode was specified during connection.
The method cannot be called from event handlers (any IMT*Sink class methods).
IMTManagerAPI::ChartDelete
Delete the bar of a symbol.
C++
MTAPIRES IMTManagerAPI::ChartDelete(
LPCWSTR symbol, // Symbol
const INT64* bars_dates, // Dates of bars to delete
const UINT bars_dates_total // Number of bars to delete
)
.NET
MTRetCode CIMTManagerAPI.ChartDelete(
string symbol, // Symbol
long bars_dates // Dates of bars to delete
)
Python
ManagerAPI.ChartDelete(
symbol, # Symbol
bars_dates # Dates of bars to delete
)
Parameters
symbol
[in] The symbol, for which you want to delete historical data.
bars_dates
[in] Array of dates of bars to be deleted. Specified in seconds since 01.01.1970.
bars_dates_total
[in] Number of dates in the bars_dates array.
Return Value
An indication of successful completion is the MT_RET_OK response code. Otherwise, an error code will be returned.
IMTManagerAPI::ChartUpdate
Change historical data of a symbol.
C++
MTAPIRES IMTManagerAPI::ChartUpdate(
LPCWSTR symbol, // Symbol
const MTChartBar* bars, // Bars to change
const UINT bars_total // The number of bars to change
)
.NET
file:///C:/Users/Administrator/AppData/Local/Temp/~hh4BC4.htm 7/17/2025
Manager API Page 398 of 464
MTRetCode CIMTManagerAPI.ChartUpdate(
string symbol, // Symbol
MTChartBar[] bars // Bars to change
)
Python
ManagerAPI.ChartUpdate(
symbol, # Symbol
bars # Bars to change
)
Parameters
symbol
[in] The symbol, for which you want to update historical data.
bars
[in] Bars you want to update, described by the MTChartBar structure.
bars_total
[in] The number of bars to update.
Return Value
An indication of successful completion is the MT_RET_OK response code. Otherwise, an error code will be returned.
Note
If the bar open price (MTChartBar.open) in the passed structure is equal to 0, this bar will be deleted.
The standard historical data update scheme is to pre-request the available data using the IMTManagerAPI::ChartRequest method, to make changes and then to send the changed
data to the server using the IMTManagerAPI::ChartUpdate method.
IMTManagerAPI::ChartReplace
Completely replace historical data in the specified period by the transmitted data
C++
MTAPIRES IMTManagerAPI::ChartReplace(
LPCWSTR symbol, // Symbol
const INT64 from, // Beginning of the period
const INT64 to, // End of the period
const MTChartBar* bars, // New bars
const UINT bars_total // Number of new bars
)
.NET
MTRetCode CIMTManagerAPI.ChartReplace(
string symbol, // Symbol
long from, // Beginning of the period
long to, // End of the period
MTChartBar[] bars // New bars
)
Python
ManagerAPI.ChartReplace(
symbol, # Symbol
from, # Beginning of the period
to, # End of the period
bars # New bars
)
Parameters
symbol
[in] The symbol, for which you want to update historical data.
from
[in] The beginning date of the period for which you want to replace data. The date is specified in seconds since 01.01.1970.
to
[in] The end date of the period for which you want to replace data. The date is specified in seconds since 01.01.1970.
bars
[in] New bars described by the MTChartBar structure.
bars_total
[in] The number of passed bars.
Return Value
An indication of successful completion is the MT_RET_OK response code. Otherwise, a corresponding error code is returned.
Note
The method completely replaces historical data in the specified time interval with the data passed in the 'bars' parameter.
To delete an existing bar, specify the corresponding time (MTChartBar.datetime) and the zero price (MTChartBar.open) for the bar in the passed MTChartBar structure. If the bar
with the specified time does not exist in the platform, a new bar with a zero price will be added.
IMTManagerAPI::ChartSplit
Split of the symbol's price history. For details please read the MetaTrader 5 Administrator Help.
C++
file:///C:/Users/Administrator/AppData/Local/Temp/~hh4BC4.htm 7/17/2025
Manager API Page 399 of 464
MTAPIRES IMTManagerAPI::ChartSplit(
LPCWSTR symbol, // Symbol
const UINT new_shares, // Number of new shares
const UINT old_shares, // Number of old shares
const UINT rounding_rule, // Rounding rule
const INT64 datetime_from, // Beginning of interval for split
const INT64 datetime_to // End of interval for split
)
.NET
MTRetCode CIMTManagerAPI.ChartSplit(
string symbol, // Symbol
uint new_shares, // Number of new shares
uint old_shares, // Number of old shares
uint rounding_rule, // Rounding rule
long datetime_from, // Beginning of interval for split
long datetime_to // End of interval for split
)
Python
ManagerAPI.ChartSplit(
symbol, # Symbol
new_shares, # Number of new shares
old_shares, # Number of old shares
rounding_rule, # Rounding rule
datetime_from, # Beginning of interval for split
datetime_to # End of interval for split
)
Parameters
symbol
[in] The symbol for which you want to run split.
new_shares
[in] Number of new shares. Shares are split/consolidated in a certain ratio, while their prices are also converted accordingly.
old_shares
[in] Number of old shares. Shares are split/consolidated in a certain ratio, while their prices are also converted accordingly.
rounding_rule
[in] The rounding rule in case the number of digital places of a new price exceeds the value set in the symbol's Digits parameter (IMTConSymbol::Digits). The following three
options are available:
• 0 — standard rounding
• 1 — round down
• 2 — round up
For example, when transforming the price of 35.15 with the ratio of 2:1, we obtain 17.575. When rounded down, the final price is 17.57, when rounded up, it is 17.58. The
"Standard" rounding option (standard rounding to the nearest integer) is available as well. For example, if the Digits is 2, the rounding is performed as follows: 17.234 -> 17.23,
17.235 -> 17.24.
datetime_from
[in] The beginning date of the time interval in which split will be performed. If the parameter is not set, the split will be performed for the entire symbol price history.
datetime_to
[in] The end date of the time interval in which split will be performed. If the parameter is not set, the split will be performed for the entire symbol price history.
Return Value
An indication of successful command sending is the MT_RET_OK response code. Otherwise, an error code will be returned.
Note
The method is asynchronous and receiving of the MT_RET_OK response does not mean that the split has completed. The operation can take a long time.
If a split operation is running on the server has already split the specified tool, calling this method will not interrupt this process and will not start a new split.
The method splits the symbol's bar and tick history.
Function Purpose
TickSubscribe Subscribe to the events associated with changes in the database of price data.
TickUnsubscribe Unsubscribe from the events associated with changes in the database of price data.
TickAdd Add a quote into the price stream.
TickAddBatch Add multiple quotes into the price stream.
TickAddStat Add statistical information about the price.
TickLast Get the last quote of a symbol taking into account spread difference settings for the current manager's group or another specified group.
TickLastRaw Get the last raw quote of a symbol.
TickStat Get statistical information about quotes for the specified symbol.
TickHistoryRequest Get quotes for a symbol in the specified time range.
TickHistoryRequestRaw Get the entire stream of quotes for a symbol (raw and processed prices in accordance with the configuration of the symbol) in the specified time
range.
TickHistoryAdd Add tick data for a symbol.
TickHistoryReplace Full replacement of tick data in the specified period with the passed data.
file:///C:/Users/Administrator/AppData/Local/Temp/~hh4BC4.htm 7/17/2025
Manager API Page 400 of 464
IMTManagerAPI::TickSubscribe
Subscribe to the events associated with changes in the database of price data.
C++
MTAPIRES IMTManagerAPI::TickSubscribe(
IMTTickSink* sink // A pointer to the IMTTickSink object
)
.NET
MTRetCode CIMTManagerAPI.TickSubscribe(
CIMTTickSink sink // CIMTTickSink object
)
Python
ManagerAPI.TickSubscribe(
sink # IMTTickSink object
)
Parameters
sink
[in] A pointer to the object that implements the IMTTickSink interface.
Return Value
An indication of successful completion is the MT_RET_OK response code. Otherwise, an error has occurred, which corresponds to the response code.
Note
The Manager API application only receives ticks for the selected symbols.
Subscribing to events is thread safe. One and the same interface IMTTickSink cannot subscribe to an event twice - in this case the response code MT_RET_ERR_DUPLICATE is
returned.
The object at which sink points, must remain in the memory (must not be removed) until the call of IMTManagerAPI::TickUnsubscribe or until the administrator interface is
deleted using the IMTManagerAPI::Release method.
The subscription to the events associated with price changes works only for the symbols selected using the IMTManagerAPI::SelectedAdd (or for all symbols if they are selected
using IMTManagerAPI::SelectedAddAll).
IMTManagerAPI::TickUnsubscribe
Unsubscribe from the events associated with changes in the database of price data.
C++
MTAPIRES IMTManagerAPI::TickUnsubscribe(
IMTTickSink* sink // A pointer to the IMTTickSink object
)
.NET
MTRetCode CIMTManagerAPI.TickUnsubscribe(
CIMTTickSink sink // CIMTTickSink object
)
Python
ManagerAPI.TickUnsubscribe(
sink # IMTTickSink object
)
Parameters
sink
[in] A pointer to the object that implements the IMTTickSink interface.
Return Value
An indication of successful completion is the MT_RET_OK response code. Otherwise, an error code will be returned.
Note
This is a pair method to IMTManagerAPI::TickSubscribe. If an attempt is made to unsubscribe from the interface to which it has not subscribed, MT_RET_ERR_NOTFOUND error is
returned.
IMTManagerAPI::TickAdd
Add a quote into the price stream.
C++
MTAPIRES IMTManagerAPI::TickAdd(
LPCWSTR symbol, // Symbol
MTTick& tick // Reference to the quote structure
)
.NET
MTRetCode CIMTManagerAPI.TickAdd(
srting symbol, // Symbol
MTTick tick // Quote structure
)
Python
file:///C:/Users/Administrator/AppData/Local/Temp/~hh4BC4.htm 7/17/2025
Manager API Page 401 of 464
ManagerAPI.TickAdd(
symbol, # Symbol
tick # Quote structure
)
Parameters
symbol
[in] The symbol, for which a quote is added. Obsolete parameter, its value is ignored. Can be filled with NULL.
tick
[in] A reference to the structure that describes the tick (MTTick).
Return Value
An indication of successful completion is the MT_RET_OK response code. Otherwise, an error has occurred, which corresponds to the response code.
Note
To execute this function, a manager must have appropriate rights, otherwise the MT_RET_ERR_PERMISSIONS error is returned.
Unlike IMTManagerAPI::TickHistoryAdd, this method adds a quote to the price stream instead of writing it directly to the price history.
The method must not be called the IMTTickSink::OnTick handler.
IMTManagerAPI::TickAddBatch
Add multiple quotes into the price stream.
C++
MTAPIRES IMTManagerAPI::TickAddBatch(
MTTick* ticks, // An array of quotes
ticks_total tick // The number of quotes
)
.NET
MTRetCode CIMTManagerAPI.TickAddBatch(
MTTick[] ticks // An array of quotes
)
Python
ManagerAPI.TickAddBatch(
ticks # An array of quotes
)
Parameters
ticks
[in] An array of MTTick objects describing quotes.
tick
[in] The number of quotes in the 'ticks' array.
Return Value
An indication of successful completion is the MT_RET_OK response code. Otherwise, an error has occurred that corresponds to the response code.
Note
To execute the function, the manager must have the appropriate permission; otherwise the MT_RET_ERR_PERMISSIONS error will be returned.
Unlike IMTManagerAPI::TickHistoryAdd, this method adds quotes into the price stream rather than writing it directly to the price history.
IMTManagerAPI::TickAddStat
Add statistical information about the price.
C++
MTAPIRES IMTManagerAPI::TickAddStat(
MTTick& tick, // Reference to the structure of tick
MTTickStat& stat // Reference to the structure of statistical information
)
.NET
MTRetCode CIMTManagerAPI.TickAddStat(
MTTick tick, // Quote structure
MTTickStat stat // Statistical information structure
)
Python
ManagerAPI.TickAddStat(
tick, # Quote structure
stat # Statistical information structure
)
Parameters
tick
[in] A reference to the structure that describes the tick (MTTick).
stat
[in] A reference to the structure that describes statistical price information (MTTickStat).
Return Value
An indication of successful completion is the MT_RET_OK response code. Otherwise, an error has occurred that corresponds to the response code.
Note
file:///C:/Users/Administrator/AppData/Local/Temp/~hh4BC4.htm 7/17/2025
Manager API Page 402 of 464
To execute this function, a manager must have appropriate rights, otherwise the MT_RET_ERR_PERMISSIONS error is returned.
IMTManagerAPI::TickLast
Get the last quote of a symbol taking into account spread difference settings (IMTConGroupSymbol::SpreadDiff) for the group of the manager account, which is used for Manager
API connection.
C++
MTAPIRES IMTManagerAPI::TickLast(
LPCWSTR symbol, // Symbol
MTTickShort& tick // Reference to the quote structure
)
.NET
MTRetCode CIMTManagerAPI.TickLast(
string symbol, // Symbol
MTTickShort tick // Quotes structure
)
Python
ManagerAPI.TickLast(
symbol # Symbol
)
Parameters
symbol
[in] The symbol, for which you need to get a quote.
tick
[out] A reference to the structure describing the quote (MTTickShort).
Return Value
An indication of successful completion is the MT_RET_OK response code. Otherwise, an error has occurred, which corresponds to the response code.
Note
The symbol for which data are requested must be included into the list of selected symbols.
IMTManagerAPI::TickLast
Get the last quote of a symbol taking into account spread widening settings (IMTConGroupSymbol::SpreadDiff) of the specified group.
C++
MTAPIRES IMTManagerAPI::TickLast(
LPCWSTR symbol, // Symbol
LPCWSTR group, // Group
MTTickShort& tick // Reference to the quote structure
)
.NET
MTRetCode CIMTManagerAPI.TickLast(
string symbol, // Symbol
string group, // Group
out MTTickShort tick // Quote structure
)
Python
ManagerAPI.TickLast(
symbol, # Symbol
group # Group
)
Parameters
symbol
[in] The symbol, for which you need to get a quote.
group
[in] A group, whose spread difference settings are applied to the quote.
tick
[out] A reference to the structure describing the quote (MTTickShort).
Return Value
An indication of successful completion is the MT_RET_OK response code. Otherwise, an error has occurred, which corresponds to the response code.
Note
The symbol for which data are requested must be included into the list of selected symbols.
Example
file:///C:/Users/Administrator/AppData/Local/Temp/~hh4BC4.htm 7/17/2025
Manager API Page 403 of 464
IMTManagerAPI::TickLastRaw
Get the last raw quote of a symbol.
C++
MTAPIRES IMTManagerAPI::TickLastRaw(
LPCWSTR symbol, // Symbol
MTTickShort& tick // Reference to the quote structure
)
.NET
MTRetCode CIMTManagerAPI.TickLastRaw(
string symbol, // Symbol
out MTTickShort tick // Quote structure
)
Python
ManagerAPI.TickLastRaw(
str symbol # Symbol
)
Parameters
symbol
[in] The symbol, for which you need to get a quote.
tick
[out] A reference to the structure describing the quote (MTTickShort).
Return Value
An indication of successful completion is the MT_RET_OK response code. Otherwise, an error has occurred, which corresponds to the response code.
Note
For this method to work, the manager account must have the IMTConManager::RIGHT_QUOTES_RAW permission enabled. If the permission is absent, the error
MT_RET_ERR_PERMISSIONS is returned.
The method returns original quotes provided by the history server. These quotes do not include spread difference settings (IMTConGroupSymbol::SpreadDiff) which are used
either for the current manager or for a client group.
The symbol for which data are requested must be included into the list of selected symbols.
IMTManagerAPI::TickStat
Get statistical information about quotes for the specified symbol.
C++
MTAPIRES IMTManagerAPI::TickStat(
LPCWSTR symbol, // Symbol
MTTickStat& stat // Reference to the structure of statistical information
)
.NET
MTRetCode CIMTManagerAPI.TickStat(
string symbol, // Symbol
out MTTickStat stat // Statistical information structure
)
Python
file:///C:/Users/Administrator/AppData/Local/Temp/~hh4BC4.htm 7/17/2025
Manager API Page 404 of 464
ManagerAPI.TickStat(
symbol # Symbol
)
Parameters
symbol
[in] The symbol, for which you need to get information.
stat
[out] A reference to the structure that describes statistical price information (MTTickStat).
Return Value
An indication of successful completion is the MT_RET_OK response code. Otherwise, an error has occurred that corresponds to the response code.
Note
The symbol for which data are requested must be included into the list of selected symbols.
IMTManagerAPI::TickHistoryRequest
Get quotes for a symbol in the specified time range.
C++
MTAPIRES IMTManagerAPI::TickHistoryRequest(
LPCWSTR symbol, // Symbol
const INT64 from, // Start date
const INT64 to, // End date
MTTickShort*& ticks, // Reference to the array of structures of quotes
UINT& ticks_total // Number of quotes
)
.NET
MTTickShort[] CIMTManagerAPI.TickHistoryRequest(
string symbol, // Symbol
long from, // Start date
long to, // End date
MTRetCode res // Response code
)
Python
ManagerAPI.TickHistoryRequest(
symbol, # Symbol
from, # Start date
to # End date
)
Parameters
news
[in] The name of the symbol, for which you need to get quotes.
from
[in] The start date for requesting quotes. The date is specified in seconds since January 1, 1970.
to
[in] The end date for requesting quotes. The date is specified in seconds since January 1, 1970.
ticks
[out] A reference to the array of structures that describe quotes (MTTickShort).
ticks_total
[out] The total number of received quotes.
Return Value
An indication of a successful execution is the MT_RET_OK response code. Otherwise, an error has occurred, which corresponds to the response code.
Note
After being used, the array of structures MTTickShort must be released using the IMTManagerAPI::Free method.
The method only works with the quotes accepted by the history server in accordance with symbol filtering settings (IMTConSymbol::Filter*). To work with the raw quote stream,
use IMTManagerAPI::TickHistoryRequestRaw.
For the method operation, you should enable the pumping mode IMTManagerAPI::PUMP_MODE_SYMBOL.
This method cannot be called from event handlers (any methods of IMT*Sink classes).
The method was previously called TickRequest.
IMTManagerAPI::TickHistoryRequestRaw
Get the entire stream of quotes for a symbol (raw and processed prices in accordance with the configuration of the symbol) in the specified time range.
C++
MTAPIRES IMTManagerAPI::TickHistoryRequestRaw(
LPCWSTR symbol, // Symbol
const INT64 from, // Beginning date
const INT64 to, // End date
MTTickShort*& ticks, // Reference to an array of quote structures
UINT& ticks_total // Number of quotes
)
.NET
file:///C:/Users/Administrator/AppData/Local/Temp/~hh4BC4.htm 7/17/2025
Manager API Page 405 of 464
MTTickShort[] CIMTManagerAPI.TickHistoryRequestRaw(
string symbol, // Symbol
long from, // Beginning date
long to, // End date
out MTRetCode res // Response code
)
Python
ManagerAPI.TickHistoryRequestRaw(
symbol # Symbol
from # Beginning date
to # End date
)
Parameters
news
[in] The name of the symbol, for which you need to get quotes.
from
[in] The start date for requesting quotes. The date is specified in seconds since 01.01.1970.
to
[in] The end date for requesting quotes. The date is specified in seconds since 01.01.1970.
ticks
[out] A reference to the array of structures which describe quotes (MTTickShort).
ticks_total
[out] The total number of received quotes.
Return Value
An indication of a successful execution is the MT_RET_OK response code. Otherwise, an error has occurred, which corresponds to the response code.
Note
If the raw quote storing option (IMTConSymbol::TickFlags) is disabled in symbol settings, only the quote which were accepted by the server are received, i.e. the operation is
similar to the IMTManagerAPI::TickHistoryRequest method call.
After using the array of MTTickShort structures must be released using the IMTManagerAPI::Free method.
For the method operation, you should enable the pumping mode IMTManagerAPI::PUMP_MODE_SYMBOL.
The method cannot be called from event handlers (any IMT*Sink class methods).
IMTManagerAPI::TickHistoryAdd
Add tick data of a symbol.
C++
MTAPIRES IMTManagerAPI::TickHistoryAdd(
LPCWSTR symbol, // Symbol
const MTTickShort* ticks, // Ticks to add
const UINT ticks_total // Number of ticks to add
)
.NET
MTRetCode CIMTManagerAPI.TickHistoryAdd(
string symbol, // Symbol
MTTickShort[] ticks // Ticks to add
)
Python
ManagerAPI.TickHistoryAdd(
symbol, # Symbol
ticks # Ticks to add
)
Parameters
symbol
[in] The symbol, for which you want to update tick data.
ticks
[in] Array of MTTickShort structures, describing the ticks to be added.
ticks_total
[in] The number of ticks to add.
Return Value
An indication of successful completion is the MT_RET_OK response code. Otherwise, an error code will be returned.
Note
Unlike IMTManagerAPI::TickAdd, this method directly adds quotes to the price history rather than adding them to the price stream.
IMTManagerAPI::TickHistoryReplace
Completely replace tick data in the specified period by the transmitted data.
C++
MTAPIRES IMTManagerAPI::TickHistoryReplace(
LPCWSTR symbol, // Symbol
const INT64 from_msc, // Beginning of the period
const INT64 to_msc, // End of the period
const MTTickShort* ticks, // New ticks
const UINT ticks_total // Number of new ticks
)
file:///C:/Users/Administrator/AppData/Local/Temp/~hh4BC4.htm 7/17/2025
Manager API Page 406 of 464
.NET
MTRetCode CIMTManagerAPI.TickHistoryReplace(
string symbol, // Symbol
long from_msc, // Beginning of the period
long to_msc, // End of period
MTTickShort[] ticks // New ticks
)
Python
ManagerAPI.TickHistoryReplace(
symbol, # Symbol
from_msc, # Beginning of the period
to_msc, # End of period
ticks # New ticks
)
Parameters
symbol
[in] The symbol, for which you want to update tick data.
from_msc
[in] The beginning date of the period for which you want to replace data. The date is specified in milliseconds since 01.01.1970.
to_msc
[in] The end date of the period for which you want to replace data. The date is specified in milliseconds since 01.01.1970.
ticks
[in] Array of MTTickShort structures which describe new ticks.
ticks_total
[in] The number of passed ticks.
Return Value
An indication of successful completion is the MT_RET_OK response code. Otherwise, an error code will be returned.
Note
The method completely replaces tick data in the specified time interval with the data passed in the 'ticks' parameter.
Function Purpose
MailCreate Create a message in the internal mail system.
MailSubscribe Subscribe to events associated with changes in the mail database.
MailUnsubscribe Undubscribe from events associated with changes in the mail database.
MailTotal Get the total number of emails in the manager's mailbox.
MailNext Get an email by a position in the mailbox.
MailDelete Delete an email by a position in the mailbox.
MailDeleteId Delete an email by an ID.
MailSend Send emails via the internal mail system.
MailBodyRequest Get an email body.
IMTManagerAPI::MailCreate
Create an object of a message in the internal mail system.
C++
IMTMail* IMTManagerAPI::MailCreate()
.NET
CIMTMail CIMTManagerAPI.MailCreate()
Return Value
It returns a pointer to the created object that implements the IMTMail interface. In case of failure, it returns NULL.
Note
The created object must be destroyed by calling the IMTMail::Release method of this object.
IMTManagerAPI::MailSubscribe
Subscribe to events associated with changes in the mail database.
C++
file:///C:/Users/Administrator/AppData/Local/Temp/~hh4BC4.htm 7/17/2025
Manager API Page 407 of 464
MTAPIRES IMTManagerAPI::MailSubscribe(
IMTMailSink* sink // A pointer at the IMTMailSink object
)
.NET
MTRetCode CIMTManagerAPI.MailSubscribe(
CIMTMailSink sink // CIMTMailSink object
)
Parameters
sink
[in] A pointer to the object that implements the IMTMailSink interface.
Return Value
An indication of successful completion is the MT_RET_OK response code. Otherwise, an error has occurred that corresponds to the response code.
Note
Subscribing to events is thread safe. One and the same interface IMTMailSink cannot subscribe to an event twice - in this case the response code MT_RET_ERR_DUPLICATE is
returned.
The object at which sink points, must remain in the memory (must not be removed) until the call of IMTManagerAPI::MailUnsubscribe or until the administrator interface is
deleted using the IMTManagerAPI::Release method.
To receive events connected with mail database changes, the pumping mode IMTManagerAPI::PUMP_MODE_MAIL must be enabled.
IMTManagerAPI::MailUnsubscribe
Undubscribe from events associated with changes in the mail database.
C++
MTAPIRES IMTManagerAPI::MailUnsubscribe(
IMTMailSink* sink // A pointer at the IMTMailSink object
)
.NET
MTRetCode CIMTManagerAPI.MailUnsubscribe(
CIMTMailSink sink // CIMTMailSink object
)
Parameters
sink
[in] A pointer to the object that implements the IMTMailSink interface.
Return Value
An indication of successful completion is the MT_RET_OK response code. Otherwise, an error code will be returned.
Note
This is a pair method IMTManagerAPI::MailSubscribe. If an attempt is made to unsubscribe from the interface to which it has not subscribed, MT_RET_ERR_NOTFOUND error is
returned.
IMTManagerAPI::MailTotal
Get the total number of messages in the manager's mailbox.
C++
UINT IMTManagerAPI::MailTotal()
.NET
uint CIMTManagerAPI.MailTotal()
Return Value
The total number of messages in a mailbox of the manager whose account is used for connecting to the server.
Note
The method is valid only if the IMTManagerAPI::PUMP_MODE_MAIL pumping mode was specified during connection.
IMTManagerAPI::MailNext
Get a mail by a position in the mailbox.
C++
MTAPIRES IMTManagerAPI::MailNext(
const UINT pos, // Mail position
IMTMail* mail // Mail object
)
.NET
MTRetCode CIMTManagerAPI.MailNext(
uint pos, // Mail position
CIMTMail mail // Mail object
)
file:///C:/Users/Administrator/AppData/Local/Temp/~hh4BC4.htm 7/17/2025
Manager API Page 408 of 464
Parameters
pos
[in] Position of a message in a mailbox ranging from 0.
mail
[out] An object of the mail. The mail object must be first created using the IMTManagerAPI::MailCreate method.
Return Value
An indication of successful completion is the MT_RET_OK response code. Otherwise, an error code will be returned.
Note
The method copies data of the mail at the specified position to the mail object. The method is valid only if the IMTManagerAPI::PUMP_MODE_MAIL pumping mode was specified
during connection.
IMTManagerAPI::MailDelete
Delete a mail by a position in the mailbox.
C++
MTAPIRES IMTManagerAPI::MailDelete(
const UINT pos // Position of the mail
)
.NET
MTRetCode CIMTManagerAPI.MailDelete(
uint pos // Position of the mail
)
Parameters
pos
[in] Position of a mail in a mailbox ranging from 0.
Return Value
An indication of successful completion is the MT_RET_OK response code. Otherwise, an error code will be returned.
IMTManagerAPI::MailDeleteId
Delete a mail by an ID.
C++
MTAPIRES IMTManagerAPI::MailDeleteId(
const UINT64 id // Mail ID
)
.NET
MTRetCode CIMTManagerAPI.MailDeleteId(
ulong id // Mail ID
)
Parameters
id
[in] The ID of the email that should be deleted.
Return Value
An indication of successful completion is the MT_RET_OK response code. Otherwise, an error code will be returned.
Note
The IMTMail::Id value is used as the identifier.
IMTManagerAPI::MailSend
Send emails via the internal mail system.
C++
MTAPIRES IMTManagerAPI::MailSend(
IMTMail* mail // Mail object
)
.NET
MTRetCode CIMTManagerAPI.MailSend(
CIMTMail mail // Mail object
)
Python
ManagerAPI.MailSend(
MTMail mail # Mail object
)
Parameters
mail
file:///C:/Users/Administrator/AppData/Local/Temp/~hh4BC4.htm 7/17/2025
Manager API Page 409 of 464
[in] Mail object. The mail object must be first created using the IMTManagerAPI::MailCreate method.
Return Value
An indication of successful completion is the MT_RET_OK response code. Otherwise, an error code will be returned.
Note
Before sending an email, its correctness is checked (presence of its subject and recipient). Sender field is automatically filled with the login of the manager account, which is
used by the Manager API application to connect to the server.
You can use macros in the email body, which allow substituting relevant data depending on the email recipient:
IMTManagerAPI::MailBodyRequest
Get an email body.
C++
MTAPIRES IMTManagerAPI::MailBodyRequest(
const UINT64 id, // email ID
IMTMail* mail // an email object
)
.NET
MTRetCode CIMTManagerAPI.MailBodyRequest(
ulong id, // email ID
CIMTMail mail // an email object
)
Function Purpose
NewsCreate Create an object of a news item.
NewsSubscribe Subscribe to events and hooks associated with changes in the news database.
NewsUnsubscribe Undubscribe from events and hooks associated with changes in the news database.
NewsTotal Get the total number of news items received by the manager.
NewsNext Get the news item received by the manager.
NewsBodyRequest Get the body of the news item received by the manager.
NewsSend Send news.
IMTManagerAPI::NewsCreate
Create an object of a news item.
file:///C:/Users/Administrator/AppData/Local/Temp/~hh4BC4.htm 7/17/2025
Manager API Page 410 of 464
C++
IMTNews* IMTManagerAPI::NewsCreate()
.NET
CIMTNews CIMTManagerAPI.NewsCreate()
Return Value
It returns a pointer to the created object that implements the IMTNews interface. In case of failure, it returns NULL.
Note
The created object must be deleted by calling the IMTManagerAPI::Release method of this object.
IMTManagerAPI::NewsSubscribe
Subscribe to events and hooks associated with changes in the news database.
C++
MTAPIRES IMTManagerAPI::NewsSubscribe(
IMTNewsSink* sink // A pointer to the IMTNewsSink object
)
.NET
MTRetCode CIMTManagerAPI.NewsSubscribe(
CIMTNewsSink sink // CIMTNewsSink object
)
Python
ManagerAPI.NewsSubscribe(
sink # IMTNewsSink object
)
Parameters
sink
[in] A pointer to the object that implements the IMTNewsSink interface.
Return Value
An indication of successful completion is the MT_RET_OK response code. Otherwise, an error has occurred that corresponds to the response code.
Note
Subscribing to events is thread safe. One and the same interface IMTNewsSink cannot subscribe to an event twice - in this case the response code MT_RET_ERR_DUPLICATE is
returned.
The object at which sink points, must remain in the memory (must not be removed) until the call of IMTManagerAPI::NewsUnsubscribe or until the administrator interface is
deleted using the IMTManagerAPI::Release method.
To receive events connected with mews database changes, the pumping mode IMTManagerAPI::PUMP_MODE_NEWS must be enabled.
IMTManagerAPI::NewsUnsubscribe
Undubscribe from events and hooks associated with changes in the news database.
C++
MTAPIRES IMTManagerAPI::NewsUnsubscribe(
IMTNewsSink* sink // A pointer to the IMTNewsSink object
)
.NET
MTRetCode CIMTManagerAPI.NewsUnsubscribe(
CIMTNewsSink sink // CIMTNewsSink object
)
Python
ManagerAPI.NewsUnsubscribe(
sink # IMTNewsSink object
)
Parameters
sink
[in] A pointer to the object that implements the IMTNewsSink interface.
Return Value
An indication of successful completion is the MT_RET_OK response code. Otherwise, an error code will be returned.
Note
This is a pair method to IMTManagerAPI::NewsSubscribe. If an attempt is made to unsubscribe from the interface to which it has not subscribed, MT_RET_ERR_NOTFOUND error is
returned.
IMTManagerAPI::NewsTotal
Get the total number of news items received by the manager.
file:///C:/Users/Administrator/AppData/Local/Temp/~hh4BC4.htm 7/17/2025
Manager API Page 411 of 464
C++
UINT IMTManagerAPI::NewsTotal()
.NET
uint CIMTManagerAPI.NewsTotal()
Python
ManagerAPI.NewsTotal()
Return Value
The total number of news items received by the manager whose account is used for connecting to the server.
Note
The method is valid only if the IMTManagerAPI::PUMP_MODE_NEWS pumping mode was specified during connection.
IMTManagerAPI::NewsNext
Get the news item received by the manager.
C++
MTAPIRES IMTManagerAPI::NewsNext(
const UINT pos, // News position
IMTNews* news // News object
)
.NET
MTRetCode CIMTManagerAPI.NewsNext(
uint pos, // News position
CIMTNews news // News object
)
Python
ManagerAPI.NewsNext(
pos # News position
)
Parameters
pos
[in] Position of the news item received by the manager, ranging from 0.
news
[out] News object. The news object must first be created using the IMTManagerAPI::NewsCreate method.
Return Value
An indication of successful completion is the MT_RET_OK response code. Otherwise, an error code will be returned.
Note
The method copies data of the news item at the specified position to the news object. The method is valid only if the IMTManagerAPI::PUMP_MODE_NEWS pumping mode was
specified during connection.
IMTManagerAPI::NewsBodyRequest
Get the body of the news item received by the manager.
C++
MTAPIRES IMTManagerAPI::NewsBodyRequest(
const UINT64 id, // News ID
IMTNews* news // News object
)
.NET
MTRetCode CIMTManagerAPI.NewsBodyRequest(
ulong id, // News ID
CIMTNews news // News object
)
Python
ManagerAPI.NewsBodyRequest(
id # News ID
)
Parameters
pos
[in] The ID of the news item received by the manager. The IMTNews::Id value is used as the identifier.
news
[out] News object. The news object must first be created using the IMTManagerAPI::NewsCreate method.
Return Value
An indication of successful completion is the MT_RET_OK response code. Otherwise, an error code will be returned.
Note
The method completely fills the 'news' object, i.e. the news body (including attachments), as well as the subject, time, etc.
The method is valid only if the IMTManagerAPI::PUMP_MODE_NEWS pumping mode was specified during connection.
file:///C:/Users/Administrator/AppData/Local/Temp/~hh4BC4.htm 7/17/2025
Manager API Page 412 of 464
The method cannot be called from event handlers (any methods of IMT*Sink classes).
IMTManagerAPI::NewsSend
Send news.
C++
MTAPIRES IMTManagerAPI::NewsSend(
IMTNews* news // News object
)
.NET
MTRetCode CIMTManagerAPI.NewsSend(
CIMTNews news // News object
)
Python
ManagerAPI.NewsSend(
news # News object
)
Parameters
news
[in] News object.
Return Value
An indication of successful completion is the MT_RET_OK response code. Otherwise, an error code will be returned.
Note
Before sending a news item, its correctness is checked (presence of the subject).
Trading Functions
This section contains descriptions of functions, using which you can implement trading activities from an application developed using the MetaTrader 5 Manager API.
Trading functions are divided into the following sections:
Dealing
The Dealing permission (IMTConManager:RIGHT_TRADES_DEALER) allows a manager to handle trade requests received in accordance with the routing rules. Also, this right allows
the manager the perform trade operations.
The dealing procedure:
• After connecting to a server using the IMTManagerAPI::Connect method with the required pumping modes (for orders, positions, accounts, groups and symbols) and starting
dealing using the IMTManagerAPI:DealerStart method, the manager receives the status of the queue of requests forwarded to the manager in accordance with the routing
rules. Next, it will receive the changes of the queue (added, edited and deleted requests) using the methods of the IMTRequestSink interface.
• To capture a request from a queue for processing, methods IMTManagerAPI:DealerGet and IMTManagerAPI:DealerLock are used. A captured request must necessarily be
processed by the dealer using the IMTManagerAPI::DealerAnswer method. In this method, the object request confirmation IMTConfirm is passed, where the dealer specifies
how the request should be executed.
• Once confirmed by a dealer, the request appears on the queue to be executed by the server. The result of request execution can be received based on its identifier
(IMTRequest::ID) using the IMTRequest::Result* methods.
Supervisor
The Supervisor right (IMTConManager:RIGHT_TRADES_SUPERVIOSR) allows a manager to view the entire queue of requests forwarded to him or her from available client groups, and
track the process of request processing by other dealers.
Description of the Supervisor mode:
• After connecting to a server using the IMTManagerAPI::Connect method with the required pumping modes (for orders, positions, accounts, groups and symbols), the manager
receives the status of the queue of requests, which the manager can view in accordance with the client group settings (IMTConManager::Group*).
• Then the manager will receive changes of the queue (added, edited and deleted requests) using the methods of the IMTRequestSink interface. Also, the manager will be able
to get the results of request processing by other dealers using the IMTRequest::Result* methods.
• When switching to the dealing mode using the IMTManagerAPI:DealerStart method, the manager no longer sees the entire queue of requests from client groups available to
him or her. Since then, the manager receives only the requests that are forwarded to him or her for processing in accordance with routing rules. Thus, the manager simply
switches to the dealing mode described above.
Dealing
The MetaTrader 5 Manager API allows performing dealing using a special set of functions. Functions described in this section allow to connect to a queue of requests of a trade
server, select requests from it and process them in accordance with the encoded algorithms.
Functions Purpose
DealerConfirmCreate Create request confirmation interface object.
file:///C:/Users/Administrator/AppData/Local/Temp/~hh4BC4.htm 7/17/2025
Manager API Page 413 of 464
Functions Purpose
DealerUnsubscribe Unsubscribe from waiting for results of trading operations executed by DealerSend commands.
DealerStart Start dealing.
DealerStop Stop dealing.
DealerGet Get the first request in the queue of requests for processing.
DealerLock Get a request with a specified ID for processing.
DealerAnswer Respond to a trade request received for processing using the DealerGet or DealerLock method.
DealerSend Send a trade request to the server.
DealerBalance Conduct balance operations on an account.
DealerBalanceRaw Conduct balance operation on a user account without checking the free margin and the current balance on the account.
IMTManagerAPI::DealerConfirmCreate
Create request confirmation interface object.
C++
IMTConfirm* IMTManagerAPI::DealerConfirmCreate()
.NET
CIMTConfirm CIMTManagerAPI.DealerConfirmCreate()
Return Value
It returns a pointer to the created object that implements the IMTConfirm interface. In case of failure, it returns NULL.
Note
The created object must be destroyed by calling the IMTConfirm::Release method of this object.
IMTManagerAPI::DealerUnsubscribe
Unsubscribe from waiting for results of trading operations executed by IMTManagerAPI::DealerSend commands (by any manager).
C++
MTAPIRES IMTManagerAPI::DealerUnsubscribe(
IMTDealerSink* sink // A pointer to the IMTDealerSink object
)
.NET
MTRetCode CIMTManagerAPI.DealerUnsubscribe(
CIMTDealerSink sink // CIMTDealerSink object
)
Python
ManagerAPI.DealerUnsubscribe(
sink # MTDealerSink object
)
Parameters
sink
[in] A pointer to the object that implements the IMTDealerSink interface.
Return Value
An indication of successful completion is the MT_RET_OK response code. Otherwise, an error has occurred that corresponds to the response code.
IMTManagerAPI::DealerStart
Start dealing.
C++
MTAPIRES IMTManagerAPI::DealerStart()
.NET
MTRetCode CIMTManagerAPI.DealerStart()
Python
ManagerAPI.DealerStart()
Return Value
An indication of successful completion is the MT_RET_OK response code. Otherwise, an error has occurred that corresponds to the response code.
Note
After the execution of this method, the queue of trade requests will be loaded to the application, and events associated with trade requests (OnRequestAdd, OnRequestUpdate,
OnRequestDelete and OnRequestSync) will start arriving.
file:///C:/Users/Administrator/AppData/Local/Temp/~hh4BC4.htm 7/17/2025
Manager API Page 414 of 464
IMTManagerAPI::DealerStop
Stop dealing.
C++
MTAPIRES IMTManagerAPI::DealerStop()
.NET
MTRetCode CIMTManagerAPI.DealerStop()
Python
ManagerAPI.DealerStop()
Return Value
An indication of successful completion is the MT_RET_OK response code. Otherwise, an error has occurred that corresponds to the response code.
IMTManagerAPI::DealerGet
Get the first request in the queue of requests for processing.
C++
MTAPIRES IMTManagerAPI::DealerGet(
IMTRequest* request // An object of a trade request
)
.NET
MTRetCode CIMTManagerAPI.DealerGet(
CIMTRequest request // An object of a trade request
)
Python
MTManagerAPI.DealerGet()
Parameters
request
[out] An object of a trade request. The object must first be created using the IMTManagerAPI::RequestCreate method.
Return Value
An indication of successful completion is the MT_RET_OK response code. Otherwise, an error has occurred that corresponds to the response code.
Note
This method can be used only after calling IMTManagerAPI::DealerStart.
The request obtained with this method is marked by the server as a request passed to a certain manager for processing, which prevents passing the same request to another
manager. hen the server waits till the request is processed using the IMTManagerAPI::DealerAnswer method.
A request received for processing must necessarily be processed, otherwise it will be lost (requests are not returned to the queue). A captured request cannot be returned to the
queue.
IMTManagerAPI::DealerLock
Get a request with a specified ID for processing.
C++
MTAPIRES IMTManagerAPI::DealerLock(
const UINT id, // Trade request ID
IMTRequest* request // An object of a trade request
)
.NET
MTRetCode CIMTManagerAPI.DealerLock(
uint id, // Trade request ID
CIMTRequest request // An object of a trade request
)
Python
MTManagerAPI.DealerLock(
id, # Trade request ID
)
Parameters
id
[in] Trade request ID. The IMTRequest::Id value is used as the identifier.
request
[out] An object of a trade request. The object must first be created using the IMTManagerAPI::RequestCreate method.
Return Value
An indication of successful completion is the MT_RET_OK response code. Otherwise, an error has occurred that corresponds to the response code. Code MT_RET_OK_NONE means
that the request is no longer available on the trade server. For example, it could have been captured by another dealer or application.
file:///C:/Users/Administrator/AppData/Local/Temp/~hh4BC4.htm 7/17/2025
Manager API Page 415 of 464
Note
This method can be used only after calling IMTManagerAPI::DealerStart.
The request obtained with this method is marked by the server as a request passed to a certain manager for processing, which prevents passing the same request to another
manager. hen the server waits till the request is processed using the IMTManagerAPI::DealerAnswer method.
A request received for processing must necessarily be processed, otherwise it will be lost (requests are not returned to the queue).
IMTManagerAPI::DealerAnswer
Respond to a trade request received for processing using the IMTManagerAPI::DealerGet or IMTManagerAPI::DealerLock method.
C++
MTAPIRES IMTManagerAPI::DealerAnswer(
IMTConfirm* confirm // An objet of trade request confirmation
)
.NET
MTRetCode CIMTManagerAPI.DealerAnswer(
CIMTConfirm confirm // An objet of trade request confirmation
)
Python
MTManagerAPI.DealerAnswer(
confirm # An objet of trade request confirmation
)
Parameters
confirm
[in] Filled object of the trade request confirmation.
Return Value
An indication of successful completion is the MT_RET_OK response code. Otherwise, an error has occurred that corresponds to the response code.
Note
This method can be used only after calling IMTManagerAPI::DealerStart.
IMTManagerAPI::DealerSend
Send a trade request to the server.
C++
MTAPIRES IMTManagerAPI::DealerSend(
IMTRequest* request, // An object of a trade request
IMTDealerSink* sink, // A pointer to the IMTDealerSink object
UINT& id // Request ID
)
.NET
MTRetCode CIMTManagerAPI.DealerSend(
CIMTRequest request, // An object of a trade request
CIMTDealerSink sink, // CIMTDealerSink object
out uint id // Request ID
)
Python
ManagerAPI.DealerSend(
request, # объект торгового запроса
sink # MTDealerSink object
)
Parameters
request
[in] An object of a trade request. Only dealer actions (200-255) can be set as a request type in IMTRequest::Action.
sink
[in] A pointer to the object that implements the IMTDealerSink interface, to which the result of trade request execution is passed asynchronously. To unsubscribe from receipt
of the result, the IMTManagerAPI::DealerUnsubscribe method is used. If you don't need any notification, pass nullptr as a value.
id
[out] The ID assigned to the sent request (IMTRequest::IDClient). This ID allows the application to identify its own requests in the stream when receiving the answers from the
trade server in the IMTDealerSink interface. The ID is only unique within the current connection of the application. Requests from several clients/API can have the same IDs.
Therefore, it makes sense to analyze the identifier only from the application which fills it.
Return Value
An indication of successful completion is the MT_RET_OK response code. Otherwise, an error has occurred which corresponds to the response code. The MT_RET_OK response
code only means that the request has successfully been sent to the trade server. The execution result should be tracked in the IMTDealerSink::OnDealerResult or
IMTDealerSink::OnDealerAnswer handlers.
Note
An answer to a trade request is formed in two forms - IMTDealerSink::OnDealerResult and IMTDealerSink::OnDealerAnswer.
Up to 128 requests can be sent to the trade processing queue at a time. If this limit is exceeded, the server will return MT_RET_REQUEST_TOO_MANY error.
file:///C:/Users/Administrator/AppData/Local/Temp/~hh4BC4.htm 7/17/2025
Manager API Page 416 of 464
IMTManagerAPI::DealerBalance
Conduct balance operations on an account.
C++
MTAPIRES IMTManagerAPI::DealerBalance(
const UINT64 login, // Login
const double value, // Amount
const UINT type, // Type of operation
LPCWSTR comment // Comment
UINT64& deal_id // Deal ID
)
.NET
MTRetCode CIMTManagerAPI.DealerBalance(
ulong login, // Login
double value, // Amount
uint type, // Type of operation
string comment // Comment
out ulong deal_id // Deal ID
)
Python
ManagerAPI.DealerBalance(
login, # Login
value, # Amount
type, # Type of operation
comment # Comment
)
Parameters
login
[in] A login for conducting a balance operation.
value
[in] The amount to add or subtract from an account. In order to deposit to the account, specify a positive value; to withdraw, specify a negative value.
type
[in] Type of the balance operation. To pass the type, the following values of the IMTDeal::EnDealAction enumeration are used: DEAL_BALANCE, DEAL_CREDIT, DEAL_CHARGE,
DEAL_CORRECTION, DEAL_BONUS, DEAL_COMMISSION, DEAL_TAX, DEAL_DIVIDEND, DEAL_DIVIDEND_FRANKED.
comment
[in] A comment to a balance operation. The length of the comment is limited to 32 characters (including the end-of-line character). If a string of a greater length is assigned, it
will be cut to this length.
deal_id
[out] The ID of the deal in which a balance operation was executed.
Return Value
An indication of successful completion is the MT_RET_REQUEST_DONE response code. Otherwise, an error has occurred that corresponds to the response code.
Note
Balance operations are represented as deals. The ID of the resulting deal is passed in the deal_id parameter.
In case the deal type is incorrect, the code MT_RET_ERR_PARAMS is returned.
An amount of money accrued/withdrawn with a single operation cannot exceed 1000000000. In case this value is exceeded, the code MT_RET_TRADE_MAX_MONEY is returned.
An amount of withdrawal cannot exceed the current free margin (regardless of the balance operation type). In case this amount is exceeded the code
MT_RET_REQUEST_NO_MONEY is returned.
An amount of withdrawal during a credit operation (TYPE=IMTDeal::DEAL_CREDIT) cannot exceed the amount of previously issued credit assets. In case this amount is exceeded
the code MT_RET_REQUEST_NO_MONEY is returned.
The free margin is not checked during a correction operation (TYPE=IMTDeal::DEAL_CORRECTION). Be careful with withdrawal operations. If the client has open positions, and
you deduct an amount greater than the free margin, Stop Out will trigger on the account.
An amount of withdrawal during any balance operation cannot exceed the current balance. In case this amount is exceeded the code MT_RET_REQUEST_NO_MONEY is returned.
Balance operations can also be conducted by sending IMTRequest::TA_DEALER_BALANCE type requests to the requests queue using the IMTManagerAPI::DealerSend method.
IMTManagerAPI::DealerBalanceRaw
Conduct balance operation on a user account without checking the free margin and the current balance on the account.
C++
MTAPIRES IMTManagerAPI::DealerBalanceRaw(
const UINT64 login, // Login
const double value, // Amount
const UINT type, // Type of operation
LPCWSTR comment // Comment
UINT64& deal_id // Deal ID
)
.NET
MTRetCode CIMTManagerAPI.DealerBalanceRaw(
ulong login, // Login
double value, // Amount
uint type, // Type of operation
string comment // Comment
out ulong deal_id // Deal ID
)
Python
file:///C:/Users/Administrator/AppData/Local/Temp/~hh4BC4.htm 7/17/2025
Manager API Page 417 of 464
MTManagerAPI.DealerBalanceRaw(
login, # Login
value, # Amount
type, # Type of operation
comment # Comment
)
Parameters
login
[in] A login for conducting a balance operation.
value
[in] The amount to add or subtract from an account. In order to deposit to the account, specify a positive value; to withdraw, specify a negative value.
type
[in] Type of the balance operation. To pass the type, the following values of the IMTDeal::EnDealAction enumeration are used: DEAL_BALANCE, DEAL_CREDIT, DEAL_CHARGE,
DEAL_CORRECTION, DEAL_BONUS, DEAL_COMMISSION, DEAL_TAX, DEAL_DIVIDEND, DEAL_DIVIDEND_FRANKED.
comment
[in] A comment to a balance operation. The length of the comment is limited to 32 characters (including the end-of-line character). If a string of a greater length is assigned, it
will be cut to this length.
deal_id
[out] The ID of the deal in which a balance operation was executed.
Return Value
An indication of successful completion is the MT_RET_REQUEST_DONE response code. Otherwise, an error has occurred that corresponds to the response code.
Note
Balance operations are represented as deals. The ID of the resulting deal is passed in the deal_id parameter.
In case the deal type is incorrect, the code MT_RET_ERR_PARAMS is returned.
An amount of money accrued/withdrawn with a single operation cannot exceed 1000000000. In case this value is exceeded, the code MT_RET_TRADE_MAX_MONEY is returned.
Balance operations can also be conducted by sending IMTRequest::TA_DEALER_BALANCE type requests to the requests queue using the IMTManagerAPI::DealerSend method.
Trade Requests
Functions described in this section allow working with the server trade requests queue. They allow to get existing trade requests and subscribe to events associated with changes in
the queue of requests.
The following functions are available for working with trade requests:
Function Purpose
RequestCreate Create an object of a trade request.
RequestCreateArray Create an object of the array of trade requests.
RequestSubscribe Subscribe to events associated with trade requests queue changes.
RequestUnsubscribe Unsubscribe from events associated with requests queue changes.
RequestTotal Get the total amount of trade requests in a requests queue.
RequestNext Get a trade request by a queue position.
RequestGet Get a trade request by ID.
RequestGetAll Get all the trade requests in a queue.
IMTManagerAPI::RequestCreate
Create an object of a trade request.
C++
IMTRequest* IMTManagerAPI::RequestCreate()
.NET
CIMTRequest CIMTManagerAPI.RequestCreate()
Return Value
It returns a pointer to the created object that implements the IMTRequest interface. In case of failure, it returns NULL.
Note
The created object must be destroyed by calling the IMTRequest::Release method of this object.
IMTManagerAPI::RequestCreateArray
Create an object of the array of trade requests.
C++
IMTRequestArray* IMTManagerAPI::RequestCreateArray()
.NET
file:///C:/Users/Administrator/AppData/Local/Temp/~hh4BC4.htm 7/17/2025
Manager API Page 418 of 464
CIMTRequestArray CIMTManagerAPI.RequestCreateArray()
Return Value
It returns a pointer to the created object that implements the IMTRequestArray interface. In case of failure, it returns NULL.
Note
The created object must be destroyed by calling the IMTRequestArray::Release method of this object.
IMTManagerAPI::RequestSubscribe
Subscribe to events associated with trade requests queue changes.
C++
MTAPIRES IMTManagerAPI::RequestSubscribe(
IMTRequestSink* sink // A pointer to the IMTRequestSink object
)
.NET
MTRetCode CIMTManagerAPI.RequestSubscribe(
CIMTRequestSink sink // CIMTRequestSink object
)
Python
ManagerAPI.RequestSubscribe(
sink # IMTRequestSink object
)
Parameters
sink
[in] A pointer to the object that implements the IMTRequestSink interface.
Return Value
An indication of successful completion is the MT_RET_OK response code. Otherwise, an error has occurred that corresponds to the response code.
Note
Subscribing to events is thread safe. One and the same interface IMTRequestSink cannot subscribe to an event twice - in this case the response code MT_RET_ERR_DUPLICATE is
returned.
To receive IMTRequestSink::OnRequestSync events, subscribe before calling the IMTManagerAPI::Connect method.
The object at which sink points, must remain in the memory (must not be removed) until the call of IMTManagerAPI::RequestUnsubscribe or until the administrator interface is
deleted using the IMTManagerAPI::Release method.
IMTManagerAPI::RequestUnsubscribe
Unsubscribe from events associated with requests queue changes.
C++
MTAPIRES IMTManagerAPI::RequestUnsubscribe(
IMTRequestSink* sink // A pointer to the IMTRequestSink object
)
.NET
MTRetCode CIMTManagerAPI.RequestUnsubscribe(
CIMTRequestSink sink // CIMTRequestSink object
)
Python
ManagerAPI.RequestUnsubscribe(
sink # IMTRequestSink object
)
Parameters
sink
[in] A pointer to the object that implements the IMTRequestSink interface.
Return Value
An indication of successful completion is the MT_RET_OK response code. Otherwise, an error code will be returned.
Note
This is a pair method to IMTManagerAPI::RequestSubscribe. If an attempt is made to unsubscribe from the interface to which it has not subscribed, MT_RET_ERR_NOTFOUND error
is returned.
IMTManagerAPI::RequestTotal
Get the total amount of trade requests in a requests queue.
C++
UINT IMTManagerAPI::RequestTotal()
.NET
file:///C:/Users/Administrator/AppData/Local/Temp/~hh4BC4.htm 7/17/2025
Manager API Page 419 of 464
uint CIMTManagerAPI.RequestTotal()
Python
ManagerAPI.RequestTotal()
Return Value
Total amount of trade requests in a requests queue.
Note
To use this method, you must first call IMTManagerAPI::DealerStart.
IMTManagerAPI::RequestNext
Get a trade request by a queue position.
C++
MTAPIRES IMTManagerAPI::RequestNext(
const UINT pos, // Trade request position
IMTRequest* request // An object of a trade request
)
.NET
MTRetCode CIMTManagerAPI.RequestNext(
uint pos, // Trade request position
CIMTRequest request // An object of a trade request
)
Python
ManagerAPI.RequestNext(
pos # Trade request position
)
Parameters
pos
[in] Position of a trade request in a queue, starting with 0.
request
[out] An object of a trade request. The request object must first be created using the IMTManagerAPI::RequestCreate method.
Return Value
An indication of successful completion is the MT_RET_OK response code. Otherwise, an error has occurred that corresponds to the response code.
Note
This method copies trade request data at the specified queue position to the request object. To use this method, you must first call DealerStart.
IMTManagerAPI::RequestGet
Get a trade request by ID.
C++
MTAPIRES IMTManagerAPI::RequestGet(
const UINT id, // Request ID
IMTRequest* request // An object of a trade request
)
.NET
MTRetCode CIMTManagerAPI.RequestGet(
uint id, // Request ID
CIMTRequest request // An object of a trade request
)
Python
ManagerAPI.RequestGet(
id # Request ID
)
Parameters
id
[in] Trade request ID. The IMTRequest::Id value is used as the identifier.
request
[out] An object of a trade request. The request object must first be created using the IMTManagerAPI::RequestCreate method.
Return Value
An indication of successful completion is the MT_RET_OK response code. Otherwise, an error has occurred that corresponds to the response code.
Note
To use this method, you must first call IMTManagerAPI::DealerStart.
IMTManagerAPI::RequestGetAll
Get all the trade requests in a queue.
file:///C:/Users/Administrator/AppData/Local/Temp/~hh4BC4.htm 7/17/2025
Manager API Page 420 of 464
C++
MTAPIRES IMTManagerAPI::RequestGetAll(
IMTRequestArray* requests // An object of the array of requests
)
.NET
MTRetCode CIMTManagerAPI.RequestGetAll(
CIMTRequestArray requests // An object of the array of requests
)
Python
ManagerAPI.RequestGetAll(
requests # An object of the array of requests
)
Parameters
requests
[out] An object of the array of requests. The requests object must first be created using the IMTManagerAPI::RequestCreateArray method.
Return Value
An indication of successful completion is the MT_RET_OK response code. Otherwise, an error has occurred that corresponds to the response code.
Note
This method copies the array of trade requests in a queue to the requests object. To use this method, you must first call IMTManagerAPI::DealerStart.
Auxiliary Functions
Functions described in this section are auxiliary. They allow calculating profit and margin requirements for positions as well as calculating conversion rates for currencies.
Functions Purpose
TradeProfit Calculates profit for the specified trading conditions.
TradeProfitExt Calculates profit for the specified trading conditions using extended volume accuracy.
TradeRateBuy Calculates the conversion rate for a Buy trade.
TradeRateSell Calculates the conversion rate for a Sell trade.
TradeMarginCheck Checks the availability of the margin required for the execution of this order.
TradeMarginCheckExt Checks the availability of the margin required for the execution of this order with the indication of increased accuracy volume.
To ensure proper operation of these functions, the Manager API needs to have access to actual quotes of financial instruments used in calculations. To receive quotes of an
instrument, add it to the list of selected symbols using the IMTManagerAPI::SelectedAdd or IMTManagerAPI::SelectedAddAll method. Please note that these methods work
asynchronously, i.e. they only send a request for a subscription to the symbols. The prices do not become available to the application immediately after the call. To make sure that
the application uses actual prices, call auxiliary functions after receiving the IMTTickSink::OnTick event for the corresponding symbol. To receive such events, you need to
subscribe to them using the IMTManagerAPI::TickSubscribe method.
IMTManagerAPI::TradeProfit
Calculates profit for the specified trading conditions.
C++
MTAPIRES IMTManagerAPI::TradeProfit(
LPCWSTR group, // Group name
LPCWSTR symbol, // Symbol name
const UINT type, // Type of operation
const UINT64 volume, // Volume
const double price_open, // Open price
const double price_close, // Close price
double& profit, // Profit
double& profit_rate // Profit conversion rate
)
.NET
MTRetCode CIMTManagerAPI.TradeProfit(
string group, // Group name
string symbol, // Symbol name
CIMTOrder.EnOrderType type, // Type of operation
ulong volume, // Volume
double price_open, // Open price
double price_close, // Close price
out double profit, // Profit
out double profit_rate // Profit conversion rate
)
Python
ManagerAPI.TradeProfit(
group, # Group name
symbol, # Symbol name
type, # Type of operation
volume, # Volume
price_open, # Open price
price_close # Close price
)
Parameters
group
[in] The name of the group of clients, for which the calculations are performed.
file:///C:/Users/Administrator/AppData/Local/Temp/~hh4BC4.htm 7/17/2025
Manager API Page 421 of 464
symbol
[in] The name of the trading instrument, for which the calculations are performed.
type
[in] Position direction: Buy - IMTPosition::POSITION_BUY, Sell - IMTPosition::POSITION_SELL.
volume
[in] Position volume in the UINT64 format (one unit corresponds to 1/10000 lot, for example, 10500 means 1.05 lots).
price_open
[in] Position open price.
price_close
[in] Position close price.
profit
[out] Position profit in the deposit currency of the specified group.
profit_rate
[out] Conversion rate for the profit of the position from the profit currency of a trading instrument to the group deposit currency.
Return Value
An indication of successful completion is the MT_RET_OK response code. Otherwise, a corresponding error code will be returned.
Note
Profit is converted from the profit currency of a trading instrument to the group deposit currency using the current market prices for the group.
The symbol involved in the calculation must be available to the group for which the calculation is performed.
The method operates with the standard volume accuracy (4 decimal places). For extended volume accuracy, use the IMTManagerAPI::TradeProfitExt method.
IMTManagerAPI::TradeProfitExt
Calculates profit for the specified trading conditions using extended volume accuracy.
C++
MTAPIRES IMTManagerAPI::TradeProfitExt(
LPCWSTR group, // Group name
LPCWSTR symbol, // Symbol name
const UINT type, // Operation type
const UINT64 volume, // Volume
const double price_open, // Open price
const double price_close, // Close price
double& profit, // Profit
double& profit_rate // Profit conversion rate
)
.NET
MTRetCode CIMTManagerAPI.TradeProfitExt(
string group, // Group name
string symbol, // Symbol name
CIMTOrder.EnOrderType type, // Operation type
ulong volume, // Volume
double price_open, // Open price
double price_close, // Close price
out double profit, // Profit
out double profit_rate // Profit conversion rate
)
Python
ManagerAPI.TradeProfitExt(
group, # Group name
symbol, # Symbol name
type, # Type of operation
volume, # Volume
price_open, # Open price
price_close # Close price
)
Program Parameters
group
[in] The name of the group of clients, for which the calculations are performed.
symbol
[in] The name of the trading instrument, for which the calculations are performed.
type
[in] Position direction: buying - IMTPosition::POSITION_BUY, selling - IMTPosition::POSITION_SELL.
volume
[in] Position volume in the UINT64 format (one unit corresponds to 1/100000000 lot, for example, 105000000 means 1.05 lots).
price_open
[in] Position open price.
price_close
[in] Position close price.
profit
[out] Position profit in the deposit currency of the specified group.
profit_rate
[out] Conversion rate for the profit of the position from the profit currency of a trading instrument to the group deposit currency.
Return Value
An indication of successful completion is the MT_RET_OK response code. Otherwise, a corresponding error code will be returned.
Note
file:///C:/Users/Administrator/AppData/Local/Temp/~hh4BC4.htm 7/17/2025
Manager API Page 422 of 464
Profit is converted from the profit currency of a trading instrument to the group deposit currency using the current market prices for the group.
The symbol involved in the calculation must be available to the group for which the calculation is performed.
The method operates with the extended volume accuracy (8 decimal places). For standard volume accuracy, use the IMTManagerAPI::TradeProfit method.
IMTManagerAPI::TradeRateBuy
Calculate the conversion rate for a Buy trade.
C++
MTAPIRES IMTManagerAPI::TradeRateBuy(
LPCWSTR base, // Name of the purchased currency
LPCWSTR currency, // Name of the calculation currency
double& rate, // Conversion rate
LPCWSTR group=NULL, // Group name
LPCWSTR symbol=NULL, // Symbol name
const double price=0 // Price
)
.NET
MTRetCode CIMTManagerAPI.TradeRateBuy(
string base, // Name of the purchased currency
string currency, // Name of the calculation currency
out double rate, // Conversion rate
string group=NULL, // Group name
string symbol=NULL, // Symbol name
double price=0 // Price
)
Python
ManagerAPI.TradeRateBuy(
base, # Name of the purchased currency
currency, # Name of the calculation currency
group, # Group name
symbol, # Symbol name
price # Price
)
Parameters
base
[in] Name of the base (purchased) currency. Three-letter abbreviation for the currency, for example, EUR.
currency
[in] The name of the currency that is used to pay for the purchased currency. Three-letter abbreviation for the currency, for example, USD.
rate
[out] The calculated conversion rate of buying the 'base' currency for the 'currency' currency.
group=NULL
[in] The name of the group of clients, for which the calculations are performed. If the group is specified, then the conversion rate is calculated using the market prices, taking
into account spread adjustment for this group. If a group is not specified, market prices are used.
symbol=NULL
[in] The name of the symbol that should be taken into account when calculating the conversion rate. If a trading symbol with the name specified in the symbol parameter is
used for calculating the conversion rate, then the 'price' price will be used as the price of this symbol.
If the symbol parameter is NULL, current market prices of the symbol (including spread adjustment for this client group) will be used for conversion.
price=0
[in] The price of the symbol specified in the symbol parameter, which will be used for conversion instead of the current market price. This parameter is ignored for the symbols
with the IMTConSymbol::TRADE_FLAGS_PROFIT_BY_MARKET flag enabled. The market price is always used for such symbols.
Return Value
An indication of successful completion is the MT_RET_OK response code. Otherwise, a corresponding error code is returned.
Note
This method calculates the rate of buying the 'base' currency for the 'currency' currency.
For the method to operate, pumping modes PUMP_MODE_ORDERS and PUMP_MODE_POSITIONS must be enabled.
IMTManagerAPI::TradeRateSell
Calculate the conversion rate for a Sell trade.
C++
MTAPIRES IMTManagerAPI::TradeRateSell(
LPCWSTR base, // Name of the sold currency
LPCWSTR currency, // Name of the calculation currency
double& rate, // Conversion rate
LPCWSTR group=NULL, // Group name
LPCWSTR symbol=NULL, // Symbol name
const double price=0 // Price
)
.NET
file:///C:/Users/Administrator/AppData/Local/Temp/~hh4BC4.htm 7/17/2025
Manager API Page 423 of 464
MTRetCode CIMTManagerAPI.TradeRateSell(
string base, // Name of the sold currency
string currency, // Name of the calculation currency
double rate, // Conversion rate
string group=NULL, // Group name
string symbol=NULL, // Symbol name
double price=0 // Price
)
Python
ManagerAPI.TradeRateSell(
base, # Name of the sold currency
currency, # Name of the calculation currency
group, # Group name
symbol, # Symbol name
price # Price
)
Parameters
base
[in] Name of the base (sold) currency. Three-letter abbreviation for the currency, for example, EUR.
currency
[in] The name of the currency that is used to pay for the sold currency. Three-letter abbreviation for the currency, for example, USD.
rate
[out] The calculated conversion rate of selling the 'base' currency for the 'currency' currency.
group=NULL
[in] The name of the group of clients, for which the calculations are performed. If the group is specified, then the conversion rate is calculated using the market prices, taking
into account spread adjustment for this group. If a group is not specified, market prices are used.
symbol=NULL
[in] The name of the symbol that should be taken into account when calculating the conversion rate. If a trading symbol with the name specified in the symbol parameter is
used for calculating the conversion rate, then the 'price' price will be used as the price of this symbol.
If the symbol parameter is NULL, current market prices of the symbol (including spread adjustment for this client group) will be used for conversion.
price=0
[in] The price of the symbol specified in the symbol parameter, which will be used for conversion instead of the current market price. This parameter is ignored for the symbols
with the IMTConSymbol::TRADE_FLAGS_PROFIT_BY_MARKET flag enabled. The market price is always used for such symbols.
Return Value
An indication of successful completion is the MT_RET_OK response code. Otherwise, a corresponding error code is returned.
Note
This method calculates the rate of selling the 'base' currency for the 'currency' currency.
For the method to operate, pumping modes PUMP_MODE_ORDERS and PUMP_MODE_POSITIONS must be enabled.
IMTManagerAPI::TradeMarginCheck
Checks the availability of the margin required for the execution of this order.
C++
MTAPIRES IMTManagerAPI::TradeMarginCheck(
const UINT64 login, // Login
LPCWSTR symbol, // Symbol name
const UINT type, // Type of order
const UINT64 volume, // Volume
const double price, // Price
IMTAccount* account_new=NULL, // New state of account
IMTAccount* account_current=NULL // Current state of account
)
.NET
MTRetCode CIMTManagerAPI.TradeMarginCheck(
ulong login, // Login
string symbol, // Symbol name
CIMTOrder.EnOrderType type, // Type of order
ulong volume, // Volume
double price, // Price
CIMTAccount account_new=NULL, // New state of account
CIMTAccount account_current=NULL // Current state of account
)
Python
ManagerAPI.TradeMarginCheck(
login, # Login
symbol, # Symbol name
type, # Type of order
volume, # Volume
price # Price
)
Parameters
login
[in] The login of the client for whom the order is executed.
symbol
[in] The name of the trading instrument, for which the order is executed.
type
[in] Type of trade order passed using the IMTOrder::EnOrderType enumeration.
volume
[in] The volume of a trade order in the UINT64 format (one unit corresponds to 1/10000 lot, for example, 10500 means 1.05 lots). The final order size is calculated based on
the current contract size for the specified trading instrument.
file:///C:/Users/Administrator/AppData/Local/Temp/~hh4BC4.htm 7/17/2025
Manager API Page 424 of 464
price
[in] Price of the trade order execution.
account_new=NULL
[out] An object of the trading state of a client account. If account_new is not NULL, it is filled with the state of the client's trading account after the execution of a trade order
with the specified parameters. The account_new object must be first created using the IMTManagerAPI::UserCreateAccount method.
account_current=NULL
[out] An object of the trading state of a client account. If account_current is not NULL, it is filled with state of the client's trading account before the execution of a trade
orders with the specified parameters (i.e., the account state at the time of the call of TradeMarginCheck). The account_current object must be first created using the
IMTManagerAPI::UserCreateAccount method.
Return Value
An indication of the availability of the required margin is the MT_RET_OK response code. Otherwise, an error code will be returned.
Note
The check is performed taking into account the current state of the client account (balance, credit, floating profit, open orders and positions, etc.) and the current market prices
for the group of the client.
The method operates with the standard volume accuracy (4 decimal places). For extended volume accuracy, use the IMTManagerAPI::TradeMarginCheckExt method.
IMTManagerAPI::TradeMarginCheck
Checks the availability of the margin required for the execution of this order.
C++
MTAPIRES IMTManagerAPI::TradeMarginCheck(
const IMTOrder* order, // An object of a trade order
IMTAccount* account_new=NULL, // New state of account
IMTAccount* account_current=NULL // Current state of account
)
.NET
MTRetCode CIMTManagerAPI.TradeMarginCheck(
CIMTOrder order, // An object of a trade order
CIMTAccount account_new=NULL, // New state of account
CIMTAccount account_current=NULL // Current state of account
)
Parameters
order
[in] An object of a trading order.
account_new=NULL
[out] An object of the trading state of a client account. If account_new is not NULL, it is filled with the state of the client's trading account after the execution of a trade order
with the specified parameters. The account_new object must be first created using the IMTManagerAPI::UserCreateAccount method.
account_current=NULL
[out] An object of the trading state of a client account. If account_current is not NULL, it is filled with state of the client's trading account before the execution of a trade
orders with the specified parameters (i.e., the account state at the time of the call of TradeMarginCheck). The account_current object must be first created using the
IMTManagerAPI::UserCreateAccount method.
Return Value
An indication of the availability of the required margin is the MT_RET_OK response code. Otherwise, an error code will be returned.
Note
The check is performed taking into account the current state of the client account (balance, credit, floating profit, open orders and positions, etc.) and the current market prices
for the group of the client.
IMTManagerAPI::TradeMarginCheckExt
Checks the availability of the margin required for the execution of this order with the indication of increased accuracy volume.
C++
MTAPIRES IMTManagerAPI::TradeMarginCheckExt(
const UINT64 login, // Login
LPCWSTR symbol, // Symbol name
const UINT type, // Order type
const UINT64 volume, // Volume
const double price, // Price
IMTAccount* account_new=NULL, // New account state
IMTAccount* account_current=NULL // Current account state
)
.NET
MTRetCode CIMTManagerAPI.TradeMarginCheckExt(
ulong login, // Login
string symbol, // Symbol name
CIMTOrder.EnOrderType type, // Order type
ulong volume, // Volume
double price, // Price
CIMTAccount account_new=NULL, // New account state
CIMTAccount account_current=NULL // Current account state
)
ManagerAPI.TradeMarginCheckExt(
login, # Login
symbol, # Symbol name
type, # Type of order
volume, # Volume
price # Price
)
Program Parameters
login
[in] The login of the client for whom the order is executed.
file:///C:/Users/Administrator/AppData/Local/Temp/~hh4BC4.htm 7/17/2025
Manager API Page 425 of 464
symbol
[in] The name of the trading instrument, for which the order is executed.
type
[in] Type of trade order passed using the IMTOrder::EnOrderType enumeration.
volume
[in] Trading order volume in the UINT64 format (one unit corresponds to 1/10000 lot, for example, 10500 means 1.05 lots). The final order size is calculated based on the
current contract size for the specified trading instrument.
price
[in] Price of the trade order execution.
account_new=NULL
[out] An object of the trading state of a client account. If account_new is not NULL, it is filled with the state of the client's trading account after the execution of a trade order
with the specified parameters. The account_new object must be created in advance using the IMTManagerAPI::UserCreateAccount method.
account_current=NULL
[out] An object of the trading state of a client account. If account_current is not NULL, it is filled with state of the client's trading account before the execution of a trade
orders with the specified parameters (i.e., the account state at the time of the call of TradeMarginCheck). The account_current object must be created in advance
IMTManagerAPI::UserCreateAccount.
Return Value
An indication of the availability of the required margin is the MT_RET_OK response code. Otherwise, an error code will be returned.
Note
The check is performed taking into account the current state of the client account (balance, credit, floating profit, open orders and positions, etc.) and using the current market
prices for the group of the client.
The method operates with the extended volume accuracy (8 decimal places). For standard volume accuracy, use the IMTManagerAPI::TradeMarginCheck method.
Functions Purpose
TradeAccountSet Synchronization of an account's trade state with an external system.
Manager API / Manager Interface / Trade Activity / Monitoring Account States / TradeAccountSet
IMTManagerAPI::TradeAccountSet
The method is used to match client's MetaTrader 5 trading data (current pending orders, positions and balance) with an external trading system. Using this method, a developer can
transfer the state of positions, orders and client balance to MetaTrader 5 platform. As a result of executing the method, the current pending orders, positions and client balance
will match the passed data.
C++
MTAPIRES IMTManagerAPI::TradeAccountSet(
const INT64 request_id, // Request ID
const IMTUser* user, // An object of a client record
const IMTAccount* account, // An object of a trading account
const IMTOrderArray* orders, // Orders array
const IMTPositionArray* positions // Positions array
)
.NET
MTRetCode CIMTManagerAPI.TradeAccountSet(
long request_id, // Request ID
CIMTUser user, // An object of a client record
CIMTAccount account, // An object of a trading account
CIMTOrderArray orders, // Orders array
CIMTPositionArray positions // Positions array
)
Python
ManagerAPI.TradeAccountSet(
request_id, # Request ID
user, # An object of a client record
account, # An object of a trading account
orders, # Orders array
positions # Positions array
)
Parameters
request_id
[in] Arbitrary request ID. It is used for binding the requests executed by this method and the answers received via IMTManagerSink::OnTradeAccountSet.
user
[in] An object of the client record. The Login field is used for identification of the user, for whom data synchronization is performed. If that feild is not filled, the client's
account number in an external system is used. Account in an external system can be defined using IMTUser::ExternalAccountAdd method.
account
[in] Trading account object. Only Balance field is used in IMTAccount object for passing the actual balance value.
orders
[in] An object of the array of orders placed for the specified account. To avoid order synchronization, pass the NULL value.
positions
[in] An object of the array of positions placed for the specified account. To avoid position synchronization, pass the NULL value.
Return Value
An indication of successful completion is the MT_RET_OK response code. Otherwise, an error has occurred, which corresponds to the response code.
file:///C:/Users/Administrator/AppData/Local/Temp/~hh4BC4.htm 7/17/2025
Manager API Page 426 of 464
Note
Correcting operations are created as a result of trading data synchronization. These operations are displayed in the client's trading history.
Deals performed as a result of synchronization have value EnDealReason::DEAL_REASON_SYNC in their Reason field.
Execution result, as well as the final status of a client entry are passed to IMTManagerSink::OnTradeAccountSet handler.
Balance synchronization:
Identification is based on the client account number in an external trading system, which corresponds to this gateway (it is set via IMTUser::ExternalAccountAdd). If the passed
balance (the 'account' parameter) and the client's balance on the trade server do not match, a corrective balance deal is formed on the trade server. If the client's balance on the
trade server is zero (when balance should be added), the deal type is IMTDeal::DEAL_BALANCE. Otherwise the deal type is IMTDeal::DEAL_CORRECTION.
Synchronization of orders:
When the method is called, firstly all passed orders are checked (the 'orders' parameter). The following fields must be filled in these parameters:
• IMTOrder::Symbol
• IMTOrder::VolumeInitial
• IMTOrder::VolumeCurrent (must be less than or equal to IMTOrder::VolumeInitial)
• IMTOrder::PriceOrder (must be non-zero)
• IMTOrder::State (must be ORDER_STATE_STARTED, ORDER_STATE_PLACED, ORDER_STATE_PARTIAL or ORDER_STATE_REQUEST_*)
If this condition is not met for any of the passed orders, synchronization stops with an error.
Next, the equality of the list of passed orders (the 'orders' parameter) and the client's list of orders on the trade server is checked. The matching of the following fields is
checked:
• IMTOrder::Order
• IMTOrder::ExternalID
• IMTOrder::Symbol
• IMTOrder::Type
• IMTOrder::VolumeCurrent
• IMTOrder::PriceOrder
• IMTOrder::State (if this field in the incoming order is different from ORDER_STATE_STARTED)
The all these fields are identical in a passed order, such an order will not participate in the synchronization. For the remaining orders the system searches for orders with the
same ticket (IMTOrder::Order) or external system ID (IMTOrder::ExternalID) at the platform side. When matching is found, data of a passed order is copied into the appropriate
order. However the values of the following original fields are preserved:
• IMTOrder::Order
• IMTOrder::PriceTP
• IMTOrder::PriceSL
• IMTOrder::State (if this field in the incoming order is ORDER_STATE_STARTED)
• IMTOrder::ContractSize
• IMTOrder::Digits
• IMTOrder::DigitsCurrency
The IMTOrder::Login field is filled in accordance with the account login specified in the 'user' parameter. The IMTOrder::TimeSetup field is filled with the current server time if
this field is not specified in the passed order.
After that the system copies the orders which are not available in the current list (which were not found by ticket or ID).
Next, the orders available in the client's current order list but not contained in the passed array are copied.
Synchronization of positions:
When the method is called, the equality of the list of passed positions (the 'positions' parameter) and the client's list of positions on the trade server is checked. The system
checks if the following parameters are identical: position identifier in the external system (IMTPosition::ExternalID), trading instrument (IMTPosition::Symbol), position direction
(IMTPosition::Action), volume (IMTPosition::Volume), open price (IMTPosition::PriceOpen) and the contract size (IMTPosition::ContractSize). If the lists are equal, synchronization
of positions is considered completed. If the lists do not match:
• Positions which exist on the trade server but are not found in the passed list, are closed with zero profit.
• Positions which do not exist on the trade server but are included in the passed list, are added to the client's account.
• Positions with matching trading symbols existing in both lists are compared. If the direction, open price or contract size of a position has changed, the position on the
trade server is closed and a new one received via the gateway is opened. If only the volume of a position has changed, the position on the trade server is corrected via an
appropriate deal.
Function Purpose
BookSubscribe Subscribe to events associated with changes in the symbol's DOM.
BookSubscribeBatch Subscribe to events related to a change of the Market Depth of multiple symbols.
BookUnsubscribe Unsubscribe from events associated with changes in the symbol's DOM.
BookUnsubscribeBatch Unsubscribe from events related to a change of the Market Depth of multiple symbols.
BookGet Get a symbol's Depth of Market.
IMTManagerAPI::BookSubscribe
Subscribe to events associated with changes in the symbol's DOM.
C++
MTAPIRES IMTManagerAPI::BookSubscribe(
LPCWSTR symbol, // Symbol
IMTBookSink* sink // A pointer to the IMTBookSink object
)
file:///C:/Users/Administrator/AppData/Local/Temp/~hh4BC4.htm 7/17/2025
Manager API Page 427 of 464
.NET
MTRetCode CIMTManagerAPI.BookSubscribe(
string symbol, // Symbol
CIMTBookSink sink // CIMTBookSink object
)
Python
ManagerAPI.BookSubscribe(
symbol, # Symbol
sink # IMTBookSink object
)
Parameters
news
[in] The symbol for which your subscribe.
sink
[in] A pointer to the object that implements the IMTBookSink interface.
Return Value
An indication of successful completion is the MT_RET_OK response code. Otherwise, an error has occurred, which corresponds to the response code.
An attempt to subscribe to a symbol with the Depth of Market disabled (IMTConSymbol::TickBookDepth equal to ==0) will cause the MT_RET_ERR_NETWORK error.
Note
Subscribing to events is thread safe. One and the same interface IMTBookSink cannot subscribe to an event twice - in this case the response code MT_RET_ERR_DUPLICATE is
returned.
The object at which sink points, must remain in the memory (must not be removed) until the call of IMTManagerAPI::BookUnsubscribe or until the administrator interface is
deleted using the IMTManagerAPI::Release method.
The subscription to the events associated with DOM changes works only for the symbols selected using the IMTManagerAPI::SelectedAdd (or for all symbols if they are selected
using IMTManagerAPI::SelectedAddAll).
In the IMTBookSink::OnBook handler, Manager API always receives the full Marked Depth state (rather than changes relative to the current state). Market Depth elements passed
in MTBook::items are sorted by price in the descending order. Market Depth reset elements (MTBookItem::ItemReset) are not used in Manager API.
The MT_RET_OK response code indicates only a successful event subscription, but not receiving of the Market Depth. To receive notifications about the arrival of the Market
Depth, use the IMTBookSink::OnBook event.
IMTManagerAPI::BookSubscribeBatch
Subscribe to events related to a change of the Market Depth of multiple symbols.
C++
MTAPIRES IMTManagerAPI::BookSubscribeBatch(
LPWSTR* symbols, // Array of symbols
UINT symbols_total, // Number of symbols
IMTBookSink* sink // A pointer to the IMTBookSink object
)
.NET
MTRetCode CIMTManagerAPI.BookSubscribeBatch(
array<String^>^ symbols, // Array of symbols
CIMTBookSink sink // CIMTBookSink object
)
Python
ManagerAPI.BookSubscribeBatch(
symbols, # Array of symbols
sink # IMTBookSink object
)
Parameters
symbol
[in] An array of symbols, to which events you want to subscribe.
symbols_total
[in] The number of elements in the 'symbols' array.
sink
[in] A pointer to the object that implements the IMTBookSink interface.
Return Value
An indication of successful completion is the MT_RET_OK response code. Otherwise, an error has occurred, which corresponds to the response code.
Note
Subscribing to events is thread safe. The same IMTBookSink interface cannot subscribe to an event twice: in this case the MT_RET_ERR_DUPLICATE response code is returned.
The object at which 'sink' points, must remain in the memory (must not be removed) until the call of IMTManagerAPI::BookUnsubscribe or until the manager interface is deleted
using the IMTManagerAPI::Release method.
Subscription to Market Depth change events is only performed for the symbols selected using the IMTManagerAPI::SelectedAdd method (or for all symbols if they are selected
using IMTManagerAPI::SelectedAddAll)
In the IMTBookSink::OnBook handler, Manager API always receives the full Marked Depth state (rather than changes relative to the current state). Market Depth elements passed
in MTBook::items are sorted by price in the descending order. Market Depth reset elements (MTBookItem::ItemReset) are not used in Manager API.
The MT_RET_OK response code indicates only a successful event subscription, but not receiving of the Market Depth. To receive notifications about the arrival of the Market
Depth, use the IMTBookSink::OnBook event.
file:///C:/Users/Administrator/AppData/Local/Temp/~hh4BC4.htm 7/17/2025
Manager API Page 428 of 464
IMTManagerAPI::BookUnsubscribe
Unsubscribe from events associated with changes in the symbol's DOM.
C++
MTAPIRES IMTManagerAPI::BookUnsubscribe(
LPCWSTR symbol, // Symbol
IMTBookSink* sink // A pointer to the IMTBookSink object
)
.NET
MTRetCode CIMTManagerAPI.BookUnsubscribe(
string symbol, // Symbol
CIMTBookSink sink // CIMTBookSink object
)
Python
ManagerAPI.BookUnsubscribe(
symbol, # Symbol
sink # IMTBookSink object
)
Parameters
symbol
[in] The symbol from which your unsubscribe.
sink
[in] A pointer to the object that implements the IMTBookSink interface.
Return Value
An indication of successful completion is the MT_RET_OK response code. Otherwise, an error code will be returned.
Note
This is a pair method to IMTManagerAPI::BookSubscribe. If an attempt is made to unsubscribe from the interface to which it has not subscribed, MT_RET_ERR_NOTFOUND error is
returned.
IMTManagerAPI::BookUnsubscribeBatch
Unsubscribe from events related to a change of the Market Depth of multiple symbols.
C++
MTAPIRES IMTManagerAPI::BookUnsubscribeBatch(
LPWSTR* symbols, // Array of symbols
UINT symbols_total, // Number of symbols
IMTBookSink* sink // A pointer to the IMTBookSink object
)
.NET
MTRetCode CIMTManagerAPI.BookUnsubscribeBatch(
array<String^>^ symbols, // Array of symbols
CIMTBookSink sink // CIMTBookSink object
)
Python
ManagerAPI.BookUnsubscribeBatch(
symbols, # Array of symbols
sink # IMTBookSink object
)
Parameters
symbol
[in] An array of symbols, from which events you want to unsubscribe.
symbols_total
[in] The number of elements in the 'symbols' array.
sink
[in] A pointer to the object that implements the IMTBookSink interface.
Return Value
An indication of successful completion is the MT_RET_OK response code. Otherwise, an error code will be returned.
Note
This method is paired with IMTManagerAPI::BookSubscribeBatch. If an attempt is made to unsubscribe from the interface to which it has not subscribed, MT_RET_ERR_NOTFOUND
error is returned.
IMTManagerAPI::BookGet
Get a symbol's Depth of Market.
C++
MTAPIRES IMTManagerAPI::BookGet(
LPCWSTR symbol, // Symbol
MTBook& book // An array of DOM records
)
.NET
file:///C:/Users/Administrator/AppData/Local/Temp/~hh4BC4.htm 7/17/2025
Manager API Page 429 of 464
MTRetCode CIMTManagerAPI.BookGet(
string symbol, // Symbol
out MTBook res // An array of DOM records
)
Python
ManagerAPI.BookGet(
symbol # Symbol
)
Parameters
symbol
[in] [in] The symbol whose DOM you need to get.
book
[out] An array of DOM records of type MTBook.
Return Value
An indication of successful completion is the MT_RET_OK response code. Otherwise, an error code will be returned.
Note
To get information about a symbol's DOM using the IMTManagerAPI::BookGet method, it is necessary to subscribe to events of changes in the DOM of this symbol using the
IMTManagerAPI::BookSubscribe method.
After using, the book array must be released using the IMTManagerAPI::Free method.
Summary Functions
Functions described in this section allow to receive information about the summary of clients' positions, as well as subscribe and unsubscribe from events associated with its
change.
The following functions are available for working with summary values:
Function Purpose
SummaryCreate Create an object of the summary of clients' positions.
SummaryCreateArray Create an array of objects of the summary of clients' positions.
SummarySubscribe Subscribe to events associated with changes in the summary of clients' positions.
SummaryUnsubscribe Unsubscribe from events associated with changes in the summary of clients' positions.
SummaryCurrency Get and set a currency used for calculating profits of the summary positions.
SummaryTotal Get the number of records in the summary table.
SummaryNext Get a record from a summary table by an index.
SummaryGet Get a record from a summary table for a symbol.
SummaryGetAll Get an array of summary records.
IMTManagerAPI::SummaryCreate
Create an object of the summary of clients' positions.
C++
IMTSummary* IMTManagerAPI::SummaryCreate()
.NET
CIMTSummary CIMTManagerAPI.SummaryCreate()
Return Value
It returns a pointer to the created object that implements the IMTSummary interface. In case of failure, it returns NULL.
Note
The created object must be deleted by calling the IMTSummary::Release method of this object.
IMTManagerAPI::SummaryCreateArray
Create an array of objects of the summary of clients' positions.
C++
IMTSummaryArray* IMTManagerAPI::SummaryCreateArray()
.NET
CIMTSummaryArray CIMTManagerAPI.SummaryCreateArray()
Return Value
It returns a pointer to the created object that implements the IMTSummaryArray interface. In case of failure, it returns NULL.
Note
file:///C:/Users/Administrator/AppData/Local/Temp/~hh4BC4.htm 7/17/2025
Manager API Page 430 of 464
The created object must be deleted by calling the IMTSummary::Release method of this object.
IMTManagerAPI::SummarySubscribe
Subscribe to events associated with changes in the summary of clients' positions.
C++
MTAPIRES IMTManagerAPI::SummarySubscribe(
IMTSummarySink* sink // A pointer to the IMTSummarySink object
)
.NET
MTRetCode CIMTManagerAPI.SummarySubscribe(
CIMTSummarySink sink // CIMTSummarySink object
)
Python
ManagerAPI.SummarySubscribe(
sink # IMTSummarySink object
)
Parameters
sink
[in] A pointer to the object that implements the IMTSummarySink interface.
Return Value
An indication of successful completion is the MT_RET_OK response code. Otherwise, an error has occurred that corresponds to the response code.
Note
Subscribing to events is thread safe. One and the same interface IMTSummarySink cannot subscribe to an event twice - in this case the response code MT_RET_ERR_DUPLICATE is
returned.
The object at which sink points, must remain in the memory (must not be removed) until the call of IMTManagerAPI::SummaryUnsubscribe or until the administrator interface is
deleted using the IMTManagerAPI::Release method.
IMTManagerAPI::SummaryUnsubscribe
Unsubscribe from events associated with changes in the summary of clients' positions.
C++
MTAPIRES IMTManagerAPI::SummaryUnsubscribe(
IMTSummarySink* sink // A pointer to the IMTSummarySink object
)
.NET
MTRetCode CIMTManagerAPI.SummaryUnsubscribe(
CIMTSummarySink sink // CIMTSummarySink object
)
Python
ManagerAPI.SummaryUnsubscribe(
sink # IMTSummarySink object
)
Parameters
sink
[in] A pointer to the object that implements the IMTSummarySink interface.
Return Value
An indication of successful completion is the MT_RET_OK response code. Otherwise, an error has occurred that corresponds to the response code.
Note
This is a pair method to IMTManagerAPI::SummarySubscribe. If an attempt is made to unsubscribe from the interface to which it has not subscribed, MT_RET_ERR_NOTFOUND
error is returned.
IMTManagerAPI::SummaryCurrency
Get the currency used for calculating profits of the summary positions.
C++
LPCWSTR IMTManagerAPI::SummaryCurrency()
.NET
string CIMTManagerAPI.SummaryCurrency()
Python
ManagerAPI.SummaryCurrency()
Return Value
If successful, it returns a pointer to the string with the currency. Otherwise, it returns NULL.
file:///C:/Users/Administrator/AppData/Local/Temp/~hh4BC4.htm 7/17/2025
Manager API Page 431 of 464
IMTManagerAPI::SummaryCurrency
Sets the currency, in which clients' summary positions for a symbol are calculated.
C++
MTAPIRES IMTManagerAPI::SummaryCurrency(
LPCWSTR currency // Currency
)
.NET
MTRetCode CIMTManagerAPI.SummaryCurrency(
string currency // Currency
)
Python
ManagerAPI.SummaryCurrency(
str currency # Currency
)
Parameters
currency
[in] The currency used for calculating profits of the summary positions.
Return Value
An indication of successful completion is the MT_RET_OK response code. Otherwise, an error has occurred that corresponds to the response code.
IMTManagerAPI::SummaryTotal
Get the number of records in the summary table.
C++
UINT IMTManagerAPI::SummaryTotal()
.NET
uint CIMTManagerAPI.SummaryTotal()
Python
ManagerAPI.SummaryTotal()
Return Value
The number of records in the summary table.
Note
The number of records returned by the method includes the result (total) record from the summary table (as a symbol with empty name).
IMTManagerAPI::SummaryNext
Get a record from a summary table by an index.
C++
MTAPIRES IMTManagerAPI::SummaryNext(
const UINT pos, // Position
IMTSummary* summary // Summary position object
)
.NET
MTRetCode CIMTManagerAPI.SummaryNext(
uint pos, // Position
CIMTSummary summary // Summary position object
)
Python
ManagerAPI.SummaryNext(
int pos # Position
)
Parameters
pos
[in] Position of the record, starting with 0.
summary
[out] Summary position object. The summary object must first be created using the IMTManagerAPI::SummaryCreate method.
Return Value
An indication of successful completion is the MT_RET_OK response code. Otherwise, an error has occurred that corresponds to the response code.
Note
To receive information about summary, it is necessary to subscribe to events of its changes using the IMTManagerAPI::SummarySubscribe method.
Information about the profit/loss of positions (IMTSummary::Profit*) belonging to clients, whose deposit currency (IMTConGroup::Currency) differs from the summary currency
(IMTManagerAPI::SummaryCurrency) may not be available immediately. After connecting and synchronizing with the server, the Manager API application must receive at least one
quote for the symbol, required for converting profit from the deposit currency to the summary currency. Until then, the values of IMTSummary::Profit* for such clients will be
zero. Information on position volumes (IMTSummary::Volume*) is available immediately.
file:///C:/Users/Administrator/AppData/Local/Temp/~hh4BC4.htm 7/17/2025
Manager API Page 432 of 464
IMTManagerAPI::SummaryGet
Get a record from a summary table for a symbol.
C++
MTAPIRES IMTManagerAPI::SummaryGet(
LPCWSTR symbol, // Symbol
IMTSummary* summary // Summary position object
)
.NET
MTRetCode CIMTManagerAPI.SummaryGet(
string symbol, // Symbol
CIMTSummary summary // Summary position object
)
Python
ManagerAPI.SummaryGet(
str symbol # Symbol
)
Parameters
symbol
[in] Symbol.
summary
[out] Summary position object. The summary object must first be created using the IMTManagerAPI::SummaryCreate method.
Return Value
An indication of successful completion is the MT_RET_OK response code. Otherwise, an error has occurred that corresponds to the response code.
Note
To receive information about summary, it is necessary to subscribe to events of its changes using the IMTManagerAPI::SummarySubscribe method.
Information about the profit/loss of positions (IMTSummary::Profit*) belonging to clients, whose deposit currency (IMTConGroup::Currency) differs from the summary currency
(IMTManagerAPI::SummaryCurrency) may not be available immediately. After connecting and synchronizing with the server, the Manager API application must receive at least one
quote for the symbol, required for converting profit from the deposit currency to the summary currency. Until then, the values of IMTSummary::Profit* for such clients will be
zero. Information on position volumes (IMTSummary::Volume*) is available immediately.
IMTManagerAPI::SummaryGetAll
Get an array of summary records.
C++
MTAPIRES IMTManagerAPI::SummaryGetAll(
IMTSummaryArray* summary // An object of the array of summary positions
)
.NET
MTRetCode CIMTManagerAPI.SummaryGetAll(
CIMTSummaryArray summary // An object of the array of summary positions
)
Python
ManagerAPI.SummaryGetAll()
Parameters
summary
[out] An object of the array of summary positions. The summary object must first be created using the IMTManagerAPI::SummaryCreateArray method.
Return Value
An indication of successful completion is the MT_RET_OK response code. Otherwise, an error has occurred that corresponds to the response code.
Note
To receive information about summary, it is necessary to subscribe to events of its changes using the IMTManagerAPI::SummarySubscribe method.
The returned array includes the result (total) record from the summary table (as a symbol with empty name).
Information about the profit/loss of positions (IMTSummary::Profit*) belonging to clients, whose deposit currency (IMTConGroup::Currency) differs from the summary currency
(IMTManagerAPI::SummaryCurrency) may not be available immediately. After connecting and synchronizing with the server, the Manager API application must receive at least one
quote for the symbol, required for converting profit from the deposit currency to the summary currency. Until then, the values of IMTSummary::Profit* for such clients will be
zero. Information on position volumes (IMTSummary::Volume*) is available immediately.
Exposure Functions
Functions described in this section allow to receive information about client assets and company's coverage assets, as well as subscribe and unsubscribe from events associated with
its change.
The following functions are available for working with exposure:
Function Purpose
ExposureCreate Create an object of an exposure record.
ExposureCreateArray Create an array of objects of exposure records.
file:///C:/Users/Administrator/AppData/Local/Temp/~hh4BC4.htm 7/17/2025
Manager API Page 433 of 464
Function Purpose
ExposureSubscribe Subscribe to events associated with changes in the exposure database.
ExposureUnsubscribe Undubscribe from events associated with changes in the exposure database.
ExposureCurrency Get and set a currency of the net total of assets.
ExposureTotal Get the number of records in the exposure table.
ExposureNext Get a record from an exposure table by an index.
ExposureGet Get a record from an exposure table by a symbol.
ExposureGetAll Get an array of exposure records.
IMTManagerAPI::ExposureCreate
Create an object of an exposure record.
C++
IMTExposure* IMTManagerAPI::ExposureCreate()
.NET
CIMTExposure CIMTManagerAPI.ExposureCreate()
Return Value
It returns a pointer to the created object that implements the IMTExposure interface. In case of failure, it returns NULL.
Note
The created object must be deleted by calling the IMTExposure::Release method of this object.
IMTManagerAPI::ExposureCreateArray
Create an array of objects of exposure records.
C++
IMTExposureArray* IMTManagerAPI::ExposureCreateArray()
.NET
CIMTExposureArray CIMTManagerAPI.ExposureCreateArray()
Return Value
It returns a pointer to the created object that implements the IMTExposureArray interface. In case of failure, it returns NULL.
Note
The created object must be deleted by calling the IMTExposureArray::Release method of this object.
IMTManagerAPI::ExposureSubscribe
Subscribe to events associated with changes in the exposure database.
C++
MTAPIRES IMTManagerAPI::ExposureSubscribe(
IMTExposureSink* sink // A pointer to the IMTExposureSink object
)
.NET
MTRetCode CIMTManagerAPI::ExposureSubscribe(
CIMTExposureSink sink // CIMTExposureSink object
)
Python
ManagerAPI::ExposureSubscribe(
callback # MTExposureSink object
)
Parameters
sink
[in] A pointer to the object that implements the IMTExposureSink interface.
Return Value
An indication of successful completion is the MT_RET_OK response code. Otherwise, an error has occurred that corresponds to the response code.
Note
Subscribing to events is thread safe. One and the same interface IMTExposureSink cannot subscribe to an event twice - in this case the response code MT_RET_ERR_DUPLICATE is
returned.
The object at which sink points, must remain in the memory (must not be removed) until the call of IMTManagerAPI::ExposureUnsubscribe or until the administrator interface is
deleted using the IMTManagerAPI::Release method.
file:///C:/Users/Administrator/AppData/Local/Temp/~hh4BC4.htm 7/17/2025
Manager API Page 434 of 464
IMTManagerAPI::ExposureUnsubscribe
Undubscribe from events associated with changes in the exposure database.
C++
MTAPIRES IMTManagerAPI::ExposureUnsubscribe(
IMTExposureSink* sink // A pointer to the IMTExposureSink object
)
.NET
MTRetCode CIMTManagerAPI.ExposureUnsubscribe(
CIMTExposureSink sink // CIMTExposureSink object
)
Python
ManagerAPI.ExposureUnsubscribe(
callback # MTExposureSink object
)
Parameters
sink
[in] A pointer to the object that implements the IMTExposureSink interface.
Return Value
An indication of successful completion is the MT_RET_OK response code. Otherwise, an error has occurred that corresponds to the response code.
Note
This is a pair method to IMTManagerAPI::ExposureSubscribe. If an attempt is made to unsubscribe from the interface to which it has not subscribed, MT_RET_ERR_NOTFOUND
error is returned.
IMTManagerAPI::ExposureCurrency
Get a currency of the net total of assets.
C++
LPCWSTR IMTManagerAPI::ExposureCurrency()
.NET
string CIMTManagerAPI.ExposureCurrency()
Python
ManagerAPI.ExposureCurrency()
Return Value
The currency of the net total of assets.
IMTManagerAPI::ExposureCurrency
Set a currency of the net total of assets.
C++
MTAPIRES IMTManagerAPI::ExposureCurrency(
LPCWSTR currency // Currency
)
.NET
MTRetCode CIMTManagerAPI.ExposureCurrency(
string currency // Currency
)
Python
ManagerAPI.ExposureCurrency(
str currency # Currency
)
Parameters
currency
[in] The currency of the net total of assets.
Return Value
An indication of successful completion is the MT_RET_OK response code. Otherwise, an error has occurred that corresponds to the response code.
IMTManagerAPI::ExposureTotal
Get the number of records in the exposure table.
C++
UINT IMTManagerAPI::ExposureTotal()
.NET
file:///C:/Users/Administrator/AppData/Local/Temp/~hh4BC4.htm 7/17/2025
Manager API Page 435 of 464
uint CIMTManagerAPI.ExposureTotal()
Python
ManagerAPI.ExposureTotal()
Return Value
The number of records in the exposure table.
Note
The number of records returned by the method includes the result (total) record from the exposure table (as a symbol with empty name).
IMTManagerAPI::ExposureNext
Get a record from an exposure table by an index.
C++
MTAPIRES IMTManagerAPI::ExposureNext(
const UINT pos, // Position
IMTExposure* exposure // Exposure object
)
.NET
MTRetCode CIMTManagerAPI.ExposureNext(
uint pos, // Position
CIMTExposure exposure // Exposure object
)
Python
ManagerAPI.ExposureNext(
int pos # Position
)
Parameters
pos
[in] Position of the record, starting with 0.
exposure
[out] An object of the exposure record. The exposure object must first be created using the IMTManagerAPI::ExposureCreate method.
Return Value
An indication of successful completion is the MT_RET_OK response code. Otherwise, an error has occurred that corresponds to the response code.
Note
To receive information about exposure, it is necessary to subscribe to events of its changes using the IMTManagerAPI::ExposureSubscribe method.
IMTManagerAPI::ExposureGet
Get a record from an exposure table by a symbol.
C++
MTAPIRES IMTManagerAPI::ExposureGet(
LPCWSTR symbol, // Symbol
IMTExposure* exposure // Exposure object
)
.NET
MTRetCode CIMTManagerAPI.ExposureGet(
string symbol, // Symbol
CIMTExposure exposure // Exposure object
)
Python
ManagerAPI.ExposureGet(
str symbol # Symbol
)
Parameters
symbol
[in] Symbol.
exposure
[out] An object of the exposure record. The exposure object must first be created using the IMTManagerAPI::ExposureCreate method.
Return Value
An indication of successful completion is the MT_RET_OK response code. Otherwise, an error has occurred that corresponds to the response code.
Note
To receive information about exposure, it is necessary to subscribe to events of its changes using the IMTManagerAPI::ExposureSubscribe method.
IMTManagerAPI::ExposureGetAll
file:///C:/Users/Administrator/AppData/Local/Temp/~hh4BC4.htm 7/17/2025
Manager API Page 436 of 464
.NET
MTRetCode CIMTManagerAPI.ExposureGetAll(
CIMTExposureArray exposure // An object of an array of exposure records
)
Python
ManagerAPI.ExposureGetAll()
Parameters
exposure
[out] An object of the array. The exposure object must first be created using the IMTManagerAPI::ExposureCreateArray method.
Return Value
An indication of successful completion is the MT_RET_OK response code. Otherwise, an error has occurred that corresponds to the response code.
Note
To receive information about exposure, it is necessary to subscribe to events of its changes using the IMTManagerAPI::ExposureSubscribe method.
The returned array includes the result (total) record from the exposure table (as a symbol with empty name).
Function Purpose
DailyCreate Create an object of a daily report.
DailyCreateArray Create an object of the array of daily reports.
DailyRequest Get an array of daily reports by the login and date range.
DailyRequestByLogins Get an array of daily reports by the list of logins and date range.
DailyRequestByGroup Get an array of daily reports by groups and date range.
DailyRequestLight Get an array of lightweight daily reports by the login and date range. Unlike full daily reports, lightweight reports do not include open client
orders and positions.
DailyRequestLightByLogins Get an array of lightweight daily reports by the list of logins and date range.
DailyRequestLightByGroup Get an array of lightweight daily reports by groups and date range.
IMTManagerAPI::DailyCreate
Create an object of a daily report.
C++
IMTDaily* IMTManagerAPI::DailyCreate()
.NET
CIMTDaily CIMTManagerAPI.DailyCreate()
Return Value
It returns a pointer to the created object that implements the IMTDaily interface. In case of failure, it returns NULL.
Note
The created object must be destroyed by calling the IMTDaily::Release method of this object.
IMTManagerAPI::DailyCreateArray
Create an object of the array of daily reports.
C++
IMTDailyArray* IMTManagerAPI::DailyCreateArray()
.NET
CIMTDailyArray CIMTManagerAPI.DailyCreateArray()
Return Value
It returns a pointer to the created object that implements the IMTConDailyArray interface. In case of failure, it returns NULL.
Note
The created object must be destroyed by calling the IMTDaily::Release method of this object.
file:///C:/Users/Administrator/AppData/Local/Temp/~hh4BC4.htm 7/17/2025
Manager API Page 437 of 464
IMTManagerAPI::DailyRequest
Get an array of daily reports by the login and date range.
C++
MTAPIRES IMTManagerAPI::DailyRequest(
const UINT64 login, // Login
const INT64 from, // Beginning of period
const INT64 to, // End of period
IMTDailyArray* daily // Reports array
)
.NET
MTRetCode CIMTManagerAPI.DailyRequest(
ulong login, // Login
long from, // Beginning of period
long to, // End of period
CIMTDailyArray daily // Reports array
)
Python
ManagerAPI.DailyRequest(
login, # Login
from, # Beginning of period
to # End of period
)
Parameters
login
[in] The login of the client, whose daily report you need to get.
from
[in] The beginning of the period for which you need to get daily reports. The date is specified in seconds that have elapsed since 01.01.1970.
to
[in] The end of the period for which you need to get daily reports. The date is specified in seconds that have elapsed since 01.01.1970.
daily
[out] An object of the array of daily reports. The daily object must be first created using the IMTManagerAPI::DailyCreateArray method.
Return Value
An indication of successful completion is the MT_RET_OK response code. Otherwise, an error code is returned.
Note
This method copies an array of daily reports by the specified login and date range to the daily object.
This method cannot be called from event handlers (any methods of IMT*Sink classes).
IMTManagerAPI::DailyRequestByLogins
Get an array of daily reports by the list of logins and date range.
C++
MTAPIRES IMTManagerAPI::DailyRequestByLogins(
const UINT64 logins, // logins
const UINT logins_total, // number of logins
const INT64 from, // beginning of period
const INT64 to, // end of period
IMTDailyArray* daily // array of report
)
.NET
MTRetCode CIMTManagerAPI.DailyRequestByLogins(
ulong logins, // logins
long from, // beginning of period
long to, // end of period
CIMTDailyArray daily // array of reports
)
Python
ManagerAPI.DailyRequestByLogins(
logins, # logins
from, # beginning of period
to # end of period
)
Parameters
logins
[in] Array of client logins.
logins_total
[in] Number of logins in the 'logins' array.
from
[in] The beginning of the period for which you need to get daily reports. The date is specified in seconds since 01.01.1970.
to
[in] The end of the period for which you need to get daily reports. The date is specified in seconds since 01.01.1970.
daily
file:///C:/Users/Administrator/AppData/Local/Temp/~hh4BC4.htm 7/17/2025
Manager API Page 438 of 464
[out] An object of the array of daily reports. The 'daily' object must be previously created using the IMTManagerAPI::DailyCreateArray method.
Return Value
An indication of successful completion is the MT_RET_OK response code. Otherwise, an error code will be returned.
Note
This method copies an array of daily reports for the specified logins and date range to the 'daily' object.
The method cannot be called from event handlers (any IMT*Sink class methods).
IMTManagerAPI::DailyRequestByGroup
Get an array of daily reports by groups and date range.
C++
MTAPIRES IMTManagerAPI::DailyRequestByGroup(
LPCWSTR group, // group
const INT64 from, // beginning of period
const INT64 to, // end of period
IMTDailyArray* daily // array of reports
)
.NET
MTRetCode CIMTManagerAPI.DailyRequestByGroup(
string group, // group
long from, // beginning of period
long to, // end of period
CIMTDailyArray daily // array of reports
)
Python
ManagerAPI.DailyRequestByGroup(
group, # group
from, # beginning of period
to # end of period
)
Parameters
group
[in] Groups for which the reports are requested. You can specify one group, several groups (comma separated) or a group mask. The mask is specified using characters "*" (any
value) and "!" (exception). For example: "demo*,!demoforex" - all groups whose names begin with 'demo', except for the group demoforex.
from
[in] The beginning of the period for which you need to get daily reports. The date is specified in seconds since 01.01.1970.
to
[in] The end of the period for which you need to get daily reports. The date is specified in seconds since 01.01.1970.
daily
[out] An object of the array of daily reports. The 'daily' object must be previously created using the IMTManagerAPI::DailyCreateArray method.
Return Value
An indication of successful completion is the MT_RET_OK response code. Otherwise, an error code will be returned.
Note
This method copies an array of daily reports for the specified groups and date range to the 'daily 'object.
The method cannot be called from event handlers (any IMT*Sink class methods).
IMTManagerAPI::DailyRequestLight
Get an array of lightweight daily reports by the login and date range. Unlike full daily reports, lightweight reports do not include open client orders and positions.
C++
MTAPIRES IMTManagerAPI::DailyRequestLight(
const UINT64 login, // Login
const INT64 from, // Beginning of period
const INT64 to, // End of period
IMTDailyArray* daily // Reports array
)
.NET
MTRetCode CIMTManagerAPI.DailyRequestLight(
ulong login, // Login
long from, // Beginning of period
long to, // End of period
CIMTDailyArray daily // Reports array
)
Python
ManagerAPI.DailyRequestLight(
login, # Login
from, # Beginning of period
to # End of period
)
Parameters
login
[in] The login of the client, whose daily report you need to get.
file:///C:/Users/Administrator/AppData/Local/Temp/~hh4BC4.htm 7/17/2025
Manager API Page 439 of 464
from
[in] The beginning of the period for which you need to get daily reports. The date is specified in seconds that have elapsed since 01.01.1970.
to
[in] The end of the period for which you need to get daily reports. The date is specified in seconds that have elapsed since 01.01.1970.
daily
[out] An object of the array of light daily reports. The daily object must be first created using the IMTManagerAPI::DailyCreateArray method.
Return Value
An indication of successful completion is the MT_RET_OK response code. Otherwise, an error code is returned.
Note
This method copies an array of light daily reports by the specified login and date range to the daily object.
This method is less resource consuming comparing to IMTManagerAPI::DailyRequest.
This method cannot be called from event handlers (any methods of IMT*Sink classes).
IMTManagerAPI::DailyRequestLightByLogins
Get an array of lightweight daily reports by the date range and login. Unlike full daily reports, lightweight reports do not include open orders and positions.
C++
MTAPIRES IMTManagerAPI::DailyRequestLightByLogins(
const UINT64 logins, // logins
const UINT logins_total, // number of logins
const INT64 from, // beginning of period
const INT64 to, // end of period
IMTDailyArray* daily // array of report
)
.NET
MTRetCode CIMTManagerAPI.DailyRequestLightByLogins(
ulong logins, // logins
long from, // beginning of period
long to, // end of period
CIMTDailyArray daily // array of reports
)
Python
ManagerAPI.DailyRequestLightByLogins(
logins, # logins
from, # beginning of period
to # end of period
)
Parameters
logins
[in] Array of client logins.
logins_total
[in] Number of logins in the 'logins' array.
from
[in] The beginning of the period for which you need to get daily reports. The date is specified in seconds since 01.01.1970.
to
[in] The end of the period for which you need to get daily reports. The date is specified in seconds since 01.01.1970.
daily
[out] An object of the array of lightweight daily reports. The 'daily' object must be previously created using the IMTManagerAPI::DailyCreateArray method.
Return Value
An indication of successful completion is the MT_RET_OK response code. Otherwise, an error code will be returned.
Note
This method copies an array of lightweight daily reports by the specified login and date range to the 'daily' object.
This method is less resource intensive than IMTManagerAPI::DailyRequestByLogins.
The method cannot be called from event handlers (any IMT*Sink class methods).
IMTManagerAPI::DailyRequestLightByGroup
Get an array of lightweight daily reports by groups and date range. Unlike full daily reports, lightweight reports do not include open orders and positions.
C++
MTAPIRES IMTManagerAPI::DailyRequestLightByGroup(
LPCWSTR group, // group
const INT64 from, // beginning of period
const INT64 to, // end of period
IMTDailyArray* daily // array of reports
)
.NET
MTRetCode CIMTManagerAPI.DailyRequestLightByGroup(
string group, // group
long from, // beginning of period
long to, // end of period
CIMTDailyArray daily // array of reports
)
file:///C:/Users/Administrator/AppData/Local/Temp/~hh4BC4.htm 7/17/2025
Manager API Page 440 of 464
Python
ManagerAPI.DailyRequestLightByGroup(
group, # group
from, # beginning of period
to # end of period
)
Parameters
group
[in] Groups for which the reports are requested. You can specify one group, several groups (comma separated) or a group mask. The mask is specified using characters "*" (any
value) and "!" (exception). For example: "demo*,!demoforex" - all groups whose names begin with 'demo', except for the group demoforex.
from
[in] The beginning of the period for which you need to get daily reports. The date is specified in seconds since 01.01.1970.
to
[in] The end of the period for which you need to get daily reports. The date is specified in seconds since 01.01.1970.
daily
[out] An object of the array of lightweight daily reports. The 'daily' object must be previously created using the IMTManagerAPI::DailyCreateArray method.
Return Value
An indication of successful completion is the MT_RET_OK response code. Otherwise, an error code will be returned.
Note
This method copies an array of lightweight daily reports for the specified groups and date range to the 'daily 'object.
This method is less resource intensive than IMTManagerAPI::DailyRequestByGroup.
The method cannot be called from event handlers (any IMT*Sink class methods).
Settings Files
The Manager API allows saving application settings on a trade server and accessing them at any time. Settings are stored in a special directory separately for each manager account,
which uses the application: [trade server directory]\settings\[manager login]\.
This option allows you to quickly configure the manager's workplace. For example, if the manager changes the computer, there will be no need to re-configure the application.
Instead, you can easily apply settings, which were saved previously on the trade server. It is also possible to create several sets of manager settings for performing certain tasks.
• Only one level of nesting and no more than 128 folders can be stored inside each manager directory. The maximum number of settings files is 1024. The size of each
configuration file is no more than 16 MB.
• Settings are saved and accessed on the server, to which the Manager API application is connected (on which the connected manager account is located). If you have
multiple servers, you need to save the settings on each server.
• This function is secure for the trade server: the Manager API does not allow sending potentially dangerous file types to the server (for example, *.exe). Only files with
the following extensions are allowed: ini, cfg, dat, json, config, sqlite, xml, conf, settings, key, db, txt and log, as well as files without extensions.
• The application receives the file with settings using the IMTManagerAPI::SettingGet method. For example, during the application launch or when the user executes an
appropriate command.
• The settings are read from the file and applied.
• If the user edits settings during the application operation, the application can update the settings file on the trade server via the IMTManagerAPI::SettingSet method.
Please note that settings comprise one whole file. You cannot update a separate setting on the server. To update a setting, it is necessary to generate a whole file with all settings.
The format of the settings file and its parsing methods are determined by the file creator. IMTManagerAPI::Setting* methods work with arbitrary data.
Settings should not be updated on the server too often, i.e. every time when settings are edited on the application side. After editing settings, the user can immediately change
some other settings or revert changes. It is recommended to send updates not more than once in 5 minutes.
Several applications can work with the same settings files. The Manager API does not track changes in files on the server side. Every call of IMTManagerAPI::SettingSet re-writes the
specified settings file, even if it has already been changed by another application. Only the last submitted version is always stored on the server.
IMTManagerAPI::SettingGet
Receives the settings file from the trade server.
C++
MTAPIRES IMTManagerAPI::SettingGet(
LPCWSTR section, // directory name
LPCWSTR key, // file name
LPVOID& outdata, // return data
UINT& outdata_len // the size of the return data
)
.NET
file:///C:/Users/Administrator/AppData/Local/Temp/~hh4BC4.htm 7/17/2025
Manager API Page 441 of 464
MTRetCode CIMTManagerAPI.SettingGet(
string section, // directory name
string key, // file name
byte[] outdata // return data
)
Python
ManagerAPI.SettingGet(
section, # directory name
key # file name
)
Parameters
section
[in] The name of the subfolder in the manager account directory, from which you want to receive the settings file.
key
[in] The name of the settings file.
outdata
[out] A reference to the data returned in response to the request.
outdata_len
[out] A reference to the size of data returned in response to the request.
Return Value
An indication of successful completion is the MT_RET_OK response code. Otherwise, an error has occurred, which corresponds to the response code. For example:
• MT_RET_ERR_PARAMS — invalid parameters, for example the name of the folder or file.
• MT_RET_ERR_NOTFOUND — the requested file is not found.
• MT_RET_ERR_MEM — not enough memory to receive the file.
Note
The path to the settings file is formed as follows: [trade server directory]\settings\[manager login]\section\key. section and key — the first and the second parameters of the
IMTManagerAPI::SettingGet method, manager login is the manager's account, using which the application is connected to the trade server.
The format of the settings file and its parsing methods are determined by the file creator. IMTManagerAPI::Setting* methods work with arbitrary data.
After the use, the outdata data array must be released using the IMTManagerAPI::Free method.
IMTManagerAPI::SettingSet
Sends the settings file to the trade server.
C++
MTAPIRES IMTManagerAPI::SettingSet(
LPCWSTR section, // directory name
LPCWSTR key, // file name
const LPVOID& indata, // passed data
const UINT& indata_len // size of passed data
)
.NET
MTRetCode CIMTManagerAPI.SettingSet(
string section, // directory name
string key, // file name
byte[] indata // passed data
)
Python
ManagerAPI.SettingSet(
section, # directory name
key # file name
)
Parameters
section
[in] The name of the subfolder in the manager account directory, to which you want to write the settings file.
key
[in] The name of the settings file. Only files with the following extensions are allowed: ini, cfg, dat, json, config, sqlite, xml, conf, settings, key, db, txt and log, as well as
files without extensions.
indata
[out] A reference to data to be sent.
indata_len
[out] A reference to the size of passed data in bytes.
Return Value
An indication of successful completion is the MT_RET_OK response code. Otherwise, an error has occurred, which corresponds to the response code. For example:
• MT_RET_ERR_PARAMS — invalid parameters, for example the name of the folder or file.
• MT_RET_CFG_LIMIT_REACHED — the maximum number of files or folders has been reached.
• MT_RET_ERR_DISK — writing the file to the disk failed.
Note
The path to the settings file is formed as follows: [trade server directory]\settings\[manager login]\section\key. section and key — the first and the second parameters of the
IMTManagerAPI::SettingSet method, manager login is the manager's account, using which the application is connected to the trade server.
The format of the settings file and its parsing methods are determined by the file creator. IMTManagerAPI::Setting* methods work with arbitrary data.
Only one level of nesting and no more than 128 folders can be stored inside each manager directory. The maximum number of settings files is 1024. The size of each configuration
file is no more than 16 MB.
file:///C:/Users/Administrator/AppData/Local/Temp/~hh4BC4.htm 7/17/2025
Manager API Page 442 of 464
The IMTManagerAPI::SettingSet method works with files, not with individual settings. Therefore, a whole settings file needs to be formed to send changes to the server.
The Manager API does not track changes in files on the server side. Every call of IMTManagerAPI::SettingSet re-writes the specified settings file, even if it has already been
changed by another application. Only the last submitted version is always stored on the server.
Settings should not be updated on the server too often, i.e. every time when settings are edited on the application side. After editing settings, the user can immediately change
some other settings or revert changes. It is recommended to send updates not more than once in 5 minutes.
IMTManagerAPI::SettingDelete
Deletes the settings file on the trade server.
C++
MTAPIRES IMTManagerAPI::SettingDelete(
LPCWSTR section, // directory name
LPCWSTR key // file name
)
.NET
MTRetCode CIMTManagerAPI.SettingDelete(
string section, // directory name
string key // file name
)
Python
ManagerAPI.SettingDelete(
section, # directory name
key # file name
)
Parameters
section
[in] The name of the subfolder in the manager account directory, from which you want to delete the settings file.
key
[in] The name of the settings file.
Return Value
An indication of successful completion is the MT_RET_OK response code. Otherwise, an error code is returned. The MT_RET_ERR_PARAMS response code means that invalid
parameters were passed: the name of the folder or the file.
Subscriptions
With the "Subscriptions" service, you can offer additional paid services to traders directly in the client terminals. For example, you can sell subscriptions for high-quality market
data from well-known providers, offer personal manager services to assist traders in understanding the basics of trading, deliver one-time services such as position transferring or
currency conversion, and much more. For further details, please read the MetaTrader 5 Administrator Help.
The functions described in this section enable the management of subscriptions on traders' accounts:
Function Purpose
SubscriptionCreate Create a subscription object.
SubscriptionCreateArray Create an object of the subscriptions array.
SubscriptionJoin Add a subscription for a user.
SubscriptionJoinBatch Bulk adding of subscriptions for users.
SubscriptionCancel Cancel a subscription for a user.
SubscriptionCancelBatch Bulk canceling of user subscriptions.
SubscriptionUpdate Edit a user subscription in the server database.
SubscriptionUpdateBatch Bulk change of user subscriptions in the server database.
SubscriptionUpdateBatchArray Bulk change of user subscriptions in the server database.
SubscriptionDelete Delete a user subscription from the server database.
SubscriptionDeleteBatch Delete a user subscription from the server database.
SubscriptionRequest Request all user subscriptions from the server.
SubscriptionRequestByID Request a subscription from the server by ID.
SubscriptionRequestByIDs Request subscriptions from the server by a list of IDs.
SubscriptionRequestByGroup Request subscriptions from the server by a client group.
SubscriptionRequestByLogins Request subscriptions from the server by a list of logins.
SubscriptionHistoryCreate Create a subscription action object.
SubscriptionHistoryCreateArray Create an object of an array of subscription actions.
SubscriptionHistoryUpdate Edit a user subscription action in the server database.
SubscriptionHistoryUpdateBatch Bulk change of user subscription actions in the server database.
SubscriptionHistoryUpdateBatchArray Bulk change of user subscription actions in the server database.
SubscriptionHistoryDelete Delete a user subscription action from the server database.
SubscriptionHistoryDeleteBatch Delete a batch of user subscription actions from the server database.
file:///C:/Users/Administrator/AppData/Local/Temp/~hh4BC4.htm 7/17/2025
Manager API Page 443 of 464
Function Purpose
SubscriptionHistoryRequest Request user subscription action from the server for the specified date range.
SubscriptionHistoryRequestByID Request a subscription action from the server by its identifier.
SubscriptionHistoryRequestByIDs Request subscription actions from the server by a list of identifiers.
SubscriptionHistoryRequestByGroup Request subscription actions from the server by a client group.
SubscriptionHistoryRequestByLogins Request subscription actions from the server by a list of logins.
IMTManagerAPI::SubscriptionCreate
Create a subscription object.
C++
IMTSubscription* IMTManagerAPI::SubscriptionCreate()
.NET
CIMTSubscription CIMTManagerAPI.SubscriptionCreate()
Return Value
Returns a pointer to the created object that implements the IMTSubscription interface. Null is returned in case of failure.
Note
The created object must be destroyed by calling the IMTSubscription::Release method of this object.
IMTManagerAPI::SubscriptionCreateArray
Create an object of the subscriptions array.
C++
IMTSubscriptionArray* IMTManagerAPI::SubscriptionCreateArray()
.NET
CIMTSubscriptionArray CIMTManagerAPI.SubscriptionCreateArray()
Return Value
Returns a pointer to the created object that implements the IMTSubscriptionArray interface. Null is returned in case of failure.
Note
The created object must be destroyed by calling the IMTSubscriptionArray::Release method of this object.
IMTManagerAPI::SubscriptionJoin
Add a subscription for a user.
C++
MTAPIRES IMTManagerAPI::SubscriptionJoin(
const UINT64 login, // User
const UINT64 subscription, // Subscription configuration ID
IMTSubscription* record, // Subscription description
IMTSubscriptionHistory* history // Description of a subscription action
)
Parameters
login
[in] The login of the user, for whom the subscription is added.
subscription
[in] ID of subscription configuration to be added.
record
[out] Description of the created subscription.
history
[out] Description of the action which was performed to create the subscription.
Return Value
An indication of successful completion is the MT_RET_OK response code. Otherwise, an error code will be returned.
Note
When the method is called, it is checked whether subscription adding is allowed according to the IMTConSubscription::ControlMode parameter. If necessary, the subscription cost
is debited from the corresponding account. Thus, subscribing by this method is similar to how a trader subscribes.
When a subscription is added by this method, both handlers are called: IMTSubscriptionSink::OnSubscriptionJoin and IMTSubscriptionSink::OnSubscriptionAdd.
file:///C:/Users/Administrator/AppData/Local/Temp/~hh4BC4.htm 7/17/2025
Manager API Page 444 of 464
IMTManagerAPI::SubscriptionJoinBatch
Bulk adding of subscriptions for users.
C++
MTAPIRES IMTManagerAPI::SubscriptionJoinBatch(
const UINT64* logins, // Array of users
const UINT64* subscriptions, // Array of configuration IDs
const UINT total, // Number
MTAPIRES* results // Array of results
IMTSubscriptionArray* records, // Description of subscriptions
IMTSubscriptionHistoryArray* history // Description of subscription actions
)
Parameters
logins
[in] An array of user logins for which the subscriptions are added. The array size must match the array of the 'subscriptions' array.
subscriptions
[in] An array of IDs of subscription configurations which are added. The array size must match the array of the 'logins' array.
total
[in] The number of logins/subscriptions.
results
[out] an array with subscription adding results. The size of the 'results' array must not be less than that of 'logins'.
records
[out] An array of descriptions of created subscriptions.
history
[out] An array of descriptions of actions which were performed to create subscriptions
Return Value
The MT_RET_OK response code indicates that all orders have been updated. The MT_RET_ERR_PARTIAL response code means that only some of the subscriptions have been
added. Analyze the 'results' array for a detailed information on execution results. The result of adding of each subscription from the 'subscriptions' array is added to 'results'. The
result index corresponds to the subscription index in the source array.
Note
When the method is called, it is checked whether subscription adding is allowed according to the IMTConSubscription::ControlMode parameter. If necessary, the subscription cost
is debited from the corresponding account. Thus, subscribing by this method is similar to how a trader subscribes.
When a subscription is added by this method, both handlers are called: IMTSubscriptionSink::OnSubscriptionJoin and IMTSubscriptionSink::OnSubscriptionAdd.
Sorting of logins and subscriptions added for them in the 'logins' and 'subscriptions' arrays must match.
IMTManagerAPI::SubscriptionCancel
Cancel a subscription for a user.
C++
MTAPIRES IMTManagerAPI::SubscriptionCancel(
const UINT64 login, // User
const UINT64 subscription, // Subscription configuration ID
IMTSubscription* record, // Subscription description
IMTSubscriptionHistory* history // Description of a subscription action
)
Parameters
login
[in] The login of the user, for whom the subscription is canceled.
subscription
[in] ID of subscription configuration to be canceled.
record
[out] Description of the canceled subscription.
history
[out] Description of the action which was performed to cancel the subscription.
Return Value
An indication of successful completion is the MT_RET_OK response code. Otherwise, an error code will be returned.
Note
When the method is called, it is checked whether unsubscription is allowed according to the IMTConSubscription::ControlMode parameter.
When a subscription is canceled by this method, both handlers are called: IMTSubscriptionSink::OnSubscriptionCancel and IMTSubscriptionSink::OnSubscriptionDelete.
file:///C:/Users/Administrator/AppData/Local/Temp/~hh4BC4.htm 7/17/2025
Manager API Page 445 of 464
IMTManagerAPI::SubscriptionCancelBatch
Bulk canceling of user subscriptions.
C++
MTAPIRES IMTManagerAPI::SubscriptionCancelBatch(
const UINT64* logins, // Array of users
const UINT64* subscriptions, // Array of configuration IDs
const UINT total, // Number
MTAPIRES* results, // Array of results
IMTSubscriptionArray* records, // Description of subscriptions
IMTSubscriptionHistoryArray* history // Description of subscription actions
)
Parameters
logins
[in] An array of user logins for which the subscriptions are canceled. The array size must match the array of the 'subscriptions' array.
subscriptions
[in] An array of IDs of subscription configurations which are canceled. The array size must match the array of the 'logins' array.
total
[in] The number of logins/subscriptions.
results
[out] an array with subscription canceling results. The size of the 'results' array must not be less than that of 'logins'.
records
[out] An array of descriptions of canceled subscriptions.
history
[out] An array of descriptions of actions which were performed to canceled subscriptions
Return Value
The MT_RET_OK response code indicates that all orders have been updated. The MT_RET_ERR_PARTIAL response code means that only some of the subscriptions have been
added. To obtain further details, you can check subscription statuses in the returned 'records' array (IMTSubscription::Status).
Note
When the method is called, it is checked whether unsubscription is allowed according to the IMTConSubscription::ControlMode parameter.
When a subscription is added by this method, both handlers are called: IMTSubscriptionSink::OnSubscriptionJoin and IMTSubscriptionSink::OnSubscriptionAdd.
Sorting of logins and subscriptions added for them in the 'logins' and 'subscriptions' arrays must match.
IMTManagerAPI::SubscriptionUpdate
Edit a user subscription in the server database.
C++
MTAPIRES IMTManagerAPI::SubscriptionUpdate(
IMTSubscription* record // Subscription description
)
Parameters
record
[in] Subscription description. The key field for finding an exiting record is IMTSubscription::ID.
Return Value
An indication of successful completion is the MT_RET_OK response code. Otherwise, an error code will be returned. For example, if the specified subscription does not exist, the
response code MT_RET_ERR_NOTFOUND will be returned.
Note
When the method is called, it is NOT checked whether subscription change is allowed according to the IMTConSubscription::ControlMode parameter. Changes take place directly
in the database.
A subscription can only be updated from the applications connected to the trade server, on which the subscription has been created. For all other applications, the response code
MT_RET_ERR_NOTMAIN is returned. If the object is not found, the response code MT_RET_ERR_NOTFOUND is returned.
All required fields of subscriptions must be filled in, not only the ones that need to be changed. It is recommended that you first receive a subscription from the server, change
the required fields, and then send it back to the server.
The manager account requires the RIGHT_SUBSCRIPTIONS_EDIT permission in order to be able to use this function.
IMTManagerAPI::SubscriptionUpdateBatch
Bulk change of user subscriptions in the server database.
file:///C:/Users/Administrator/AppData/Local/Temp/~hh4BC4.htm 7/17/2025
Manager API Page 446 of 464
C++
MTAPIRES IMTManagerAPI::SubscriptionUpdateBatch(
IMTSubscriptionArray* records, // Array of subscriptions
MTAPIRES* results // Array of results
)
.NET
MTRetCode CIMTManagerAPI.SubscriptionUpdateBatch(
CIMTSubscriptionArray records, // Array of subscriptions
MTRetCode[] res // Array of results
)
Parameters
records
[in] Array of subscriptions. The key field for finding exiting records is IMTSubscription::ID.
results
[out] an array with subscription changing results. The size of the 'results' array must not be less than that of 'records'.
Return Value
The MT_RET_OK response code indicates that all subscriptions have been updated. The MT_RET_ERR_PARTIAL response code means that only some of the subscriptions have been
updated. Analyze the 'results' array for a detailed information on execution results. The result of update of each subscription from the 'records' array is added to 'results'. The
result index corresponds to the subscription index in the source array.
Note
When the method is called, it is NOT checked whether subscription change is allowed according to the IMTConSubscription::ControlMode parameter. Changes take place directly
in the database.
A subscription can only be updated from the applications connected to the trade server, on which the subscription has been created. For all other applications, the response code
MT_RET_ERR_NOTMAIN is returned. If the object is not found, the response code MT_RET_ERR_NOTFOUND is returned.
All required fields of subscriptions must be filled in, not only the ones that need to be changed. It is recommended that you first receive subscriptions from the server, change
the required fields, and then send them back to the server.
The manager account requires the RIGHT_SUBSCRIPTIONS_EDIT permission in order to be able to use this function.
IMTManagerAPI::SubscriptionUpdateBatchArray
Bulk change of user subscriptions in the server database.
C++
MTAPIRES IMTManagerAPI::SubscriptionUpdateBatchArray(
IMTSubscription** records, // Array of subscriptions
MTAPIRES* results // Array of results
)
.NET
MTRetCode CIMTManagerAPI.SubscriptionUpdateBatchArray(
CIMTSubscription[] records, // Array of subscriptions
MTRetCode[] res // Array of results
)
Parameters
records
[in] A pointer to the array of subscriptions. The key field for finding exiting records is IMTSubscription::ID.
results
[out] an array with subscription changing results. The size of the 'results' array must not be less than that of 'records'.
Return Value
The MT_RET_OK response code indicates that all subscriptions have been updated. The MT_RET_ERR_PARTIAL response code means that only some of the subscriptions have been
updated. Analyze the 'results' array for a detailed information on execution results. The result of update of each subscription from the 'records' array is added to 'results'. The
result index corresponds to the subscription index in the source array.
Note
When the method is called, it is NOT checked whether subscription change is allowed according to the IMTConSubscription::ControlMode parameter. Changes take place directly
in the database.
A subscription can only be updated from the applications connected to the trade server, on which the subscription has been created. For all other applications, the response code
MT_RET_ERR_NOTMAIN is returned. If the object is not found, the response code MT_RET_ERR_NOTFOUND is returned.
All required fields of subscriptions must be filled in, not only the ones that need to be changed. It is recommended that you first receive subscriptions from the server, change
the required fields, and then send them back to the server.
The manager account requires the RIGHT_SUBSCRIPTIONS_EDIT permission in order to be able to use this function.
IMTManagerAPI::SubscriptionDelete
Delete a user subscription from the server database.
C++
MTAPIRES IMTManagerAPI::SubscriptionDelete(
const UINT64 id // Subscription ID
)
Parameters
id
file:///C:/Users/Administrator/AppData/Local/Temp/~hh4BC4.htm 7/17/2025
Manager API Page 447 of 464
IMTManagerAPI::SubscriptionDeleteBatch
Delete a user subscription from the server database.
MTAPIRES IMTManagerAPI::SubscriptionDeleteBatch(
const UINT64* ids, // Array of IDs
const UINT ids_total, // Number of IDs in the array
MTAPIRES* results // Array of results
)
.NET
MTRetCode CIMTManagerAPI.SubscriptionDeleteBatch(
ulong[] ids, // Array of IDs
MTRetCode[] retcodes // Array of results
)
Parameters
ids
[in] A pointer to an array of IDs of subscriptions which you want to delete. The IMTSubscription::ID value is used as the identifier.
ids_total
[in] The number of identifiers in the 'ids' array.
results
[out] an array with subscription deletion results. The size of the 'results' array must not be less than that of 'ids'.
Return Value
The MT_RET_OK response code indicates that all subscriptions have been deleted. The MT_RET_ERR_PARTIAL response code means that only some of the subscriptions have been
deleted. Analyze the 'results' array for a detailed information on execution results. The result of deletion of each subscription from the 'ids' array is added to 'results'. The result
index corresponds to the id index in the source array.
Note
When the method is called, it is NOT checked whether subscription deletion is allowed according to the IMTConSubscription::ControlMode parameter. Changes take place directly
in the database.
A subscription can only be deleted from the applications connected to the trade server, on which the subscription has been created. For all other applications, the response code
MT_RET_ERR_NOTMAIN is returned. If the object is not found, the response code MT_RET_ERR_NOTFOUND is returned.
When a deleting a subscription by this method, the IMTSubscriptionSink::OnSubscriptionDelete handler is called, while the IMTSubscriptionSink::OnSubscriptionCancel handler is
not called.
The manager account requires the RIGHT_SUBSCRIPTIONS_EDIT permission in order to be able to use this function.
IMTManagerAPI::SubscriptionRequest
Request all user subscriptions from the server.
C++
MTAPIRES IMTManagerAPI::SubscriptionRequest(
const UINT64 login, // Login
IMTSubscriptionArray* records // Array of subscriptions
)
.NET
MTRetCode CIMTManagerAPI.SubscriptionRequest(
ulong login, // Login
CIMTSubscriptionArray records // Array of subscriptions
)
Parameters
login
[in] The login of the user whose subscriptions you want to obtain.
records
[out] An object of the array of subscriptions. The 'records' object must be previously created via the IMTManagerAPI::SubscriptionCreateArray method.
Return Value
An indication of successful completion is the MT_RET_OK response code. Otherwise, an error code will be returned.
Note
The method cannot be called from event handlers (any IMT*Sink class methods).
file:///C:/Users/Administrator/AppData/Local/Temp/~hh4BC4.htm 7/17/2025
Manager API Page 448 of 464
IMTManagerAPI::SubscriptionRequestByID
Request a subscription from the server by ID.
C++
MTAPIRES IMTManagerAPI::SubscriptionRequestByID(
const UINT64 id, // ID
IMTSubscription* record // Subscription object
)
.NET
MTRetCode CIMTManagerAPI.SubscriptionRequestByID(
ulong id, // ID
CIMTSubscription record // Subscription object
)
Parameters
id
[in] Subscription ID. The IMTSubscription::ID value is used as the identifier.
record
[out] Subscription object. The 'record' object must be previously created via the IMTManagerAPI::SubscriptionCreate method.
Return Value
An indication of successful completion is the MT_RET_OK response code. Otherwise, an error code will be returned.
Note
The method cannot be called from event handlers (any IMT*Sink class methods).
IMTManagerAPI::SubscriptionRequestByIDs
Request subscriptions from the server by a list of IDs.
C++
MTAPIRES IMTManagerAPI::SubscriptionRequestByIDs(
const UINT64* ids, // IDs
const UINT ids, // Number of IDs
IMTSubscriptionArray* records // Object of array of subscriptions
)
.NET
MTRetCode CIMTManagerAPI.SubscriptionRequestByIDs(
ulong[] ids, // IDs
CIMTSubscriptionArray records // Object of array of subscriptions
)
Parameters
ids
[in] Array of subscription identifiers. The IMTSubscription::ID value is used as the identifier.
ids_total
[in] The number of identifiers in the 'ids' array.
records
[out] An object of the array of subscriptions. The 'records' object must be previously created via the IMTManagerAPI::SubscriptionCreateArray method.
Return Value
An indication of successful completion is the MT_RET_OK response code. Otherwise, an error code will be returned.
Note
The method cannot be called from event handlers (any IMT*Sink class methods).
IMTManagerAPI::SubscriptionRequestByGroup
Request subscriptions from the server by a client group.
C++
MTAPIRES IMTManagerAPI::SubscriptionRequestByGroup(
LPCWSTR group, // Group
IMTSubscriptionArray* records // Object of array of subscriptions
)
.NET
MTRetCode CIMTManagerAPI.SubscriptionRequestByGroup(
string mask, // Group
CIMTSubscriptionArray records // Object of array of subscriptions
)
Parameters
group
[in] The groups for which the subscriptions are requested. You can specify one group, several groups (comma separated) or a group mask. The mask is specified using
characters "*" (any value) and "!" (exception). For example: "demo*,!demoforex" - all groups whose names begin with 'demo', except for the group demoforex.
records
[out] An object of the array of subscriptions. The 'records' object must be previously created via the IMTManagerAPI::SubscriptionCreateArray method.
Return Value
file:///C:/Users/Administrator/AppData/Local/Temp/~hh4BC4.htm 7/17/2025
Manager API Page 449 of 464
An indication of successful completion is the MT_RET_OK response code. Otherwise, an error code will be returned.
Note
The method cannot be called from event handlers (any IMT*Sink class methods).
IMTManagerAPI::SubscriptionRequestByLogins
Request subscriptions from the server by a list of logins.
C++
MTAPIRES IMTManagerAPI::SubscriptionRequestByLogins(
const UINT64* logins, // Logins
const UINT logins_total, // Number of logins
IMTSubscriptionArray* records // Object of array of subscriptions
)
.NET
MTRetCode CIMTManagerAPI.SubscriptionRequestByLogins(
ulong[] logins, // Logins
CIMTSubscriptionArray records // Object of array of subscriptions
)
Parameters
logins
[in] Array of client logins.
logins_total
[in] Number of logins in the 'logins' array.
records
[out] An object of the array of subscriptions. The 'records' object must be previously created via the IMTManagerAPI::SubscriptionCreateArray method.
Return Value
An indication of successful completion is the MT_RET_OK response code. Otherwise, an error code will be returned.
Note
The method cannot be called from event handlers (any IMT*Sink class methods).
IMTManagerAPI::SubscriptionHistoryCreate
Create a subscription action object.
C++
IMTSubscriptionHistory* IMTManagerAPI::SubscriptionHistoryCreate()
.NET
CIMTSubscriptionHistory CIMTManagerAPI.SubscriptionHistoryCreate()
Return Value
Returns a pointer to the created object that implements the IMTSubscriptionHistory interface. Null is returned in case of failure.
Note
The created object must be destroyed by calling the IMTSubscriptionHistory::Release method of this object.
IMTManagerAPI::SubscriptionHistoryCreateArray
Create an object of an array of subscription actions.
C++
IMTSubscriptionHistoryArray* IMTManagerAPI::SubscriptionHistoryCreateArray()
.NET
CIMTSubscriptionHistoryArray CIMTManagerAPI.SubscriptionHistoryCreateArray()
Return Value
Returns a pointer to the created object that implements the IMTSubscriptionHistoryArray interface. Null is returned in case of failure.
Note
The created object must be destroyed by calling the IMTSubscriptionHistoryArray::Release method of this object.
IMTManagerAPI::SubscriptionHistoryUpdate
Edit a user subscription action in the server database.
C++
MTAPIRES IMTManagerAPI::SubscriptionHistoryUpdate(
IMTSubscriptionHistory* record // Action description
)
file:///C:/Users/Administrator/AppData/Local/Temp/~hh4BC4.htm 7/17/2025
Manager API Page 450 of 464
MTRetCode CIMTManagerAPI.SubscriptionHistoryUpdate(
CIMTSubscriptionHistory record // Action description
)
Parameters
record
[in] Subscription action description. The key field for finding an exiting record is IMTSubscriptionHistory::ID.
Return Value
An indication of successful completion is the MT_RET_OK response code. Otherwise, an error code will be returned. For example, if the specified subscription does not exist, the
response code MT_RET_ERR_NOTFOUND will be returned.
Note
An action can only be edited from the applications connected to the trade server, on which the action has been created. For all other applications, the response code
MT_RET_ERR_NOTMAIN is returned. If the object is not found, the response code MT_RET_ERR_NOTFOUND is returned.
All required action fields must be filled in, not only the ones that need to be changed. It is recommended that you first receive an action description from the server, change the
required fields in them and then send it back to the server.
The manager account must have the RIGHT_SUBSCRIPTIONS_EDIT permission to use this function.
IMTManagerAPI::SubscriptionHistoryUpdateBatch
Bulk change of user subscription actions in the server database.
C++
MTAPIRES IMTManagerAPI::SubscriptionHistoryUpdateBatch(
IMTSubscriptionHistoryArray* records, // Array of actions
MTAPIRES* results // Array of results
)
.NET
MTRetCode CIMTManagerAPI.SubscriptionHistoryUpdateBatch(
CIMTSubscriptionHistoryArray records, // Array of actions
MTRetCode[] res // Array of reasults
)
Parameters
records
[in] Array of subscription actions. The key field for finding exiting records is IMTSubscriptionHistory::ID.
results
[out] An array with action editing results. The size of the 'results' array must not be less than that of 'records'.
Return Value
The MT_RET_OK response code means that all specified actions have been updated. The MT_RET_ERR_PARTIAL response code means that only some of the actions have been
updated. Analyze the 'results' array for a detailed information on execution results. The result of update of each subscription action from the 'records' array is added to 'results'.
The index of a result corresponds to the index of a subscription in the source array.
Note
An action can only be edited from the applications connected to the trade server, on which the action has been created. For all other applications, the response code
MT_RET_ERR_NOTMAIN is returned. If the object is not found, the response code MT_RET_ERR_NOTFOUND is returned.
All required action fields must be filled in, not only the ones that need to be changed. It is recommended that you first receive action descriptions from the server, change the
required fields in them and then send them back to the server.
The manager account must have the RIGHT_SUBSCRIPTIONS_EDIT permission to use this function.
IMTManagerAPI::SubscriptionHistoryUpdateBatchArray
Bulk change of user subscription actions in the server database.
C++
MTAPIRES IMTManagerAPI::SubscriptionHistoryUpdateBatchArray(
IMTSubscriptionHistory** records, // Array of actions
MTAPIRES* results // Array of results
)
.NET
MTRetCode CIMTManagerAPI.SubscriptionHistoryUpdateBatchArray(
CIMTSubscriptionHistory[] records, // Array of actions
MTRetCode[] res // Array of results
)
Parameters
records
[in] A pointer to an array of subscription actions. The key field for finding exiting records is IMTSubscriptionHistory::ID.
results
[out] An array with action editing results. The size of the 'results' array must not be less than that of 'records'.
Return Value
The MT_RET_OK response code means that all specified actions have been updated. The MT_RET_ERR_PARTIAL response code means that only some of the actions have been
updated. Analyze the 'results' array for a detailed information on execution results. The result of update of each subscription action from the 'records' array is added to 'results'.
The index of a result corresponds to the index of a subscription in the source array.
Note
An action can only be edited from the applications connected to the trade server, on which the action has been created. For all other applications, the response code
MT_RET_ERR_NOTMAIN is returned. If the object is not found, the response code MT_RET_ERR_NOTFOUND is returned.
All required action fields must be filled in, not only the ones that need to be changed. It is recommended that you first receive action descriptions from the server, change the
required fields in them and then send them back to the server.
file:///C:/Users/Administrator/AppData/Local/Temp/~hh4BC4.htm 7/17/2025
Manager API Page 451 of 464
The manager account must have the RIGHT_SUBSCRIPTIONS_EDIT permission to use this function.
IMTManagerAPI::SubscriptionHistoryDelete
Delete a user subscription action from the server database.
C++
MTAPIRES IMTManagerAPI::SubscriptionHistoryDelete(
const UINT64 id // Action identifier
)
Parameters
id
[in] Action identifier. The IMTSubscriptionHistory::ID value is used for the identifier.
Return Value
An indication of successful completion is the MT_RET_OK response code. Otherwise, an error code will be returned. For example, if the specified subscription does not exist, the
response code MT_RET_ERR_NOTFOUND will be returned.
Note
An action can only be deleted from the applications connected to the trade server, on which the action has been created. For all other applications, the response code
MT_RET_ERR_NOTMAIN is returned. If the object is not found, the response code MT_RET_ERR_NOTFOUND is returned.
The manager account must have the RIGHT_SUBSCRIPTIONS_EDIT permission to use this function.
IMTManagerAPI::SubscriptionHistoryDeleteBatch
Delete a batch of user subscription actions from the server database.
MTAPIRES IMTManagerAPI::SubscriptionHistoryDeleteBatch(
const UINT64* ids, // Array of IDs
const UINT ids_total, // The number of IDs in the array
MTAPIRES* results // Array of results
)
.NET
MTRetCode CIMTManagerAPI.SubscriptionHistoryDeleteBatch(
ulong[] ids, // Array of IDs
MTRetCode[] retcodes // Array of results
)
Parameters
ids
[in] A pointer to an array of IDs of subscription actions which you want to delete. The IMTSubscriptionHistory::ID value is used for the identifier.
ids_total
[in] The number of identifiers in the 'ids' array.
results
[out] An array with action deletion results. The size of the 'results' array must not be less than that of 'ids'.
Return Value
The MT_RET_OK response code indicates that all actions have been deleted. The MT_RET_ERR_PARTIAL response code means that only some of the actions have been deleted.
Analyze the 'results' array for a detailed information on execution results. The result of deletion of each action from the 'ids' array is added to 'results'. The result index
corresponds to the action index in the source array.
Note
An action can only be deleted from the applications connected to the trade server, on which the action has been created. For all other applications, the response code
MT_RET_ERR_NOTMAIN is returned. If the object is not found, the response code MT_RET_ERR_NOTFOUND is returned.
The manager account must have the RIGHT_SUBSCRIPTIONS_EDIT permission to use this function.
IMTManagerAPI::SubscriptionHistoryRequest
Request user subscription action from the server for the specified date range.
C++
MTAPIRES IMTManagerAPI::SubscriptionHistoryRequest(
const UINT64 login, // Login
const INT64 from, // Period start
const INT64 to, // Period end
IMTSubscriptionHistoryArray* records // Array of actions
)
.NET
MTRetCode CIMTManagerAPI.SubscriptionHistoryRequest(
ulong login, // Login
long from, // Period start
long to, // Period end
CIMTSubscriptionHistoryArray records // Array of actions
)
Parameters
login
file:///C:/Users/Administrator/AppData/Local/Temp/~hh4BC4.htm 7/17/2025
Manager API Page 452 of 464
[in] The login of the user whose actions you want to obtain.
from
[in] The beginning of the period for which you need to get actions. The date is specified in seconds since 01.01.1970.
to
[in] The end of the period for which you need to get actions. The date is specified in seconds since 01.01.1970.
records
[out] Object of an array of subscription actions. The 'records' object must be pre-created by the IMTManagerAPI::SubscriptionHistoryCreateArray method.
Return Value
An indication of successful completion is the MT_RET_OK response code. Otherwise, an error code will be returned.
Note
The method cannot be called from event handlers (any IMT*Sink class methods).
IMTManagerAPI::SubscriptionHistoryRequestByID
Request a subscription action from the server by its identifier.
C++
MTAPIRES IMTManagerAPI::SubscriptionHistoryRequestByID(
const UINT64 id, // Identifier
IMTSubscriptionHistory* record // Action object
)
.NET
MTRetCode CIMTManagerAPI.SubscriptionHistoryRequestByID(
ulong id, // Identifier
CIMTSubscriptionHistory record // Action object
)
Parameters
id
[in] Subscription action identifier. The IMTSubscriptionHistory::ID value is used for the identifier.
record
[out] Subscription action object. The 'record' object must be previously created via the IMTManagerAPI::SubscriptionHistoryCreate method.
Return Value
An indication of successful completion is the MT_RET_OK response code. Otherwise, an error code will be returned.
Note
The method cannot be called from event handlers (any IMT*Sink class methods).
IMTManagerAPI::SubscriptionHistoryRequestByIDs
Request subscription actions from the server by a list of identifiers.
C++
MTAPIRES IMTManagerAPI::SubscriptionHistoryRequestByIDs(
const UINT64* ids, // IDs
const UINT ids, // Number of IDs
IMTSubscriptionHistoryArray* records // Object of the actions array
)
.NET
MTRetCode CIMTManagerAPI.SubscriptionHistoryRequestByIDs(
ulong[] ids, // IDs
CIMTSubscriptionHistoryArray records // Object of an array of actions
)
Parameters
ids
[in] Array of action identifiers. The IMTSubscriptionHistory::ID value is used for the identifier.
ids_total
[in] The number of identifiers in the 'ids' array.
records
[out] Object of an array of subscription actions. The 'records' object must be pre-created by the IMTManagerAPI::SubscriptionHistoryCreateArray method.
Return Value
An indication of successful completion is the MT_RET_OK response code. Otherwise, an error code will be returned.
Note
The method cannot be called from event handlers (any IMT*Sink class methods).
IMTManagerAPI::SubscriptionHistoryRequestByGroup
Request subscription actions from the server by a client group.
C++
file:///C:/Users/Administrator/AppData/Local/Temp/~hh4BC4.htm 7/17/2025
Manager API Page 453 of 464
MTAPIRES IMTManagerAPI::SubscriptionHistoryRequestByGroup(
LPCWSTR group, // Group
const INT64 from, // Period start
const INT64 to, // Period end
IMTSubscriptionHistoryArray* records // Object of the actions array
)
.NET
MTRetCode CIMTManagerAPI.SubscriptionHistoryRequestByGroup(
string mask, // Group
long from, // Period start
long to, // Period end
CIMTSubscriptionHistoryArray records // Action array object
)
Parameters
group
[in] The groups the actions are requested for. You can specify one group, several groups (comma separated) or a group mask. The mask is specified using characters "*" (any
value) and "!" (exception). For example: "demo*,!demoforex" - all groups with the names beginning with 'demo', except for the group demoforex.
from
[in] The beginning of the period for which you need to get actions. The date is specified in seconds since 01.01.1970.
to
[in] The end of the period for which you need to get actions. The date is specified in seconds since 01.01.1970.
records
[out] Object of an array of subscription actions. The 'records' object must be pre-created by the IMTManagerAPI::SubscriptionHistoryCreateArray method.
Return Value
An indication of successful completion is the MT_RET_OK response code. Otherwise, an error code will be returned.
Note
The method cannot be called from event handlers (any IMT*Sink class methods).
IMTManagerAPI::SubscriptionHistoryRequestByLogins
Request subscription actions from the server by a list of logins.
C++
MTAPIRES IMTManagerAPI::SubscriptionHistoryRequestByLogins(
const UINT64* logins, // Logins
const UINT logins_total, // Number of logins
const INT64 from, // Period start
const INT64 to, // Period end
IMTSubscriptionHistoryArray* records // Action array object
)
.NET
MTRetCode CIMTManagerAPI.SubscriptionHistoryRequestByLogins(
ulong[] logins, // Logins
long from, // Period start
long to, // Period end
CIMTSubscriptionHistoryArray records // Action array object
)
Parameters
logins
[in] Array of client logins.
logins_total
[in] Number of logins in the 'logins' array.
from
[in] The beginning of the period for which you need to get actions. The date is specified in seconds since 01.01.1970.
to
[in] The end of the period for which you need to get actions. The date is specified in seconds since 01.01.1970.
records
[out] Object of an array of subscription actions. The 'records' object must be pre-created by the IMTManagerAPI::SubscriptionHistoryCreateArray method.
Return Value
An indication of successful completion is the MT_RET_OK response code. Otherwise, an error code will be returned.
Note
The method cannot be called from event handlers (any IMT*Sink class methods).
Custom Functions
MetaTrader 5 Manager API provides the possibility of extending the protocol for running custom commands on the server. Currently, there are two functions for this purpose:
Function Purpose
CustomCommand Sends a custom command to the server.
CustomCreateStream Creation of an object of a byte stream.
file:///C:/Users/Administrator/AppData/Local/Temp/~hh4BC4.htm 7/17/2025
Manager API Page 454 of 464
IMTManagerAPI::CustomCommand
Sends a custom command to the server.
C++
virtual MTAPIRES IMTManagerAPI::CustomCommand(
LPCVOID indata, // Input data
const UINT indata_len, // Size of input data
LPVOID& outdata, // Output data
UINT& outdata_len // Size of output data
)
.NET
byte[] CIMTManagerAPI.CustomCommand(
byte[] indata, // Input data
out MTRetCode res // Response code
)
Parameters
indata
[in] Data returned to the server.
indata_len
[in] Size of data to pass in bytes.
outdata
[out] A reference to the data returned in response to the command.
outdata_len
[out] A reference to the size of data returned in response to the command.
Return Value
An indication of successful completion is the MT_RET_OK response code. Otherwise, an error has occurred that corresponds to the response code.
Note
An appropriate plugin must be installed in the server for processing custom commands (IMTCustomSink::HookManagerCommand).
It is recommended to use this variant of the function only when working with small and infrequent data transmissions. The second variant of the function described below is
adapted for transmission of large amount of data.
IMTManagerAPI::CustomCommand
Sends a custom command to the server.
C++
virtual MTAPIRES IMTManagerAPI::CustomCommand(
IMTByteStream* indata, // Input data
IMTByteStream* outdata, // Output data
)
.NET
MTRetCode CIMTManagerAPI.CustomCommand(
CIMTByteStream indata, // Input data
CIMTByteStream outdata, // Output data
)
Parameters
indata
[in] A pointer to the object of a byte stream passed to the server.
outdata
[out] A pointer to the object of a byte stream returned in response to the command.
Return Value
An indication of successful completion is the MT_RET_OK response code. Otherwise, an error has occurred that corresponds to the response code.
Note
An appropriate plugin must be installed in the server for processing custom commands. (IMTCustomSink::HookManagerCommand).
For transmission of large amount of data and for frequent transmissions it is recommended to use this exact variant of the function.
IMTManagerAPI::CustomCreateStream
Creation of an object of a byte stream.
C++
IMTByteStream* IMTManagerAPI::CustomCreateStream()
.NET
CIMTByteStream CIMTManagerAPI.CustomCreateStream()
Return Value
It returns a pointer to the created object that implements the IMTByteStream interface. In case of failure, it returns NULL.
Note
The created object must be deleted by calling the IMTByteStream::Release method of this object.
file:///C:/Users/Administrator/AppData/Local/Temp/~hh4BC4.htm 7/17/2025
Manager API Page 455 of 464
ECN
MetaTrader 5 API provides access to built-in ECN databases. Functions from these section enable the detailed analysis of the current matching queue and history, of operations with
liquidity providers and other data.
Function Purpose
ECNCreateMatching Create a matching order object.
ECNCreateMatchingArray Create an array of matching order objects.
ECNCreateFilling Create a filling order object.
ECNCreateFillingArray Create an array of filling objects.
ECNCreateProvider Create an object of a provider via which orders are executed.
ECNCreateProviderArray Create an object of the array of providers via which orders are executed.
ECNCreateHistoryMatching Create an object of a matching order from history.
ECNCreateHistoryMatchingArray Create an array of matching order objects from history.
ECNCreateHistoryFilling Create an object of a filling order from history.
ECNCreateHistoryFillingArray Create an array of filling order objects from history.
ECNCreateHistoryDeal Create an object of a deal from the ECN history.
ECNCreateHistoryDealArray Create an object of an array of deals from the ECN history.
ECNRequestByGroup Request the current state of matching for the specified client groups.
ECNRequestByLogins Request the current state of matching for the specified logins.
ECNRequestByTickets Request the current state of matching for the specified order tickets.
ECNRequestHistoryByGroup Request the matching history for the specified client groups.
ECNRequestHistoryByLogins Request the matching history for the specified logins.
ECNRequestHistoryByTickets Request the matching history for the specified order tickets.
IMTManagerAPI::ECNCreateMatching
Create a matching order object.
C++
IMTECNMatching* IMTManagerAPI::ECNCreateMatching()
.NET
CIMTECNMatching CIMTManagerAPI.ECNCreateMatching()
Return Value
The function returns a pointer to the created object that implements the IMTECNMatching interface. Null is returned in case of failure.
Note
The created object must be destroyed by calling the IMTECNMatching::Release method of this object.
IMTManagerAPI::ECNCreateMatchingArray
Create an array of matching order objects.
C++
IMTECNMatchingArray* IMTManagerAPI::ECNCreateMatchingArray()
.NET
CIMTECNMatchingArray CIMTManagerAPI.ECNCreateMatchingArray()
Return Value
The function returns a pointer to the created object that implements the IMTECNMatchingArray interface. Null is returned in case of failure.
Note
The created object must be destroyed by calling the IMTECNMatchingArray::Release method of this object.
IMTManagerAPI::ECNCreateFilling
Create a filling order object.
C++
IMTECNFilling* IMTManagerAPI::ECNCreateFilling()
.NET
CIMTECNFilling CIMTManagerAPI.ECNCreateFilling()
Return Value
The function returns a pointer to the created object that implements the IMTECNFilling interface. Null is returned in case of failure.
Note
file:///C:/Users/Administrator/AppData/Local/Temp/~hh4BC4.htm 7/17/2025
Manager API Page 456 of 464
The created object must be destroyed by calling the IMTECNFilling::Release method of this object.
IMTManagerAPI::ECNCreateFillingArray
Create an array of filling objects.
C++
IMTECNFillingArray* IMTManagerAPI::ECNCreateFillingArray()
.NET
CIMTECNFillingArray CIMTManagerAPI.ECNCreateFillingArray()
Return Value
The function returns a pointer to the created object that implements the IMTECNFillingArray interface. Null is returned in case of failure.
Note
The created object must be destroyed by calling the IMTECNFillingArray::Release method of this object.
IMTManagerAPI::ECNCreateProvider
Create an object of a provider via which orders are executed.
C++
IMTECNProvider* IMTManagerAPI::ECNCreateProvider()
.NET
CIMTECNProvider CIMTManagerAPI.ECNCreateProvider()
Return Value
The function returns a pointer to the created object that implements the IMTECNProvider interface. Null is returned in case of failure.
Note
The created object must be destroyed by calling the IMTECNProvider::Release method of this object.
IMTManagerAPI::ECNCreateProviderArray
Create an object of the array of providers via which orders are executed.
C++
IMTECNProviderArray* IMTManagerAPI::ECNCreateProviderArray()
.NET
CIMTECNProviderArray CIMTManagerAPI.ECNCreateProviderArray()
Return Value
The function returns a pointer to the created object that implements the IMTECNProviderArray interface. Null is returned in case of failure.
Note
The created object must be destroyed by calling the IMTECNProviderArray::Release method of this object.
IMTManagerAPI::ECNCreateHistoryMatching
Create an object of a matching order from history.
C++
IMTECNHistoryMatching* IMTManagerAPI::ECNCreateHistoryMatching()
.NET
CIMTECNHistoryMatching CIMTManagerAPI.ECNCreateHistoryMatching()
Return Value
The function returns a pointer to the created object that implements the IMTECNHistoryFillingArray interface. Null is returned in case of failure.
Note
The created object must be destroyed by calling the IMTECNHistoryMatching::Release method of this object.
IMTManagerAPI::ECNCreateHistoryMatchingArray
Create an array of matching order objects from history.
C++
IMTECNHistoryMatchingArray* IMTManagerAPI::ECNCreateHistoryMatchingArray()
.NET
CIMTECNHistoryMatchingArray CIMTManagerAPI.ECNCreateHistoryMatchingArray()
file:///C:/Users/Administrator/AppData/Local/Temp/~hh4BC4.htm 7/17/2025
Manager API Page 457 of 464
Return Value
The function returns a pointer to the created object that implements the IMTECNHistoryMatchingArray interface. Null is returned in case of failure.
Note
The created object must be destroyed by calling the IMTECNHistoryMatchingArray::Release method of this object.
IMTManagerAPI::ECNCreateHistoryFilling
Create an object of a filling order from history.
C++
IMTECNHistoryFilling* IMTManagerAPI::ECNCreateHistoryFilling()
.NET
CIMTECNHistoryFilling CIMTManagerAPI.ECNCreateHistoryFilling()
Return Value
The function returns a pointer to the created object that implements the IMTECNHistoryFilling interface. Null is returned in case of failure.
Note
The created object must be destroyed by calling the IMTECNHistoryFilling::Release method of this object.
IMTManagerAPI::ECNCreateHistoryFillingArray
Create an array of filling order objects from history.
C++
IMTECNHistoryFillingArray* IMTManagerAPI::ECNCreateHistoryFillingArray()
.NET
CIMTECNHistoryFillingArray CIMTManagerAPI.ECNCreateHistoryFillingArray()
Return Value
The function returns a pointer to the created object that implements the IMTECNHistoryFillingArray interface. Null is returned in case of failure.
Note
The created object must be destroyed by calling the IMTECNHistoryFillingArray::Release method of this object.
IMTManagerAPI::ECNCreateHistoryDeal
Create an object of a deal from the ECN history.
C++
IMTECNHistoryDeal* IMTManagerAPI::ECNCreateHistoryDeal()
.NET
CIMTECNHistoryDeal CIMTManagerAPI.ECNCreateHistoryDeal()
Return Value
The function returns a pointer to the created object that implements the IMTECNHistoryFilling interface. Null is returned in case of failure.
Note
The created object must be destroyed by calling the IMTECNHistoryDeal::Release method of this object.
IMTManagerAPI::ECNCreateHistoryDealArray
Create an object of an array of deals from the ECN history.
C++
IMTECNHistoryDealArray* IMTManagerAPI::ECNCreateHistoryDealArray()
.NET
IMTECNHistoryDealArray CIMTManagerAPI.ECNCreateHistoryDealArray()
Return Value
The function returns a pointer to the created object that implements the IMTECNHistoryFilling interface. Null is returned in case of failure.
Note
The created object must be destroyed by calling the IMTECNHistoryDealArray::Release method of this object.
IMTManagerAPI::ECNRequestByGroup
Request the current state of matching for the specified client groups.
C++
file:///C:/Users/Administrator/AppData/Local/Temp/~hh4BC4.htm 7/17/2025
Manager API Page 458 of 464
MTAPIRES IMTManagerAPI::ECNRequestByGroup(
LPCWSTR mask, // groups
IMTECNMatchingArray* matching, // array of matching orders
IMTECNFillingArray* filling, // array of filling orders
IMTECNProviderArray* providers // array of providers
)
.NET
MTRetCode CIMTManagerAPI.ECNRequestByGroup(
string mask, // groups
CIMTECNMatchingArray matching, // array of matching orders
CIMTECNFillingArray filling, // array of filling orders
CIMTECNProviderArray providers // array of providers
)
Parameters
groups
[in] Client group the data is requested for. You can specify one group, several groups (comma separated) or a group mask. The mask is specified using characters "*" (any value)
and "!" (exception). For example: "demo*,!demoforex" - all groups whose names begin with 'demo', except for the group demoforex.
matching
[out] An object of the array of matching orders. The 'matching' object must be previously created via the IMTAdminAPI::ECNCreateMatchingArray method.
filling
[out] An object of the array of filling orders. The 'filling' object must be previously created via the IMTAdminAPI::ECNCreateFillingArray method.
providers
[out] An object of the array of providers. The 'providers' object must be previously created via the IMTAdminAPI::ECNCreateProvidersArray method.
Return Value
An indication of a successful execution is the MT_RET_OK response code. Otherwise, an error code is returned.
Note
The method cannot be called from event handlers (any IMT*Sink class methods).
IMTManagerAPI::ECNRequestByLogins
Request the current state of matching for the specified logins.
C++
MTAPIRES IMTManagerAPI::ECNRequestByLogins(
const UINT64* logins, // logins
const UINT logins_total, // number of logins
IMTECNMatchingArray* matching, // array of matching orders
IMTECNFillingArray* filling, // array of filling orders
IMTECNProviderArray* providers // array of providers
)
.NET
MTRetCode CIMTManagerAPI.ECNRequestByLogins(
ulong[] logins, // logins
CIMTECNMatchingArray matching, // array of matching orders
CIMTECNFillingArray filling, // array of filling orders
CIMTECNProviderArray providers // array of providers
)
Parameters
logins
[in] An array of logins the data is requested for.
logins_total
[in] The number of logins in the 'logins' array.
matching
[out] An object of the array of matching orders. The 'matching' object must be previously created via the IMTAdminAPI::ECNCreateMatchingArray method.
filling
[out] An object of the array of filling orders. The 'filling' object must be previously created via the IMTAdminAPI::ECNCreateFillingArray method.
providers
[out] An object of the array of providers. The 'providers' object must be previously created via the IMTAdminAPI::ECNCreateProvidersArray method.
Return Value
An indication of a successful execution is the MT_RET_OK response code. Otherwise, an error code is returned.
Note
The method cannot be called from event handlers (any IMT*Sink class methods).
IMTManagerAPI::ECNRequestByTickets
Request the current state of matching for the specified order tickets.
C++
MTAPIRES IMTManagerAPI::ECNRequestByTickets(
const UINT64* tickets, // tickets
const UINT tickets_total, // number of tickets
IMTECNMatchingArray* matching, // array of matching orders
IMTECNFillingArray* filling, // array of filling orders
IMTECNProviderArray* providers // array of providers
)
.NET
file:///C:/Users/Administrator/AppData/Local/Temp/~hh4BC4.htm 7/17/2025
Manager API Page 459 of 464
MTRetCode CIMTManagerAPI.ECNRequestByTickets(
ulong[] tickets, // tickets
CIMTECNMatchingArray matching, // array of matching orders
CIMTECNFillingArray filling, // array of filling orders
CIMTECNProviderArray providers // array of providers
)
Parameters
tickets
[in] An array of tickets the data is requested for.
tickets_total
[in] The number of tickets in the 'tickets' array.
matching
[out] An object of the array of matching orders. The 'matching' object must be previously created via the IMTAdminAPI::ECNCreateMatchingArray method.
filling
[out] An object of the array of filling orders. The 'filling' object must be previously created via the IMTAdminAPI::ECNCreateFillingArray method.
providers
[out] An object of the array of providers. The 'providers' object must be previously created via the IMTAdminAPI::ECNCreateProvidersArray method.
Return Value
An indication of a successful execution is the MT_RET_OK response code. Otherwise, an error code is returned.
Note
The method cannot be called from event handlers (any IMT*Sink class methods).
IMTManagerAPI::ECNRequestHistoryByGroup
Request the matching history for the specified client groups.
C++
MTAPIRES IMTManagerAPI::ECNRequestHistoryByGroup(
LPCWSTR mask, // groups
const INT64 from, // period beginning
const INT64 to, // period end
IMTECNHistoryMatchingArray* matching, // array of matching orders
IMTECNHistoryFillingArray* filling, // array of filling orders
IMTECNHistoryDealArray* deals, // array of deals
IMTECNProviderArray* providers // array of providers
)
.NET
MTRetCode CIMTManagerAPI.ECNRequestHistoryByGroup(
string mask, // groups
long from, // period beginning
long to, // period end
CIMTECNMatchingArray matching, // array of matching orders
CIMTECNFillingArray filling, // array of filling orders
CIMTECNHistoryDealArray deals, // array of deals
CIMTECNProviderArray providers // array of providers
)
Parameters
groups
[in] Client group the data is requested for. You can specify one group, several groups (comma separated) or a group mask. The mask is specified using characters "*" (any value)
and "!" (exception). For example: "demo*,!demoforex" - all groups whose names begin with 'demo', except for the group demoforex.
from
[in] The beginning of the period for which you need to get data. The date is specified in seconds since 01.01.1970.
to
[in] The end of the period for which you need to get data. The date is specified in seconds since 01.01.1970.
matching
[out] An object of the array of matching orders from history. The 'matching' object must be previously created via the IMTAdminAPI::ECNCreateHistoryMatchingArray method.
filling
[out] An object of the array of filling orders from history. The 'filling' object must be previously created via the IMTAdminAPI::ECNCreateHistoryFillingArray method.
deals
[out] An object of the array of deals from history. The 'deals' object must be previously created via the IMTAdminAPI::ECNCreateHistoryDealArray method.
providers
[out] An object of the array of providers. The 'providers' object must be previously created via the IMTAdminAPI::ECNCreateProvidersArray method.
Return Value
An indication of a successful execution is the MT_RET_OK response code. Otherwise, an error code is returned.
Note
The method cannot be called from event handlers (any IMT*Sink class methods).
IMTManagerAPI::ECNRequestByLogins
Request the matching history for the specified logins.
C++
file:///C:/Users/Administrator/AppData/Local/Temp/~hh4BC4.htm 7/17/2025
Manager API Page 460 of 464
MTAPIRES IMTManagerAPI::ECNRequestByLogins(
const UINT64* logins, // logins
const UINT logins_total, // the number of logins
const INT64 from, // period beginning
const INT64 to, // period end
IMTECNHistoryMatchingArray* matching, // array of matching orders
IMTECNHistoryFillingArray* filling, // array of filling objects
IMTECNHistoryDealArray* deals, // array of deals
IMTECNProviderArray* providers // array of providers
)
.NET
MTRetCode CIMTManagerAPI.ECNRequestByLogins(
ulong[] logins, // logins
long from, // period beginning
long to, // period end
CIMTECNMatchingArray matching, // array of matching orders
CIMTECNFillingArray filling, // array of filling orders
CIMTECNHistoryDealArray deals, // array of deals
CIMTECNProviderArray providers // array of providers
)
Parameters
logins
[in] An array of logins the data is requested for.
logins_total
[in] The number of logins in the 'logins' array.
from
[in] The beginning of the period for which you need to get data. The date is specified in seconds since 01.01.1970.
to
[in] The end of the period for which you need to get data. The date is specified in seconds since 01.01.1970.
matching
[out] An object of the array of matching orders from history. The 'matching' object must be previously created via the IMTAdminAPI::ECNCreateHistoryMatchingArray method.
filling
[out] An object of the array of filling orders from history. The 'filling' object must be previously created via the IMTAdminAPI::ECNCreateHistoryFillingArray method.
deals
[out] An object of the array of deals from history. The 'deals' object must be previously created via the IMTAdminAPI::ECNCreateHistoryDealArray method.
providers
[out] An object of the array of providers. The 'providers' object must be previously created via the IMTAdminAPI::ECNCreateProvidersArray method.
Return Value
An indication of a successful execution is the MT_RET_OK response code. Otherwise, an error code is returned.
Note
The method cannot be called from event handlers (any IMT*Sink class methods).
IMTManagerAPI::ECNRequestByTickets
Request the matching history for the specified order tickets.
C++
MTAPIRES IMTManagerAPI::ECNRequestByTickets(
const UINT64* tickets, // tickets
const UINT tickets_total, // number of tickets
const INT64 from, // period beginning
const INT64 to, // period end
IMTECNHistoryMatchingArray* matching, // array of matching orders
IMTECNHistoryFillingArray* filling, // array of filling orders
IMTECNHistoryDealArray* deals, // array of deals
IMTECNProviderArray* providers // array of providers
)
.NET
MTRetCode CIMTManagerAPI.ECNRequestByTickets(
ulong[] tickets, // tickets
long from, // period beginning
long to, // period end
CIMTECNMatchingArray matching, // array of matching orders
CIMTECNFillingArray filling, // array of filling orders
CIMTECNHistoryDealArray deals, // array of deals
CIMTECNProviderArray providers // array of providers
)
Parameters
tickets
[in] An array of tickets the data is requested for.
tickets_total
[in] The number of tickets in the 'tickets' array.
from
[in] The beginning of the period for which you need to get data. The date is specified in seconds since 01.01.1970.
to
[in] The end of the period for which you need to get data. The date is specified in seconds since 01.01.1970.
matching
[out] An object of the array of matching orders from history. The 'matching' object must be previously created via the IMTAdminAPI::ECNCreateHistoryMatchingArray method.
filling
[out] An object of the array of filling orders from history. The 'filling' object must be previously created via the IMTAdminAPI::ECNCreateHistoryFillingArray method.
deals
file:///C:/Users/Administrator/AppData/Local/Temp/~hh4BC4.htm 7/17/2025
Manager API Page 461 of 464
[out] An object of the array of deals from history. The 'deals' object must be previously created via the IMTAdminAPI::ECNCreateHistoryDealArray method.
providers
[out] An object of the array of providers. The 'providers' object must be previously created via the IMTAdminAPI::ECNCreateProvidersArray method.
Return Value
An indication of a successful execution is the MT_RET_OK response code. Otherwise, an error code is returned.
Note
The method cannot be called from event handlers (any IMT*Sink class methods).
Geo-services
The methods described in this section provide access to the GeoIP database information on the trading server. These methods enable access to the information about visitors'
country, city, coordinates and Internet providers, based on their IP addresses. The database is automatically updated on the server once a week, keeping the relevant information
up to date.
By using these methods, you can generate user activity reports and create maps, among others.
Function Purpose
GeoCreate Create an IP address description object.
GeoResolve Resolve an IPv4 or IPv6 address.
GeoResolveBatch Resolve a list of IP addresses of any type: IPv4 or IPv6.
IMTManagerAPI::GeoCreate
Create an IP address description object.
C++
IMTGeo* IMTManagerAPI::GeoCreate()
.NET
CIMTGeo CIMTManagerAPI.GeoCreate()
Return Value
Returns a pointer to the created object that implements the IMTGeo interface. NULL is returned in case of failure.
Note
The created object should be destroyed by calling the IMTGeo::Release method of this object.
IMTManagerAPI::GeoResolve
Resolve an IPv4 or IPv6 address.
C++
MTAPIRES IMTManagerAPI::GeoResolve(
LPCWSTR address, // IP address
const UINT flags, // flags
IMTGeo record // IP address description
)
.NET
MTRetCode CIMTManagerAPI.GeoResolve(
string address, // IP address
CIMTGeo.EnGeoRequestFlags flags, // flags
CIMTGeo record // IP address description
)
Python
ManagerAPI.GeoResolve(
address, # IP address
flags # flags
)
Parameters
address
[in] IPv4 or IPv6 address.
flags
[in] Additional resolution parameters in the form of flags from the IMTGeo::EnGeoRequestFlags enumeration.
record
[out] IP address description as an IMTGeo object. The object must be first created by the IMTManagerAPI::GeoCreate method.
Return Value
An indication of a successful performance is the MT_RET_OK response code. Otherwise, an error has occurred that corresponds to the response code.
IMTManagerAPI::GeoResolveAny
Resolve a list of IP addresses of any type: IPv4 or IPv6.
file:///C:/Users/Administrator/AppData/Local/Temp/~hh4BC4.htm 7/17/2025
Manager API Page 462 of 464
C++
MTAPIRES IMTManagerAPI::GeoResolveAny(
LPCWSTR* addresses, // array of IP addresses
const UINT addresses_total, // number of addresses
const UINT flags, // flags
IMTGeo** records, // description of IP addresses
MTAPIRES* results // array of results
)
.NET
MTRetCode CIMTManagerAPI.GeoResolveAny(
string[] addresses, // array of IP addresses
CIMTGeo.EnGeoRequestFlags flags, // flags
CIMTGeo[] records, // description of IP addresses
MTRetCode[] retcodes // array of results
)
Python
ManagerAPI.GeoResolveAny(
addresses, # list of IP addresses
flags # flags
)
Parameters
addresses
[in] Array of addresses of any type: IPv4 or IPv6.
addresses_total
[in] Number of addresses in the 'addresses' array.
flags
[in] Additional resolution parameters in the form of flags from the IMTGeo::EnGeoRequestFlags enumeration.
records
[out] Description of IP addresses as an array of IMTGeo objects. The objects must be first created by the IMTManagerAPI::GeoCreate method.
results
[out] Array with the address resolution results. The size of the 'results' array must not be less than that of 'addresses'.
Return Value
The MT_RET_OK response code indicates that all specified addresses have been processed. The MT_RET_ERR_PARTIAL response code indicates that resolution results are only
available for some of the addresses. Analyze the 'results' array for more details on the execution results. It contains the result of processing of each address from the 'addresses'
array. The result index corresponds to the address index in the source array.
Note
In 'addresses' you can simultaneously transfer IP addresses of both types.
Method Purpose
OnDealerResult Asynchronous answer to a dealer's trade request in the form of the object of confirmation.
OnDealerAnswer Asynchronous answer to a dealer's trade request in the form of the object of request.
IMTDealerSink::OnDealerResult
Asynchronous answer to a dealer's trade request in the form of the object of confirmation.
C++
virtual void IMTDealerSink::OnDealerResult(
const IMTConfirm* result // Request confirmation result
)
.NET
virtual void CIMTDealerSink.OnDealerResult(
CIMTConfirm result // Request confirmation result
)
Parameters
result
[in] The result of confirmation of the trade request.
Note
The method is obsolete, it is recommended to use IMTDealerSink::OnDealerAnswer instead.
The method is an asynchronous response of the server to a dealer's trade request performed using the IMTManagerAPI::DealerSend method.
A value corresponding to the IMTRequest::ID (not IMTRequest::IDClient) value of the initial request is passed to the IMTConfirm::ID field.
IMTDealerSink::OnDealerAnswer
Asynchronous answer to a dealer's trade request in the form of the object of request.
file:///C:/Users/Administrator/AppData/Local/Temp/~hh4BC4.htm 7/17/2025
Manager API Page 463 of 464
C++
virtual void IMTDealerSink::OnDealerAnswer(
const IMTRequest* request // An object of a trade request
)
.NET
virtual void CIMTDealerSink.OnDealerAnswer(
CIMTRequest request // An object of a trade request
)
Parameters
request
[in] An object of the trade request.
Note
This method is an asynchronous response of the server to a dealer's trade request performed using the IMTManagerAPI::DealerSend method.
To get the identifier of the order and deal created as a result of execution of the request, use the IMTRequest::ResultOrder and IMTRequest::ResultDeal methods.
Method Purpose
OnConnect A handler that notifies of establishing/restoring a connection between the manager or administrator terminal and the server.
OnDisconnect A handler that notifies of loss of connection between the manager or administrator terminal and the server.
OnTradeAccountSet This handler receives IMTManagerAPI::TradeAccountSet method execution result, as well as the final status of a client entry (after the passed
changes have been applied).
IMTManagerSink::OnConnect
A handler of the event of an application's connection to the server.
C++
virtual void IMTManagerSink::OnConnect()
.NET
virtual void CIMTManagerSink.OnConnect()
Note
The method is called when the connection of the manager or administrator interface with the server has been established/restored.
IMTManagerSink::OnDisconnect
A handler of the event of an application's disconnection from the server.
C++
virtual void IMTManagerSink::OnDisconnect()
.NET
virtual void CIMTManagerSink.OnDisconnect()
Note
The method is called when the connection of the manager or administrator interface with the server is lost..
IMTManagerSink::OnTradeAccountSet
This handler receives IMTManagerAPI::TradeAccountSet method execution result, as well as the final status of a client entry (after the passed changes have been applied).
C++
virtual void IMTManagerSink::OnTradeAccountSet(
const MTAPIRES retcode, // Result
const INT64 request_id // Request ID
const IMTUser* user // An object of a client record
const IMTAccount* account // An object of a trading account
const IMTOrderArray* orders // Array of orders
const IMTPositionArray* positions // Positions array
)
.NET
file:///C:/Users/Administrator/AppData/Local/Temp/~hh4BC4.htm 7/17/2025
Manager API Page 464 of 464
Parameters
retcode
[in] IMTManagerAPI::TradeAccountSet execution result code. MT_RET_OK response code is passed if a client entry has been successfully changed. Otherwise, the appropriate
error code is returned.
request_id
[in] Arbitrary request ID. It is used for binding the requests executed by IMTManagerAPI::TradeAccountSet method and the answers received via this handler.
user
[in] An object of the client record. Login field is used in IMTUser object for identifying a user, whose data has been changed. The client external system's account number
corresponding to the gateway can also be used for identification. Account in an external system can be defined using IMTUser::ExternalAccountAdd method.
account
[in] Trading account object. Only Balance field is used in IMTAccount object for passing the balance value.
orders
[in] An object of the array of orders placed for the specified account.
positions
[in] An object of the array of positions placed for the specified account.
Return Value
An indication of successful completion is the MT_RET_OK response code. Otherwise, an error has occurred that corresponds to the response code.
Note
After a client's data is changed using IMTManagerAPI::TradeAccountSet method, the status of the client's trading account, orders and positions is passed to account, orders and
positions parameters.
file:///C:/Users/Administrator/AppData/Local/Temp/~hh4BC4.htm 7/17/2025