TG Trade Service Manager MT4
- Bibliotheken
- Daciana Elena Chirica
- Version: 1.0
- Aktivierungen: 15
Der "TG Trade Service Manager" - Ihre Komplettlösung für nahtloses Handelsmanagement in MQL4- und MQL5-Umgebungen. Mit dem Fokus auf Geschwindigkeit, Zuverlässigkeit und Komfort vereinfacht diese leistungsstarke Bibliothek die Komplexität der Handelsausführung und -verwaltung und bietet Entwicklern eine einzige Schnittstelle für mehr Effizienz.
Hauptmerkmale:
-
Einheitliche Schnittstelle: TG Trade Service Manager" bietet eine einheitliche Schnittstelle fürMQL4 und MQL5 und rationalisiert die Handelsverwaltungsprozesse plattformübergreifend.
-
Fehlerbehandlung und Protokollierung: Robuste Fehlerbehandlungs- und Protokollierungsmechanismen stellen sicher, dass sowohl erfolgreiche Transaktionen als auch Fehlermeldungen sorgfältig aufgezeichnet werden, so dass Entwickler einen umfassenden Einblick in die Handelsaktivitäten erhalten.
-
Flexible Stop-Loss- und Take-Profit-Optionen: Entwickler profitieren von flexiblen Stop-Loss- und Take-Profit-Optionen, die auf ihre Präferenzen zugeschnitten sind. Für die Festlegung von Stop-Loss- und Take-Profit-Niveaus stehen zwei verschiedene Methoden zur Verfügung, wobei die Entwickler wählen können zwischen der direkten Definition von Preisen oder der Angabe von Abständen in Punkten. Die Bibliothek führt intelligente Berechnungen durch, um Stop-Loss- und Take-Profit-Aufträge in den gewünschten Abständen zu platzieren, wodurch manuelle Berechnungen überflüssig werden und die Arbeitsabläufe im Handelsmanagement vereinfacht werden.
#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
VOR DER VERWENDUNG MÜSSEN SIE DIE BIBLIOTHEK WIE IN MEINEM OBIGEN BEISPIEL IMPORTIEREN. Beispiele für die Verwendung
//eröffnet einen Handel mit StopLoss = 125 Punkte, TakeProfit = 125 Punkte long resultTicket = MarketExecution( (int)ORDER_TYPE_BUY, // Auftragsart 0.01, // Lose 125, //stopLoss(in Punkten) 125, //Gewinn nehmen (in Punkten) _Symbol, //Symbol (fakultativ) 1, //magische Zahl (optional) "MyFirstTrade"); //Kommentar (optional) if(resultTicket <= 0) //wenn die Ausführung fehlschlägt, wird normalerweise -1 angezeigt { //Code zur Behandlung von Fehlern //Rückgabe false/Schlaf/etc } //Rest der Algorithmus-Implementierung
Hinweis: Ich verwende keine negativen Werte für stopLoss, die Bibliothek berechnet alles von selbst.
Beispiel 2 mit price(double) als Parameter:
//eröffnet einen Handel mit StopLoss = 125 Punkte, TakeProfit = 125 Punkte long resultTicket = MarketExecution( (int)ORDER_TYPE_BUY, // Auftragsart 0.01, // Lose 1.08300, //stopLoss(PRICE) 1.08800, //Gewinneinnahme(PREIS) _Symbol, //Symbol (fakultativ) 1, //magische Zahl (optional) "MyFirstTrade"); //Kommentar (optional) if(resultTicket <= 0) //wenn die Ausführung fehlschlägt, wird normalerweise -1 angezeigt { //Code zur Behandlung von Fehlern //Rückgabe false/Schlaf/etc } //Rest der Algorithmus-Implementierung
Beispiele für die Protokollierung
Fehler
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] | Ungültige 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] | Erfolg >>> Senden >>> Symbol[EURUSD], Volumen[0.01], Operation[0], PriceOpen[1.08511], SL[1.08386], TP[1.08636]
