This commit is contained in:
2024-07-01 02:39:01 +03:30
parent 3cbedd591a
commit 73f7b3dc48
4 changed files with 1697 additions and 1388 deletions
File diff suppressed because it is too large Load Diff
-165
View File
@@ -4988,171 +4988,6 @@ string PrepareSLTrailTag(
return result;
}
//
// EQM Support Orders ...
//
int GenerateEQMOrders(
XSignal &orders[], // Result
XPosition &position, // Supported Position
XOHCLSupRes &supRes, // Data Source
bool longs = true,
bool shorts = true //
)
{
//
int result = 0;
//
Clean(orders);
//
if (!supRes.IsValid() ||
!position.IsValid())
{
return result;
}
//
if (longs)
{
//
double longLevels[];
//
Copy(
supRes.res,
longLevels //
);
//
double minSup = GetMin(
supRes.sup //
);
if (minSup > 0)
{
//
Add(
minSup,
longLevels //
);
}
//
ArraySort(longLevels);
//
if (ArraySize(longLevels) > 2)
{
//
for (int i = 0; i < ArraySize(longLevels) - 2; i++)
{
//
double iSL = longLevels[i];
double iEntry = longLevels[i + 1];
double iTP = longLevels[i + 2];
//
XSignal iSignal;
bool isPrepared = iSignal.PrepareStopLong(
position.symbol,
XEQMSupportToken,
position.period,
iEntry,
position.volume,
iSL,
iTP //
);
if (isPrepared)
{
//
string comment = GenerateSupportTag(position.ticket);
iSignal.comment = comment;
//
AddRef(
iSignal,
orders //
);
}
}
}
}
//
if (shorts)
{
//
double shortLevels[];
//
Copy(
supRes.sup,
shortLevels //
);
//
double maxRes = GetMax(
supRes.res //
);
if (maxRes > 0)
{
//
Add(
maxRes,
shortLevels //
);
}
//
ArraySort(shortLevels);
ArrayReverse(shortLevels);
//
if (ArraySize(shortLevels) > 2)
{
//
for (int i = 0; i < ArraySize(shortLevels) - 2; i++)
{
//
double iSL = shortLevels[i];
double iEntry = shortLevels[i + 1];
double iTP = shortLevels[i + 2];
//
XSignal iSignal;
bool isPrepared = iSignal.PrepareStopShort(
position.symbol,
XEQMSupportToken,
position.period,
iEntry,
position.volume,
iSL,
iTP //
);
if (isPrepared)
{
//
string comment = GenerateSupportTag(position.ticket);
iSignal.comment = comment;
//
AddRef(
iSignal,
orders //
);
}
}
}
}
//
result = ArraySize(orders);
//
return result;
}
//
// Count Positions from a Collection ...
void CountPositions(