last ...
This commit is contained in:
@@ -86,7 +86,7 @@ struct XCAEAStrategyConditions
|
||||
// Constructor ...
|
||||
XCAEAStrategyConditions()
|
||||
{
|
||||
Clean();
|
||||
Default();
|
||||
}
|
||||
|
||||
//
|
||||
@@ -125,6 +125,40 @@ struct XCAEAStrategyConditions
|
||||
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 ...
|
||||
XCAEAGuard()
|
||||
{
|
||||
Clean();
|
||||
Default();
|
||||
}
|
||||
|
||||
//
|
||||
@@ -352,6 +386,29 @@ struct XCAEAGuard
|
||||
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 ...
|
||||
*
|
||||
|
||||
@@ -108,7 +108,7 @@ struct XCAPivot
|
||||
// Constructor ...
|
||||
XCAPivot()
|
||||
{
|
||||
Clean();
|
||||
Default();
|
||||
}
|
||||
|
||||
//
|
||||
@@ -135,6 +135,27 @@ struct XCAPivot
|
||||
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 ...
|
||||
*
|
||||
@@ -482,7 +503,7 @@ struct XCAPVPivot
|
||||
// Constructor ...
|
||||
XCAPVPivot()
|
||||
{
|
||||
Clean();
|
||||
Default();
|
||||
}
|
||||
|
||||
//
|
||||
@@ -500,6 +521,15 @@ struct XCAPVPivot
|
||||
ZeroMemory(this);
|
||||
}
|
||||
|
||||
//
|
||||
void Default()
|
||||
{
|
||||
//
|
||||
value = 0;
|
||||
Clean(pivots);
|
||||
dir = X_DIRECTION_NONE;
|
||||
}
|
||||
|
||||
//
|
||||
bool IsValid()
|
||||
{
|
||||
@@ -601,7 +631,7 @@ struct XCAPVTick
|
||||
//
|
||||
XCAPVTick()
|
||||
{
|
||||
Clean();
|
||||
Default();
|
||||
}
|
||||
|
||||
//
|
||||
@@ -618,6 +648,16 @@ struct XCAPVTick
|
||||
ZeroMemory(this);
|
||||
}
|
||||
|
||||
//
|
||||
void Default()
|
||||
{
|
||||
//
|
||||
pivot.Clean();
|
||||
|
||||
//
|
||||
ZeroMemory(zone);
|
||||
}
|
||||
|
||||
//
|
||||
bool IsValid()
|
||||
{
|
||||
|
||||
@@ -86,7 +86,7 @@ struct X121X3MAInputs
|
||||
// Constructor ...
|
||||
X121X3MAInputs()
|
||||
{
|
||||
Clean();
|
||||
Default();
|
||||
}
|
||||
|
||||
//
|
||||
@@ -124,6 +124,9 @@ struct X121X3MAInputs
|
||||
showFast = false;
|
||||
showSlow = false;
|
||||
showMedium = false;
|
||||
|
||||
//
|
||||
ZeroMemory(this);
|
||||
}
|
||||
|
||||
//
|
||||
@@ -368,6 +371,9 @@ struct X121X3MAConditions
|
||||
//
|
||||
is3MaFinishedFromBullish = false;
|
||||
is3MaFinishedFromBearish = false;
|
||||
|
||||
//
|
||||
ZeroMemory(this);
|
||||
}
|
||||
|
||||
/**
|
||||
|
||||
@@ -80,6 +80,9 @@ struct XSignalBox
|
||||
ob.Clean();
|
||||
fvg.Clean();
|
||||
sharp.Clean();
|
||||
|
||||
//
|
||||
ZeroMemory(this);
|
||||
}
|
||||
|
||||
/**
|
||||
|
||||
@@ -347,6 +347,9 @@ struct XRR
|
||||
|
||||
//
|
||||
Clean(tps);
|
||||
|
||||
//
|
||||
ZeroMemory(this);
|
||||
}
|
||||
|
||||
//
|
||||
@@ -1119,6 +1122,7 @@ struct XSignal
|
||||
//
|
||||
// Traget ...
|
||||
double targets[]; // Force Risk Free On Targets ...
|
||||
bool isTargetApplied; // Target Applied ...
|
||||
int appliedTargetIDX; // Last Applied Target Index ...
|
||||
bool ignoreEAVolume; // Ignore EA Volume ...
|
||||
|
||||
@@ -1131,7 +1135,7 @@ struct XSignal
|
||||
// Constructor ...
|
||||
XSignal()
|
||||
{
|
||||
Clean();
|
||||
Default();
|
||||
}
|
||||
|
||||
//
|
||||
@@ -1683,6 +1687,7 @@ struct XSignal
|
||||
Clean(targets);
|
||||
appliedTargetIDX = -1;
|
||||
ignoreEAVolume = false;
|
||||
isTargetApplied = false;
|
||||
|
||||
//
|
||||
trailSL = false;
|
||||
@@ -1702,6 +1707,46 @@ struct XSignal
|
||||
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 ...
|
||||
bool IsValid()
|
||||
|
||||
@@ -648,6 +648,9 @@ struct XCATRENDFVG
|
||||
//
|
||||
Clean(fvgs);
|
||||
trend.Clean();
|
||||
|
||||
//
|
||||
ZeroMemory(this);
|
||||
}
|
||||
|
||||
//
|
||||
|
||||
@@ -558,10 +558,13 @@ class XCXCAEATradeManager : public XCBaseAlert
|
||||
//
|
||||
double jTarget = targets[j];
|
||||
|
||||
//
|
||||
int appliedTargetIDX = -1;
|
||||
|
||||
//
|
||||
// Check Target is Applied Before or Not ...
|
||||
has =
|
||||
!IsValidIndex(trades[idx].signal.appliedTargetIDX)
|
||||
!trades[idx].signal.isTargetApplied
|
||||
? true
|
||||
: trades[idx].signal.appliedTargetIDX < j;
|
||||
if (!has)
|
||||
@@ -612,6 +615,7 @@ class XCXCAEATradeManager : public XCBaseAlert
|
||||
{
|
||||
//
|
||||
trades[idx].signal.appliedTargetIDX = j;
|
||||
trades[idx].signal.isTargetApplied = true;
|
||||
|
||||
//
|
||||
string message = prefix +
|
||||
|
||||
@@ -126,6 +126,7 @@ struct XCAEAStrategyConditions
|
||||
type = X_POSITION_TYPE_NONE;
|
||||
|
||||
//
|
||||
ZeroMemory(this);
|
||||
}
|
||||
|
||||
//
|
||||
@@ -783,6 +784,27 @@ bool DetectXCAEAConditions(
|
||||
double pCCI = conditions.cciBuffer[pIDX];
|
||||
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 ...
|
||||
|
||||
@@ -914,6 +936,26 @@ bool DetectXCAEAConditions(
|
||||
cCCI < pCCI &&
|
||||
!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 isHighUnderMin = cBar.high < minCTrendValue;
|
||||
@@ -1233,14 +1275,15 @@ bool DetectXCAEAConditions(
|
||||
isPCCIOS &&
|
||||
isRSIBullish &&
|
||||
isCCIBullish &&
|
||||
hasRCIContainers &&
|
||||
// isADXBullish &&
|
||||
// hasRCIContainers &&
|
||||
rciPivot.IsValid() &&
|
||||
rciPivot.IsBullish() &&
|
||||
conditions.isUnderMal &&
|
||||
conditions.isValeIsPivot &&
|
||||
// conditions.isUnderMal &&
|
||||
// conditions.isValeIsPivot &&
|
||||
(conditions.isRSICrossedOverOS ||
|
||||
conditions.isCCICrossedOverOS) &&
|
||||
conditions.swingLowBuffer[cIDX] < conditions.fiboLevel3Buffer[cIDX]
|
||||
conditions.isCCICrossedOverOS) // &&
|
||||
// conditions.swingLowBuffer[cIDX] < conditions.fiboLevel3Buffer[cIDX]
|
||||
//
|
||||
;
|
||||
|
||||
@@ -1253,14 +1296,15 @@ bool DetectXCAEAConditions(
|
||||
isPCCIOB &&
|
||||
isRSIBearish &&
|
||||
isCCIBearish &&
|
||||
hasRCIContainers &&
|
||||
// isADXBearish &&
|
||||
// hasRCIContainers &&
|
||||
rciPivot.IsValid() &&
|
||||
rciPivot.IsBearish() &&
|
||||
conditions.isOverMal &&
|
||||
conditions.isPeakIsPivot &&
|
||||
// conditions.isOverMal &&
|
||||
// conditions.isPeakIsPivot &&
|
||||
(conditions.isRSICrossedUnderOB ||
|
||||
conditions.isCCICrossedUnderOB) &&
|
||||
conditions.swingHighBuffer[cIDX] > conditions.fiboLevel1Buffer[cIDX]
|
||||
conditions.isCCICrossedUnderOB) // &&
|
||||
// conditions.swingHighBuffer[cIDX] > conditions.fiboLevel1Buffer[cIDX]
|
||||
//
|
||||
;
|
||||
|
||||
@@ -1269,11 +1313,7 @@ bool DetectXCAEAConditions(
|
||||
isCond2Bearish;
|
||||
if (isCond2)
|
||||
{
|
||||
//
|
||||
pivotBox = rciPivot;
|
||||
|
||||
//
|
||||
// Selectiing Pivot Box based on RCI Containers ...
|
||||
}
|
||||
|
||||
//
|
||||
@@ -1458,7 +1498,8 @@ bool DetectXCAEAConditions(
|
||||
|
||||
//
|
||||
// Preparing Targets ...
|
||||
if (isCond1)
|
||||
if (isCond1 ||
|
||||
isCond2)
|
||||
{
|
||||
//
|
||||
// Add Reward 1 ...
|
||||
@@ -1771,4 +1812,90 @@ bool SelectRejectedBox(
|
||||
return result;
|
||||
}
|
||||
|
||||
//
|
||||
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;
|
||||
}
|
||||
|
||||
//
|
||||
@@ -852,8 +852,8 @@ class XCXCAEASignaller : XCBase
|
||||
|
||||
//
|
||||
// Oscillators Views ...
|
||||
inputs.showRSI = true;
|
||||
inputs.showCCI = true;
|
||||
inputs.showRSI = false;
|
||||
inputs.showCCI = false;
|
||||
inputs.showMFI = false;
|
||||
inputs.showRVI = false;
|
||||
inputs.showADX = false;
|
||||
|
||||
Reference in New Issue
Block a user