last works ...

This commit is contained in:
2024-05-31 03:44:31 +03:30
parent 60db76db07
commit 421f271441
26 changed files with 728 additions and 15860 deletions
File diff suppressed because it is too large Load Diff
+11 -6
View File
@@ -47,7 +47,7 @@
//
// X121 Specified Market Cycle Structure ...
class X121MCycleInputs : public XSCBaseProviderInpts
class X121MCycleInputs : public XSCBase
{
//
// Public ...
@@ -401,19 +401,24 @@ public:
//
// Specific Market Sense Based on Specified Bar Index on Host Period ...
class X121MCycleConditions : public XSCBaseProviderMarketConditions
class X121MCycleConditions : public XSCBase
{
//
// Public ...
public:
//
// Props ...
datetime time; // Time
string symbol; // Symbol
ENUM_TIMEFRAMES period; // Period
//
// Common ...
string prefix; // Cycle Prefix ...
ENUM_TIMEFRAMES hostPeriod; // Hosting Time Frame ...
ENUM_X_MARKET_CYCLES cycle; // Init Cycle ...
string prefix; // Cycle Prefix
ENUM_X_MARKET_CYCLES cycle; // Init Cycle
ENUM_TIMEFRAMES hostPeriod; // Hosting Time Frame
//
XOHCL bars[]; // Number of Bars
//
// Candlestic Conditions ...
+1 -136
View File
@@ -22,7 +22,6 @@
//
// Imports ...
#include <Generic/HashMap.mqh>
#include "../Classes/x-saherelm.base.class.mq5"
#include "../Classes/x-saherelm.xalert.class.mq5"
#include "../Classes/x-saherelm.xtrade.class.mq5"
@@ -2133,7 +2132,7 @@ private:
//
// Class Definition ...
class XSCBaseEA : public XSCBase
class XSCBaseEA : public XSCBaseAlert
{
//
// Public ...
@@ -2245,18 +2244,6 @@ public:
mTrader.AddOnTradeStateChangedEventHandler(mOnTradeStateChangedHandler);
}
//
// Instantiate Alert Class ...
mAlert = new XSCAlert(
GetTag(),
enableAlerts,
logAlerts,
terminalAlerts,
mailAlerts,
pushAlerts
//
);
//
// Instantiate XPositionTracker Class ...
mPositionTracker = new XSCPositionTracker();
@@ -2276,7 +2263,6 @@ public:
{
//
delete mTrader;
delete mAlert;
delete mPositionTracker;
}
@@ -2426,126 +2412,6 @@ public:
return result;
}
//
// Alert ...
//
bool GetLogAlerts()
{
return mAlert.GetLogAlerts();
}
//
void SetLogAlerts(bool value)
{
mAlert.SetLogAlerts(value);
}
//
bool GetEnableAlerts()
{
return mAlert.GetEnableAlerts();
}
//
void SetEnableAlerts(bool value)
{
mAlert.SetEnableAlerts(value);
}
//
bool GetPushAlerts()
{
return mAlert.GetPushAlerts();
}
//
void SetPushAlerts(bool value)
{
mAlert.SetPushAlerts(value);
}
//
bool GetMailAlerts()
{
return mAlert.GetMailAlerts();
}
//
void SetMailAlerts(bool value)
{
mAlert.SetMailAlerts(value);
}
//
bool GetTerminalAlerts()
{
return mAlert.GetTerminalAlerts();
}
//
void SetTerminalAlerts(bool value)
{
mAlert.SetTerminalAlerts(value);
}
//
void SetAlertPrefix(string value)
{
mAlert.SetPrefix(value);
}
//
// Event Listeners ...
void AddOnSignalEventHandler(TOnSignal listener)
{
//
Add(
listener,
mOnSignalEventHandlers
//
);
}
//
// Alert Functions ...
//
// Logging an Alert ...
void LogAlert(string message)
{
mAlert.LogAlert(message);
}
//
// Terminal Alert ...
void TerminalAlert(string message)
{
mAlert.TerminalAlert(message);
}
//
// Mail Alert ...
void MailAlert(string message)
{
mAlert.MailAlert(message);
}
//
// Send Push Notification ...
void PushAlert(string message)
{
mAlert.PushAlert(message);
}
//
// Send an Alert by Handling all Different Specified
// type's of Alert's if they are Enabled ...
void Alert(string message)
{
mAlert.Alert(message);
}
//
// Overrides ...
@@ -2933,7 +2799,6 @@ protected:
//
// Trade Class Instance ...
XSCTrade *mTrader;
XSCAlert *mAlert;
XSCPositionTracker *mPositionTracker;
//
+2 -98
View File
@@ -22,82 +22,15 @@
//
// Includes ...
#include "../Classes/x-saherelm.base.class.mq5"
#include "../Classes/x-saherelm.xalert.class.mq5"
#include "../Libraries/x-saherelm.xtrade.lib.mq5"
//
// Definitions ...
//
// Base Provider Inputs ...
class XSCBaseProviderInpts : public XSCBase
{
//
// Public ...
public:
//
// Validate Input ...
virtual bool IsValid();
//
// Cleanup ...
virtual void Clean();
//
// Default ...
virtual void Default();
//
// Max ...
virtual int Max();
};
//
// Base Market Conditions Class ...
class XSCBaseProviderMarketConditions : public XSCBase
{
//
// Public ...
public:
//
// Props ...
string symbol; // Symbol
ENUM_TIMEFRAMES period; // Period
datetime time; // Time
//
XOHCL bars[]; // Number of Bars ...
//
// Buffers ...
//
// Conditions ...
//
// Generate Score ...
virtual void GenerateScore(
double &bullishScore, // Bullish Score
double &bearishScore, // Bearish Score
double multiplier = 1 // Score Multiplier
);
//
// Generate Summary ...
virtual string GenerateSummary(
const bool onlySummary = false, // Only Generate Conditions Summary
double multiplier = 1, // Score Multiplier
const string separator = "\n", // Separator
const bool ignoreFalseConditions = true // Ignore False Conditions
);
};
//
// Class ...
//
// Base Provider Class ...
class XSCBaseProvider : public XSCBase
class XSCBaseProvider : public XSCBaseAlert
{
//
// Public ...
@@ -139,39 +72,10 @@ public:
//
// Properties Gettr(s) / Setter(s) ...
//
// Inheritance ...
//
// Init all Requirements ...
virtual bool Init(XSCBaseProviderInpts &inputs);
//
// Get Inputs ...
virtual void GetInputs(XSCBaseProviderInpts &inputs);
//
// Set Inputs and Reinitial ...
virtual bool setInputs(XSCBaseProviderInpts &inputs);
//
// DeInit all Requirements ...
virtual void DeInit();
//
virtual void GetMarketConditions(
XSCBaseProviderMarketConditions &conditions, // Market Conditions Result
int barIndex = 0 // Specified Bar Index
);
//
// Check Market For Signal ...
virtual bool HasSignal(
int barIndex,
XSignal &signal, // Hold's Signal if Exists ...
XSCBaseProviderMarketConditions &conditions // Hold's Market Conditions ...
);
//
// Functions ...
+12 -23
View File
@@ -1094,17 +1094,6 @@ public:
);
bool isLong = IsLong(mSignal.type);
//
// Select SL and TP ...
//
double selectedSL = 0;
mSignal.RegularSL(selectedSL);
//
double selectedTP = 0;
mSignal.RegularTP(selectedTP);
//
if (!mSignal.IsValid())
{
@@ -1142,8 +1131,8 @@ public:
mSignal.period,
mSignal.volume,
mSignal.entry,
selectedSL,
selectedTP,
mSignal.sl,
mSignal.tp,
mSignal.comment
//
);
@@ -1156,8 +1145,8 @@ public:
mSignal.period,
mSignal.volume,
mSignal.entry,
selectedSL,
selectedTP,
mSignal.sl,
mSignal.tp,
mSignal.comment
//
);
@@ -1194,8 +1183,8 @@ public:
mSignal.period,
mSignal.volume,
mSignal.entry,
selectedSL,
selectedTP,
mSignal.sl,
mSignal.tp,
lifetime,
expiration,
mSignal.comment
@@ -1210,8 +1199,8 @@ public:
mSignal.period,
mSignal.volume,
mSignal.entry,
selectedSL,
selectedTP,
mSignal.sl,
mSignal.tp,
lifetime,
expiration,
mSignal.comment
@@ -1248,8 +1237,8 @@ public:
mSignal.period,
mSignal.volume,
mSignal.entry,
selectedSL,
selectedTP,
mSignal.sl,
mSignal.tp,
lifetime,
expiration,
mSignal.comment
@@ -1264,8 +1253,8 @@ public:
mSignal.period,
mSignal.volume,
mSignal.entry,
selectedSL,
selectedTP,
mSignal.sl,
mSignal.tp,
lifetime,
expiration,
mSignal.comment