cleanup ...
This commit is contained in:
@@ -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);
|
||||
|
||||
Reference in New Issue
Block a user