prepare all indicators for working by new structures of libraries and models and compile them successfully ...
This commit is contained in:
@@ -18,9 +18,10 @@
|
||||
#property link "https://www.saherelm.ir"
|
||||
#property version "1.00"
|
||||
#property strict
|
||||
|
||||
\
|
||||
//
|
||||
// Imports ...
|
||||
#include "../Classes/x-saherelm.xmd5.class.mq5"
|
||||
|
||||
//
|
||||
// Models ...
|
||||
@@ -435,10 +436,20 @@ struct XOHCL
|
||||
return result;
|
||||
}
|
||||
|
||||
//
|
||||
// Retrieve Price base On Series Mode ...
|
||||
double GetPrice(ENUM_SERIESMODE mMode) {
|
||||
//
|
||||
ENUM_X_PRICE mXMode = ToPrice(mMode);
|
||||
|
||||
//
|
||||
return GetPrice(mXMode);
|
||||
}
|
||||
|
||||
//
|
||||
// Calculate Applied Price ...
|
||||
double GetPrice(
|
||||
ENUM_APPLIED_PRICE appliedTo // Select Application Method
|
||||
ENUM_APPLIED_PRICE mAppliedTo // Select Application Method
|
||||
)
|
||||
{
|
||||
//
|
||||
@@ -446,7 +457,7 @@ struct XOHCL
|
||||
|
||||
//
|
||||
// Calculate Applied Price ...
|
||||
switch (appliedTo)
|
||||
switch (mAppliedTo)
|
||||
{
|
||||
//
|
||||
case PRICE_CLOSE:
|
||||
@@ -3279,6 +3290,48 @@ string GetTypeName(const T &t)
|
||||
return typename(T);
|
||||
}
|
||||
|
||||
//
|
||||
template <typename T>
|
||||
string GetToken(T &item)
|
||||
{
|
||||
//
|
||||
string mType = GetTypeName(item);
|
||||
|
||||
//
|
||||
string result = mType;
|
||||
|
||||
//
|
||||
string parts[];
|
||||
int partsCount = SplitContent(
|
||||
parts,
|
||||
result,
|
||||
" "
|
||||
//
|
||||
);
|
||||
if (partsCount <= 0)
|
||||
{
|
||||
//
|
||||
result = mType;
|
||||
return result;
|
||||
}
|
||||
|
||||
//
|
||||
bool hasLastPart = GetLastItem(
|
||||
result,
|
||||
parts
|
||||
//
|
||||
);
|
||||
if (!hasLastPart)
|
||||
{
|
||||
//
|
||||
result = mType;
|
||||
return result;
|
||||
}
|
||||
|
||||
//
|
||||
return result;
|
||||
}
|
||||
|
||||
//
|
||||
// Generate Unique Tags ...
|
||||
template <typename T>
|
||||
@@ -3704,7 +3757,7 @@ double GetMax(
|
||||
//
|
||||
// Get Min of Specific Loopback of a Buffer ...
|
||||
template <typename T>
|
||||
double GetMinValue(
|
||||
double GetMin(
|
||||
T &buffer[], // the Buffer which required to search
|
||||
int start = 0, // Start Index
|
||||
int count = 0 // Count for Search
|
||||
@@ -3753,7 +3806,7 @@ double GetMinValue(
|
||||
//
|
||||
// Find a Value less than Specified ...
|
||||
template <typename T>
|
||||
T FindLesserThanValue(
|
||||
T FindLesserThan(
|
||||
T value, // Specified Value ...
|
||||
const T &source[], // Source ...
|
||||
bool isDescend = false // Find Biggest Lesser Value ...
|
||||
@@ -3814,7 +3867,7 @@ T FindLesserThanValue(
|
||||
//
|
||||
// Find a Value less than Specified ...
|
||||
template <typename T>
|
||||
T FindBiggerThanValue(
|
||||
T FindBiggerThan(
|
||||
T value, // Specified Value ...
|
||||
const T &source[], // Source ...
|
||||
bool isDescend = false // Find Smallest Bigger Value ...
|
||||
@@ -3875,7 +3928,7 @@ T FindBiggerThanValue(
|
||||
//
|
||||
// Find Same Values in Array ...
|
||||
template <typename T>
|
||||
void FindSameValues(
|
||||
void FindSames(
|
||||
T &result[], // Holds Result ...
|
||||
T &source[], // Source ...
|
||||
int verifications = 3 // Number of Consequence Repeat ...
|
||||
@@ -4821,6 +4874,77 @@ int ParseDoubleArraySurrounded(
|
||||
//
|
||||
return count;
|
||||
}
|
||||
int ParseTimeArraySurrounded(
|
||||
datetime &result[], // Holds Result
|
||||
const string surrounded, // Surrounded Content
|
||||
const string mToken, // Specified Token
|
||||
string separator = ",", // Separator ...
|
||||
const string startString = "(", // Expression Start String must be Unique
|
||||
const string endString = ")", // Where to End Extraction, usually a Sign
|
||||
bool forceClean = true // Clean Result ...
|
||||
)
|
||||
{
|
||||
//
|
||||
int count = 0;
|
||||
|
||||
//
|
||||
if (forceClean)
|
||||
{
|
||||
Clean(result);
|
||||
}
|
||||
|
||||
//
|
||||
int before = ArraySize(result);
|
||||
|
||||
//
|
||||
string contentStr = ParseStringSurrounded(surrounded, mToken);
|
||||
if (!IsValid(contentStr))
|
||||
{
|
||||
return count;
|
||||
}
|
||||
|
||||
//
|
||||
string tmps[];
|
||||
int tmpsCount = SplitContent(
|
||||
tmps,
|
||||
contentStr
|
||||
//
|
||||
);
|
||||
if (tmpsCount <= 0)
|
||||
{
|
||||
return count;
|
||||
}
|
||||
|
||||
//
|
||||
for (int i = 0; i < tmpsCount; i++)
|
||||
{
|
||||
//
|
||||
string iTMP = tmps[i];
|
||||
if (!IsValid(iTMP))
|
||||
{
|
||||
continue;
|
||||
}
|
||||
|
||||
//
|
||||
datetime iValue = (datetime)iTMP;
|
||||
|
||||
//
|
||||
Add(
|
||||
iValue,
|
||||
result
|
||||
//
|
||||
);
|
||||
}
|
||||
|
||||
//
|
||||
int after = ArraySize(result);
|
||||
|
||||
//
|
||||
count = after - before;
|
||||
|
||||
//
|
||||
return count;
|
||||
}
|
||||
|
||||
//
|
||||
// Surround an String by Specific Token ...
|
||||
@@ -4859,6 +4983,38 @@ string Surround(
|
||||
return result;
|
||||
}
|
||||
|
||||
//
|
||||
template <typename T>
|
||||
string SurroundArray(
|
||||
string mToken,
|
||||
T &value[],
|
||||
string startString = "(", // Token Start Content
|
||||
string endString = ")" // Token End Content
|
||||
)
|
||||
{
|
||||
//
|
||||
string result = NULL;
|
||||
|
||||
//
|
||||
string valueStr = ToString(value);
|
||||
if (!IsValid(valueStr))
|
||||
{
|
||||
return result;
|
||||
}
|
||||
|
||||
//
|
||||
result = Surround(
|
||||
mToken,
|
||||
valueStr,
|
||||
startString,
|
||||
endString
|
||||
//
|
||||
);
|
||||
|
||||
//
|
||||
return result;
|
||||
}
|
||||
|
||||
//
|
||||
// Periods / Cycles ...
|
||||
|
||||
|
||||
Reference in New Issue
Block a user