Attach CheckForGuard Event Handler for Signallers to Handle Guards ...

This commit is contained in:
2025-09-11 15:19:56 +03:30
parent 5eaeb13087
commit 94539b2b5d
7 changed files with 321 additions and 196 deletions
+51
View File
@@ -116,6 +116,7 @@ class XCXOM1EAExpert : public XCBase
//
TOnGuarded onGuardedEventHandler;
TCanAnalyse canAnalyseEventHandler;
TCheckForGuard checkForGuardEventHandler;
//
// Signal Event Handlers ...
@@ -519,6 +520,10 @@ class XCXOM1EAExpert : public XCBase
//
// Configuring Trade Manager ...
//
// Attache Check For Guard Event Listener ...
eaTradeManager.checkForGuardEventListener = checkForGuardEventHandler;
//
eaTradeManager.SaveWins(eaSaveWins);
eaTradeManager.SaveLosts(eaSaveLosts);
@@ -742,6 +747,52 @@ class XCXOM1EAExpert : public XCBase
eaTradeManager.HandleSignal(signal);
}
/**
* Check For Guard Event Handler ...
*
* @param guards: XGuard[]
*
* @return ( int )
*/
int CheckForGuardTriggered(XGuard &guards[])
{
//
int result = 0;
//
if (!HasChild(eaSignallers))
{
return result;
}
//
int count = ArraySize(eaSignallers);
for (int i = 0; i < count; i++)
{
//
XGuard iGuards[];
int iGuardsCount = eaSignallers[i].CheckForGuard(iGuards);
if (IsValidSize(iGuardsCount))
{
//
Copy(
iGuards,
guards,
false //
);
}
//
SpecifiedClean(iGuards);
}
//
result = ArraySize(guards);
//
return result;
}
/**
* Handle Guard Events ...
*
+26
View File
@@ -558,6 +558,32 @@ class XCXOM1SignallerBase
iConditions.Clean();
}
/**
* Check Guards Based on MarketConditions ...
*
* @param guards: XGuard[]
* @param barIndex: int
*
* @return ( int )
*/
int CheckForGuard(
XGuard &guards[],
int barIndex = 0 //
)
{
//
int result = 0;
//
SpecifiedClean(guards);
//
result = ArraySize(guards);
//
return result;
}
//
// Virtuals ...