add alert class instance in x121ea and configure it for using tima tracker alerting ...

This commit is contained in:
2024-07-08 20:05:29 +03:30
parent 366e55a9de
commit c49034002c
3 changed files with 147 additions and 33 deletions
+47 -21
View File
@@ -139,6 +139,7 @@ string x121EAUsedSymbols[];
XSCX121SetupEA *x121EA;
//
XSCAlert *x121EAAlert;
XSCXCTHelper *x121EACTHelper;
XSCXCCHelper *x121EACCHelper;
@@ -207,32 +208,46 @@ void OnTick()
// Time Tracking ...
//
if (x121EATimeTracker.IsNewHour())
{
//
if (!is121EAInTestMode)
{
x121EA.Alert("New Hour ...");
}
}
//
if (x121EATimeTracker.IsNewDay())
{
//
if (!is121EAInTestMode)
{
x121EA.Alert("New Day ...");
}
}
//
// Alert Month ...
if (x121EATimeTracker.IsNewMonth())
{
//
if (!is121EAInTestMode)
{
x121EA.Alert("New Mount ...");
x121EAAlert.Alert("New Mount ...");
}
}
//
// Alert Week ...
if (x121EATimeTracker.IsNewWeek())
{
//
if (!is121EAInTestMode)
{
x121EAAlert.Alert("New Week ...");
}
}
//
// Alert New Day ...
if (x121EATimeTracker.IsNewDay())
{
//
if (!is121EAInTestMode)
{
x121EAAlert.Alert("New Day ...");
}
}
//
// Alert New Hour ...
if (x121EATimeTracker.IsNewHour())
{
//
if (!is121EAInTestMode)
{
x121EAAlert.Alert("New Hour ...");
}
}
@@ -282,6 +297,17 @@ bool InitialEA()
return result;
}
//
// Initial Alert Class ...
x121EATimeTracker.Clean();
x121EAAlert = new XSCAlert();
x121EAAlert.SetPrefix(ShortName);
x121EAAlert.SetEnableAlerts(x121EAEnableAlerts);
x121EAAlert.SetLogAlerts(x121EALogAlerts);
x121EAAlert.SetMailAlerts(x121EAMailAlerts);
x121EAAlert.SetPushAlerts(x121EAPushAlerts);
x121EAAlert.SetTerminalAlerts(x121EATerminalAlerts);
//
// TesterHideIndicators(true);
+75 -12
View File
@@ -49,6 +49,10 @@ XSCXTestSetup *iSetup;
XSCXCTHelper *mCTHelper;
XSCXCCHelper *mCCHelper;
//
XSCAlert *eaAlert;
XTimeTracker eaTimeTracker;
//
// For Pivot Checking ...
XPivot lastSupportPivot;
@@ -79,6 +83,7 @@ int OnInit()
}
//
// Initial Bar Tracker ...
bool isInited = eaBarTracker.Init(
_Symbol,
_Period //
@@ -88,6 +93,18 @@ int OnInit()
return INIT_FAILED;
}
//
// Initial Alert Class ...
eaAlert = new XSCAlert(
ShortName,
true,
true,
false,
false,
true //
);
eaTimeTracker.Clean();
//
// Init Succeed ...
return INIT_SUCCEEDED;
@@ -131,11 +148,15 @@ void OnTick()
//
// Check Pivots ...
HandleCheckPivots();
// HandleCheckPivots();
//
// Check Zones ...
// HandleCheckZones();
//
// Check Time Tracker ...
// HandleCheckTimeTracker();
}
//
@@ -446,50 +467,92 @@ void HandleCheckPivots()
}
//
void HandleCheckZones() {
void HandleCheckZones()
{
//
bool result = false;
//
// Find Last Support Zone ...
if (!lastSupportZone.IsValid()) {
if (!lastSupportZone.IsValid())
{
//
result = lastSupportZone.FindLastSupportZone(
_Symbol,
_Period //
);
if (!result) {
if (!result)
{
return;
}
//
result = lastSupportZone.Draw(ChartID());
if (result) {
if (result)
{
Print("Valid Support Zone ...");
}
} else {
}
else
{
}
//
// Find Last Resistance Zone ...
if (!lastResistanceZone.IsValid()) {
if (!lastResistanceZone.IsValid())
{
//
result = lastResistanceZone.FindLastResistanceZone(
_Symbol,
_Period //
);
if (!result) {
if (!result)
{
return;
}
//
result = lastResistanceZone.Draw(ChartID());
if (result) {
if (result)
{
Print("Valid Resistance Zone ...");
}
} else {
}
else
{
}
}
//
void HandleCheckTimeTracker() {
//
// Month ...
if (eaTimeTracker.IsNewMonth()) {
eaAlert.Alert("New Month ...");
}
//
// Week ...
if (eaTimeTracker.IsNewWeek()) {
eaAlert.Alert("New Week ...");
}
//
// Day ...
if (eaTimeTracker.IsNewDay()) {
eaAlert.Alert("New Day ...");
}
//
// Hour ...
if (eaTimeTracker.IsNewHour()) {
eaAlert.Alert("New Hour ...");
}
//
// Minute ...
if (eaTimeTracker.IsNewMinute()) {
eaAlert.Alert("New Minute ...");
}
}
@@ -630,5 +693,5 @@ void OldTests()
// eaBarTracker.Waits();
// }
}
//