refactor libraries issues for new version compiling ...
This commit is contained in:
@@ -725,7 +725,7 @@ ENUM_ORDER_TYPE Opposit(ENUM_ORDER_TYPE value)
|
||||
*
|
||||
* @return ( string )
|
||||
*/
|
||||
string ToString(ENUM_POSITION_TYPE value)
|
||||
string ToXString(ENUM_POSITION_TYPE value)
|
||||
{
|
||||
//
|
||||
string result = NULL;
|
||||
@@ -750,7 +750,7 @@ string ToString(ENUM_POSITION_TYPE value)
|
||||
*
|
||||
* @return ( string )
|
||||
*/
|
||||
string ToString(ENUM_ORDER_TYPE value)
|
||||
string ToXString(ENUM_ORDER_TYPE value)
|
||||
{
|
||||
//
|
||||
string result = NULL;
|
||||
@@ -834,6 +834,12 @@ double GetSpread(
|
||||
//
|
||||
return result;
|
||||
}
|
||||
double GetXSpread(
|
||||
string mSymbol = NULL //
|
||||
)
|
||||
{
|
||||
return GetSpread(mSymbol);
|
||||
}
|
||||
|
||||
/**
|
||||
* Get Point Price ...
|
||||
@@ -934,6 +940,13 @@ double GetEntry(
|
||||
//
|
||||
return result;
|
||||
}
|
||||
double GetXEntry(
|
||||
string mSymbol = NULL,
|
||||
ENUM_POSITION_TYPE type = POSITION_TYPE_BUY //
|
||||
)
|
||||
{
|
||||
return GetEntry(mSymbol, type);
|
||||
}
|
||||
|
||||
/**
|
||||
* Get Entry Price ...
|
||||
@@ -964,6 +977,13 @@ double GetEntry(
|
||||
//
|
||||
return result;
|
||||
}
|
||||
double GetXEntry(
|
||||
string mSymbol = NULL,
|
||||
ENUM_X_DIRECTION type = X_DIRECTION_BULLISH //
|
||||
)
|
||||
{
|
||||
return GetEntry(mSymbol, type);
|
||||
}
|
||||
|
||||
/**
|
||||
* Get Exit Price ...
|
||||
@@ -994,6 +1014,13 @@ double GetExit(
|
||||
//
|
||||
return result;
|
||||
}
|
||||
double GetXExit(
|
||||
string mSymbol = NULL,
|
||||
ENUM_POSITION_TYPE type = POSITION_TYPE_BUY //
|
||||
)
|
||||
{
|
||||
return GetExit(mSymbol, type);
|
||||
}
|
||||
|
||||
/**
|
||||
* Get Exit Price ...
|
||||
@@ -1024,6 +1051,13 @@ double GetExit(
|
||||
//
|
||||
return result;
|
||||
}
|
||||
double GetXExit(
|
||||
string mSymbol = NULL,
|
||||
ENUM_X_DIRECTION type = X_DIRECTION_BULLISH //
|
||||
)
|
||||
{
|
||||
return GetExit(mSymbol, type);
|
||||
}
|
||||
|
||||
/**
|
||||
* Retrieve Current Tick ...
|
||||
@@ -1388,7 +1422,7 @@ string GenerateTag(T &model)
|
||||
string result = "";
|
||||
|
||||
//
|
||||
string tag = model.ToString();
|
||||
string tag = model.ToXString();
|
||||
if (StringLen(tag) == 0)
|
||||
{
|
||||
return result;
|
||||
@@ -1422,7 +1456,7 @@ string ToMD5(T content)
|
||||
string result = "";
|
||||
|
||||
//
|
||||
string strContent = ToString(content);
|
||||
string strContent = ToXString(content);
|
||||
if (StringLen(strContent) == 0)
|
||||
{
|
||||
return result;
|
||||
@@ -1801,6 +1835,15 @@ int FindIndexes(
|
||||
//
|
||||
return mResult;
|
||||
}
|
||||
int FindXIndexes(
|
||||
string mQuery,
|
||||
string mContent,
|
||||
int &result[],
|
||||
bool ignoreCase = false //
|
||||
)
|
||||
{
|
||||
return FindXIndexes(mQuery, mContent, result, ignoreCase);
|
||||
}
|
||||
|
||||
/**
|
||||
* Convert From String ...
|
||||
@@ -1836,7 +1879,7 @@ T FromString(string value)
|
||||
* @return ( string )
|
||||
*/
|
||||
template <typename T>
|
||||
string ToString(T value)
|
||||
string ToXString(T value)
|
||||
{
|
||||
return (string)value;
|
||||
}
|
||||
@@ -1859,7 +1902,7 @@ string Trim(string value)
|
||||
|
||||
//
|
||||
// Used In Report or Summary Generators ...
|
||||
string ToString(
|
||||
string ToXString(
|
||||
string prefix, // Title
|
||||
bool value, // Value
|
||||
bool ignoreFalseConditions = true, // Ignore False Conditions
|
||||
@@ -1872,7 +1915,7 @@ string ToString(
|
||||
|
||||
//
|
||||
bool canSet =
|
||||
IsBoolean(ToString(value))
|
||||
IsBoolean(ToXString(value))
|
||||
? (bool)value || !ignoreFalseConditions
|
||||
: true;
|
||||
|
||||
@@ -1880,7 +1923,7 @@ string ToString(
|
||||
result = canSet
|
||||
? prefix +
|
||||
prefixSeparator + " " +
|
||||
ToString(value) +
|
||||
ToXString(value) +
|
||||
lineSeparator
|
||||
: "";
|
||||
|
||||
@@ -1890,7 +1933,7 @@ string ToString(
|
||||
|
||||
//
|
||||
template <typename T>
|
||||
string ToString(
|
||||
string ToXString(
|
||||
string prefix, // Title
|
||||
T value, // Value
|
||||
string lineSeparator = "\n", // Line Separator
|
||||
@@ -1903,7 +1946,7 @@ string ToString(
|
||||
//
|
||||
result = prefix +
|
||||
prefixSeparator + " " +
|
||||
ToString(value) +
|
||||
ToXString(value) +
|
||||
lineSeparator;
|
||||
|
||||
//
|
||||
@@ -1944,7 +1987,7 @@ string SetLabel(
|
||||
//
|
||||
// Converts a Buffer to String Representation ...
|
||||
template <typename T>
|
||||
string ToString(
|
||||
string ToXString(
|
||||
const T &buffer[], // Specified Buffer
|
||||
string separator = ",", // Specified Separator
|
||||
bool addIndex = false, // Specified Add Items Indexes or Not
|
||||
@@ -2015,7 +2058,7 @@ bool IsBoolean(string value)
|
||||
|
||||
//
|
||||
string istring = value;
|
||||
string normalizedValue = ToString(istring);
|
||||
string normalizedValue = ToXString(istring);
|
||||
StringToLower(normalizedValue);
|
||||
normalizedValue = Trim(normalizedValue);
|
||||
|
||||
@@ -2726,7 +2769,7 @@ string Surround(
|
||||
string result = NULL;
|
||||
|
||||
//
|
||||
string strValue = ToString(value);
|
||||
string strValue = ToXString(value);
|
||||
if (!IsValid(strValue))
|
||||
{
|
||||
return result;
|
||||
@@ -2762,7 +2805,7 @@ string SurroundArray(
|
||||
string result = NULL;
|
||||
|
||||
//
|
||||
string valueStr = ToString(value);
|
||||
string valueStr = ToXString(value);
|
||||
if (!IsValid(valueStr))
|
||||
{
|
||||
return result;
|
||||
@@ -2908,7 +2951,7 @@ ENUM_TIMEFRAMES ToPeriod(string value)
|
||||
*
|
||||
* @return ( string )
|
||||
*/
|
||||
string ToString(ENUM_TIMEFRAMES value)
|
||||
string ToXString(ENUM_TIMEFRAMES value)
|
||||
{
|
||||
//
|
||||
string result = "";
|
||||
@@ -3758,7 +3801,7 @@ int Add(
|
||||
return result;
|
||||
}
|
||||
template <typename T>
|
||||
int AddSpecific(
|
||||
int AddSpecified(
|
||||
T item, // item want to add
|
||||
T &buffer[] // Destination buffer
|
||||
)
|
||||
@@ -3801,7 +3844,7 @@ bool HasChild(T &buffer[])
|
||||
return IsValidSize(ArraySize(buffer));
|
||||
}
|
||||
template <typename T>
|
||||
bool SpecificHasChild(T &buffer[])
|
||||
bool SpecifiedHasChild(T &buffer[])
|
||||
{
|
||||
return HasChild(buffer);
|
||||
}
|
||||
@@ -3846,7 +3889,7 @@ void Clean(T &buffer[])
|
||||
ZeroMemory(buffer);
|
||||
}
|
||||
template <typename T>
|
||||
void SpecificClean(T &buffer[])
|
||||
void SpecifiedClean(T &buffer[])
|
||||
{
|
||||
Clean(buffer);
|
||||
}
|
||||
@@ -4194,6 +4237,15 @@ int FindIndex(
|
||||
//
|
||||
return result;
|
||||
}
|
||||
template <typename T>
|
||||
int FindXIndex(
|
||||
T item, // What is Search ...
|
||||
T &buffer[] // Search in ...
|
||||
)
|
||||
{
|
||||
return FindIndex(item, buffer);
|
||||
}
|
||||
|
||||
//
|
||||
// Find Specific Item Index inside a Collection ...
|
||||
template <typename T>
|
||||
@@ -4245,6 +4297,14 @@ int FindIndex(
|
||||
//
|
||||
return result;
|
||||
}
|
||||
template <typename T>
|
||||
int FindXIndex(
|
||||
T &item, // Item to Find
|
||||
const T &items[] // Items for Search
|
||||
)
|
||||
{
|
||||
return FindIndex(item, items);
|
||||
}
|
||||
|
||||
//
|
||||
// Check an Array Contains Specified Value ...
|
||||
@@ -5720,14 +5780,14 @@ string GetTimeString(
|
||||
}
|
||||
|
||||
//
|
||||
string hour = ToString(tStruct.hour);
|
||||
string hour = ToXString(tStruct.hour);
|
||||
hour =
|
||||
StringLen(hour) == 1
|
||||
? "0" + hour
|
||||
: hour;
|
||||
|
||||
//
|
||||
string minute = ToString(tStruct.min);
|
||||
string minute = ToXString(tStruct.min);
|
||||
minute =
|
||||
StringLen(minute) == 1
|
||||
? "0" + minute
|
||||
@@ -5768,12 +5828,12 @@ string ToFormatString(
|
||||
}
|
||||
|
||||
//
|
||||
string year = ToString(timeStruct.year);
|
||||
string month = ToString(timeStruct.mon);
|
||||
string day = ToString(timeStruct.day);
|
||||
string hour = ToString(timeStruct.hour);
|
||||
string minute = ToString(timeStruct.min);
|
||||
string second = ToString(timeStruct.sec);
|
||||
string year = ToXString(timeStruct.year);
|
||||
string month = ToXString(timeStruct.mon);
|
||||
string day = ToXString(timeStruct.day);
|
||||
string hour = ToXString(timeStruct.hour);
|
||||
string minute = ToXString(timeStruct.min);
|
||||
string second = ToXString(timeStruct.sec);
|
||||
|
||||
//
|
||||
result =
|
||||
|
||||
@@ -342,6 +342,10 @@ bool IsValid(ENUM_X_BOUNDARY_PRICE value)
|
||||
//
|
||||
return result;
|
||||
}
|
||||
bool IsSpecifiedValid(ENUM_X_BOUNDARY_PRICE value)
|
||||
{
|
||||
return IsValid(value);
|
||||
}
|
||||
|
||||
/**
|
||||
* Converts To String ...
|
||||
|
||||
@@ -954,8 +954,8 @@ struct XOHCL
|
||||
}
|
||||
|
||||
//
|
||||
bool isBullish = IsBullish(forDir);
|
||||
bool isBearish = IsBearish(forDir);
|
||||
bool isBullish = IsSpecifiedBullish(forDir);
|
||||
bool isBearish = IsSpecifiedBearish(forDir);
|
||||
|
||||
//
|
||||
double fiboLevelValue = GetFibonacciLevel(
|
||||
@@ -1003,13 +1003,13 @@ struct XOHCL
|
||||
|
||||
//
|
||||
bool isBullish =
|
||||
IsBullish(forDir) &&
|
||||
IsSpecifiedBullish(forDir) &&
|
||||
low < price &&
|
||||
GetDown() > price;
|
||||
|
||||
//
|
||||
bool isBearish =
|
||||
IsBearish(forDir) &&
|
||||
IsSpecifiedBearish(forDir) &&
|
||||
high > price &&
|
||||
GetUp() < price;
|
||||
|
||||
@@ -1064,7 +1064,7 @@ struct XOHCL
|
||||
result = IsValid() &&
|
||||
price > 0 &&
|
||||
HasDirection(forDir) &&
|
||||
IsValid(boundaryType);
|
||||
IsSpecifiedValid(boundaryType);
|
||||
if (!result)
|
||||
{
|
||||
return result;
|
||||
@@ -1078,14 +1078,14 @@ struct XOHCL
|
||||
IsBullish() &&
|
||||
low < price &&
|
||||
high > price &&
|
||||
IsBullish(forDir);
|
||||
IsSpecifiedBullish(forDir);
|
||||
|
||||
//
|
||||
bool isBearish =
|
||||
IsBearish() &&
|
||||
low < price &&
|
||||
high > price &&
|
||||
IsBearish(forDir);
|
||||
IsSpecifiedBearish(forDir);
|
||||
|
||||
//
|
||||
result = isBullish ||
|
||||
@@ -1346,10 +1346,10 @@ struct XOHCL
|
||||
|
||||
//
|
||||
result =
|
||||
(IsValid(prefix)
|
||||
(IsSpecifiedValid(prefix)
|
||||
? prefix + "_"
|
||||
: "") +
|
||||
"XOHCL_" + symbol + "_" + ToString(period) + "_" + ToFormatString(time);
|
||||
"XOHCL_" + symbol + "_" + ToXString(period) + "_" + ToFormatString(time);
|
||||
|
||||
//
|
||||
return result;
|
||||
@@ -1364,7 +1364,7 @@ struct XOHCL
|
||||
|
||||
//
|
||||
result = GetTypeName(this) +
|
||||
"(O(" + ToString(open) + "),H(" + ToString(high) + "),C(" + ToString(close) + "),L(" + ToString(low) + "))";
|
||||
"(O(" + ToXString(open) + "),H(" + ToXString(high) + "),C(" + ToXString(close) + "),L(" + ToXString(low) + "))";
|
||||
|
||||
//
|
||||
return result;
|
||||
@@ -1496,7 +1496,7 @@ struct XBarRemainsTime
|
||||
if (!ignoreZeroValues || hours > 0)
|
||||
{
|
||||
//
|
||||
string strHour = ToString(hours);
|
||||
string strHour = ToXString(hours);
|
||||
if (StringLen(strHour) == 1)
|
||||
{
|
||||
strHour = "0" + strHour;
|
||||
@@ -1511,7 +1511,7 @@ struct XBarRemainsTime
|
||||
if (!ignoreZeroValues || minutes > 0)
|
||||
{
|
||||
//
|
||||
string strMinute = ToString(minutes);
|
||||
string strMinute = ToXString(minutes);
|
||||
if (StringLen(strMinute) == 1)
|
||||
{
|
||||
strMinute = "0" + strMinute;
|
||||
@@ -1526,7 +1526,7 @@ struct XBarRemainsTime
|
||||
if (!ignoreZeroValues || seconds > 0)
|
||||
{
|
||||
//
|
||||
string strSec = ToString(seconds);
|
||||
string strSec = ToXString(seconds);
|
||||
if (StringLen(strSec) == 1)
|
||||
{
|
||||
strSec = "0" + strSec;
|
||||
|
||||
@@ -93,11 +93,11 @@ struct XBoxZone
|
||||
upper > 0 &&
|
||||
lower > 0 &&
|
||||
from < to &&
|
||||
IsValid(to) &&
|
||||
IsSpecifiedValid(to) &&
|
||||
upper >= lower &&
|
||||
IsValid(from) &&
|
||||
IsValid(symbol) &&
|
||||
IsValid(period)
|
||||
IsSpecifiedValid(from) &&
|
||||
IsSpecifiedValid(symbol) &&
|
||||
IsSpecifiedValid(period)
|
||||
//
|
||||
;
|
||||
|
||||
@@ -113,7 +113,7 @@ struct XBoxZone
|
||||
bool IsBullish()
|
||||
{
|
||||
return IsValid() &&
|
||||
IsBullish(dir);
|
||||
IsSpecifiedBullish(dir);
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -124,7 +124,7 @@ struct XBoxZone
|
||||
bool IsBearish()
|
||||
{
|
||||
return IsValid() &&
|
||||
IsBearish(dir);
|
||||
IsSpecifiedBearish(dir);
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -209,7 +209,7 @@ struct XBoxZone
|
||||
}
|
||||
|
||||
//
|
||||
if (!IsValid(forPeriod))
|
||||
if (!IsSpecifiedValid(forPeriod))
|
||||
{
|
||||
forPeriod = period;
|
||||
}
|
||||
@@ -379,7 +379,7 @@ struct XBoxZone
|
||||
}
|
||||
|
||||
//
|
||||
if (!IsValid(forPeriod))
|
||||
if (!IsSpecifiedValid(forPeriod))
|
||||
{
|
||||
forPeriod = period;
|
||||
}
|
||||
@@ -450,7 +450,7 @@ struct XBoxZone
|
||||
}
|
||||
|
||||
//
|
||||
if (!IsValid(forPeriod))
|
||||
if (!IsSpecifiedValid(forPeriod))
|
||||
{
|
||||
forPeriod = period;
|
||||
}
|
||||
@@ -515,7 +515,7 @@ struct XBoxZone
|
||||
double nLower = NormalizeDouble(NormalizePrice(lower, symbol), digits);
|
||||
|
||||
//
|
||||
string typeStr = IsValid(type)
|
||||
string typeStr = IsSpecifiedValid(type)
|
||||
? type
|
||||
: "XBOX";
|
||||
string result =
|
||||
@@ -523,9 +523,9 @@ struct XBoxZone
|
||||
typeStr + "_" +
|
||||
ToString(dir) + "_" +
|
||||
symbol + "_" +
|
||||
ToString(period) + "_" +
|
||||
ToString(nUpper) + "_" +
|
||||
ToString(nLower)
|
||||
ToXString(period) + "_" +
|
||||
ToXString(nUpper) + "_" +
|
||||
ToXString(nLower)
|
||||
//
|
||||
;
|
||||
|
||||
@@ -545,7 +545,7 @@ struct XBoxZone
|
||||
double nMid = NormalizeDouble(NormalizePrice(GetMid(), symbol), digits);
|
||||
|
||||
//
|
||||
string typeStr = IsValid(type)
|
||||
string typeStr = IsSpecifiedValid(type)
|
||||
? type
|
||||
: "XBOX";
|
||||
string result =
|
||||
@@ -554,8 +554,8 @@ struct XBoxZone
|
||||
"Mid_" +
|
||||
ToString(dir) + "_" +
|
||||
symbol + "_" +
|
||||
ToString(period) + "_" +
|
||||
ToString(nMid)
|
||||
ToXString(period) + "_" +
|
||||
ToXString(nMid)
|
||||
//
|
||||
;
|
||||
|
||||
@@ -614,11 +614,11 @@ struct XDirectionShift
|
||||
//
|
||||
result =
|
||||
after > 0 &&
|
||||
IsValid(at) &&
|
||||
IsValid(type) &&
|
||||
IsSpecifiedValid(at) &&
|
||||
IsSpecifiedValid(type) &&
|
||||
after != before &&
|
||||
IsValid(symbol) &&
|
||||
IsValid(period) &&
|
||||
IsSpecifiedValid(symbol) &&
|
||||
IsSpecifiedValid(period) &&
|
||||
HasDirection(shiftTo);
|
||||
|
||||
//
|
||||
|
||||
@@ -353,7 +353,7 @@ struct XRR
|
||||
type = X_POSITION_TYPE_NONE;
|
||||
|
||||
//
|
||||
Clean(tps);
|
||||
SpecifiedClean(tps);
|
||||
|
||||
//
|
||||
ZeroMemory(this);
|
||||
@@ -376,8 +376,8 @@ struct XRR
|
||||
result =
|
||||
_sl > 0 &&
|
||||
_entry > 0 &&
|
||||
IsValid(_symbol) &&
|
||||
IsValid(_period) &&
|
||||
IsSpecifiedValid(_symbol) &&
|
||||
IsSpecifiedValid(_period) &&
|
||||
_type != X_POSITION_TYPE_ALL &&
|
||||
_type != X_POSITION_TYPE_NONE &&
|
||||
(_type == X_POSITION_TYPE_LONG
|
||||
@@ -453,9 +453,9 @@ struct XRR
|
||||
result =
|
||||
sl > 0 &&
|
||||
entry > 0 &&
|
||||
IsValid(time) &&
|
||||
IsValid(symbol) &&
|
||||
IsValid(period) &&
|
||||
IsSpecifiedValid(time) &&
|
||||
IsSpecifiedValid(symbol) &&
|
||||
IsSpecifiedValid(period) &&
|
||||
IsValidSize(ArraySize(tps)) &&
|
||||
type != X_POSITION_TYPE_ALL &&
|
||||
type != X_POSITION_TYPE_NONE &&
|
||||
@@ -486,7 +486,7 @@ struct XRR
|
||||
|
||||
//
|
||||
result =
|
||||
GetTypeName(this) + sep + (IsValid(prefix) ? prefix + sep : "") + symbol + sep + ToString(period) + sep + ToFormatString(time) + sep + ToString(type);
|
||||
GetTypeName(this) + sep + (IsSpecifiedValid(prefix) ? prefix + sep : "") + symbol + sep + ToXString(period) + sep + ToFormatString(time) + sep + ToString(type);
|
||||
|
||||
//
|
||||
return result;
|
||||
@@ -864,7 +864,7 @@ struct XPosition
|
||||
//
|
||||
result =
|
||||
//
|
||||
IsValid(symbol) &&
|
||||
IsSpecifiedValid(symbol) &&
|
||||
NotEmpty(ticket)
|
||||
//
|
||||
;
|
||||
@@ -887,7 +887,7 @@ struct XPosition
|
||||
}
|
||||
|
||||
//
|
||||
result = GetEntry(
|
||||
result = GetXEntry(
|
||||
symbol,
|
||||
type
|
||||
//
|
||||
@@ -911,7 +911,7 @@ struct XPosition
|
||||
}
|
||||
|
||||
//
|
||||
result = GetExit(
|
||||
result = GetXExit(
|
||||
symbol,
|
||||
type
|
||||
//
|
||||
@@ -935,7 +935,7 @@ struct XPosition
|
||||
}
|
||||
|
||||
//
|
||||
result = PriceToPoint(GetSpread(symbol));
|
||||
result = PriceToPoint(GetXSpread(symbol));
|
||||
|
||||
//
|
||||
return result;
|
||||
@@ -1067,7 +1067,7 @@ struct XPosition
|
||||
int result = 0;
|
||||
|
||||
//
|
||||
Clean(tps);
|
||||
SpecifiedClean(tps);
|
||||
|
||||
//
|
||||
bool isValid = IsValid();
|
||||
@@ -1175,7 +1175,7 @@ struct XPosition
|
||||
ENUM_TIMEFRAMES mPeriod // Calculate Age based on this period
|
||||
)
|
||||
{
|
||||
return GetAge(this, mPeriod);
|
||||
return GetXAge(this, mPeriod);
|
||||
}
|
||||
|
||||
//
|
||||
@@ -1207,11 +1207,11 @@ struct XPosition
|
||||
//
|
||||
// Find index in a Collection ...
|
||||
int FindIndex(
|
||||
const XPosition &values[] // Collection to Find
|
||||
XPosition &values[] // Collection to Find
|
||||
)
|
||||
{
|
||||
//
|
||||
return FindIndex(
|
||||
return FindXIndex(
|
||||
this,
|
||||
values
|
||||
//
|
||||
@@ -1358,7 +1358,7 @@ struct XSignal
|
||||
conditions = NULL;
|
||||
|
||||
//
|
||||
Clean(targets);
|
||||
SpecifiedClean(targets);
|
||||
appliedTargetIDX = -1;
|
||||
ignoreEAVolume = false;
|
||||
isTargetApplied = false;
|
||||
@@ -1387,7 +1387,7 @@ struct XSignal
|
||||
conditions = NULL;
|
||||
|
||||
//
|
||||
Clean(targets);
|
||||
SpecifiedClean(targets);
|
||||
appliedTargetIDX = -1;
|
||||
ignoreEAVolume = false;
|
||||
isTargetApplied = false;
|
||||
@@ -1403,8 +1403,8 @@ struct XSignal
|
||||
//
|
||||
result =
|
||||
//
|
||||
IsValid(period) &&
|
||||
IsValid(symbol) &&
|
||||
IsSpecifiedValid(period) &&
|
||||
IsSpecifiedValid(symbol) &&
|
||||
NotEmpty(volume) &&
|
||||
NotEmpty(entry)
|
||||
//
|
||||
@@ -1481,7 +1481,7 @@ struct XSignal
|
||||
}
|
||||
|
||||
//
|
||||
if (IsValid(provider))
|
||||
if (IsSpecifiedValid(provider))
|
||||
{
|
||||
//
|
||||
// Generate Provider Tag ...
|
||||
@@ -1489,7 +1489,7 @@ struct XSignal
|
||||
}
|
||||
|
||||
//
|
||||
if (IsValid(period))
|
||||
if (IsSpecifiedValid(period))
|
||||
{
|
||||
//
|
||||
// Generate Period Tag ...
|
||||
@@ -1504,7 +1504,7 @@ struct XSignal
|
||||
int GetAge()
|
||||
{
|
||||
//
|
||||
return GetAge(
|
||||
return GetXAge(
|
||||
this,
|
||||
this.period //
|
||||
);
|
||||
@@ -1579,11 +1579,11 @@ struct XSignal
|
||||
//
|
||||
result = "XSignal_" +
|
||||
symbol + "_" +
|
||||
ToString(period) + "_" +
|
||||
ToString(type) + "_" +
|
||||
ToString(sl) + "_" +
|
||||
ToString(tp) + "_" +
|
||||
ToString(entry);
|
||||
ToXString(period) + "_" +
|
||||
ToXString(type) + "_" +
|
||||
ToXString(sl) + "_" +
|
||||
ToXString(tp) + "_" +
|
||||
ToXString(entry);
|
||||
|
||||
//
|
||||
return result;
|
||||
@@ -1599,17 +1599,17 @@ struct XSignal
|
||||
//
|
||||
result =
|
||||
//
|
||||
ToString("Symbol", symbol) +
|
||||
ToString("Period", period) +
|
||||
ToString("Provider", provider) +
|
||||
ToString("Type", type) +
|
||||
ToString("Mode", mode) +
|
||||
ToString("Volume", volume) +
|
||||
ToString("Entry", entry) +
|
||||
ToString("TP", tp) +
|
||||
ToString("SL", sl) +
|
||||
ToString("Time", time) +
|
||||
ToString("Comment", comment) +
|
||||
ToXString("Symbol", symbol) +
|
||||
ToXString("Period", period) +
|
||||
ToXString("Provider", provider) +
|
||||
ToXString("Type", type) +
|
||||
ToXString("Mode", mode) +
|
||||
ToXString("Volume", volume) +
|
||||
ToXString("Entry", entry) +
|
||||
ToXString("TP", tp) +
|
||||
ToXString("SL", sl) +
|
||||
ToXString("Time", time) +
|
||||
ToXString("Comment", comment) +
|
||||
//
|
||||
""
|
||||
//
|
||||
@@ -1660,14 +1660,14 @@ struct XSignal
|
||||
}
|
||||
|
||||
//
|
||||
result = ToString(type) +
|
||||
result = ToXString(type) +
|
||||
" Signal" +
|
||||
(!IsValid(action)
|
||||
(!IsSpecifiedValid(action)
|
||||
? ""
|
||||
: " " + action) +
|
||||
" by: " + provider +
|
||||
" on (" + symbol + ")" +
|
||||
" in: " + ToString(period);
|
||||
" in: " + ToXString(period);
|
||||
|
||||
//
|
||||
return result;
|
||||
@@ -1689,8 +1689,8 @@ struct XSignal
|
||||
result =
|
||||
//
|
||||
symbol + "\\" +
|
||||
ToString(type) + "\\" +
|
||||
ToString(period) + "_" +
|
||||
ToXString(type) + "\\" +
|
||||
ToXString(period) + "_" +
|
||||
ToFormatString(time)
|
||||
//
|
||||
;
|
||||
@@ -1978,7 +1978,7 @@ struct XOrder
|
||||
//
|
||||
result =
|
||||
//
|
||||
IsValid(symbol) &&
|
||||
IsSpecifiedValid(symbol) &&
|
||||
NotEmpty(ticket) &&
|
||||
NotEmpty(positionId)
|
||||
//
|
||||
@@ -1994,7 +1994,7 @@ struct XOrder
|
||||
ENUM_TIMEFRAMES mPeriod // Calculate Age based on this period
|
||||
)
|
||||
{
|
||||
return GetAge(this, mPeriod);
|
||||
return GetXAge(this, mPeriod);
|
||||
}
|
||||
|
||||
//
|
||||
@@ -2026,11 +2026,11 @@ struct XOrder
|
||||
//
|
||||
// Find index in a Collection ...
|
||||
int FindIndex(
|
||||
const XOrder &values[] // Collection to Find
|
||||
XOrder &values[] // Collection to Find
|
||||
)
|
||||
{
|
||||
//
|
||||
return FindIndex(
|
||||
return FindXIndex(
|
||||
this,
|
||||
values
|
||||
//
|
||||
@@ -2338,7 +2338,7 @@ struct XDeal
|
||||
//
|
||||
result =
|
||||
//
|
||||
IsValid(symbol) &&
|
||||
IsSpecifiedValid(symbol) &&
|
||||
NotEmpty(ticket) &&
|
||||
NotEmpty(positionId)
|
||||
//
|
||||
@@ -2354,7 +2354,7 @@ struct XDeal
|
||||
ENUM_TIMEFRAMES mPeriod // Calculate Age based on this period
|
||||
)
|
||||
{
|
||||
return GetAge(this, mPeriod);
|
||||
return GetXAge(this, mPeriod);
|
||||
}
|
||||
|
||||
//
|
||||
@@ -2388,11 +2388,11 @@ struct XDeal
|
||||
//
|
||||
// Find index in a Collection ...
|
||||
int FindIndex(
|
||||
const XDeal &values[] // Collection to Find
|
||||
XDeal &values[] // Collection to Find
|
||||
)
|
||||
{
|
||||
//
|
||||
return FindIndex(
|
||||
return FindXIndex(
|
||||
this,
|
||||
values
|
||||
//
|
||||
@@ -2668,7 +2668,7 @@ struct XSymbolPositions
|
||||
);
|
||||
|
||||
//
|
||||
Clean(positions);
|
||||
SpecifiedClean(positions);
|
||||
|
||||
//
|
||||
int tmpsCount = ArraySize(_tmp);
|
||||
@@ -2698,14 +2698,14 @@ struct XSymbolPositions
|
||||
}
|
||||
|
||||
//
|
||||
Clean(_tmp);
|
||||
SpecifiedClean(_tmp);
|
||||
|
||||
//
|
||||
Copy(
|
||||
_positions,
|
||||
positions //
|
||||
);
|
||||
Clean(_positions);
|
||||
SpecifiedClean(_positions);
|
||||
|
||||
//
|
||||
// Extract Types ...
|
||||
@@ -2720,7 +2720,7 @@ struct XSymbolPositions
|
||||
_supports,
|
||||
supports //
|
||||
);
|
||||
Clean(_supports);
|
||||
SpecifiedClean(_supports);
|
||||
|
||||
//
|
||||
// Extract Types ...
|
||||
@@ -2779,7 +2779,7 @@ struct XSymbolPositions
|
||||
);
|
||||
|
||||
//
|
||||
Clean(_allPositions);
|
||||
SpecifiedClean(_allPositions);
|
||||
|
||||
//
|
||||
result = true;
|
||||
@@ -2813,9 +2813,9 @@ struct XSymbolPositions
|
||||
requiredProfitForHedge = 0;
|
||||
|
||||
//
|
||||
Clean(longs);
|
||||
Clean(shorts);
|
||||
Clean(positions);
|
||||
SpecifiedClean(longs);
|
||||
SpecifiedClean(shorts);
|
||||
SpecifiedClean(positions);
|
||||
|
||||
//
|
||||
ZeroMemory(this);
|
||||
@@ -2829,7 +2829,7 @@ struct XSymbolPositions
|
||||
bool result = false;
|
||||
|
||||
//
|
||||
result = IsValid(symbol);
|
||||
result = IsSpecifiedValid(symbol);
|
||||
|
||||
//
|
||||
return result;
|
||||
@@ -2920,7 +2920,7 @@ struct XSymbolPositions
|
||||
if (isLong)
|
||||
{
|
||||
//
|
||||
result = GetOldest(
|
||||
result = GetXOldest(
|
||||
_oldest,
|
||||
longs //
|
||||
);
|
||||
@@ -2928,7 +2928,7 @@ struct XSymbolPositions
|
||||
else
|
||||
{
|
||||
//
|
||||
result = GetOldest(
|
||||
result = GetXOldest(
|
||||
_oldest,
|
||||
shorts //
|
||||
);
|
||||
@@ -2964,7 +2964,7 @@ struct XSymbolPositions
|
||||
if (isLong)
|
||||
{
|
||||
//
|
||||
result = GetYoungest(
|
||||
result = GetXYoungest(
|
||||
_youngest,
|
||||
longs //
|
||||
);
|
||||
@@ -2972,7 +2972,7 @@ struct XSymbolPositions
|
||||
else
|
||||
{
|
||||
//
|
||||
result = GetYoungest(
|
||||
result = GetXYoungest(
|
||||
_youngest,
|
||||
shorts //
|
||||
);
|
||||
@@ -3284,6 +3284,13 @@ int GetAge(
|
||||
//
|
||||
return result;
|
||||
}
|
||||
int GetXAge(
|
||||
XSignal &signal, // Selected Signal ...
|
||||
ENUM_TIMEFRAMES period = NULL // Dest Time Frame ...
|
||||
)
|
||||
{
|
||||
return GetAge(signal, period);
|
||||
}
|
||||
|
||||
//
|
||||
// Retrieve a Position Age ...
|
||||
@@ -3310,6 +3317,13 @@ int GetAge(
|
||||
//
|
||||
return result;
|
||||
}
|
||||
int GetXAge(
|
||||
XPosition &position, // Selected Position ...
|
||||
ENUM_TIMEFRAMES period = NULL // Dest Time Frame ...
|
||||
)
|
||||
{
|
||||
return GetAge(position, period);
|
||||
}
|
||||
|
||||
//
|
||||
// Retrieve an Order Age ...
|
||||
@@ -3336,6 +3350,13 @@ int GetAge(
|
||||
//
|
||||
return result;
|
||||
}
|
||||
int GetXAge(
|
||||
XOrder &order, // Selected Order ...
|
||||
ENUM_TIMEFRAMES period = NULL // Dest Time Frame ...
|
||||
)
|
||||
{
|
||||
return GetAge(order, period);
|
||||
}
|
||||
|
||||
//
|
||||
// Retrieve a Deal Age ...
|
||||
@@ -3362,6 +3383,13 @@ int GetAge(
|
||||
//
|
||||
return result;
|
||||
}
|
||||
int GetXAge(
|
||||
XDeal &deal, // Selected Deal ...
|
||||
ENUM_TIMEFRAMES period = NULL // Dest Time Frame ...
|
||||
)
|
||||
{
|
||||
return GetAge(deal, period);
|
||||
}
|
||||
|
||||
//
|
||||
// Get Oldest Deal ...
|
||||
@@ -3410,6 +3438,13 @@ int GetOldest(
|
||||
//
|
||||
return result;
|
||||
}
|
||||
int GetXOldest(
|
||||
XDeal &item, // Hold Result ...
|
||||
XDeal &items[] // Source Array ...
|
||||
)
|
||||
{
|
||||
return GetOldest(item, items);
|
||||
}
|
||||
|
||||
//
|
||||
// Get Youngest Deal ...
|
||||
@@ -3458,6 +3493,13 @@ int GetYoungest(
|
||||
//
|
||||
return result;
|
||||
}
|
||||
int GetXYoungest(
|
||||
XDeal &item, // Hold Result ...
|
||||
XDeal &items[] // Source Array ...
|
||||
)
|
||||
{
|
||||
return GetYoungest(item, items);
|
||||
}
|
||||
|
||||
//
|
||||
// Get Oldest Order ...
|
||||
@@ -3506,6 +3548,13 @@ int GetOldest(
|
||||
//
|
||||
return result;
|
||||
}
|
||||
int GetXOldest(
|
||||
XOrder &item, // Hold Result ...
|
||||
XOrder &items[] // Source Array ...
|
||||
)
|
||||
{
|
||||
return GetOldest(item, items);
|
||||
}
|
||||
|
||||
//
|
||||
// Get Youngest Order ...
|
||||
@@ -3554,6 +3603,13 @@ int GetYoungest(
|
||||
//
|
||||
return result;
|
||||
}
|
||||
int GetXYoungest(
|
||||
XOrder &item, // Hold Result ...
|
||||
XOrder &items[] // Source Array ...
|
||||
)
|
||||
{
|
||||
return GetYoungest(item, items);
|
||||
}
|
||||
|
||||
//
|
||||
// Get Oldes Position ...
|
||||
@@ -3602,6 +3658,13 @@ int GetOldest(
|
||||
//
|
||||
return result;
|
||||
}
|
||||
int GetXOldest(
|
||||
XPosition &item, // Hold Result ...
|
||||
XPosition &items[] // Source Array ...
|
||||
)
|
||||
{
|
||||
return GetOldest(item, items);
|
||||
}
|
||||
|
||||
//
|
||||
// Get Youngest Position ...
|
||||
@@ -3650,6 +3713,13 @@ int GetYoungest(
|
||||
//
|
||||
return result;
|
||||
}
|
||||
int GetXYoungest(
|
||||
XPosition &item, // Hold Result ...
|
||||
XPosition &items[] // Source Array ...
|
||||
)
|
||||
{
|
||||
return GetYoungest(item, items);
|
||||
}
|
||||
|
||||
//
|
||||
int FindMaxProfitIndex(
|
||||
@@ -4481,7 +4551,7 @@ ENUM_ORDER_TYPE ToOrderType(ENUM_X_POSITION_TYPES value)
|
||||
string GeneratePeriodTag(ENUM_TIMEFRAMES period)
|
||||
{
|
||||
//
|
||||
string strPeriod = ToString(period);
|
||||
string strPeriod = ToXString(period);
|
||||
return Surround(
|
||||
XPeriodToken,
|
||||
strPeriod
|
||||
|
||||
Reference in New Issue
Block a user