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