How to develop MT5 Gateway API Quote and Trade

The main task for a developer is to transfer all the data, obtained in the MetaTrader 5 Gateway API. For application programmers we can compose the following algorithm to work with this API:

  1. Initialization. At this stage, developer has to load the library.

  2. Obtaining and running server port interface. All interaction with API is done via server port interface. This interface contains methods of data management and sending. When you create a user interface API, developer must specify his own notification handler. Using this handler API will notify the developer about new connections of History Servers and their parameters (quotes symbols, operation mode, additional parameters). This information only notifies a user and its use is optional.

  3. Sending data. Server port interface contains all the necessary methods for sending data to connected History Servers.

  4. Exiting. At this stage, a developer has to release server port interface and unload the library.

MetaTrader 5 Gateway API is described in a single 'MT5APIGateway.h' file and implemented in the 'MT5APIGateway.dll' and 'MT5APIGateway64.dll' files for win32 and x64 platforms, respectively. For an application that uses API, it is necessary that these files must be available. Simply copy them into the application folder.

The library exports a few simple functions:

  • MTAPIRES MTGatewayVersion(UINT &version) - returns the version of the Gateway API.

  • MTAPIRES MTGatewayCreateLocal(MTGatewayInfo& info,IMTGatewayAPI **gateway,int argc,wchar_t** argv) - creates and returns an instance of the gateway interface taking into account its description and parameters passed in the command line. In the command line from History Server passed are the time zone and the server port number, on which interface must be started as a server accepting incoming connections. Command line is also used to obtain Data Feed description. By passing command line parameters to the library, we've freed developers from parsing line parameters, time zone initialization and Data Feed description formatting. This method is used only by Data Feeds, controlled by History Server.

  • MTAPIRES MTGatewayCreate(MTGatewayInfo& info,IMTGatewayAPI **gateway) - creates and returns an instance of gateway interface.


When creating a gateway interface, we need to pass to it a correctly filled out MTGatewayInfo structure. This structure contains the description of a data feed and its default settings.

To develop a streaming and OSD (On-Screen Display) system, you will need to follow these steps: 1. Choose a hardware platform: You need to select a hardware platform that is capable of streaming and OSD. You can choose from a range of platforms such as Raspberry Pi, Nvidia Jetson, or any other platform that meets your requirements. 2. Select a streaming protocol: You need to select a streaming protocol that suits your needs. There are several protocols available such as HLS, RTSP, RTMP, etc. Choose the one that best suits your requirements. 3. Develop a streaming application: Once you have selected a hardware platform and a streaming protocol, you need to develop a streaming application. This application should be able to capture video from a camera or a source and stream it using the selected protocol. 4. Develop an OSD application: You also need to develop an OSD application that will overlay graphics and text on the streaming video. This application should be able to receive data from external sources such as sensors or GPS and overlay the data on the video. 5. Integrate streaming and OSD: Once you have developed both the streaming and OSD applications, you need to integrate them. This can be done by using APIs or libraries provided by the platform or the streaming protocol. 6. Test and deploy: Finally, you need to test the system thoroughly and deploy it. You should ensure that the system is stable, performs well, and meets the requirements of your use case. Overall, developing a streaming and OSD system requires expertise in hardware, software, and integration. It is a complex task that requires careful planning, implementation, and testing.
评论 1
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值