Trading libraries for MetaTrader 4

Special Offer!

Time Left to Buy:

Up to 25% OFF

Shopping cart

The cart is empty

MetaTrader 4

Top Rated Products MT4

350 $263 $ KTS poverty killer robot
Thato Modiba
4 5 6 Product
5 500 $4 125 $ Bonnitta EA MT5
Ugochukwu Mobi
4 5 3 Product
999 $749 $ AI Gen XII MT4
Denis Kurnev
5 5 1 Product

TG Trade Service Manager MT4

tg-trade-service-manager-mt4-logo-200x200-6057
100 $75 $

Free updates are included

We accept crypto: BTC, ETH, BCH and more...

30-Day Money Back Guarantee
100% Guarantee of Originality

Information

Libraries
MetaTrader 4
Daciana Elena Chirica
1.0
15

Overview

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.

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]


 












30-Day Money Back Guarantee

If for any reason you do not like the purchased program, you can request a refund within 30 days from the date of purchase. You can also make an exchange for any other product at an equal cost or by paying the difference.
Simply send a request for refund or exchange with your order number by email: support@market-fx.pro.
Refund requests received more than 30 days after purchase will be rejected.

Email Us Now! Support is available 24/7
by Email: support@market-fx.pro

Do You Need Help?
Click Here To Start Live Chat

Contact Us

Image

Search