last works on EA all Requirements Prepare as Template and Implement it's Testing Usage as XFIMA EA ...

This commit is contained in:
2025-09-17 22:22:12 +03:30
parent b11e4f7f4b
commit 177d115de6
11 changed files with 4555 additions and 31 deletions
+52 -5
View File
@@ -33,11 +33,30 @@ class XCChartHelper : public XCBase
//
// Constructor ...
XCChartHelper(ulong _chartId = 0)
XCChartHelper(
ulong _chartId = 0,
string _symbol = NULL,
ENUM_TIMEFRAMES _period = NULL)
{
//
// Normalize Chart ID ...
mChartID = NormalizeChartId(_chartId);
bool canSetSymbolPeriod =
IsSpecifiedValid(_symbol) &&
IsSpecifiedValid(_period);
//
// Normalize ...
if (!canSetSymbolPeriod)
{
//
mChartID = NormalizeChartId(_chartId);
mSymbol = NormalizeSymbol(_symbol);
mPeriod = NormalizePeriod(_period);
}
else
{
//
SetSymbolPeriod(mSymbol, mPeriod);
}
}
//
@@ -181,7 +200,16 @@ class XCChartHelper : public XCBase
ENUM_TIMEFRAMES period //
)
{
return (ChartSetSymbolPeriod(mChartID, symbol, period));
bool result = (ChartSetSymbolPeriod(mChartID, symbol, period));
if (result)
{
//
mSymbol = symbol;
mPeriod = period;
}
//
return result;
}
/**
@@ -644,6 +672,23 @@ class XCChartHelper : public XCBase
return has;
}
ulong Open()
{
//
mChartID = ChartOpen(mSymbol, mPeriod);
return (mChartID);
}
void Close()
{
//
if (mChartID != -1 && mChartID != 0)
{
ChartClose(mChartID);
mChartID = 0;
}
}
//
// Properties ...
@@ -819,7 +864,9 @@ class XCChartHelper : public XCBase
// Props ...
//
ulong mChartID; // Chart ID ...
ulong mChartID; // Chart ID ...
string mSymbol; // Chart Symbol ...
ENUM_TIMEFRAMES mPeriod; // Chart Period ...
};
//
File diff suppressed because it is too large Load Diff
+10 -24
View File
@@ -2,7 +2,7 @@
//
// SaherElm IT Center MQL5 Class
// -------------------------------------------------
// Name: XCXBaseSignaller ...
// Name: XCBaseSignaller ...
// Description: Base Signaller Class ...
//
// - Create an Instance based on this ...
@@ -18,7 +18,7 @@
//
// - also Whenever you want you can call PrepareSignal Action to
// provide a Signal based on Current Market State ...
//
//
// Maintainer:
// ------------
// Hadi Khazaee Asl (hadi_khazaee_asl@yahoo.com)
@@ -41,23 +41,9 @@
//
// Definitions ...
//
// a Event Listener for Checking Can Analyse Market or not ...
// Usually for Time Based Session Handling ...
typedef bool (*TXCSignallerCanAnalyse)(
string _symbol,
ENUM_TIMEFRAMES _period,
datetime _time //
);
//
// a Event Listener for Notifying a Signal ...
// Usually for Time Based Session Handling ...
typedef bool (*TXCSignallerOnSignalEvent)(XSignal &signal);
//
// Implementations ...
class XCXBaseSignaller : public XCBase
class XCBaseSignaller : public XCBase
{
//
// Public ...
@@ -69,11 +55,11 @@ class XCXBaseSignaller : public XCBase
ENUM_TIMEFRAMES period; // Period ...
//
TXCSignallerCanAnalyse canAnalyseEventListener;
TCanAnalyse canAnalyseEventListener;
//
// Constructor ...
XCXBaseSignaller(
XCBaseSignaller(
string _name, // Name ...
string _symbol, // Symbol ...
ENUM_TIMEFRAMES _period, // Period ...
@@ -110,7 +96,7 @@ class XCXBaseSignaller : public XCBase
//
// Deconstructor ...
~XCXBaseSignaller()
~XCBaseSignaller()
{
//
// Cleanup Event Listeners ...
@@ -123,9 +109,9 @@ class XCXBaseSignaller : public XCBase
/**
* Add On Signal Event Listener ...
*
* @param listener: TXCSignallerOnSignalEvent instance ...
* @param listener: TOnSignal instance ...
*/
void AddOnSignalEventListener(TXCSignallerOnSignalEvent listener)
void AddOnSignalEventHandler(TOnSignal listener)
{
//
// Validate ...
@@ -392,7 +378,7 @@ class XCXBaseSignaller : public XCBase
/**
* Preparing Default Signal ...
*
*
* @param signal: XSignal, holding result Signal ...
* @param forDir: ENUM_X_DIRECTION
* @return ( bool )
@@ -473,7 +459,7 @@ class XCXBaseSignaller : public XCBase
//
// Event Listeners ...
TXCSignallerOnSignalEvent onSignalEventListeners[];
TOnSignal onSignalEventListeners[];
};
//