TG Trade Service Manager MT4 外汇EA

TG Trade Service Manager MT4 外汇EA-EA侦探社 - 全球领先的MQL5官网外汇EA机器人MT4自动化交易EA资源免费分享网站
TG Trade Service Manager MT4 外汇EA
此内容为免费资源,请登录后查看
0积分
免费资源

如果免费资源下载的文件为TXT文档

请联系站长更新!站长微信:Lv596999  Telegram:@eapoj

“Mql5官网”板块的EA基本都有,大部分是无限制NODLL版,NODLL版本MT1420升级,大多数不可用!这些EA来源为国外花钱买过来的

有需要,请联系站长!

“EA测评”板块资源全部现有,看见不错的,可以联系站长看EA在确定是否收费

“无限制EA”板块,大部分免费,下载文件全部存在,都可以免费下载

站长硬盘EA太多,因大部分时间做交易,做风控,没太多时间更新下载地址,请谅解!

需要更新下载文件,请联系站长微信!国外朋友请联系Telegram。


Introducing “TG Trade Service Manager” — your all-in-one solution for seamless trade management in both MQL4 and MQL5 environments. With a focus on speed, reliability, and convenience, this powerful library simplifies the complexities of trade execution and management, empowering developers with a single interface for enhanced efficiency.

Metatrader5 Version| All Products | Contact

Key Features:

  1. Unified Interface: TG Trade Service Manager” provides a unified interface for MQL4 and MQL5, streamlining trade management processes across platforms.

  2. Error Handling and Logging: Robust error handling and logging mechanisms ensure that both successful transactions and error messages are meticulously recorded, providing developers with comprehensive insights into trade activities.

  3. Flexible Stop Loss and Take Profit Options: Developers benefit from flexible stop loss and take profit options tailored to their preferences. With two distinct methods available for setting stop loss and take profit levels, developers can choose between defining prices directly or specifying distances in points. The library intelligently handles computations to place stop loss and take profit orders at the desired distances, eliminating the need for manual calculations and simplifying trade management workflows.

#import "TG_TradeServiceLib.ex4" //or path to library
long Buy(double lots, int stopLossPoints, int takeProfitPoints, string symbol, int magic, string comment = NULL);
long Buy(double lots, double stopLossPrice, double takeProfitPrice, string symbol, int magic, string comment = NULL);
long Sell(double lots, int stopLossPoints, int takeProfitPoints, string symbol, int magic, string comment = NULL);
long Sell(double lots, double stopLossPrice, double takeProfitPrice, string symbol, int magic, string comment = NULL);
long BuyLimit(double price, double lots, double stopLossPrice, double takeProfitPrice, string symbol, int magic, string comment = NULL);
long BuyLimit(double price, double lots, int stopLossPoints,  int takeProfitPoints, string symbol, int magic, string comment = NULL);
long SellLimit(double price, double lots, double stopLossPrice, double takeProfitPrice, string symbol, int magic, string comment = NULL);
long SellLimit(double price, double lots, int stopLossPoints,  int takeProfitPoints, string symbol, int magic, string comment = NULL);
long BuyStop(double price, double lots, double stopLossPrice, double takeProfitPrice, string symbol, int magic, string comment = NULL) ;
long BuyStop(double price, double lots, int stopLossPoints,  int takeProfitPoints, string symbol, int magic, string comment = NULL);
long SellStop(double price, double lots, double stopLossPrice, double takeProfitPrice, string symbol, int magic, string comment = NULL);
long SellStop(double price, double lots, int stopLossPoints,  int takeProfitPoints, string symbol, int magic, string comment = NULL);
long MarketExecution(int operation, double lots, int stopLossPoints,  int takeProfitPoints, string symbol, int magic, string comment = NULL);
long MarketExecution(int operation, double lots, double stopLossPrice,  double takeProfitPrice, string symbol, int magic, string comment = NULL);
bool Close(long ticket, double lots, int slippage);
bool Close(long ticket, int slippage);
bool CloseBatch(int magic, string symbol, int type = -1);
bool DeletePending(long ticket);
bool DeleteBatch(int magic, string symbol, int type = -1) ;
bool ModifyMarket(long ticket, int stopLossPoints, int takeProfitPoints) ;
bool ModifyMarket(long ticket, double stopLossPrice, double takeProfitPrice); 
bool ModifyMarketBatch(int magic, double stopLossPrice, double takeProfitPrice, string symbol, int type = -1);
bool ModifyMarketBatch(int magic, int stopLossPoints, int takeProfitPoints, string symbol, int type = -1);
bool ModifyPending(ulong ticket, double stopLossPrice, double takeProfitPrice, double price = 0, datetime expiration = 0);
bool ModifyPending(ulong ticket, int stopLossPoints, int takeProfitPoints, double price = 0, datetime expiration = 0);
long Pending(int operation, double price, string symbol, int magic, double lots, int stopLossPoints, int takeProfitPoint, string comment = NULL, datetime expiration = 0);
#import

BEFORE USING YOU HAVE TO IMPORT THE LIBRARY LIKE MY EXAMPLE ABOVE How to use Examples

Example 1 using points(int) as parameters:

 //will open a trade with StopLoss = 125 points, TakeProfit = 125 points
   long resultTicket = MarketExecution(
                          (int)ORDER_TYPE_BUY,  // order type
                          0.01,                 // lots
                          125,                  //stopLoss(in points)
                          125,                  //takeProfit(in points)
                          _Symbol,              //symbol (optional)
                          1,                    //magic number(optional)
                          "MyFirstTrade");      //comment (optional)

   if(resultTicket <= 0) //usually if execution fails it will result in -1
   {
      //Code to handle failure
      //return false/Sleep/etc
   }

   //Rest of algorithm implementation

Note: I do not use negative values for stopLoss, the library computes everything by itself.

Example 2 using price(double) as parameters:

   //will open a trade with StopLoss = 125 points, TakeProfit = 125 points
   long resultTicket = MarketExecution(
                          (int)ORDER_TYPE_BUY,  // order type
                          0.01,                 // lots
                          1.08300,              //stopLoss(PRICE)
                          1.08800,              //takeProfit(PRICE)
                          _Symbol,              //symbol (optional)
                          1,                    //magic number(optional)
                          "MyFirstTrade");      //comment (optional)

   if(resultTicket <= 0) //usually if execution fails it will result in -1
   {
      //Code to handle failure
      //return false/Sleep/etc
   }

   //Rest of algorithm implementation

Logging Examples

Errors

2024.01.31 19:10:12.684 TradeManagerUnitTests EURUSD,H4: [INFO] | [Trade.mqh::CTrade::CheckStopLossTakeProfitCorrectness] | For order ORDER_TYPE_BUY   TakeProfit=-1.08800 must be greater than 1.08506 (Bid=1.08506 + SYMBOL_TRADE_STOPS_LEVEL=0 points)

2024.01.31 19:10:12.684 TradeManagerUnitTests EURUSD,H4: [ERROR] | [Trade.mqh::CTrade::SendOrder::205] | Invalid stops ORDER_TYPE_BUY PendingPrice: 1.08510, Bid:1.08506, Ask:1.08510 SL: 1.08300, TP: -1.08800 

INFO:

2024.01.31 19:09:19.733 TradeManagerUnitTests EURUSD,H4: [INFO] | [Trade.mqh::CTrade::SendOrder] | Success >>> Send  >>> Symbol[EURUSD], Volume[0.01], Operation[0], PriceOpen[1.08511], SL[1.08300], TP[1.08800]

2024.01.31 19:09:55.496 TradeManagerUnitTests EURUSD,H4: [INFO] | [Trade.mqh::CTrade::SendOrder] | Success >>> Send  >>> Symbol[EURUSD], Volume[0.01], Operation[0], PriceOpen[1.08511], SL[1.08386], TP[1.08636]

 

© 版权声明
THE END
喜欢就支持一下吧
点赞43 分享