last works ...

This commit is contained in:
2025-08-28 01:04:57 +03:30
parent 068394f629
commit 69df921dd2
3 changed files with 109 additions and 16 deletions
+9 -2
View File
@@ -146,14 +146,18 @@ class XCXOM1EAExpert : public XCBase
// Here we Apply Symbols,Periods and Configs ... // Here we Apply Symbols,Periods and Configs ...
// //
// Configure Indicator ...
XOM1Inputs iDZoneOMInputs; XOM1Inputs iDZoneOMInputs;
iDZoneOMInputs.Default(); iDZoneOMInputs.Default();
iDZoneOMInputs.showFiboZone = false;
// //
// Configure Signaller ...
XOM1SignallerConfig iDZoneSignallerConfig; XOM1SignallerConfig iDZoneSignallerConfig;
iDZoneSignallerConfig.processAllTicks = false; iDZoneSignallerConfig.processAllTicks = false;
// //
// Make Instance Signaller Class ...
XCXOM1SignallerBase *iDZoneSignaller = NULL; XCXOM1SignallerBase *iDZoneSignaller = NULL;
iDZoneSignaller = new XCXOM1SignallerBase( iDZoneSignaller = new XCXOM1SignallerBase(
"XDZN", "XDZN",
@@ -164,6 +168,7 @@ class XCXOM1EAExpert : public XCBase
if (iDZoneSignaller != NULL) if (iDZoneSignaller != NULL)
{ {
// //
// Register Signaller ...
Add( Add(
iDZoneSignaller, iDZoneSignaller,
signallers // signallers //
@@ -208,13 +213,15 @@ class XCXOM1EAExpert : public XCBase
// //
int count = ArraySize(signallers); int count = ArraySize(signallers);
bool has = IsValidSize(count); bool has = IsValidSize(count);
if (!has) { if (!has)
{
return; return;
} }
// //
// Loop through Signallers ... // Loop through Signallers ...
for (int i = 0; i < count; i++) { for (int i = 0; i < count; i++)
{
// //
// Calling Process Ticks on Signaller ... // Calling Process Ticks on Signaller ...
signallers[i].ProcessTick(0); signallers[i].ProcessTick(0);
+49 -12
View File
@@ -22,6 +22,7 @@
// //
// Imports ... // Imports ...
#include "../../Classes/x-saherelm.x-poi.drawer.class.mq5"
#include "../../Helpers/x-saherelm.xom1.helper.mq5" #include "../../Helpers/x-saherelm.xom1.helper.mq5"
#include "../Libraries/xom1ea.lib.mq5" #include "../Libraries/xom1ea.lib.mq5"
@@ -39,7 +40,8 @@ struct XOM1SignallerConfig
// //
// Constructor ... // Constructor ...
XOM1SignallerConfig() { XOM1SignallerConfig()
{
Clean(); Clean();
} }
@@ -49,7 +51,8 @@ struct XOM1SignallerConfig
/** /**
* Cleanup ... * Cleanup ...
*/ */
void Clean() { void Clean()
{
ZeroMemory(this); ZeroMemory(this);
} }
}; };
@@ -73,6 +76,7 @@ class XCXOM1SignallerBase
XOM1Inputs inputs; // Indicator Inputs ... XOM1Inputs inputs; // Indicator Inputs ...
ENUM_TIMEFRAMES period; // Period ... ENUM_TIMEFRAMES period; // Period ...
XOM1SignallerConfig config; // Configuration ... XOM1SignallerConfig config; // Configuration ...
XCPOIDrawer drawer; // POI Drawer ...
// //
// Constructor ... // Constructor ...
@@ -133,6 +137,9 @@ class XCXOM1SignallerBase
// //
inputs.Clean(); inputs.Clean();
//
mObjects.Clear();
// //
SpecifiedClean(zones); SpecifiedClean(zones);
@@ -201,6 +208,11 @@ class XCXOM1SignallerBase
return; return;
} }
//
// Set Last Works ...
mProcessedTicksCount++;
mLastCheckedBarTime = cBarTime;
// //
// Initialize iBar ... // Initialize iBar ...
has = iBar.Init( has = iBar.Init(
@@ -239,9 +251,9 @@ class XCXOM1SignallerBase
// //
int zIdx = 0; int zIdx = 0;
int cIdx = zIdx++; int cIdx = zIdx + 1;
int pIdx = cIdx++; int pIdx = cIdx + 1;
int p2Idx = pIdx++; int p2Idx = pIdx + 1;
// //
// Check New Peak or Vale Happens ... // Check New Peak or Vale Happens ...
@@ -306,7 +318,8 @@ class XCXOM1SignallerBase
iPrice, iPrice,
iDir, iDir,
iReason, iReason,
iConditions.bars[pIdx].time // From ... iConditions.bars[pIdx].time, // From ...
iConditions.bars[cIdx].time // To
); );
if (has) if (has)
{ {
@@ -318,11 +331,6 @@ class XCXOM1SignallerBase
); );
} }
//
// Set Last Works ...
mProcessedTicksCount++;
mLastCheckedBarTime = cBarTime;
// //
// Clean Resources ... // Clean Resources ...
iBar.Clean(); iBar.Clean();
@@ -342,6 +350,9 @@ class XCXOM1SignallerBase
// //
// Props ... // Props ...
//
CArrayObj mObjects; // Drawn Objects ...
// //
XCXOM1Helper *mHelper; // Indicator Helper ... XCXOM1Helper *mHelper; // Indicator Helper ...
@@ -375,9 +386,35 @@ class XCXOM1SignallerBase
{ {
// //
// Update Lifetime by Bar Index ... // Update Lifetime by Bar Index ...
zones[i].UpdateByBarIndex(barIndex); // zones[i].UpdateByBarIndex(barIndex);
//
// COnverts to Box ...
XBoxZone iBox;
has = zones[i].ToBox(iBox);
if (has)
{
//
XCBoxObject *iBoxObj;
has = drawer.DrawBox(
iBox,
iBoxObj,
true // Ignore At ...
);
if (has)
{
mObjects.Add(iBoxObj);
}
}
//
iBox.Clean();
} }
} }
//
// Check XOMZones Validations ...
} }
}; };
+50 -1
View File
@@ -23,6 +23,7 @@
// //
// Imports ... // Imports ...
#include "../../Libraries/x-saherelm.common.lib.mq5" #include "../../Libraries/x-saherelm.common.lib.mq5"
#include "../../Libraries/x-saherelm.x-poi.lib.mq5"
// //
// Definitions ... // Definitions ...
@@ -170,6 +171,7 @@ struct XOM1Zone
* @param _dir: Direction * @param _dir: Direction
* @param _reason: Creation Reason * @param _reason: Creation Reason
* @param _from: Detection Time * @param _from: Detection Time
* @param _to: Lifetime Time
* *
* @return ( bool ) * @return ( bool )
*/ */
@@ -182,7 +184,8 @@ struct XOM1Zone
double _price, double _price,
ENUM_X_DIRECTION _dir, ENUM_X_DIRECTION _dir,
ENUM_XOM1_ZONE_REASON _reason, ENUM_XOM1_ZONE_REASON _reason,
datetime _from // datetime _from,
datetime _to = NULL //
) )
{ {
// //
@@ -197,6 +200,11 @@ struct XOM1Zone
reason = _reason; reason = _reason;
signaller = _signaller; signaller = _signaller;
//
if (IsSpecifiedValid(_to)) {
to = _to;
}
// //
bool result = IsValid(); bool result = IsValid();
if (!result) if (!result)
@@ -346,6 +354,47 @@ struct XOM1Zone
return result; return result;
} }
/**
* Converts to Box ...
*
* @param box: Dest
*
* @return ( bool )
*/
bool ToBox(XBoxZone &box)
{
//
bool result = false;
//
box.Clean();
result = IsValid();
if (!result)
{
return result;
}
//
box.to = to;
box.dir = dir;
box.from = from;
box.upper = upper;
box.lower = lower;
box.symbol = symbol;
box.period = period;
box.type = signaller;
//
result = box.IsValid();
if (!result)
{
box.Clean();
}
//
return result;
}
/** /**
* Unique Identifier ... * Unique Identifier ...
* *