Apply URAUDb Level 3 Fix ...
This commit is contained in:
@@ -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
|
||||
{
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user