cleanup ...

This commit is contained in:
2024-05-28 08:01:50 +03:30
parent 030e8e3c72
commit 670ca1eac2
13 changed files with 5533 additions and 97395 deletions
+23 -41
View File
@@ -721,9 +721,11 @@ public:
//
// TODO:
// Make them Configurable ...
int maxTrailTPs = 5;
int levelsOnClose = 6;
int riskFreeLevel = 2;
int requiredAgeForTrail = 0;
int requiredDistanceForTrail = 30;
int requiredDistanceForTrail = 20;
//
int positionsCount = ArraySize(positions);
@@ -792,7 +794,7 @@ public:
//
double slDiff = PointToPrice(priceDistance, iPosition.symbol);
double appliedSL = slDiff / 2;
double appliedSL = slDiff;
//
double sl =
@@ -848,33 +850,8 @@ public:
//
double priceDistanceInPoint = PriceToPoint((iPosition.profit - trail.profit) / iPosition.volume, iPosition.symbol);
double priceDistance = PointToPrice(priceDistanceInPoint, iPosition.symbol);
if (priceDistance < (requiredDistanceForTrail / 2))
if (priceDistance < requiredDistanceForTrail)
{
// //
// // int positionAge = iPosition.GetAge(iPosition.period);
// if (trail.level >= levelsOnClose)
// {
// //
// string comment = "EQM Close In Profit ...";
// bool isClosed = mTrader.ClosePositionPack(
// iPosition.ticket,
// iPosition.symbol,
// iPosition.period,
// comment,
// true,
// GetMinProfitPerTrade(),
// GetMinProfitPerVolumeFactor() //
// );
// if (isClosed)
// {
// //
// RemoveTrail(iPosition.ticket);
// //
// string message = "EQM Close (" + ToString(iPosition.ticket) + ") In Profit ...";
// mAlert.Alert(message);
// }
// }
continue;
}
@@ -883,21 +860,20 @@ public:
//
double slDiff = PointToPrice(priceDistance, iPosition.symbol);
double appliedSL = slDiff / 2;
double appliedSL = (slDiff / 2);
//
double selectedValue = iPosition.sl;
// //
// double selectedValue =
// //
// trail.level == 1 || (isLong
// ? iPosition.sl < iPosition.entry
// : iPosition.sl > iPosition.entry)
// ? iPosition.entry
// : iPosition.sl
// //
// ;
double selectedValue =
//
(riskFreeLevel > 0 &&
trail.level == riskFreeLevel) ||
(isLong
? iPosition.sl < iPosition.entry
: iPosition.sl > iPosition.entry)
? iPosition.entry
: iPosition.sl
//
;
//
double sl =
@@ -1009,6 +985,12 @@ public:
//
// Update Exists ...
//
if (trail.level >= maxTrailTPs)
{
continue;
}
//
// Check Profit ...
bool isProfitPassed = MathAbs(iPosition.profit) > MathAbs(trail.profit);