last ...
This commit is contained in:
@@ -294,7 +294,7 @@ class XCAlert : public XCBase
|
||||
}
|
||||
|
||||
//
|
||||
Print(GetPrefix(), " > ", message);
|
||||
Print(message);
|
||||
}
|
||||
void Log(string tag, string message)
|
||||
{
|
||||
|
||||
@@ -59,16 +59,7 @@ class XCDataCollector : public XCBase
|
||||
//
|
||||
void Path(string value)
|
||||
{
|
||||
//
|
||||
// Normalizing Collector Path ...
|
||||
if (IsValid(value))
|
||||
{
|
||||
mPath = value;
|
||||
}
|
||||
else
|
||||
{
|
||||
mPath = "XDataCollector";
|
||||
}
|
||||
mPath = value;
|
||||
}
|
||||
|
||||
//
|
||||
@@ -83,7 +74,7 @@ class XCDataCollector : public XCBase
|
||||
//
|
||||
result =
|
||||
//
|
||||
mPath + "\\" + fileName + ".x121.log"
|
||||
(IsValid(mPath) ? mPath + "\\" : "") + fileName + ".x121.log"
|
||||
//
|
||||
;
|
||||
|
||||
@@ -128,7 +119,7 @@ class XCDataCollector : public XCBase
|
||||
//
|
||||
result = FileOpen(
|
||||
filePath,
|
||||
FILE_READ | FILE_TXT //
|
||||
FILE_READ | FILE_TXT | FILE_ANSI //
|
||||
);
|
||||
|
||||
//
|
||||
|
||||
@@ -1407,3 +1407,27 @@
|
||||
|
||||
///////////////////////////////////////////////////////////////////
|
||||
|
||||
template <typename T>
|
||||
bool IsBoolean(T value)
|
||||
{
|
||||
//
|
||||
bool result = false;
|
||||
|
||||
//
|
||||
string normalizedValue = ToString(value);
|
||||
StringToLower(normalizedValue);
|
||||
normalizedValue = Trim(normalizedValue);
|
||||
|
||||
//
|
||||
result =
|
||||
!IsValid(normalizedValue)
|
||||
? false
|
||||
: (normalizedValue == "true" ||
|
||||
normalizedValue == "false");
|
||||
|
||||
//
|
||||
return result;
|
||||
}
|
||||
|
||||
///////////////////////////////////////////////////////////////////
|
||||
|
||||
|
||||
@@ -0,0 +1 @@
|
||||
X121XCATBEA\X121XCATBEA_XAUUSDb_M5.x121.log
|
||||
Binary file not shown.
@@ -1857,28 +1857,6 @@ string Trim(string value)
|
||||
return result;
|
||||
}
|
||||
|
||||
template <typename T>
|
||||
bool IsBoolean(T value)
|
||||
{
|
||||
//
|
||||
bool result = false;
|
||||
|
||||
//
|
||||
string normalizedValue = ToString(value);
|
||||
StringToLower(normalizedValue);
|
||||
normalizedValue = Trim(normalizedValue);
|
||||
|
||||
//
|
||||
result =
|
||||
!IsValid(normalizedValue)
|
||||
? false
|
||||
: (normalizedValue == "true" ||
|
||||
normalizedValue == "false");
|
||||
|
||||
//
|
||||
return result;
|
||||
}
|
||||
|
||||
//
|
||||
// Used In Report or Summary Generators ...
|
||||
string ToString(
|
||||
@@ -1894,7 +1872,7 @@ string ToString(
|
||||
|
||||
//
|
||||
bool canSet =
|
||||
IsBoolean(value)
|
||||
IsBoolean(ToString(value))
|
||||
? (bool)value || !ignoreFalseConditions
|
||||
: true;
|
||||
|
||||
@@ -2023,6 +2001,35 @@ string ToString(
|
||||
return result;
|
||||
}
|
||||
|
||||
/**
|
||||
* Check a String Value is Boolean or Not ...
|
||||
*
|
||||
* @param value: string representation of value ...
|
||||
*
|
||||
* @return ( bool )
|
||||
*/
|
||||
bool IsBoolean(string value)
|
||||
{
|
||||
//
|
||||
bool result = false;
|
||||
|
||||
//
|
||||
string istring = value;
|
||||
string normalizedValue = ToString(istring);
|
||||
StringToLower(normalizedValue);
|
||||
normalizedValue = Trim(normalizedValue);
|
||||
|
||||
//
|
||||
result =
|
||||
!IsValid(normalizedValue)
|
||||
? false
|
||||
: (normalizedValue == "true" ||
|
||||
normalizedValue == "false");
|
||||
|
||||
//
|
||||
return result;
|
||||
}
|
||||
|
||||
/**
|
||||
* Converts String to boolean ...
|
||||
*
|
||||
@@ -2036,14 +2043,24 @@ bool ToBoolean(string value)
|
||||
bool result = false;
|
||||
|
||||
//
|
||||
if (StringLen(value) <= 0)
|
||||
if (!IsBoolean(value) ||
|
||||
StringLen(value) <= 0)
|
||||
{
|
||||
return result;
|
||||
}
|
||||
|
||||
//
|
||||
value = Trim(value);
|
||||
StringToLower(value);
|
||||
result = value == "true";
|
||||
|
||||
//
|
||||
bool isTrue = value == "true";
|
||||
bool isFalse = value == "false";
|
||||
|
||||
//
|
||||
result = isTrue
|
||||
? true
|
||||
: false;
|
||||
|
||||
//
|
||||
return result;
|
||||
|
||||
File diff suppressed because it is too large
Load Diff
@@ -1647,10 +1647,13 @@ class XCXCATBEATradeManager : public XCBase
|
||||
|
||||
//
|
||||
collector = new XCDataCollector();
|
||||
|
||||
|
||||
//
|
||||
// Setting Collector Path ...
|
||||
string mPath = alert.GetPrefix() + "\\" + trader.mAccount.GetCompany();
|
||||
string mPath = (IsValid(alert.GetPrefix())
|
||||
? alert.GetPrefix() + "\\"
|
||||
: "") +
|
||||
trader.mAccount.GetCompany();
|
||||
collector.Path(mPath);
|
||||
}
|
||||
|
||||
@@ -3066,14 +3069,8 @@ class XCXCATBEATradeManager : public XCBase
|
||||
string result = NULL;
|
||||
|
||||
//
|
||||
string mPath = collector.Path();
|
||||
|
||||
//
|
||||
result =
|
||||
//
|
||||
mPath + "\\" + "Trades" + "\\" + fileName + ".x121.log"
|
||||
//
|
||||
;
|
||||
result = collector
|
||||
.GetFilePath("Trades" + "\\" + fileName);
|
||||
|
||||
//
|
||||
return result;
|
||||
@@ -3086,14 +3083,8 @@ class XCXCATBEATradeManager : public XCBase
|
||||
string result = NULL;
|
||||
|
||||
//
|
||||
string mPath = collector.Path();
|
||||
|
||||
//
|
||||
result =
|
||||
//
|
||||
mPath + "\\" + "Signals" + "\\" + fileName + ".x121.log"
|
||||
//
|
||||
;
|
||||
result = collector
|
||||
.GetFilePath("Signals" + "\\" + fileName);
|
||||
|
||||
//
|
||||
return result;
|
||||
@@ -3106,17 +3097,10 @@ class XCXCATBEATradeManager : public XCBase
|
||||
string result = NULL;
|
||||
|
||||
//
|
||||
string mPath = collector.Path();
|
||||
|
||||
//
|
||||
result =
|
||||
//
|
||||
mPath + "\\" +
|
||||
"Conditions" + "\\" +
|
||||
trade.signal.symbol + "\\" +
|
||||
ToString(trade.signal.period) + "_wins.x121.log"
|
||||
//
|
||||
;
|
||||
result = collector
|
||||
.GetFilePath("Conditions" + "\\" +
|
||||
trade.signal.symbol + "\\" +
|
||||
ToString(trade.signal.period) + "_wins");
|
||||
|
||||
//
|
||||
return result;
|
||||
@@ -3129,17 +3113,10 @@ class XCXCATBEATradeManager : public XCBase
|
||||
string result = NULL;
|
||||
|
||||
//
|
||||
string mPath = collector.Path();
|
||||
|
||||
//
|
||||
result =
|
||||
//
|
||||
mPath + "\\" +
|
||||
"Conditions" + "\\" +
|
||||
trade.signal.symbol + "\\" +
|
||||
ToString(trade.signal.period) + "_losts.x121.log"
|
||||
//
|
||||
;
|
||||
result = collector
|
||||
.GetFilePath("Conditions" + "\\" +
|
||||
trade.signal.symbol + "\\" +
|
||||
ToString(trade.signal.period) + "_losts");
|
||||
|
||||
//
|
||||
return result;
|
||||
@@ -3158,16 +3135,8 @@ class XCXCATBEATradeManager : public XCBase
|
||||
}
|
||||
|
||||
//
|
||||
string mPath = collector.Path();
|
||||
|
||||
//
|
||||
result =
|
||||
//
|
||||
mPath + "\\" +
|
||||
"Restrictions" + "\\" +
|
||||
symbol + ".x121.log"
|
||||
//
|
||||
;
|
||||
result = collector
|
||||
.GetFilePath("Restrictions" + "\\" + symbol);
|
||||
|
||||
//
|
||||
return result;
|
||||
|
||||
Reference in New Issue
Block a user