From 9a67c4bc396fa9e74a310cdbeccc1d01a5f788c9 Mon Sep 17 00:00:00 2001 From: Hadi Khazaee Asl Date: Fri, 4 Apr 2025 21:20:07 +0330 Subject: [PATCH] last ... --- Documents/BKP/fvg.detection.mq5 | 35 +++++++++++++ .../Signals/x-121.smc.xind.signal.class.mq5 | 49 +++++++++++-------- 2 files changed, 64 insertions(+), 20 deletions(-) create mode 100644 Documents/BKP/fvg.detection.mq5 diff --git a/Documents/BKP/fvg.detection.mq5 b/Documents/BKP/fvg.detection.mq5 new file mode 100644 index 00000000..ae01c30b --- /dev/null +++ b/Documents/BKP/fvg.detection.mq5 @@ -0,0 +1,35 @@ + // + XCPOIDrawer *drawer = cHelper.mPOIDrawer; + + // + if (cStateEvents.hasNewFairValueGap) + { + // + int idx = GetYoungest(cState.fairValueGaps); + has = IsValidIndex(idx); + if (has) + { + // + XBoxZone box; + has = ToBox( + box, + cState.fairValueGaps[idx] // + ); + if (has) + { + // + XCBoxObject *iObj; + has = drawer.DrawBox( + box, + iObj // + ); + if (has) + { + Print("Box Drawn ..."); + } + } + } + } + + // + ZeroMemory(drawer); diff --git a/X121SMCEA/Signals/x-121.smc.xind.signal.class.mq5 b/X121SMCEA/Signals/x-121.smc.xind.signal.class.mq5 index d56a32b9..8c8c0056 100644 --- a/X121SMCEA/Signals/x-121.smc.xind.signal.class.mq5 +++ b/X121SMCEA/Signals/x-121.smc.xind.signal.class.mq5 @@ -1141,18 +1141,22 @@ class XCX121SMCXINDSignalDetector : public XCBase 0, iBox.period // ); - if (isValid) + if (!isValid) { // - has = IsBoxExists(iBox); - if (!has) - { - // - AddRef( - iBox, - mWaitingBoxes // - ); - } + iBox.Clean(); + continue; + } + + // + has = IsBoxExists(iBox); + if (!has) + { + // + AddRef( + iBox, + mWaitingBoxes // + ); } // @@ -1191,18 +1195,23 @@ class XCX121SMCXINDSignalDetector : public XCBase 0, iBox.period // ); - if (isValid) + if (!isValid) { // - has = IsBoxExists(iBox); - if (!has) - { - // - AddRef( - iBox, - mWaitingBoxes // - ); - } + iBox.Clean(); + continue; + ; + } + + // + has = IsBoxExists(iBox); + if (!has) + { + // + AddRef( + iBox, + mWaitingBoxes // + ); } //