start developing X5 provider and testing it ...

This commit is contained in:
2024-05-19 02:35:48 +03:30
parent 9c6cd61f2b
commit 4c1b97e805
6 changed files with 496 additions and 309 deletions
+195 -3
View File
@@ -84,6 +84,7 @@ class X5ProviderInputs : public XSCBaseProviderInpts
public:
//
// Props ...
XTSInputs tsInputs;
XTMInputs tmInputs;
XLHInputs lhInputs;
XTDInputs tdInputs;
@@ -107,6 +108,11 @@ public:
bool result = false;
//
result = tsInputs.IsValid();
if (!result) {
return result;
}
result = ctInputs.IsValid();
if (!result)
{
@@ -188,6 +194,7 @@ public:
virtual void Clean()
{
//
tsInputs.Clean();
ctInputs.Clean();
ccInputs.Clean();
tmInputs.Clean();
@@ -206,6 +213,7 @@ public:
virtual void Default()
{
//
tsInputs.Default();
ctInputs.Default();
ccInputs.Default();
tmInputs.Default();
@@ -230,6 +238,7 @@ public:
result = MathMax(lhInputs.Max(), tmInputs.Max());
//
result = MathMax(result, tsInputs.Max());
result = MathMax(result, ctInputs.Max());
result = MathMax(result, ccInputs.Max());
result = MathMax(result, tdInputs.Max());
@@ -286,7 +295,7 @@ class X5MarketConditions : public XSCBaseProviderMarketConditions
//
// X5 Provider Class ...
class XSC5Provider : public XSCBaseProvider
class XSCX5Provider : public XSCBaseProvider
{
//
// Public ...
@@ -298,6 +307,8 @@ public:
XSCXTDHelper *tdHelper;
XSCXLHHelper *lhHelper;
XSCXTMHelper *tmHelper;
XSCXCCHelper *ccHelper;
XSCXCTHelper *ctHelper;
XSCXOBDHelper *obdHelper;
XSCXRSIHelper *rsiHelper;
XSCXAMAHelper *amaHelper;
@@ -306,12 +317,24 @@ public:
//
// Constructor ...
XSC5Provider(
XSCX5Provider(
string symbol, // Trading Symbol
ENUM_TIMEFRAMES period // Trading PEriod
) : XSCBaseProvider(symbol, period)
{
//
tsHelper = new XSCXTSHelper();
fiHelper = new XSCXFIHelper();
tdHelper = new XSCXTDHelper();
lhHelper = new XSCXLHHelper();
tmHelper = new XSCXTMHelper();
ccHelper = new XSCXCCHelper();
ctHelper = new XSCXCTHelper();
obdHelper = new XSCXOBDHelper();
rsiHelper = new XSCXRSIHelper();
amaHelper = new XSCXAMAHelper();
chmaHelper = new XSCXCHMAHelper();
chlhHelper = new XSCXCHLHHelper();
}
//
@@ -338,6 +361,162 @@ public:
//
mInputs = inputs;
//
string mSymbol = GetSymbol();
ENUM_TIMEFRAMES mPeriod = GetPeriod();
//
result = tsHelper
.Init(
mSymbol,
mPeriod,
mInputs.tsInputs
//
);
if (!result)
{
return result;
}
//
result = fiHelper
.Init(
mSymbol,
mPeriod,
mInputs.fiInputs
//
);
if (!result)
{
return result;
}
//
result = tdHelper
.Init(
mSymbol,
mPeriod,
mInputs.tdInputs
//
);
if (!result)
{
return result;
}
//
result = lhHelper
.Init(
mSymbol,
mPeriod,
mInputs.lhInputs
//
);
if (!result)
{
return result;
}
//
result = tmHelper
.Init(
mSymbol,
mPeriod,
mInputs.tmInputs
//
);
if (!result)
{
return result;
}
//
result = ccHelper
.Init(
mSymbol,
mPeriod,
mInputs.ccInputs
//
);
if (!result)
{
return result;
}
//
result = ctHelper
.Init(
mSymbol,
mPeriod,
mInputs.ctInputs
//
);
if (!result)
{
return result;
}
//
result = obdHelper
.Init(
mSymbol,
mPeriod,
mInputs.obdInputs
//
);
if (!result)
{
return result;
}
//
result = rsiHelper
.Init(
mSymbol,
mPeriod,
mInputs.rsiInputs
//
);
if (!result)
{
return result;
}
//
result = amaHelper
.Init(
mSymbol,
mPeriod,
mInputs.amaInputs
//
);
if (!result)
{
return result;
}
//
result = chmaHelper
.Init(
mSymbol,
mPeriod,
mInputs.chmaInputs
//
);
if (!result)
{
return result;
}
//
result = chlhHelper
.Init(
mSymbol,
mPeriod,
mInputs.chlhInputs
//
);
//
return result;
}
@@ -346,6 +525,19 @@ public:
// DeInit all Requirements ...
virtual void DeInit()
{
//
delete tsHelper;
delete fiHelper;
delete tdHelper;
delete lhHelper;
delete tmHelper;
delete ccHelper;
delete ctHelper;
delete obdHelper;
delete rsiHelper;
delete amaHelper;
delete chmaHelper;
delete chlhHelper;
}
//
@@ -383,7 +575,7 @@ public:
// Protected ...
protected:
//
// X5MarketConditions mInputs;
X5ProviderInputs mInputs;
//
// Private ...
+3 -20
View File
@@ -133,31 +133,15 @@ public:
//
// Init all Requirements ...
virtual bool Init(XSCBaseProviderInpts &inputs)
{
//
mInputs = inputs;
//
bool result = false;
//
return result;
}
virtual bool Init(XSCBaseProviderInpts &inputs);
//
// Get Inputs ...
virtual void GetInputs(XSCBaseProviderInpts &inputs)
{
inputs = mInputs;
}
virtual void GetInputs(XSCBaseProviderInpts &inputs);
//
// Set Inputs and Reinitial ...
virtual bool setInputs(XSCBaseProviderInpts &inputs)
{
return Init(inputs);
}
virtual bool setInputs(XSCBaseProviderInpts &inputs);
//
// DeInit all Requirements ...
@@ -218,7 +202,6 @@ protected:
//
XMarketCycle mCycle;
XSCBaseProviderInpts mInputs;
//
bool mWaitsUntilNewBar;