last ...
This commit is contained in:
@@ -2797,6 +2797,9 @@ struct XSymbolPositions
|
||||
XPosition shorts[];
|
||||
XPosition positions[];
|
||||
|
||||
//
|
||||
bool forceHedge;
|
||||
|
||||
//
|
||||
XSymbolPositions()
|
||||
{
|
||||
@@ -2862,6 +2865,7 @@ struct XSymbolPositions
|
||||
{
|
||||
//
|
||||
symbol = NULL;
|
||||
forceHedge = false;
|
||||
|
||||
//
|
||||
profit = 0;
|
||||
@@ -2928,6 +2932,51 @@ struct XSymbolPositions
|
||||
//
|
||||
};
|
||||
|
||||
//
|
||||
bool IsContainsSymbol(
|
||||
string symbol,
|
||||
int &_index,
|
||||
XSymbolPositions &_items[] //
|
||||
)
|
||||
{
|
||||
//
|
||||
bool result = false;
|
||||
|
||||
//
|
||||
_index = -1;
|
||||
|
||||
//
|
||||
result = IsValid(symbol);
|
||||
if (!result)
|
||||
{
|
||||
return result;
|
||||
}
|
||||
|
||||
//
|
||||
int itemsCount = ArraySize(_items);
|
||||
result = IsValidSize(itemsCount);
|
||||
if (!result)
|
||||
{
|
||||
return result;
|
||||
}
|
||||
|
||||
//
|
||||
for (int i = 0; i < itemsCount; i++)
|
||||
{
|
||||
//
|
||||
result = _items[i].symbol == symbol;
|
||||
if (result)
|
||||
{
|
||||
//
|
||||
_index = i;
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
//
|
||||
return result;
|
||||
}
|
||||
|
||||
//
|
||||
// TypeDefs ...
|
||||
|
||||
|
||||
Reference in New Issue
Block a user