last ...
This commit is contained in:
@@ -1262,6 +1262,7 @@ bool CanTriggerCondTEMP(
|
|||||||
ENUM_X_DIRECTION &dir,
|
ENUM_X_DIRECTION &dir,
|
||||||
double &sl,
|
double &sl,
|
||||||
XTarget &targets[],
|
XTarget &targets[],
|
||||||
|
bool allowDraws,
|
||||||
CArrayObj *drawns,
|
CArrayObj *drawns,
|
||||||
int barIndex = 0,
|
int barIndex = 0,
|
||||||
int loopback = 10 //
|
int loopback = 10 //
|
||||||
@@ -1344,6 +1345,7 @@ bool CanTriggerCond0(
|
|||||||
ENUM_X_DIRECTION &dir,
|
ENUM_X_DIRECTION &dir,
|
||||||
double &sl,
|
double &sl,
|
||||||
XTarget &targets[],
|
XTarget &targets[],
|
||||||
|
bool allowDraws,
|
||||||
CArrayObj *drawns,
|
CArrayObj *drawns,
|
||||||
int barIndex = 0,
|
int barIndex = 0,
|
||||||
int loopback = 5,
|
int loopback = 5,
|
||||||
@@ -1578,6 +1580,7 @@ bool CanTriggerCond1(
|
|||||||
ENUM_X_DIRECTION &dir,
|
ENUM_X_DIRECTION &dir,
|
||||||
double &sl,
|
double &sl,
|
||||||
XTarget &targets[],
|
XTarget &targets[],
|
||||||
|
bool allowDraws,
|
||||||
CArrayObj *drawns,
|
CArrayObj *drawns,
|
||||||
int barIndex = 0,
|
int barIndex = 0,
|
||||||
int loopback = 10 //
|
int loopback = 10 //
|
||||||
@@ -1660,6 +1663,7 @@ bool CanTriggerCond2(
|
|||||||
ENUM_X_DIRECTION &dir,
|
ENUM_X_DIRECTION &dir,
|
||||||
double &sl,
|
double &sl,
|
||||||
XTarget &targets[],
|
XTarget &targets[],
|
||||||
|
bool allowDraws,
|
||||||
CArrayObj *drawns,
|
CArrayObj *drawns,
|
||||||
int barIndex = 0,
|
int barIndex = 0,
|
||||||
int loopback = 10 //
|
int loopback = 10 //
|
||||||
@@ -1830,7 +1834,8 @@ bool CanTriggerCond2(
|
|||||||
|
|
||||||
//
|
//
|
||||||
// Draw Selected Pivot ...
|
// Draw Selected Pivot ...
|
||||||
if (hasSelectedPivot)
|
if (allowDraws &&
|
||||||
|
hasSelectedPivot)
|
||||||
{
|
{
|
||||||
//
|
//
|
||||||
// Draw Pivot ...
|
// Draw Pivot ...
|
||||||
@@ -1919,6 +1924,7 @@ bool CanTriggerCond3(
|
|||||||
ENUM_X_DIRECTION &dir,
|
ENUM_X_DIRECTION &dir,
|
||||||
double &sl,
|
double &sl,
|
||||||
XTarget &targets[],
|
XTarget &targets[],
|
||||||
|
bool allowDraws,
|
||||||
CArrayObj *drawns,
|
CArrayObj *drawns,
|
||||||
int barIndex = 0,
|
int barIndex = 0,
|
||||||
int loopback = 10 //
|
int loopback = 10 //
|
||||||
|
|||||||
@@ -40,12 +40,14 @@ class XCXCAEASignaller : XCBase
|
|||||||
//
|
//
|
||||||
// Props ...
|
// Props ...
|
||||||
bool useGuards;
|
bool useGuards;
|
||||||
int poiLoopback;
|
bool allowDraws;
|
||||||
XCAEAInputs inputs;
|
XCAEAInputs inputs;
|
||||||
|
bool allowDrawPOIs;
|
||||||
XBarTracker barTraker;
|
XBarTracker barTraker;
|
||||||
XCXCAEAHelper *helper;
|
XCXCAEAHelper *helper;
|
||||||
|
int maxAllowedSetupAge;
|
||||||
|
XBoxZone unavailables[];
|
||||||
XCXCAEAPOIDrawer *drawer;
|
XCXCAEAPOIDrawer *drawer;
|
||||||
XBoxZone unAvailableBoxes[];
|
|
||||||
XCXCAEAHelper *analyseHelper;
|
XCXCAEAHelper *analyseHelper;
|
||||||
XCXCAEAPOIDetector *detector;
|
XCXCAEAPOIDetector *detector;
|
||||||
XCAEAStrategyConditions mConditions;
|
XCAEAStrategyConditions mConditions;
|
||||||
@@ -84,9 +86,14 @@ class XCXCAEASignaller : XCBase
|
|||||||
void Init()
|
void Init()
|
||||||
{
|
{
|
||||||
//
|
//
|
||||||
|
// Configure Signaller Handler ...
|
||||||
useGuards = false;
|
useGuards = false;
|
||||||
|
allowDraws = true;
|
||||||
|
allowDrawPOIs = false;
|
||||||
|
maxAllowedSetupAge = 576;
|
||||||
|
|
||||||
//
|
//
|
||||||
|
// Initial Bar Tracker ...
|
||||||
barTraker.Init(
|
barTraker.Init(
|
||||||
symbol,
|
symbol,
|
||||||
period //
|
period //
|
||||||
@@ -121,6 +128,9 @@ class XCXCAEASignaller : XCBase
|
|||||||
ZeroMemory(detector);
|
ZeroMemory(detector);
|
||||||
ZeroMemory(analyseHelper);
|
ZeroMemory(analyseHelper);
|
||||||
|
|
||||||
|
//
|
||||||
|
Clean(unavailables);
|
||||||
|
|
||||||
//
|
//
|
||||||
mConditions.Clean();
|
mConditions.Clean();
|
||||||
Clean(mConditionsCollection);
|
Clean(mConditionsCollection);
|
||||||
@@ -178,7 +188,7 @@ class XCXCAEASignaller : XCBase
|
|||||||
int zIndex = 0;
|
int zIndex = 0;
|
||||||
int cIndex = zIndex + 1;
|
int cIndex = zIndex + 1;
|
||||||
int pIndex = cIndex + 1;
|
int pIndex = cIndex + 1;
|
||||||
int ppIndex = pIndex + 1;
|
int p2Index = pIndex + 1;
|
||||||
|
|
||||||
//
|
//
|
||||||
int loopback = 10;
|
int loopback = 10;
|
||||||
@@ -232,13 +242,17 @@ class XCXCAEASignaller : XCBase
|
|||||||
//
|
//
|
||||||
// Validate Pivots ...
|
// Validate Pivots ...
|
||||||
detector.Validate(
|
detector.Validate(
|
||||||
unAvailableBoxes,
|
unavailables,
|
||||||
zIndex //
|
zIndex //
|
||||||
);
|
);
|
||||||
|
|
||||||
//
|
//
|
||||||
// Draw Pivots ...
|
// Draw Pivots ...
|
||||||
// drawer.Draw(cTime);
|
if (allowDraws &&
|
||||||
|
allowDrawPOIs)
|
||||||
|
{
|
||||||
|
drawer.Draw(cTime);
|
||||||
|
}
|
||||||
|
|
||||||
//
|
//
|
||||||
// Setup Conditions ...
|
// Setup Conditions ...
|
||||||
@@ -255,7 +269,7 @@ class XCXCAEASignaller : XCBase
|
|||||||
drawer,
|
drawer,
|
||||||
decisionZone,
|
decisionZone,
|
||||||
decisionZoneDir,
|
decisionZoneDir,
|
||||||
unAvailableBoxes,
|
unavailables,
|
||||||
conditions,
|
conditions,
|
||||||
zIndex,
|
zIndex,
|
||||||
loopback //
|
loopback //
|
||||||
@@ -274,7 +288,7 @@ class XCXCAEASignaller : XCBase
|
|||||||
//
|
//
|
||||||
AddRef(
|
AddRef(
|
||||||
decisionZone,
|
decisionZone,
|
||||||
unAvailableBoxes //
|
unavailables //
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -347,17 +361,18 @@ class XCXCAEASignaller : XCBase
|
|||||||
*/
|
*/
|
||||||
bool DetectSignalTrigger(
|
bool DetectSignalTrigger(
|
||||||
XCAEAStrategyConditions &conditions,
|
XCAEAStrategyConditions &conditions,
|
||||||
int barIndex = 0,
|
int barIndex = 0 //
|
||||||
int maxAllowedSetupAge = 576 //
|
|
||||||
)
|
)
|
||||||
{
|
{
|
||||||
//
|
//
|
||||||
bool result = false;
|
bool result = false;
|
||||||
|
|
||||||
//
|
//
|
||||||
|
// Normalize Args ...
|
||||||
barIndex = NormalizeInt(barIndex, 0);
|
barIndex = NormalizeInt(barIndex, 0);
|
||||||
|
|
||||||
//
|
//
|
||||||
|
// Validate Setup ...
|
||||||
result = conditions.IsSetuped();
|
result = conditions.IsSetuped();
|
||||||
if (!result)
|
if (!result)
|
||||||
{
|
{
|
||||||
@@ -365,34 +380,28 @@ class XCXCAEASignaller : XCBase
|
|||||||
}
|
}
|
||||||
|
|
||||||
//
|
//
|
||||||
|
// Reading Requirements ...
|
||||||
|
|
||||||
|
//
|
||||||
|
int loopback = 10;
|
||||||
|
double ask = GetAsk(symbol);
|
||||||
|
double bid = GetBid(symbol);
|
||||||
|
datetime cTime = TimeCurrent();
|
||||||
|
double points = GetPoints(symbol);
|
||||||
datetime setupTime = conditions.setupTime;
|
datetime setupTime = conditions.setupTime;
|
||||||
ENUM_X_DIRECTION setupDir = conditions.dir;
|
ENUM_X_DIRECTION setupDir = conditions.dir;
|
||||||
|
|
||||||
//
|
|
||||||
helper.GetConditions(
|
|
||||||
conditions.conditions,
|
|
||||||
barIndex //
|
|
||||||
);
|
|
||||||
|
|
||||||
//
|
//
|
||||||
bool isBullish = IsBullish(setupDir);
|
bool isBullish = IsBullish(setupDir);
|
||||||
bool isBearish = IsBearish(setupDir);
|
bool isBearish = IsBearish(setupDir);
|
||||||
|
|
||||||
//
|
//
|
||||||
int zIndex = 0;
|
// Extract Current Bar Conditions ...
|
||||||
int cIndex = zIndex + 1;
|
helper.GetConditions(
|
||||||
int pIndex = cIndex + 1;
|
conditions.conditions,
|
||||||
int ppIndex = pIndex + 1;
|
barIndex,
|
||||||
|
loopback //
|
||||||
//
|
);
|
||||||
bool has = false;
|
|
||||||
int loopback = 10;
|
|
||||||
|
|
||||||
//
|
|
||||||
double ask = GetAsk(symbol);
|
|
||||||
double bid = GetBid(symbol);
|
|
||||||
datetime cTime = TimeCurrent();
|
|
||||||
double points = GetPoints(symbol);
|
|
||||||
|
|
||||||
//
|
//
|
||||||
// Check Signal Validation ...
|
// Check Signal Validation ...
|
||||||
@@ -407,6 +416,13 @@ class XCXCAEASignaller : XCBase
|
|||||||
return result;
|
return result;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
//
|
||||||
|
bool has = false;
|
||||||
|
int zIndex = 0;
|
||||||
|
int cIndex = zIndex + 1;
|
||||||
|
int pIndex = cIndex + 1;
|
||||||
|
int p2Index = pIndex + 1;
|
||||||
|
|
||||||
//
|
//
|
||||||
// Checking Trigger Conditions ...
|
// Checking Trigger Conditions ...
|
||||||
double sl = 0;
|
double sl = 0;
|
||||||
@@ -425,12 +441,16 @@ class XCXCAEASignaller : XCBase
|
|||||||
|
|
||||||
//
|
//
|
||||||
// Draw Decision Zone ...
|
// Draw Decision Zone ...
|
||||||
drawer.DrawBox(
|
if (allowDraws)
|
||||||
conditions.decisionZone,
|
{
|
||||||
cTime,
|
//
|
||||||
true, // Draw Middle Line ...
|
drawer.DrawBox(
|
||||||
true // Ignore Type ...
|
conditions.decisionZone,
|
||||||
);
|
cTime,
|
||||||
|
true, // Draw Middle Line ...
|
||||||
|
true // Ignore Type ...
|
||||||
|
);
|
||||||
|
}
|
||||||
|
|
||||||
//
|
//
|
||||||
// Detect Required Pivots ...
|
// Detect Required Pivots ...
|
||||||
@@ -455,7 +475,7 @@ class XCXCAEASignaller : XCBase
|
|||||||
int decisionPivotsCount = detector.FillPivots(
|
int decisionPivotsCount = detector.FillPivots(
|
||||||
conditions.decisionZone,
|
conditions.decisionZone,
|
||||||
decisionPivots,
|
decisionPivots,
|
||||||
unAvailableBoxes,
|
unavailables,
|
||||||
allowedTypes,
|
allowedTypes,
|
||||||
cTime //
|
cTime //
|
||||||
);
|
);
|
||||||
@@ -486,6 +506,7 @@ class XCXCAEASignaller : XCBase
|
|||||||
triggerDir,
|
triggerDir,
|
||||||
sl,
|
sl,
|
||||||
targets,
|
targets,
|
||||||
|
allowDraws,
|
||||||
iObjects,
|
iObjects,
|
||||||
barIndex //
|
barIndex //
|
||||||
);
|
);
|
||||||
@@ -504,6 +525,7 @@ class XCXCAEASignaller : XCBase
|
|||||||
triggerDir,
|
triggerDir,
|
||||||
sl,
|
sl,
|
||||||
targets,
|
targets,
|
||||||
|
allowDraws,
|
||||||
iObjects,
|
iObjects,
|
||||||
barIndex //
|
barIndex //
|
||||||
);
|
);
|
||||||
@@ -693,6 +715,9 @@ class XCXCAEASignaller : XCBase
|
|||||||
//
|
//
|
||||||
bool result = false;
|
bool result = false;
|
||||||
|
|
||||||
|
//
|
||||||
|
// TODO: Implement this ...
|
||||||
|
|
||||||
//
|
//
|
||||||
return result;
|
return result;
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user