This commit is contained in:
2024-06-24 21:46:41 +03:30
parent e41548979e
commit 5d12ff7958
7 changed files with 1608 additions and 49 deletions
+168 -10
View File
@@ -3578,6 +3578,8 @@ public:
//
// Current ...
double cTP = 0;
double cSL = 0;
XSignal cSignal;
int cPusher = 0;
bool cHasSignal = false;
@@ -3586,6 +3588,8 @@ public:
//
// Short ...
double sTP = 0;
double sSL = 0;
XSignal sSignal;
int sPusher = 0;
bool sHasSignal = false;
@@ -3594,6 +3598,8 @@ public:
//
// Medium ...
double mTP = 0;
double mSL = 0;
XSignal mSignal;
int mPusher = 0;
bool mHasSignal = false;
@@ -3602,6 +3608,8 @@ public:
//
// Long ...
double lTP = 0;
double lSL = 0;
XSignal lSignal;
int lPusher = 0;
bool lHasSignal = false;
@@ -3610,6 +3618,8 @@ public:
//
// Hind ...
double hTP = 0;
double hSL = 0;
XSignal hSignal;
int hPusher = 0;
bool hHasSignal = false;
@@ -3647,10 +3657,10 @@ public:
//
bool useCMarket = true;
bool useSMarket = false;
bool useMMarket = false;
bool useLMarket = false;
bool useHMarket = false;
bool useSMarket = true;
bool useMMarket = true;
bool useLMarket = true;
bool useHMarket = true;
//
for (int i = 0; i < count; i++)
@@ -3674,6 +3684,8 @@ public:
cConditions,
cPusher,
cProvider,
cTP,
cSL,
X_MARKET_CYCLE_UNKNOWN,
canSupport,
allowLong,
@@ -3706,6 +3718,8 @@ public:
sConditions,
sPusher,
sProvider,
sTP,
sSL,
X_MARKET_CYCLE_SHORT,
canSupport,
allowLong,
@@ -3738,6 +3752,8 @@ public:
mConditions,
mPusher,
mProvider,
mTP,
mSL,
X_MARKET_CYCLE_MEDIUM,
canSupport,
allowLong,
@@ -3770,6 +3786,8 @@ public:
lConditions,
lPusher,
lProvider,
lTP,
lSL,
X_MARKET_CYCLE_LONG,
canSupport,
allowLong,
@@ -3802,6 +3820,8 @@ public:
hConditions,
hPusher,
hProvider,
hTP,
hSL,
X_MARKET_CYCLE_HIND,
canSupport,
allowLong,
@@ -4089,6 +4109,13 @@ public:
//
bool isSignalValid = false;
//
isSignalValid = IsSignalDelayPassed(iSignal);
if (!isSignalValid)
{
continue;
}
//
// Handle Close All Positions when Opposit Signal Recieved ...
if (mCloseOnOpposit)
@@ -4188,21 +4215,149 @@ public:
}
//
// Only Accept Next Same Type when Previous in Profit ...
if (isSignalValid)
{
//
// Check Delay Between Two Signals ...
bool isDelayPassed = IsSignalDelayPassed(iSignal);
ENUM_X_POSITION_TYPES iType =
ToPositionType(iSignal.type);
XPosition iSymbolsPositions[];
int iSymbolsPositionsCount = mTrader.GetPositions(
iSymbolsPositions,
iSignal.symbol,
NULL, // Provider
NULL, // Period
iType, // Type
true //
);
//
if (isDelayPassed)
int iSupportsCount = 0;
if (IsValidSize(iSymbolsPositionsCount))
{
//
AddRef(
iSignal,
eSignals //
// Filter Support Positions ...
XPosition iSupports[];
iSupportsCount = ExtractSupports(
iSymbolsPositions,
iSupports //
);
//
// Filter Support Positions ...
if (IsValidSize(iSupportsCount))
{
//
XPosition tmpPositions[];
Copy(
iSymbolsPositions,
tmpPositions //
);
//
Clean(iSymbolsPositions);
//
for (int i = 0; i < iSymbolsPositionsCount; i++)
{
//
XPosition iPosition = tmpPositions[i];
//
bool isSupport = IsSupport(iPosition.comment);
if (isSupport)
{
continue;
}
//
AddRef(
iPosition,
iSymbolsPositions //
);
}
//
iSymbolsPositionsCount = ArraySize(iSymbolsPositions);
}
}
//
if (IsValidSize(iSymbolsPositionsCount))
{
//
XPosition youngest;
int youngestAge = GetYoungest(
youngest,
iSymbolsPositions //
);
//
isSignalValid = youngest.profit > 0.1;
}
//
if (!isSignalValid)
{
continue;
}
}
//
// Multiply Signal Volume ...
if (isSignalValid)
{
//
XPosition iSymbolsPositions[];
int iSymbolsPositionsCount = mTrader.GetPositions(
iSymbolsPositions,
iSignal.symbol,
NULL, // Provider
NULL, // Period
NULL, // Type
true //
);
//
int iSupportsCount = 0;
if (IsValidSize(iSymbolsPositionsCount))
{
//
// Filter Support Positions ...
XPosition iSupports[];
iSupportsCount = ExtractSupports(
iSymbolsPositions,
iSupports //
);
}
//
int multiplier =
iSupportsCount <= 0
? iSymbolsPositionsCount
: iSymbolsPositionsCount - iSupportsCount;
if (multiplier <= 0)
{
multiplier = 1;
}
else
{
multiplier++;
}
//
iSignal.volume = iSignal.volume * multiplier;
}
//
// Handle Signal ...
if (isSignalValid)
{
//
AddRef(
iSignal,
eSignals //
);
}
}
@@ -4885,6 +5040,9 @@ private:
// Handle Force State Management ...
void EQMHandleForceState()
{
//
return;
//
XPosition positions[];
int positionsCount = mTrader.GetPositions(positions);