add some new conditions to XPV and also implement usage of XRL in setup class ...
This commit is contained in:
@@ -28,6 +28,7 @@
|
||||
#include "../Classes/x-saherelm.xalert.class.mq5"
|
||||
|
||||
//
|
||||
#include "../Helpers/x-saherelm.xrl.helper.mq5"
|
||||
#include "../Helpers/x-saherelm.xmc.helper.mq5"
|
||||
#include "../Helpers/x-saherelm.xpv.helper.mq5"
|
||||
#include "../Helpers/x-saherelm.xtd.helper.mq5"
|
||||
@@ -230,6 +231,7 @@ struct X121SetupInputs
|
||||
|
||||
//
|
||||
// Helpers Inputs ...
|
||||
XRLInputs rlInputs; // XRL Inputs
|
||||
XMCInputs mcInputs; // XMC Inputs
|
||||
XPVInputs pvInputs; // XPV Inputs
|
||||
XTDInputs tdInputs; // XTD Inputs
|
||||
@@ -271,6 +273,7 @@ struct X121SetupInputs
|
||||
bool Init(
|
||||
string _symbol, // Symbol
|
||||
ENUM_TIMEFRAMES _period, // Time Frame
|
||||
XRLInputs &_rlInputs, // XRL Inputs
|
||||
XMCInputs &_mcInputs, // XMC Inputs
|
||||
XPVInputs &_pvInputs, // XPV Inputs
|
||||
XTDInputs &_tdInputs, // XTD Inputs
|
||||
@@ -334,6 +337,7 @@ struct X121SetupInputs
|
||||
period = NULL;
|
||||
|
||||
//
|
||||
rlInputs.Clean();
|
||||
mcInputs.Clean();
|
||||
pvInputs.Clean();
|
||||
tdInputs.Clean();
|
||||
@@ -359,6 +363,7 @@ struct X121SetupInputs
|
||||
void Default()
|
||||
{
|
||||
//
|
||||
rlInputs.Default();
|
||||
mcInputs.Default();
|
||||
pvInputs.Default();
|
||||
tdInputs.Default();
|
||||
@@ -398,6 +403,13 @@ struct X121SetupInputs
|
||||
return result;
|
||||
}
|
||||
|
||||
//
|
||||
result = rlInputs.IsValid();
|
||||
if (!result)
|
||||
{
|
||||
return result;
|
||||
}
|
||||
|
||||
//
|
||||
result = tdInputs.IsValid();
|
||||
if (!result)
|
||||
@@ -541,6 +553,7 @@ struct X121SetupConditions
|
||||
|
||||
//
|
||||
// Conditions ...
|
||||
XRLConditions rlConditions;
|
||||
XMCConditions mcConditions;
|
||||
XPVConditions pvConditions;
|
||||
XTDConditions tdConditions;
|
||||
@@ -585,6 +598,7 @@ struct X121SetupConditions
|
||||
Clean(macdSignal);
|
||||
|
||||
//
|
||||
rlConditions.Clean();
|
||||
mcConditions.Clean();
|
||||
tdConditions.Clean();
|
||||
hkConditions.Clean();
|
||||
@@ -617,6 +631,14 @@ struct X121SetupConditions
|
||||
double tempBullishScore = 0;
|
||||
double tempBearishScore = 0;
|
||||
|
||||
//
|
||||
rlConditions.GenerateScore(
|
||||
tempBullishScore,
|
||||
tempBearishScore //
|
||||
);
|
||||
bullishScore += tempBullishScore;
|
||||
bearishScore += tempBearishScore;
|
||||
|
||||
//
|
||||
mcConditions.GenerateScore(
|
||||
tempBullishScore,
|
||||
@@ -796,6 +818,7 @@ struct X121SetupConditions
|
||||
|
||||
//
|
||||
string pvSummary = pvConditions.GenerateSummary(false, true, false, ignoreFalseConditions);
|
||||
string rlSummary = rlConditions.GenerateSummary(false, true, false, ignoreFalseConditions);
|
||||
string mcSummary = mcConditions.GenerateSummary(false, true, false, ignoreFalseConditions);
|
||||
string tdSummary = tdConditions.GenerateSummary(false, true, false, ignoreFalseConditions);
|
||||
string hkSummary = hkConditions.GenerateSummary(false, true, false, ignoreFalseConditions);
|
||||
@@ -817,6 +840,7 @@ struct X121SetupConditions
|
||||
string conditionsStr =
|
||||
//
|
||||
pvSummary + separator +
|
||||
rlSummary + separator +
|
||||
mcSummary + separator +
|
||||
tdSummary + separator +
|
||||
hkSummary + separator +
|
||||
@@ -2131,7 +2155,7 @@ struct X121SignalGenerator
|
||||
// XICH ...
|
||||
conditions.ichConditions.isClosedOverKijunSen &&
|
||||
(conditions.ichConditions.isTenkanSenOverKijunSen ||
|
||||
conditions.ichConditions.isTenkanSenCrossedOverKijunSen)
|
||||
conditions.ichConditions.isTenkanSenCrossedOverKijunSen)
|
||||
//
|
||||
)
|
||||
//
|
||||
@@ -3860,6 +3884,7 @@ class XSCX121Setup : public XSCBaseAlert
|
||||
public:
|
||||
//
|
||||
// Props ...
|
||||
XSCXRLHelper *rlHelper;
|
||||
XSCXMCHelper *mcHelper;
|
||||
XSCXPVHelper *pvHelper;
|
||||
XSCXTDHelper *tdHelper;
|
||||
@@ -3888,6 +3913,7 @@ public:
|
||||
void ~XSCX121Setup()
|
||||
{
|
||||
//
|
||||
delete rlHelper;
|
||||
delete mcHelper;
|
||||
delete pvHelper;
|
||||
delete tdHelper;
|
||||
@@ -3959,6 +3985,19 @@ public:
|
||||
return result;
|
||||
}
|
||||
|
||||
//
|
||||
// XRL ...
|
||||
rlHelper = new XSCXRLHelper();
|
||||
result = rlHelper.Init(
|
||||
inputs.symbol,
|
||||
inputs.period,
|
||||
inputs.rlInputs //
|
||||
);
|
||||
if (!result)
|
||||
{
|
||||
return result;
|
||||
}
|
||||
|
||||
//
|
||||
// XSLN ...
|
||||
slnHelper = new XSCXSLNHelper();
|
||||
@@ -4216,6 +4255,17 @@ public:
|
||||
conditions.period = GetPeriod();
|
||||
conditions.time = TimeCurrent();
|
||||
|
||||
//
|
||||
result = rlHelper.GetConditions(
|
||||
conditions.rlConditions,
|
||||
barIndex,
|
||||
loopback //
|
||||
);
|
||||
if (!result)
|
||||
{
|
||||
return result;
|
||||
}
|
||||
|
||||
//
|
||||
result = hdtHelper.GetConditions(
|
||||
conditions.htdConditions,
|
||||
|
||||
Reference in New Issue
Block a user