85 lines
1.6 KiB
Plaintext
85 lines
1.6 KiB
Plaintext
///////////////////////////////////////////////////////
|
|
//
|
|
// SaherElm IT Center MQL5 Seriallize Library
|
|
// ---------------------------------------
|
|
// Name: XSeriallizer
|
|
// Description: provides Seriallizing EA abilities ...
|
|
//
|
|
//
|
|
// Maintainer:
|
|
// ------------
|
|
// Hadi Khazaee Asl (hadi_khazaee_asl@yahoo.com)
|
|
//
|
|
//////////////////////////////////////////////////////
|
|
//
|
|
// Global Properties ...
|
|
#property library
|
|
#property copyright "Copyright 2023, SaherElm IT Center"
|
|
#property link "https://www.saherelm.ir"
|
|
#property version "1.00"
|
|
#property strict
|
|
|
|
//
|
|
#include "../Libraries/x-saherelm.models.lib.mq5"
|
|
#include "../Libraries/x-saherelm.common.lib.mq5"
|
|
#include "../Classes/x-saherelm.xtrade.class.mq5"
|
|
|
|
//
|
|
string XProviderToken = "PRV";
|
|
string XSupportToken = "SP";
|
|
|
|
//
|
|
string GenerateSupportSignalComment(
|
|
ulong ticket // Position/Order Ticket
|
|
)
|
|
{
|
|
//
|
|
string result = "";
|
|
|
|
//
|
|
result = XSupportToken + "(" + (string)ticket + ")";
|
|
|
|
//
|
|
return result;
|
|
}
|
|
|
|
//
|
|
string ExtractParentTicketOfSupport(string comment)
|
|
{
|
|
//
|
|
string result = "";
|
|
if (StringLen(comment) <= 0)
|
|
{
|
|
return result;
|
|
}
|
|
|
|
//
|
|
result = ExtractString(
|
|
comment,
|
|
XSupportToken + "(",
|
|
")");
|
|
|
|
//
|
|
return result;
|
|
}
|
|
|
|
//
|
|
// Extract a Provider name if exists from a Comment ...
|
|
string ExtractProvider(string comment)
|
|
{
|
|
//
|
|
string result = "";
|
|
if (StringLen(comment) <= 0)
|
|
{
|
|
return result;
|
|
}
|
|
|
|
//
|
|
result = ExtractString(
|
|
comment,
|
|
XProviderToken + "(",
|
|
")");
|
|
|
|
//
|
|
return result;
|
|
} |