Apply URAUDb Level 3 Fix ...

This commit is contained in:
2024-09-08 11:28:09 +03:30
parent 867e68284d
commit 98e7d896bc
7 changed files with 11069 additions and 1 deletions
+105
View File
@@ -5859,6 +5859,111 @@ public:
//
int supportsCount = ArraySize(supports);
//
// Collect Main Position Related Data ...
//
// Hold a Position and All of it's Supports ...
XPosition iPack[];
//
// Fill Pack ...
AddRef(
iPosition,
iPack //
);
//
if (IsValidSize(supportsCount))
{
//
Copy(
supports,
iPack //
);
}
//
int iPackCount = ArraySize(iPack);
if (!IsValidSize(iPackCount))
{
continue;
}
//
double volume = 0;
double profit = 0;
double commission = 0;
//
// Calculate Required Datas ...
for (int j = 0; j < iPackCount; j++)
{
//
XPosition jPosition = iPack[j];
if (!jPosition.IsValid())
{
continue;
}
//
XPosition uPosition;
bool hasPosition = mTrader.GetPosition(
jPosition.ticket,
uPosition //
);
if (!hasPosition)
{
continue;
}
//
volume += uPosition.volume;
profit += uPosition.profit;
//
double jCommission = mTrader.GetPositionCommission(jPosition.ticket);
commission += jCommission;
}
//
// here we have to Check Protection Conditions ...
//
// Check Position State ...
bool isInProfit = profit > 0;
//
// Based On Single Position ...
if (iPackCount == 1)
{
//
// Based on Profit ...
if (isInProfit)
{
}
//
// Based On DrawDown ...
else
{
}
}
//
// Multiple Protected Positions ...
else
{
//
// Based on Profit ...
if (isInProfit)
{
}
//
// Based On DrawDown ...
else
{
}
}
}
}