fix x786 ...

This commit is contained in:
2024-05-29 00:15:02 +03:30
parent 179efd4170
commit 33b68be918
6 changed files with 352 additions and 110 deletions
+55
View File
@@ -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;
}
}
}