# Gate.io - MT5 Connection Library Project (Spot & Future) ## IMPORTANT NOTE This project involves developing a connection library written only in MQL5 language. It should be a simple library that I will use in my existing Expert Advisor. Please develop a solution that contains only the requested functions, avoiding unnecessary complexity. ## Core Requirements ### 1. MQL5 Library Structure - The project must be developed entirely in MQL5 language - Must be delivered as .mq5 and .mqh files - The .mqh file must be able to be included in Expert Advisors using `#include` - The compiled .ex5 file must also be delivered ### 2. Data Connection - Must be able to retrieve **both spot and future** symbol data from Gate.io exchange via WebSocket - Must be able to transfer data from any desired symbol to MT5 - Must be able to retrieve historical and real-time data - Spot and future data must be processable separately ### 3. API Management - Must be able to securely use Gate.io API keys (API Key and Secret Key) - Must calculate API weight and provide notification via global variable - Must include basic error checking ### 4. Core Functions Using API Key and Secret Key, it must be able to perform the following operations: #### Account Information Retrieval - Symbol-based profit/loss status - Total profit/loss - Total balance and available balance - Symbol amount and position direction information - Total number of open positions - Secure access to account information using API Key and Secret Key #### Trading Functions - Open buy position - Open sell position - Close buy position - Close sell position - Close all positions - Leverage change operations - API weight calculation after transaction #### Historical Data Operations - Display total profit of closed orders in a specific time period - For example: Calculate the total profit of closed orders from the last two days - Access to historical information with an externally adjustable variable ### 5. Configuration - Data update frequency must be adjustable (in milliseconds) - Symbol prefix must be definable externally - API keys must be configurable externally ### 6. Deliverables - .mq5 source code file - .mqh library header file - .ex5 compiled library file - Documentation including simple usage examples ## Project Limitations - Complex graphical interfaces or advanced analysis tools are NOT REQUIRED - Only basic data retrieval and trading functions are sufficient - Should be a simple library that works compatibly with my existing Expert Advisors --- *Note: This is a helper library project that I will use in my own Expert Advisors. I expect a solution written in MQL5 language that fulfills the basic functions, avoiding unnecessary complexity.*