Last Changes ...
This commit is contained in:
@@ -0,0 +1,143 @@
|
||||
`
|
||||
//
|
||||
// an Structure for Holds an Specified Symbols
|
||||
// Positions Info ...
|
||||
struct XTradeSymbolInfo
|
||||
{
|
||||
//
|
||||
// Properties ...
|
||||
|
||||
//
|
||||
string symbol; // Trading Symbol
|
||||
|
||||
//
|
||||
int longs; // All Long Trades
|
||||
int shorts; // All Short Trades
|
||||
|
||||
//
|
||||
int trades; // All Trades
|
||||
|
||||
//
|
||||
int losses; // All Loosing Trades
|
||||
int profits; // All Winning Trades
|
||||
|
||||
//
|
||||
datetime managedStart; // Managed Start Time
|
||||
|
||||
//
|
||||
int managedSLs; // Managed SL(s)
|
||||
int managedTPs; // Managed TP(s)
|
||||
int managedTrades; // Managed Trades
|
||||
|
||||
//
|
||||
double managedBalance; // Managed Start Balance
|
||||
double managedProfits; // Managed Profit(s)
|
||||
|
||||
//
|
||||
// Constructor ...
|
||||
XTradeSymbolInfo()
|
||||
{
|
||||
Clean();
|
||||
}
|
||||
|
||||
//
|
||||
// Tools ...
|
||||
|
||||
//
|
||||
// Cleanup ...
|
||||
void Clean()
|
||||
{
|
||||
//
|
||||
symbol = NULL;
|
||||
|
||||
//
|
||||
longs = 0;
|
||||
shorts = 0;
|
||||
|
||||
//
|
||||
trades = 0;
|
||||
|
||||
//
|
||||
losses = 0;
|
||||
profits = 0;
|
||||
|
||||
//
|
||||
managedStart = NULL;
|
||||
|
||||
//
|
||||
managedSLs = 0;
|
||||
managedTPs = 0;
|
||||
managedTrades = 0;
|
||||
|
||||
//
|
||||
managedBalance = 0;
|
||||
managedProfits = 0;
|
||||
|
||||
//
|
||||
ZeroMemory(this);
|
||||
}
|
||||
|
||||
//
|
||||
// Validate ...
|
||||
bool IsValid()
|
||||
{
|
||||
//
|
||||
bool result = false;
|
||||
|
||||
//
|
||||
result = IsSpecifiedValid(symbol);
|
||||
|
||||
//
|
||||
return result;
|
||||
}
|
||||
|
||||
//
|
||||
bool IsSameAs(XTradeSymbolInfo &item)
|
||||
{
|
||||
//
|
||||
bool result = false;
|
||||
|
||||
//
|
||||
result = IsValid() &&
|
||||
item.IsValid() &&
|
||||
symbol == item.symbol;
|
||||
|
||||
//
|
||||
return result;
|
||||
}
|
||||
|
||||
//
|
||||
string GetRestrictionDescription(
|
||||
ENUM_XTRADE_RESTRICTION_PERIOD period //
|
||||
)
|
||||
{
|
||||
//
|
||||
string result = NULL;
|
||||
|
||||
//
|
||||
if (!IsValid() ||
|
||||
!HasRestrictions(period))
|
||||
{
|
||||
return result;
|
||||
}
|
||||
|
||||
//
|
||||
result +=
|
||||
"-------------------" + "\n" +
|
||||
"Restrictions: " + "\n" +
|
||||
"-------------------" + "\n" +
|
||||
"Symbol: " + ToXString(symbol) + "\n" +
|
||||
"Period: " + ToXString(period) + "\n" +
|
||||
"Start: " + ToFormatString(managedStart) + "\n" +
|
||||
"Balance: " + ToXString(managedBalance) + "\n" +
|
||||
"-------------------" + "\n" +
|
||||
"Trades: " + ToXString(managedTrades) + "\n" +
|
||||
"SL: " + ToXString(managedSLs) + "\n" +
|
||||
"TP: " + ToXString(managedTPs) + "\n" +
|
||||
"Profit: " + ToXString(managedProfits) + "\n" +
|
||||
"";
|
||||
|
||||
//
|
||||
return result;
|
||||
}
|
||||
};
|
||||
Reference in New Issue
Block a user