fix x786 ...
This commit is contained in:
@@ -4110,3 +4110,58 @@ int GenerateEQMOrders(
|
||||
//
|
||||
return result;
|
||||
}
|
||||
|
||||
//
|
||||
// Count Positions from a Collection ...
|
||||
void CountPositions(
|
||||
const XPosition &positions[],
|
||||
int &longs,
|
||||
double &longProfits,
|
||||
double &longVolumes, //
|
||||
//
|
||||
int &shorts,
|
||||
double &shortProfits,
|
||||
double &shortVolumes //
|
||||
)
|
||||
{
|
||||
//
|
||||
longs = 0;
|
||||
longProfits = 0;
|
||||
longVolumes = 0;
|
||||
|
||||
//
|
||||
shorts = 0;
|
||||
shortProfits = 0;
|
||||
shortVolumes = 0;
|
||||
|
||||
//
|
||||
int positionsCount = ArraySize(positions);
|
||||
if (!IsValidSize(positionsCount))
|
||||
{
|
||||
return;
|
||||
}
|
||||
|
||||
//
|
||||
for (int i = 0; i < positionsCount; i++)
|
||||
{
|
||||
//
|
||||
XPosition iPosition = positions[i];
|
||||
|
||||
//
|
||||
bool isLong = IsLong(iPosition.type);
|
||||
if (isLong)
|
||||
{
|
||||
//
|
||||
longs++;
|
||||
longProfits += iPosition.profit;
|
||||
longVolumes = iPosition.volume;
|
||||
}
|
||||
else
|
||||
{
|
||||
//
|
||||
shorts++;
|
||||
shortProfits += iPosition.profit;
|
||||
shortVolumes = iPosition.volume;
|
||||
}
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user