last ...
This commit is contained in:
@@ -198,6 +198,112 @@ struct XCAEATriggerBlockConfiguration
|
|||||||
filterBasedOnTrend = true;
|
filterBasedOnTrend = true;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
//
|
||||||
|
void ConfigureSarRsiAdxFilter()
|
||||||
|
{
|
||||||
|
//
|
||||||
|
ConfigureFullFilter();
|
||||||
|
|
||||||
|
//
|
||||||
|
filterBasedOnTrend = false;
|
||||||
|
}
|
||||||
|
|
||||||
|
//
|
||||||
|
void ConfigureSarRsiTrendFilter()
|
||||||
|
{
|
||||||
|
//
|
||||||
|
ConfigureFullFilter();
|
||||||
|
|
||||||
|
//
|
||||||
|
filterBasedOnADX = false;
|
||||||
|
}
|
||||||
|
|
||||||
|
//
|
||||||
|
void ConfigureSarAdxTrendFilter()
|
||||||
|
{
|
||||||
|
//
|
||||||
|
ConfigureFullFilter();
|
||||||
|
|
||||||
|
//
|
||||||
|
filterBasedOnRSI = false;
|
||||||
|
}
|
||||||
|
|
||||||
|
//
|
||||||
|
void ConfigureRsiAdxTrendFilter()
|
||||||
|
{
|
||||||
|
//
|
||||||
|
ConfigureFullFilter();
|
||||||
|
|
||||||
|
//
|
||||||
|
filterBasedOnSar = false;
|
||||||
|
}
|
||||||
|
|
||||||
|
//
|
||||||
|
void ConfigureSarRsiFilter()
|
||||||
|
{
|
||||||
|
//
|
||||||
|
ConfigureFullFilter();
|
||||||
|
|
||||||
|
//
|
||||||
|
filterBasedOnADX = false;
|
||||||
|
filterBasedOnTrend = false;
|
||||||
|
}
|
||||||
|
|
||||||
|
//
|
||||||
|
void ConfigureSarAdxFilter()
|
||||||
|
{
|
||||||
|
//
|
||||||
|
ConfigureFullFilter();
|
||||||
|
|
||||||
|
//
|
||||||
|
filterBasedOnRSI = false;
|
||||||
|
filterBasedOnTrend = false;
|
||||||
|
}
|
||||||
|
|
||||||
|
//
|
||||||
|
void ConfigureSarTrendFilter()
|
||||||
|
{
|
||||||
|
//
|
||||||
|
ConfigureFullFilter();
|
||||||
|
|
||||||
|
//
|
||||||
|
filterBasedOnRSI = false;
|
||||||
|
filterBasedOnADX = false;
|
||||||
|
}
|
||||||
|
|
||||||
|
//
|
||||||
|
void ConfigureRsiAdxFilter()
|
||||||
|
{
|
||||||
|
//
|
||||||
|
ConfigureFullFilter();
|
||||||
|
|
||||||
|
//
|
||||||
|
filterBasedOnSar = false;
|
||||||
|
filterBasedOnTrend = false;
|
||||||
|
}
|
||||||
|
|
||||||
|
//
|
||||||
|
void ConfigureRsiTrendFilter()
|
||||||
|
{
|
||||||
|
//
|
||||||
|
ConfigureFullFilter();
|
||||||
|
|
||||||
|
//
|
||||||
|
filterBasedOnSar = false;
|
||||||
|
filterBasedOnADX = false;
|
||||||
|
}
|
||||||
|
|
||||||
|
//
|
||||||
|
void ConfigureAdxTrendFilter()
|
||||||
|
{
|
||||||
|
//
|
||||||
|
ConfigureFullFilter();
|
||||||
|
|
||||||
|
//
|
||||||
|
filterBasedOnSar = false;
|
||||||
|
filterBasedOnRSI = false;
|
||||||
|
}
|
||||||
|
|
||||||
//
|
//
|
||||||
};
|
};
|
||||||
|
|
||||||
@@ -359,12 +465,12 @@ bool DetectTriggerBlock(
|
|||||||
|
|
||||||
//
|
//
|
||||||
bool isBullish =
|
bool isBullish =
|
||||||
has &&
|
result &&
|
||||||
triggerBlock.IsBullish();
|
triggerBlock.IsBullish();
|
||||||
|
|
||||||
//
|
//
|
||||||
bool isBearish =
|
bool isBearish =
|
||||||
has &&
|
result &&
|
||||||
triggerBlock.IsBearish();
|
triggerBlock.IsBearish();
|
||||||
|
|
||||||
//
|
//
|
||||||
@@ -382,7 +488,7 @@ bool DetectTriggerBlock(
|
|||||||
iDir = Opposit(triggerBlock.dir);
|
iDir = Opposit(triggerBlock.dir);
|
||||||
|
|
||||||
//
|
//
|
||||||
has =
|
result =
|
||||||
iDir == p3Bar.GetDirection() ||
|
iDir == p3Bar.GetDirection() ||
|
||||||
iDir == p4Bar.GetDirection();
|
iDir == p4Bar.GetDirection();
|
||||||
if (!result)
|
if (!result)
|
||||||
@@ -693,7 +799,7 @@ bool DetectTriggerBlock(
|
|||||||
|
|
||||||
//
|
//
|
||||||
// Here we Ensure which have a Valid Zone using Different Applied Validations ...
|
// Here we Ensure which have a Valid Zone using Different Applied Validations ...
|
||||||
// from now we are Going to Filtered Validate Zones ...
|
// from now we are Going to Filterd Validate Zones ...
|
||||||
|
|
||||||
//
|
//
|
||||||
// Check Exists Filters or not ...
|
// Check Exists Filters or not ...
|
||||||
@@ -778,21 +884,21 @@ bool DetectTriggerBlock(
|
|||||||
// Summarize Filtering ...
|
// Summarize Filtering ...
|
||||||
|
|
||||||
//
|
//
|
||||||
bool isBullishFiltered =
|
bool isBullishFilterd =
|
||||||
isBullish &&
|
isBullish &&
|
||||||
(isCSarSwitchedToBullish ||
|
(isCSarSwitchedToBullish ||
|
||||||
isPSarSwitchedToBullish);
|
isPSarSwitchedToBullish);
|
||||||
|
|
||||||
//
|
//
|
||||||
bool isBearishFiltered =
|
bool isBearishFilterd =
|
||||||
isBearish &&
|
isBearish &&
|
||||||
(isCSarSwitchedToBearish ||
|
(isCSarSwitchedToBearish ||
|
||||||
isPSarSwitchedToBearish);
|
isPSarSwitchedToBearish);
|
||||||
|
|
||||||
//
|
//
|
||||||
result =
|
result =
|
||||||
isBullishFiltered ||
|
isBullishFilterd ||
|
||||||
isBearishFiltered;
|
isBearishFilterd;
|
||||||
if (!result)
|
if (!result)
|
||||||
{
|
{
|
||||||
//
|
//
|
||||||
@@ -963,7 +1069,7 @@ bool DetectTriggerBlock(
|
|||||||
// Summarize Filtering ...
|
// Summarize Filtering ...
|
||||||
|
|
||||||
//
|
//
|
||||||
bool isBullishFiltered =
|
bool isBullishFilterd =
|
||||||
isBullish &&
|
isBullish &&
|
||||||
(
|
(
|
||||||
//
|
//
|
||||||
@@ -991,7 +1097,7 @@ bool DetectTriggerBlock(
|
|||||||
);
|
);
|
||||||
|
|
||||||
//
|
//
|
||||||
bool isBearishFiltered =
|
bool isBearishFilterd =
|
||||||
isBearish &&
|
isBearish &&
|
||||||
(
|
(
|
||||||
//
|
//
|
||||||
@@ -1020,8 +1126,8 @@ bool DetectTriggerBlock(
|
|||||||
|
|
||||||
//
|
//
|
||||||
result =
|
result =
|
||||||
isBullishFiltered ||
|
isBullishFilterd ||
|
||||||
isBearishFiltered;
|
isBearishFilterd;
|
||||||
if (!result)
|
if (!result)
|
||||||
{
|
{
|
||||||
//
|
//
|
||||||
@@ -1201,7 +1307,7 @@ bool DetectTriggerBlock(
|
|||||||
// Summarize Filtering ...
|
// Summarize Filtering ...
|
||||||
|
|
||||||
//
|
//
|
||||||
bool isBullishFiltered =
|
bool isBullishFilterd =
|
||||||
isBullish &&
|
isBullish &&
|
||||||
(
|
(
|
||||||
//
|
//
|
||||||
@@ -1223,7 +1329,7 @@ bool DetectTriggerBlock(
|
|||||||
);
|
);
|
||||||
|
|
||||||
//
|
//
|
||||||
bool isBearishFiltered =
|
bool isBearishFilterd =
|
||||||
isBearish &&
|
isBearish &&
|
||||||
(
|
(
|
||||||
//
|
//
|
||||||
@@ -1246,8 +1352,8 @@ bool DetectTriggerBlock(
|
|||||||
|
|
||||||
//
|
//
|
||||||
result =
|
result =
|
||||||
isBullishFiltered ||
|
isBullishFilterd ||
|
||||||
isBearishFiltered;
|
isBearishFilterd;
|
||||||
if (!result)
|
if (!result)
|
||||||
{
|
{
|
||||||
//
|
//
|
||||||
@@ -1384,7 +1490,7 @@ bool DetectTriggerBlock(
|
|||||||
// Summarize Filtering ...
|
// Summarize Filtering ...
|
||||||
|
|
||||||
//
|
//
|
||||||
bool isBullishFiltered =
|
bool isBullishFilterd =
|
||||||
isBullish &&
|
isBullish &&
|
||||||
(
|
(
|
||||||
//
|
//
|
||||||
@@ -1406,7 +1512,7 @@ bool DetectTriggerBlock(
|
|||||||
);
|
);
|
||||||
|
|
||||||
//
|
//
|
||||||
bool isBearishFiltered =
|
bool isBearishFilterd =
|
||||||
isBearish &&
|
isBearish &&
|
||||||
(
|
(
|
||||||
//
|
//
|
||||||
@@ -1429,8 +1535,8 @@ bool DetectTriggerBlock(
|
|||||||
|
|
||||||
//
|
//
|
||||||
result =
|
result =
|
||||||
isBullishFiltered ||
|
isBullishFilterd ||
|
||||||
isBearishFiltered;
|
isBearishFilterd;
|
||||||
if (!result)
|
if (!result)
|
||||||
{
|
{
|
||||||
//
|
//
|
||||||
@@ -1457,6 +1563,14 @@ bool DetectTriggerBlock(
|
|||||||
|
|
||||||
//
|
//
|
||||||
result = triggerBlock.IsValid();
|
result = triggerBlock.IsValid();
|
||||||
|
if (result)
|
||||||
|
{
|
||||||
|
//
|
||||||
|
triggerBlock.type =
|
||||||
|
isBullish
|
||||||
|
? ToString(XCA_TRIGGER_BULL)
|
||||||
|
: ToString(XCA_TRIGGER_BEAR);
|
||||||
|
}
|
||||||
|
|
||||||
//
|
//
|
||||||
// Cleanup Resources ...
|
// Cleanup Resources ...
|
||||||
|
|||||||
@@ -196,6 +196,7 @@ class XCXCAEASignaller : XCBase
|
|||||||
int zIndex = 0;
|
int zIndex = 0;
|
||||||
bool has = false;
|
bool has = false;
|
||||||
int loopback = 10;
|
int loopback = 10;
|
||||||
|
int cIndex = zIndex + 1;
|
||||||
bool isBullish = false;
|
bool isBullish = false;
|
||||||
bool isBearish = false;
|
bool isBearish = false;
|
||||||
|
|
||||||
@@ -277,7 +278,297 @@ class XCXCAEASignaller : XCBase
|
|||||||
// In this Used Case we found a Tigger Block and use it
|
// In this Used Case we found a Tigger Block and use it
|
||||||
// for Triggering ...
|
// for Triggering ...
|
||||||
if (!hasDecisionZone &&
|
if (!hasDecisionZone &&
|
||||||
allowTriggerBlockDecisionZoneSignalling) {
|
allowTriggerBlockDecisionZoneSignalling)
|
||||||
|
{
|
||||||
|
//
|
||||||
|
int pushers = 0;
|
||||||
|
|
||||||
|
//
|
||||||
|
// We Can Detect Multiple Decision Zones ...
|
||||||
|
XBoxZone tmpZone;
|
||||||
|
XCAEATriggerBlockConfiguration config;
|
||||||
|
|
||||||
|
//
|
||||||
|
// Full Filteres ...
|
||||||
|
config.ConfigureFullFilter();
|
||||||
|
bool hasFullFiltered = DetectTriggerBlock(
|
||||||
|
tmpZone,
|
||||||
|
conditions,
|
||||||
|
helper,
|
||||||
|
config,
|
||||||
|
zIndex,
|
||||||
|
loopback //
|
||||||
|
);
|
||||||
|
if (hasFullFiltered)
|
||||||
|
{
|
||||||
|
//
|
||||||
|
pushers++;
|
||||||
|
|
||||||
|
//
|
||||||
|
if (!decisionZone.IsValid())
|
||||||
|
{
|
||||||
|
decisionZone = tmpZone;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
//
|
||||||
|
tmpZone.Clean();
|
||||||
|
config.ConfigureSarRsiAdxFilter();
|
||||||
|
bool hasSarRsiAdxFiltered = DetectTriggerBlock(
|
||||||
|
tmpZone,
|
||||||
|
conditions,
|
||||||
|
helper,
|
||||||
|
config,
|
||||||
|
zIndex,
|
||||||
|
loopback //
|
||||||
|
);
|
||||||
|
if (hasSarRsiAdxFiltered)
|
||||||
|
{
|
||||||
|
//
|
||||||
|
pushers++;
|
||||||
|
|
||||||
|
//
|
||||||
|
if (!decisionZone.IsValid())
|
||||||
|
{
|
||||||
|
decisionZone = tmpZone;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
//
|
||||||
|
tmpZone.Clean();
|
||||||
|
config.ConfigureSarRsiTrendFilter();
|
||||||
|
bool hasSarRsiTrendFiltered = DetectTriggerBlock(
|
||||||
|
tmpZone,
|
||||||
|
conditions,
|
||||||
|
helper,
|
||||||
|
config,
|
||||||
|
zIndex,
|
||||||
|
loopback //
|
||||||
|
);
|
||||||
|
if (hasSarRsiTrendFiltered)
|
||||||
|
{
|
||||||
|
//
|
||||||
|
pushers++;
|
||||||
|
|
||||||
|
//
|
||||||
|
if (!decisionZone.IsValid())
|
||||||
|
{
|
||||||
|
decisionZone = tmpZone;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
//
|
||||||
|
tmpZone.Clean();
|
||||||
|
config.ConfigureSarAdxTrendFilter();
|
||||||
|
bool hasSarAdxTrendFiltered = DetectTriggerBlock(
|
||||||
|
tmpZone,
|
||||||
|
conditions,
|
||||||
|
helper,
|
||||||
|
config,
|
||||||
|
zIndex,
|
||||||
|
loopback //
|
||||||
|
);
|
||||||
|
if (hasSarAdxTrendFiltered)
|
||||||
|
{
|
||||||
|
//
|
||||||
|
pushers++;
|
||||||
|
|
||||||
|
//
|
||||||
|
if (!decisionZone.IsValid())
|
||||||
|
{
|
||||||
|
decisionZone = tmpZone;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
//
|
||||||
|
tmpZone.Clean();
|
||||||
|
config.ConfigureRsiAdxTrendFilter();
|
||||||
|
bool hasRsiAdxTrendFiltered = DetectTriggerBlock(
|
||||||
|
tmpZone,
|
||||||
|
conditions,
|
||||||
|
helper,
|
||||||
|
config,
|
||||||
|
zIndex,
|
||||||
|
loopback //
|
||||||
|
);
|
||||||
|
if (hasRsiAdxTrendFiltered)
|
||||||
|
{
|
||||||
|
//
|
||||||
|
pushers++;
|
||||||
|
|
||||||
|
//
|
||||||
|
if (!decisionZone.IsValid())
|
||||||
|
{
|
||||||
|
decisionZone = tmpZone;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
//
|
||||||
|
tmpZone.Clean();
|
||||||
|
config.ConfigureSarRsiFilter();
|
||||||
|
bool hasSarRsiFiltered = DetectTriggerBlock(
|
||||||
|
tmpZone,
|
||||||
|
conditions,
|
||||||
|
helper,
|
||||||
|
config,
|
||||||
|
zIndex,
|
||||||
|
loopback //
|
||||||
|
);
|
||||||
|
if (hasSarRsiFiltered)
|
||||||
|
{
|
||||||
|
//
|
||||||
|
pushers++;
|
||||||
|
|
||||||
|
//
|
||||||
|
if (!decisionZone.IsValid())
|
||||||
|
{
|
||||||
|
decisionZone = tmpZone;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
//
|
||||||
|
tmpZone.Clean();
|
||||||
|
config.ConfigureSarAdxFilter();
|
||||||
|
bool hasSarAdxFiltered = DetectTriggerBlock(
|
||||||
|
tmpZone,
|
||||||
|
conditions,
|
||||||
|
helper,
|
||||||
|
config,
|
||||||
|
zIndex,
|
||||||
|
loopback //
|
||||||
|
);
|
||||||
|
if (hasSarAdxFiltered)
|
||||||
|
{
|
||||||
|
//
|
||||||
|
pushers++;
|
||||||
|
|
||||||
|
//
|
||||||
|
if (!decisionZone.IsValid())
|
||||||
|
{
|
||||||
|
decisionZone = tmpZone;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
//
|
||||||
|
tmpZone.Clean();
|
||||||
|
config.ConfigureSarTrendFilter();
|
||||||
|
bool hasSarTrendFiltered = DetectTriggerBlock(
|
||||||
|
tmpZone,
|
||||||
|
conditions,
|
||||||
|
helper,
|
||||||
|
config,
|
||||||
|
zIndex,
|
||||||
|
loopback //
|
||||||
|
);
|
||||||
|
if (hasSarTrendFiltered)
|
||||||
|
{
|
||||||
|
//
|
||||||
|
pushers++;
|
||||||
|
|
||||||
|
//
|
||||||
|
if (!decisionZone.IsValid())
|
||||||
|
{
|
||||||
|
decisionZone = tmpZone;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
//
|
||||||
|
tmpZone.Clean();
|
||||||
|
config.ConfigureRsiAdxFilter();
|
||||||
|
bool hasRsiAdxFiltered = DetectTriggerBlock(
|
||||||
|
tmpZone,
|
||||||
|
conditions,
|
||||||
|
helper,
|
||||||
|
config,
|
||||||
|
zIndex,
|
||||||
|
loopback //
|
||||||
|
);
|
||||||
|
if (hasRsiAdxFiltered)
|
||||||
|
{
|
||||||
|
//
|
||||||
|
pushers++;
|
||||||
|
|
||||||
|
//
|
||||||
|
if (!decisionZone.IsValid())
|
||||||
|
{
|
||||||
|
decisionZone = tmpZone;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
//
|
||||||
|
tmpZone.Clean();
|
||||||
|
config.ConfigureRsiTrendFilter();
|
||||||
|
bool hasRsiTrendFiltered = DetectTriggerBlock(
|
||||||
|
tmpZone,
|
||||||
|
conditions,
|
||||||
|
helper,
|
||||||
|
config,
|
||||||
|
zIndex,
|
||||||
|
loopback //
|
||||||
|
);
|
||||||
|
if (hasRsiTrendFiltered)
|
||||||
|
{
|
||||||
|
//
|
||||||
|
pushers++;
|
||||||
|
|
||||||
|
//
|
||||||
|
if (!decisionZone.IsValid())
|
||||||
|
{
|
||||||
|
decisionZone = tmpZone;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
//
|
||||||
|
tmpZone.Clean();
|
||||||
|
config.ConfigureAdxTrendFilter();
|
||||||
|
bool hasAdxTrendFiltered = DetectTriggerBlock(
|
||||||
|
tmpZone,
|
||||||
|
conditions,
|
||||||
|
helper,
|
||||||
|
config,
|
||||||
|
zIndex,
|
||||||
|
loopback //
|
||||||
|
);
|
||||||
|
if (hasAdxTrendFiltered)
|
||||||
|
{
|
||||||
|
//
|
||||||
|
pushers++;
|
||||||
|
|
||||||
|
//
|
||||||
|
if (!decisionZone.IsValid())
|
||||||
|
{
|
||||||
|
decisionZone = tmpZone;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
//
|
||||||
|
hasDecisionZone =
|
||||||
|
hasSarRsiFiltered ||
|
||||||
|
hasSarAdxFiltered ||
|
||||||
|
hasRsiAdxFiltered ||
|
||||||
|
hasSarTrendFiltered ||
|
||||||
|
hasRsiTrendFiltered ||
|
||||||
|
hasAdxTrendFiltered ||
|
||||||
|
hasSarRsiAdxFiltered ||
|
||||||
|
hasSarRsiTrendFiltered ||
|
||||||
|
hasSarAdxTrendFiltered ||
|
||||||
|
hasRsiAdxTrendFiltered;
|
||||||
|
|
||||||
|
//
|
||||||
|
if (hasDecisionZone)
|
||||||
|
{
|
||||||
|
//
|
||||||
|
drawer.DrawBox(
|
||||||
|
decisionZone,
|
||||||
|
cTime,
|
||||||
|
false, // Draw Middle ...
|
||||||
|
true // Ignore Type ...
|
||||||
|
);
|
||||||
|
|
||||||
|
//
|
||||||
|
Print(ToString(decisionZone.dir) + " Trigger Block Detected (" + ToString(pushers) + ") ...");
|
||||||
|
}
|
||||||
|
|
||||||
//
|
//
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -285,6 +576,9 @@ class XCXCAEASignaller : XCBase
|
|||||||
// Make Signal Box UnAvailable ...
|
// Make Signal Box UnAvailable ...
|
||||||
if (hasDecisionZone)
|
if (hasDecisionZone)
|
||||||
{
|
{
|
||||||
|
//
|
||||||
|
decisionZoneDir = decisionZone.dir;
|
||||||
|
|
||||||
//
|
//
|
||||||
AddRef(
|
AddRef(
|
||||||
decisionZone,
|
decisionZone,
|
||||||
@@ -428,152 +722,185 @@ class XCXCAEASignaller : XCBase
|
|||||||
int fromIDX = conditions.decisionZone.FromIndex();
|
int fromIDX = conditions.decisionZone.FromIndex();
|
||||||
|
|
||||||
//
|
//
|
||||||
// Check Box Size ...
|
bool isAnalyseSignalled =
|
||||||
double maxAllowedBoxRange = 400;
|
conditions.decisionZone.period == analyseHelper.GetPeriod();
|
||||||
double range = conditions.decisionZone.GetRange();
|
|
||||||
bool isTooLarge = range > (maxAllowedBoxRange * points);
|
|
||||||
double decisionMiddlePrice = conditions.decisionZone.GetMid();
|
|
||||||
|
|
||||||
//
|
//
|
||||||
// Draw Decision Zone ...
|
ENUM_XCAEA_TIGGER_TYPE decisionZoneType = GetType(conditions.decisionZone.type);
|
||||||
if (allowDraws)
|
bool isTriggerBlockSignalled = IsValid(decisionZoneType);
|
||||||
{
|
|
||||||
//
|
|
||||||
drawer.DrawBox(
|
|
||||||
conditions.decisionZone,
|
|
||||||
cTime,
|
|
||||||
true, // Draw Middle Line ...
|
|
||||||
true // Ignore Type ...
|
|
||||||
);
|
|
||||||
}
|
|
||||||
|
|
||||||
//
|
//
|
||||||
// Detect Required Pivots ...
|
// Looking for Analyse Helper Triggers ...
|
||||||
XBoxZone decisionPivots[];
|
if (isAnalyseSignalled &&
|
||||||
ENUM_XCA_PIVOTS allowedTypes[];
|
allowAnalyseDecisionZoneSignalling)
|
||||||
if (isBullish)
|
|
||||||
{
|
{
|
||||||
//
|
//
|
||||||
Add(
|
// Trigger Analyse Signal ...
|
||||||
XCA_OB_BULL,
|
|
||||||
allowedTypes //
|
|
||||||
);
|
|
||||||
}
|
|
||||||
else
|
|
||||||
{
|
|
||||||
//
|
|
||||||
Add(
|
|
||||||
XCA_OB_BEAR,
|
|
||||||
allowedTypes //
|
|
||||||
);
|
|
||||||
}
|
|
||||||
Add(
|
|
||||||
XCA_PEAK,
|
|
||||||
allowedTypes //
|
|
||||||
);
|
|
||||||
Add(
|
|
||||||
XCA_VALE,
|
|
||||||
allowedTypes //
|
|
||||||
);
|
|
||||||
int decisionPivotsCount = detector.FillPivots(
|
|
||||||
conditions.decisionZone,
|
|
||||||
decisionPivots,
|
|
||||||
unavailables,
|
|
||||||
allowedTypes,
|
|
||||||
cTime //
|
|
||||||
);
|
|
||||||
|
|
||||||
//
|
|
||||||
// Draw Pivots of Decision Zone only when
|
|
||||||
// it's Too Large ...
|
|
||||||
if (false &&
|
|
||||||
allowDraws &&
|
|
||||||
isTooLarge &&
|
|
||||||
HasChild(decisionPivots))
|
|
||||||
{
|
|
||||||
//
|
//
|
||||||
for (int i = 0; i < decisionPivotsCount; i++)
|
// Check Box Size ...
|
||||||
|
double maxAllowedBoxRange = 400;
|
||||||
|
double range = conditions.decisionZone.GetRange();
|
||||||
|
bool isTooLarge = range > (maxAllowedBoxRange * points);
|
||||||
|
double decisionMiddlePrice = conditions.decisionZone.GetMid();
|
||||||
|
|
||||||
|
//
|
||||||
|
// Detect Required Pivots ...
|
||||||
|
XBoxZone decisionPivots[];
|
||||||
|
ENUM_XCA_PIVOTS allowedTypes[];
|
||||||
|
if (isBullish)
|
||||||
{
|
{
|
||||||
//
|
//
|
||||||
drawer.DrawBox(
|
Add(
|
||||||
decisionPivots[i],
|
XCA_OB_BULL,
|
||||||
cTime,
|
allowedTypes //
|
||||||
false, // Draw Middle ...
|
|
||||||
true // Ignore Type ...
|
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
}
|
else
|
||||||
|
{
|
||||||
//
|
//
|
||||||
// Define a Temparory Objects
|
Add(
|
||||||
// Array instance for Holding Drawn Objects ...
|
XCA_OB_BEAR,
|
||||||
CArrayObj *iObjects;
|
allowedTypes //
|
||||||
iObjects = new CArrayObj();
|
);
|
||||||
|
}
|
||||||
//
|
Add(
|
||||||
// Check Different Trigger Conditions ...
|
XCA_PEAK,
|
||||||
|
allowedTypes //
|
||||||
//
|
);
|
||||||
// Checking Trigger Cond 0 ...
|
Add(
|
||||||
bool canTriggerCond0 = false;
|
XCA_VALE,
|
||||||
|
allowedTypes //
|
||||||
//
|
);
|
||||||
// Checking Trigger Cond 1 ...
|
int decisionPivotsCount = detector.FillPivots(
|
||||||
bool canTriggerCond1 = false;
|
|
||||||
if (isTooLarge)
|
|
||||||
{
|
|
||||||
//
|
|
||||||
canTriggerCond1 = CanTriggerCond1(
|
|
||||||
helper,
|
|
||||||
conditions.decisionZone,
|
conditions.decisionZone,
|
||||||
decisionPivots,
|
decisionPivots,
|
||||||
triggerDir,
|
unavailables,
|
||||||
sl,
|
allowedTypes,
|
||||||
targets,
|
cTime //
|
||||||
allowDraws,
|
|
||||||
iObjects,
|
|
||||||
barIndex //
|
|
||||||
);
|
);
|
||||||
}
|
|
||||||
|
|
||||||
//
|
//
|
||||||
// Checking Trigger Cond 2 ...
|
// Draw Pivots of Decision Zone only when
|
||||||
bool canTriggerCond2 = false;
|
// it's Too Large ...
|
||||||
if (!isTooLarge)
|
if (false &&
|
||||||
|
allowDraws &&
|
||||||
|
isTooLarge &&
|
||||||
|
HasChild(decisionPivots))
|
||||||
|
{
|
||||||
|
//
|
||||||
|
for (int i = 0; i < decisionPivotsCount; i++)
|
||||||
|
{
|
||||||
|
//
|
||||||
|
drawer.DrawBox(
|
||||||
|
decisionPivots[i],
|
||||||
|
cTime,
|
||||||
|
false, // Draw Middle ...
|
||||||
|
true // Ignore Type ...
|
||||||
|
);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
//
|
||||||
|
// Define a Temparory Objects
|
||||||
|
// Array instance for Holding Drawn Objects ...
|
||||||
|
CArrayObj *iObjects;
|
||||||
|
iObjects = new CArrayObj();
|
||||||
|
|
||||||
|
//
|
||||||
|
// Check Different Trigger Conditions ...
|
||||||
|
|
||||||
|
//
|
||||||
|
// Checking Trigger Cond 0 ...
|
||||||
|
bool canTriggerCond0 = false;
|
||||||
|
|
||||||
|
//
|
||||||
|
// Checking Trigger Cond 1 ...
|
||||||
|
bool canTriggerCond1 = false;
|
||||||
|
if (isTooLarge)
|
||||||
|
{
|
||||||
|
//
|
||||||
|
canTriggerCond1 = CanTriggerCond1(
|
||||||
|
helper,
|
||||||
|
conditions.decisionZone,
|
||||||
|
decisionPivots,
|
||||||
|
triggerDir,
|
||||||
|
sl,
|
||||||
|
targets,
|
||||||
|
allowDraws,
|
||||||
|
iObjects,
|
||||||
|
barIndex //
|
||||||
|
);
|
||||||
|
}
|
||||||
|
|
||||||
|
//
|
||||||
|
// Checking Trigger Cond 2 ...
|
||||||
|
bool canTriggerCond2 = false;
|
||||||
|
if (!isTooLarge)
|
||||||
|
{
|
||||||
|
//
|
||||||
|
canTriggerCond2 = CanTriggerCond2(
|
||||||
|
helper,
|
||||||
|
conditions.decisionZone,
|
||||||
|
decisionPivots,
|
||||||
|
triggerDir,
|
||||||
|
sl,
|
||||||
|
targets,
|
||||||
|
allowDraws,
|
||||||
|
iObjects,
|
||||||
|
barIndex //
|
||||||
|
);
|
||||||
|
}
|
||||||
|
|
||||||
|
//
|
||||||
|
// Checking Trigger Cond 3 ...
|
||||||
|
bool canTriggerCond3 = false;
|
||||||
|
|
||||||
|
//
|
||||||
|
// Adding Drawn Objects to Drawn Stores ...
|
||||||
|
for (int i = 0; i < iObjects.Total(); i++)
|
||||||
|
{
|
||||||
|
mObjects.Add(iObjects.At(i));
|
||||||
|
}
|
||||||
|
|
||||||
|
//
|
||||||
|
// Summarizing Result ...
|
||||||
|
result =
|
||||||
|
canTriggerCond0 ||
|
||||||
|
canTriggerCond1 ||
|
||||||
|
canTriggerCond2 ||
|
||||||
|
canTriggerCond3;
|
||||||
|
}
|
||||||
|
else if (isTriggerBlockSignalled &&
|
||||||
|
allowTriggerBlockDecisionZoneSignalling)
|
||||||
{
|
{
|
||||||
//
|
//
|
||||||
canTriggerCond2 = CanTriggerCond2(
|
// Trigger TRIGGER Block Signal ...
|
||||||
helper,
|
|
||||||
conditions.decisionZone,
|
//
|
||||||
decisionPivots,
|
// since we have to Trigger all TRIGGER Block's Signals
|
||||||
triggerDir,
|
// exactly on Setting ups ...
|
||||||
sl,
|
result = isBullish ||
|
||||||
targets,
|
isBearish;
|
||||||
allowDraws,
|
if (result)
|
||||||
iObjects,
|
{
|
||||||
barIndex //
|
//
|
||||||
);
|
triggerDir =
|
||||||
|
isBullish
|
||||||
|
? X_DIRECTION_BULLISH
|
||||||
|
: X_DIRECTION_BEARISH;
|
||||||
|
|
||||||
|
//
|
||||||
|
sl =
|
||||||
|
isBullish
|
||||||
|
? conditions.decisionZone.lower
|
||||||
|
: conditions.decisionZone.upper;
|
||||||
|
|
||||||
|
//
|
||||||
|
conditions.reward = 2;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
//
|
|
||||||
// Checking Trigger Cond 3 ...
|
|
||||||
bool canTriggerCond3 = false;
|
|
||||||
|
|
||||||
//
|
|
||||||
// Adding Drawn Objects to Drawn Stores ...
|
|
||||||
for (int i = 0; i < iObjects.Total(); i++)
|
|
||||||
{
|
|
||||||
mObjects.Add(iObjects.At(i));
|
|
||||||
}
|
|
||||||
|
|
||||||
//
|
|
||||||
// Summarizing Result ...
|
|
||||||
result =
|
|
||||||
canTriggerCond0 ||
|
|
||||||
canTriggerCond1 ||
|
|
||||||
canTriggerCond2 ||
|
|
||||||
canTriggerCond3;
|
|
||||||
|
|
||||||
//
|
//
|
||||||
isBullish = result &&
|
isBullish = result &&
|
||||||
IsBullish(triggerDir);
|
IsBullish(triggerDir);
|
||||||
@@ -584,6 +911,19 @@ class XCXCAEASignaller : XCBase
|
|||||||
// Configure Conditions for Preparing Signal ...
|
// Configure Conditions for Preparing Signal ...
|
||||||
if (result)
|
if (result)
|
||||||
{
|
{
|
||||||
|
//
|
||||||
|
// Draw Decision Zone ...
|
||||||
|
if (allowDraws)
|
||||||
|
{
|
||||||
|
//
|
||||||
|
drawer.DrawBox(
|
||||||
|
conditions.decisionZone,
|
||||||
|
cTime,
|
||||||
|
true, // Draw Middle Line ...
|
||||||
|
true // Ignore Type ...
|
||||||
|
);
|
||||||
|
}
|
||||||
|
|
||||||
//
|
//
|
||||||
// Reconfigure Position TP/SL Entry and etc ...
|
// Reconfigure Position TP/SL Entry and etc ...
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user