last ...
This commit is contained in:
@@ -422,35 +422,43 @@ public:
|
||||
// }
|
||||
|
||||
//
|
||||
string mSymbols[];
|
||||
XSCPositionHolder *mHolders[];
|
||||
int symbolsCount = FilterSymbolBasedPositions(
|
||||
mSymbols,
|
||||
mHolders //
|
||||
);
|
||||
|
||||
//
|
||||
for (int i = 0; i < symbolsCount; i++)
|
||||
int signalsCount = ArraySize(signals);
|
||||
if (IsValidSize(signalsCount))
|
||||
{
|
||||
//
|
||||
string iSymbol = mSymbols[i];
|
||||
XSCPositionHolder *iHolder = mHolders[i];
|
||||
|
||||
//
|
||||
// We Can Select Multiple Positions for Place EQM Supports ...
|
||||
|
||||
//
|
||||
// Select Max In Drawdown Position and Protect it ...
|
||||
XPosition iSelectedPosition;
|
||||
bool iHasPosition = iHolder.GetMaxInDrawdown(iSelectedPosition);
|
||||
if (iHasPosition)
|
||||
{
|
||||
//
|
||||
// Try to Protect Max In Drawdown Positions Position ...
|
||||
PlaceEQMOrders(iSelectedPosition);
|
||||
}
|
||||
Print("Cnverts " + ToString(signalsCount) + " Signal using SupRes ...");
|
||||
}
|
||||
|
||||
// //
|
||||
// string mSymbols[];
|
||||
// XSCPositionHolder *mHolders[];
|
||||
// int symbolsCount = FilterSymbolBasedPositions(
|
||||
// mSymbols,
|
||||
// mHolders //
|
||||
// );
|
||||
|
||||
// //
|
||||
// for (int i = 0; i < symbolsCount; i++)
|
||||
// {
|
||||
// //
|
||||
// string iSymbol = mSymbols[i];
|
||||
// XSCPositionHolder *iHolder = mHolders[i];
|
||||
|
||||
// //
|
||||
// // We Can Select Multiple Positions for Place EQM Supports ...
|
||||
|
||||
// //
|
||||
// // Select Max In Drawdown Position and Protect it ...
|
||||
// XPosition iSelectedPosition;
|
||||
// bool iHasPosition = iHolder.GetMaxInDrawdown(iSelectedPosition);
|
||||
// if (iHasPosition)
|
||||
// {
|
||||
// //
|
||||
// // Try to Protect Max In Drawdown Positions Position ...
|
||||
// PlaceEQMOrders(iSelectedPosition);
|
||||
// }
|
||||
// }
|
||||
|
||||
//
|
||||
}
|
||||
|
||||
@@ -722,10 +730,10 @@ public:
|
||||
// TODO:
|
||||
// Make them Configurable ...
|
||||
int maxTrailTPs = 5;
|
||||
int levelsOnClose = 6;
|
||||
int riskFreeLevel = 2;
|
||||
// int levelsOnClose = 6;
|
||||
int riskFreeLevel = 4;
|
||||
int requiredAgeForTrail = 0;
|
||||
int requiredDistanceForTrail = 20;
|
||||
int requiredDistanceForTrail = 10;
|
||||
|
||||
//
|
||||
int positionsCount = ArraySize(positions);
|
||||
@@ -747,7 +755,9 @@ public:
|
||||
//
|
||||
bool canManageState =
|
||||
//
|
||||
iPosition.provider != XEQMSupportToken
|
||||
iPosition.provider != XEQMSupportToken
|
||||
// &&
|
||||
// iPosition.provider != "WSC"
|
||||
//
|
||||
;
|
||||
|
||||
@@ -785,6 +795,7 @@ public:
|
||||
|
||||
//
|
||||
// Check Position Profit Distance ...
|
||||
// double reward = MathAbs(iPosition.tp - iPosition.entry);
|
||||
double priceDistanceInPoint = PriceToPoint(iPosition.profit / iPosition.volume, iPosition.symbol);
|
||||
double priceDistance = PointToPrice(priceDistanceInPoint, iPosition.symbol);
|
||||
if (priceDistance < requiredDistanceForTrail)
|
||||
@@ -874,6 +885,10 @@ public:
|
||||
: iPosition.sl
|
||||
//
|
||||
;
|
||||
if (riskFreeLevel > 0 && trail.level > riskFreeLevel)
|
||||
{
|
||||
appliedSL = slDiff;
|
||||
}
|
||||
|
||||
//
|
||||
double sl =
|
||||
@@ -1113,7 +1128,8 @@ public:
|
||||
//
|
||||
// dont Manage NON Signal Provider's signals ...
|
||||
string provider = iSignal.provider;
|
||||
if (!IsValid(provider))
|
||||
bool canIgnore = !IsValid(provider) || provider == "EQM";
|
||||
if (canIgnore)
|
||||
{
|
||||
//
|
||||
AddRef(
|
||||
@@ -1161,7 +1177,7 @@ public:
|
||||
//
|
||||
continue;
|
||||
}
|
||||
else if (positionsCount < 2)
|
||||
else if (positionsCount < 4)
|
||||
{
|
||||
//
|
||||
// Next Signal in a While of Specific Provider ...
|
||||
@@ -1185,6 +1201,11 @@ public:
|
||||
signals //
|
||||
);
|
||||
|
||||
// //
|
||||
// if (youngest.profit > 0)
|
||||
// {
|
||||
// }
|
||||
|
||||
//
|
||||
continue;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user