last works on recovery ...

This commit is contained in:
2024-07-28 16:41:53 +03:30
parent be741a0ebd
commit 97cbf77f7d
+11 -3
View File
@@ -4767,7 +4767,7 @@ public:
} }
else else
{ {
// //
XPosition positions[]; XPosition positions[];
int positionsCount = mTrader.GetPositions( int positionsCount = mTrader.GetPositions(
positions, positions,
@@ -4847,6 +4847,9 @@ public:
// //
string msg = "EQM Done Recovery (" + ToString(closeds) + ") Positions ..."; string msg = "EQM Done Recovery (" + ToString(closeds) + ") Positions ...";
Alert(msg); Alert(msg);
//
break;
} }
} }
@@ -5106,7 +5109,8 @@ public:
// //
// Current Profit ... // Current Profit ...
double distanceInPoints = (MathAbs(profit) / volume); double distanceInPoints = (MathAbs(profit) / volume);
double _volume = volume * ((mData[i].recoveryLevel + 1) * recoveryVolumeMultiplier); double _volumeMultiplier = ((mData[i].recoveryLevel) * recoveryVolumeMultiplier);
double _volume = volume * (_volumeMultiplier <= 0 ? 1 : _volumeMultiplier);
string _comment = GenerateRecoveryTag(ticket); string _comment = GenerateRecoveryTag(ticket);
// //
@@ -5191,7 +5195,11 @@ public:
else else
{ {
// //
bool canRecover = distanceInPoints >= recoverySLPoint; bool canRecover =
distanceInPoints >= recoverySLPoint &&
(mData[i].recoveryLevel == 0 ||
(mData[i].recoveryLevel >= 2 &&
mData[i].recoveryLevel / 2 == 0));
if (canRecover) if (canRecover)
{ {
// //