This commit is contained in:
2025-05-01 05:40:03 +03:30
parent 905413aa8c
commit ba74bca8e9
9 changed files with 310 additions and 25 deletions
+59 -2
View File
@@ -86,7 +86,7 @@ struct XCAEAStrategyConditions
// Constructor ... // Constructor ...
XCAEAStrategyConditions() XCAEAStrategyConditions()
{ {
Clean(); Default();
} }
// //
@@ -125,6 +125,40 @@ struct XCAEAStrategyConditions
type = X_POSITION_TYPE_NONE; type = X_POSITION_TYPE_NONE;
// //
ZeroMemory(this);
}
/**
* Default ...
*/
void Default()
{
//
sl = 0;
tp = 0;
pivot = 0;
point = 0;
//
symbol = NULL;
period = NULL;
provider = NULL;
//
time = NULL;
setupTime = NULL;
triggerTime = NULL;
//
Clean(targets);
//
signalBox.Clean();
conditions.Clean();
//
dir = X_DIRECTION_NONE;
type = X_POSITION_TYPE_NONE;
} }
// //
@@ -319,7 +353,7 @@ struct XCAEAGuard
// Constructor ... // Constructor ...
XCAEAGuard() XCAEAGuard()
{ {
Clean(); Default();
} }
// //
@@ -352,6 +386,29 @@ struct XCAEAGuard
ZeroMemory(this); ZeroMemory(this);
} }
/**
* Default ...
*/
void Default() {
//
time = NULL;
action = X_GUARD_ACTION_NONE;
//
symbol = NULL;
provider = NULL;
//
ticket = 0;
//
volumeMultiplier = 0;
//
sl = 0;
tp = 0;
}
/** /**
* Validate ... * Validate ...
* *
+43 -3
View File
@@ -108,7 +108,7 @@ struct XCAPivot
// Constructor ... // Constructor ...
XCAPivot() XCAPivot()
{ {
Clean(); Default();
} }
// //
@@ -135,6 +135,27 @@ struct XCAPivot
ZeroMemory(this); ZeroMemory(this);
} }
/**
* Default ...
*/
void Default()
{
//
value = 0;
to = NULL;
reserve = 0;
from = NULL;
symbol = NULL;
period = NULL;
type = XCA_NONE;
//
Clean(values);
//
ZeroMemory(this);
}
/** /**
* Validate ... * Validate ...
* *
@@ -482,7 +503,7 @@ struct XCAPVPivot
// Constructor ... // Constructor ...
XCAPVPivot() XCAPVPivot()
{ {
Clean(); Default();
} }
// //
@@ -500,6 +521,15 @@ struct XCAPVPivot
ZeroMemory(this); ZeroMemory(this);
} }
//
void Default()
{
//
value = 0;
Clean(pivots);
dir = X_DIRECTION_NONE;
}
// //
bool IsValid() bool IsValid()
{ {
@@ -601,7 +631,7 @@ struct XCAPVTick
// //
XCAPVTick() XCAPVTick()
{ {
Clean(); Default();
} }
// //
@@ -618,6 +648,16 @@ struct XCAPVTick
ZeroMemory(this); ZeroMemory(this);
} }
//
void Default()
{
//
pivot.Clean();
//
ZeroMemory(zone);
}
// //
bool IsValid() bool IsValid()
{ {
+7 -1
View File
@@ -86,7 +86,7 @@ struct X121X3MAInputs
// Constructor ... // Constructor ...
X121X3MAInputs() X121X3MAInputs()
{ {
Clean(); Default();
} }
// //
@@ -124,6 +124,9 @@ struct X121X3MAInputs
showFast = false; showFast = false;
showSlow = false; showSlow = false;
showMedium = false; showMedium = false;
//
ZeroMemory(this);
} }
// //
@@ -368,6 +371,9 @@ struct X121X3MAConditions
// //
is3MaFinishedFromBullish = false; is3MaFinishedFromBullish = false;
is3MaFinishedFromBearish = false; is3MaFinishedFromBearish = false;
//
ZeroMemory(this);
} }
/** /**
+3
View File
@@ -80,6 +80,9 @@ struct XSignalBox
ob.Clean(); ob.Clean();
fvg.Clean(); fvg.Clean();
sharp.Clean(); sharp.Clean();
//
ZeroMemory(this);
} }
/** /**
+46 -1
View File
@@ -347,6 +347,9 @@ struct XRR
// //
Clean(tps); Clean(tps);
//
ZeroMemory(this);
} }
// //
@@ -1119,6 +1122,7 @@ struct XSignal
// //
// Traget ... // Traget ...
double targets[]; // Force Risk Free On Targets ... double targets[]; // Force Risk Free On Targets ...
bool isTargetApplied; // Target Applied ...
int appliedTargetIDX; // Last Applied Target Index ... int appliedTargetIDX; // Last Applied Target Index ...
bool ignoreEAVolume; // Ignore EA Volume ... bool ignoreEAVolume; // Ignore EA Volume ...
@@ -1131,7 +1135,7 @@ struct XSignal
// Constructor ... // Constructor ...
XSignal() XSignal()
{ {
Clean(); Default();
} }
// //
@@ -1683,6 +1687,7 @@ struct XSignal
Clean(targets); Clean(targets);
appliedTargetIDX = -1; appliedTargetIDX = -1;
ignoreEAVolume = false; ignoreEAVolume = false;
isTargetApplied = false;
// //
trailSL = false; trailSL = false;
@@ -1702,6 +1707,46 @@ struct XSignal
ZeroMemory(this); ZeroMemory(this);
} }
//
// Default Values ...
void Default() {
//
entry = 0;
volume = 0;
pushers = 0;
positionId = 0;
//
time = NULL;
type = NULL;
mode = NULL;
symbol = NULL;
period = NULL;
comment = NULL;
provider = NULL;
conditions = NULL;
//
Clean(targets);
appliedTargetIDX = -1;
ignoreEAVolume = false;
isTargetApplied = false;
//
trailSL = false;
riskFreeOnBreakEven = false;
//
fullTPLevel = 0;
tpLevelForBreakEven = 0;
partialCloseOnTPLevel = 0;
partialCloseMultiplier = 0;
trailSLStartOnReachTPLevel = 0;
//
Clean(supports);
}
// //
// Validate ... // Validate ...
bool IsValid() bool IsValid()
@@ -648,6 +648,9 @@ struct XCATRENDFVG
// //
Clean(fvgs); Clean(fvgs);
trend.Clean(); trend.Clean();
//
ZeroMemory(this);
} }
// //
@@ -558,10 +558,13 @@ class XCXCAEATradeManager : public XCBaseAlert
// //
double jTarget = targets[j]; double jTarget = targets[j];
//
int appliedTargetIDX = -1;
// //
// Check Target is Applied Before or Not ... // Check Target is Applied Before or Not ...
has = has =
!IsValidIndex(trades[idx].signal.appliedTargetIDX) !trades[idx].signal.isTargetApplied
? true ? true
: trades[idx].signal.appliedTargetIDX < j; : trades[idx].signal.appliedTargetIDX < j;
if (!has) if (!has)
@@ -612,6 +615,7 @@ class XCXCAEATradeManager : public XCBaseAlert
{ {
// //
trades[idx].signal.appliedTargetIDX = j; trades[idx].signal.appliedTargetIDX = j;
trades[idx].signal.isTargetApplied = true;
// //
string message = prefix + string message = prefix +
+142 -15
View File
@@ -126,6 +126,7 @@ struct XCAEAStrategyConditions
type = X_POSITION_TYPE_NONE; type = X_POSITION_TYPE_NONE;
// //
ZeroMemory(this);
} }
// //
@@ -783,6 +784,27 @@ bool DetectXCAEAConditions(
double pCCI = conditions.cciBuffer[pIDX]; double pCCI = conditions.cciBuffer[pIDX];
double p2CCI = conditions.cciBuffer[p2IDX]; double p2CCI = conditions.cciBuffer[p2IDX];
//
// ADX ...
double zADX = conditions.adxBuffer[zIDX];
double cADX = conditions.adxBuffer[cIDX];
double pADX = conditions.adxBuffer[pIDX];
double p2ADX = conditions.adxBuffer[p2IDX];
//
// ADX P ...
double zADXP = conditions.adxpBuffer[zIDX];
double cADXP = conditions.adxpBuffer[cIDX];
double pADXP = conditions.adxpBuffer[pIDX];
double p2ADXP = conditions.adxpBuffer[p2IDX];
//
// ADX N ...
double zADXN = conditions.adxnBuffer[zIDX];
double cADXN = conditions.adxnBuffer[cIDX];
double pADXN = conditions.adxnBuffer[pIDX];
double p2ADXN = conditions.adxnBuffer[p2IDX];
// //
// X3MA ... // X3MA ...
@@ -914,6 +936,26 @@ bool DetectXCAEAConditions(
cCCI < pCCI && cCCI < pCCI &&
!conditions.isCCIOS; !conditions.isCCIOS;
//
bool isADXBullish =
cADX > cADXN;
bool isADXBullishPrev =
pADX > pADXN;
//
bool isADXSwitchedToBullish = isADXBullish &&
!isADXBullishPrev;
//
bool isADXBearish =
cADX > cADXN;
bool isADXBearishPrev =
pADX > pADXN;
//
bool isADXSwitchedToBearish = isADXBearish &&
!isADXBearishPrev;
// //
bool isLowOverMax = cBar.low > maxCTrendValue; bool isLowOverMax = cBar.low > maxCTrendValue;
bool isHighUnderMin = cBar.high < minCTrendValue; bool isHighUnderMin = cBar.high < minCTrendValue;
@@ -1233,14 +1275,15 @@ bool DetectXCAEAConditions(
isPCCIOS && isPCCIOS &&
isRSIBullish && isRSIBullish &&
isCCIBullish && isCCIBullish &&
hasRCIContainers && // isADXBullish &&
// hasRCIContainers &&
rciPivot.IsValid() && rciPivot.IsValid() &&
rciPivot.IsBullish() && rciPivot.IsBullish() &&
conditions.isUnderMal && // conditions.isUnderMal &&
conditions.isValeIsPivot && // conditions.isValeIsPivot &&
(conditions.isRSICrossedOverOS || (conditions.isRSICrossedOverOS ||
conditions.isCCICrossedOverOS) && conditions.isCCICrossedOverOS) // &&
conditions.swingLowBuffer[cIDX] < conditions.fiboLevel3Buffer[cIDX] // conditions.swingLowBuffer[cIDX] < conditions.fiboLevel3Buffer[cIDX]
// //
; ;
@@ -1253,14 +1296,15 @@ bool DetectXCAEAConditions(
isPCCIOB && isPCCIOB &&
isRSIBearish && isRSIBearish &&
isCCIBearish && isCCIBearish &&
hasRCIContainers && // isADXBearish &&
// hasRCIContainers &&
rciPivot.IsValid() && rciPivot.IsValid() &&
rciPivot.IsBearish() && rciPivot.IsBearish() &&
conditions.isOverMal && // conditions.isOverMal &&
conditions.isPeakIsPivot && // conditions.isPeakIsPivot &&
(conditions.isRSICrossedUnderOB || (conditions.isRSICrossedUnderOB ||
conditions.isCCICrossedUnderOB) && conditions.isCCICrossedUnderOB) // &&
conditions.swingHighBuffer[cIDX] > conditions.fiboLevel1Buffer[cIDX] // conditions.swingHighBuffer[cIDX] > conditions.fiboLevel1Buffer[cIDX]
// //
; ;
@@ -1269,11 +1313,7 @@ bool DetectXCAEAConditions(
isCond2Bearish; isCond2Bearish;
if (isCond2) if (isCond2)
{ {
//
pivotBox = rciPivot; pivotBox = rciPivot;
//
// Selectiing Pivot Box based on RCI Containers ...
} }
// //
@@ -1458,7 +1498,8 @@ bool DetectXCAEAConditions(
// //
// Preparing Targets ... // Preparing Targets ...
if (isCond1) if (isCond1 ||
isCond2)
{ {
// //
// Add Reward 1 ... // Add Reward 1 ...
@@ -1772,3 +1813,89 @@ bool SelectRejectedBox(
} }
// //
int ExtractValues(
double &values[],
XBoxZone &pivots[],
bool forceClean = true //
)
{
//
int result = 0;
//
if (forceClean)
{
Clean(values);
}
//
int count = ArraySize(pivots);
for (int i = 0; i < count; i++)
{
//
XBoxZone iPivot = pivots[i];
//
Add(
iPivot.upper,
values //
);
//
Add(
iPivot.lower,
values //
);
//
iPivot.Clean();
}
//
result = ArraySize(values);
//
return result;
}
//
double GetMax(XBoxZone &pivots[])
{
//
double values[];
ExtractValues(
values,
pivots //
);
//
double result = GetMax(values);
//
Clean(values);
//
return result;
}
//
double GetMin(XBoxZone &pivots[])
{
//
double values[];
ExtractValues(
values,
pivots //
);
//
double result = GetMin(values);
//
Clean(values);
//
return result;
}
//
+2 -2
View File
@@ -852,8 +852,8 @@ class XCXCAEASignaller : XCBase
// //
// Oscillators Views ... // Oscillators Views ...
inputs.showRSI = true; inputs.showRSI = false;
inputs.showCCI = true; inputs.showCCI = false;
inputs.showMFI = false; inputs.showMFI = false;
inputs.showRVI = false; inputs.showRVI = false;
inputs.showADX = false; inputs.showADX = false;