add support for get verifications from other time frames ...

This commit is contained in:
2024-06-14 09:00:28 +03:30
parent e12f7f72c5
commit 487896a078
3 changed files with 819 additions and 99 deletions
+319 -85
View File
@@ -88,6 +88,9 @@ struct XSignalInfo
bearishScore = 0;
signal.Clean();
conditions.Clean();
//
ResetGrid();
}
//
@@ -320,6 +323,21 @@ struct XSignalInfo
return result;
}
//
// Grid ...
//
double gVolume; // Next Grid Volume
double gEntry; // Next Grid Entry
//
void ResetGrid()
{
//
gEntry = 0;
gVolume = 0;
}
//
};
@@ -730,6 +748,18 @@ public:
mReuiredSignalVerifications = value;
}
//
bool GetVerificationFromOtherTimeFrames()
{
return mGetVerificationFromOtherTimeFrames;
}
//
void GetVerificationFromOtherTimeFrames(bool value)
{
mGetVerificationFromOtherTimeFrames = value;
}
//
int MaxAllowedTrades()
{
@@ -851,6 +881,7 @@ public:
// Current ...
XSignal cSignal;
int cPusher = 0;
bool cHasSignal = false;
string cProvider = NULL;
X121SetupConditions cConditions;
@@ -858,6 +889,7 @@ public:
// Short ...
XSignal sSignal;
int sPusher = 0;
bool sHasSignal = false;
string sProvider = NULL;
X121SetupConditions sConditions;
@@ -865,6 +897,7 @@ public:
// Medium ...
XSignal mSignal;
int mPusher = 0;
bool mHasSignal = false;
string mProvider = NULL;
X121SetupConditions mConditions;
@@ -872,6 +905,7 @@ public:
// Long ...
XSignal lSignal;
int lPusher = 0;
bool lHasSignal = false;
string lProvider = NULL;
X121SetupConditions lConditions;
@@ -879,6 +913,7 @@ public:
// Hind ...
XSignal hSignal;
int hPusher = 0;
bool hHasSignal = false;
string hProvider = NULL;
X121SetupConditions hConditions;
@@ -909,6 +944,13 @@ public:
lSignal.Clean();
hSignal.Clean();
//
cHasSignal = false;
sHasSignal = false;
mHasSignal = false;
lHasSignal = false;
hHasSignal = false;
//
cConditions.Clean();
sConditions.Clean();
@@ -961,7 +1003,7 @@ public:
//
// Parse Conditions for Signal ...
bool hasSignal = signalGenerator.HasSignal(
bool cHasSignal = signalGenerator.HasSignal(
cConditions,
cSignal,
cPusher,
@@ -977,7 +1019,7 @@ public:
);
//
if (hasSignal)
if (cHasSignal)
{
//
mSetups[i].WaitsUntilNextBar(
@@ -1024,7 +1066,7 @@ public:
//
// Parse Conditions for Signal ...
bool hasSignal = signalGenerator.HasSignal(
bool sHasSignal = signalGenerator.HasSignal(
sConditions,
sSignal,
sPusher,
@@ -1039,7 +1081,7 @@ public:
);
//
if (hasSignal)
if (sHasSignal)
{
//
mSetups[i].WaitsUntilNextBar(
@@ -1086,7 +1128,7 @@ public:
//
// Parse Conditions for Signal ...
bool hasSignal = signalGenerator.HasSignal(
bool mHasSignal = signalGenerator.HasSignal(
mConditions,
mSignal,
mPusher,
@@ -1102,7 +1144,7 @@ public:
);
//
if (hasSignal)
if (mHasSignal)
{
//
mSetups[i].WaitsUntilNextBar(
@@ -1149,7 +1191,7 @@ public:
//
// Parse Conditions for Signal ...
bool hasSignal = signalGenerator.HasSignal(
bool lHasSignal = signalGenerator.HasSignal(
lConditions,
lSignal,
lPusher,
@@ -1165,7 +1207,7 @@ public:
);
//
if (hasSignal)
if (lHasSignal)
{
//
mSetups[i].WaitsUntilNextBar(
@@ -1212,7 +1254,7 @@ public:
//
// Parse Conditions for Signal ...
bool hasSignal = signalGenerator.HasSignal(
bool hHasSignal = signalGenerator.HasSignal(
hConditions,
hSignal,
hPusher,
@@ -1228,7 +1270,7 @@ public:
);
//
if (hasSignal)
if (hHasSignal)
{
//
mSetups[i].WaitsUntilNextBar(
@@ -1259,21 +1301,62 @@ public:
if (cPusher >= mReuiredSignalVerifications)
{
//
// Check Final Bullish and Bearish Score ...
bool isScorePassed =
X121SetupConditions otherConditions[];
AddRef(
sConditions,
otherConditions //
);
AddRef(
mConditions,
otherConditions //
);
AddRef(
lConditions,
otherConditions //
);
AddRef(
hConditions,
otherConditions //
);
//
// Check Final Validations ...
bool isValid =
//
true
// isLong
// ? mBearishScore > mBullishScore
// : mBullishScore > mBearishScore
// isLong
// ? mBullishScore > (mBearishScore * 2)
// : mBearishScore > (mBullishScore * 2)
(
//
sHasSignal
//
||
//
mHasSignal
//
||
//
lHasSignal
//
||
//
hHasSignal
//
)
//
||
//
(
//
!mGetVerificationFromOtherTimeFrames
? true
: isLong
? signalGenerator.HasLongVerifications(otherConditions)
: signalGenerator.HasShortVerifications(otherConditions)
//
)
//
;
//
if (isScorePassed)
if (isValid)
{
//
AddRef(
@@ -1312,21 +1395,62 @@ public:
if (sPusher >= mReuiredSignalVerifications)
{
//
// Check Final Bullish and Bearish Score ...
bool isScorePassed =
X121SetupConditions otherConditions[];
AddRef(
cConditions,
otherConditions //
);
AddRef(
mConditions,
otherConditions //
);
AddRef(
lConditions,
otherConditions //
);
AddRef(
hConditions,
otherConditions //
);
//
// Check Final Validations ...
bool isValid =
//
true
// isLong
// ? mBearishScore > mBullishScore
// : mBullishScore > mBearishScore
// isLong
// ? mBullishScore > (mBearishScore * 2)
// : mBearishScore > (mBullishScore * 2)
(
//
cHasSignal
//
||
//
mHasSignal
//
||
//
lHasSignal
//
||
//
hHasSignal
//
)
//
||
//
(
//
!mGetVerificationFromOtherTimeFrames
? true
: isLong
? signalGenerator.HasLongVerifications(otherConditions)
: signalGenerator.HasShortVerifications(otherConditions)
//
)
//
;
//
if (isScorePassed)
if (isValid)
{
//
AddRef(
@@ -1365,21 +1489,62 @@ public:
if (mPusher >= mReuiredSignalVerifications)
{
//
// Check Final Bullish and Bearish Score ...
bool isScorePassed =
X121SetupConditions otherConditions[];
AddRef(
cConditions,
otherConditions //
);
AddRef(
sConditions,
otherConditions //
);
AddRef(
lConditions,
otherConditions //
);
AddRef(
hConditions,
otherConditions //
);
//
// Check Final Validations ...
bool isValid =
//
true
// isLong
// ? mBearishScore > mBullishScore
// : mBullishScore > mBearishScore
// isLong
// ? mBullishScore > (mBearishScore * 2)
// : mBearishScore > (mBullishScore * 2)
(
//
cHasSignal
//
||
//
sHasSignal
//
||
//
lHasSignal
//
||
//
hHasSignal
//
)
//
||
//
(
//
!mGetVerificationFromOtherTimeFrames
? true
: isLong
? signalGenerator.HasLongVerifications(otherConditions)
: signalGenerator.HasShortVerifications(otherConditions)
//
)
//
;
//
if (isScorePassed)
if (isValid)
{
//
AddRef(
@@ -1418,21 +1583,62 @@ public:
if (lPusher >= mReuiredSignalVerifications)
{
//
// Check Final Bullish and Bearish Score ...
bool isScorePassed =
X121SetupConditions otherConditions[];
AddRef(
cConditions,
otherConditions //
);
AddRef(
sConditions,
otherConditions //
);
AddRef(
mConditions,
otherConditions //
);
AddRef(
hConditions,
otherConditions //
);
//
// Check Final Validations ...
bool isValid =
//
true
// isLong
// ? mBearishScore > mBullishScore
// : mBullishScore > mBearishScore
// isLong
// ? mBullishScore > (mBearishScore * 2)
// : mBearishScore > (mBullishScore * 2)
(
//
cHasSignal
//
||
//
sHasSignal
//
||
//
mHasSignal
//
||
//
hHasSignal
//
)
//
||
//
(
//
!mGetVerificationFromOtherTimeFrames
? true
: isLong
? signalGenerator.HasLongVerifications(otherConditions)
: signalGenerator.HasShortVerifications(otherConditions)
//
)
//
;
//
if (isScorePassed)
if (isValid)
{
//
AddRef(
@@ -1471,21 +1677,61 @@ public:
if (hPusher >= mReuiredSignalVerifications)
{
//
// Check Final Bullish and Bearish Score ...
bool isScorePassed =
X121SetupConditions otherConditions[];
AddRef(
cConditions,
otherConditions //
);
AddRef(
sConditions,
otherConditions //
);
AddRef(
mConditions,
otherConditions //
);
AddRef(
lConditions,
otherConditions //
);
//
// Check Final Validations ...
bool isValid =
//
true
// isLong
// ? mBearishScore > mBullishScore
// : mBullishScore > mBearishScore
// isLong
// ? mBullishScore > (mBearishScore * 2)
// : mBearishScore > (mBullishScore * 2)
(
//
cHasSignal
//
||
//
sHasSignal
//
||
//
mHasSignal
//
||
//
lHasSignal
//
) //
||
//
(
//
!mGetVerificationFromOtherTimeFrames
? true
: isLong
? signalGenerator.HasLongVerifications(otherConditions)
: signalGenerator.HasShortVerifications(otherConditions)
//
)
//
;
//
if (isScorePassed)
if (isValid)
{
//
AddRef(
@@ -1506,19 +1752,6 @@ public:
}
}
//
if (mBullishScore == mBearishScore ||
mBullishScore < 10 ||
mBullishScore == 0 ||
mBullishScore > 200 ||
mBearishScore < 10 ||
mBearishScore == 0 ||
mBearishScore > 200)
{
//
// Print("Custom Scores ...");
}
//
// Create Score Summary for Commenting on Chart ...
string scoreSummary =
@@ -1748,18 +1981,19 @@ private:
// Props ...
//
bool mAllowLong; // Allow Long
bool mAllowShort; // Allow Short
double mVolume; // Volume
double mTPPoint; // TP Point
double mSLPoint; // SL Point
bool mUseSupport; // Use Support Signals
bool mIgnoreTP; // Ignore Calculated TP
bool mIgnoreSL; // Ignore Calculated SL
int mMaxAllowedTrades; // Max Alloed Positions
bool mCloseOnOpposit; // Close all Positions on Opposit
int mCloseOnSpecificTime; // Close All Trades in Specific Time
int mReuiredSignalVerifications; // Required Verifications for Validate Signals
bool mAllowLong; // Allow Long
bool mAllowShort; // Allow Short
double mVolume; // Volume
double mTPPoint; // TP Point
double mSLPoint; // SL Point
bool mUseSupport; // Use Support Signals
bool mIgnoreTP; // Ignore Calculated TP
bool mIgnoreSL; // Ignore Calculated SL
int mMaxAllowedTrades; // Max Alloed Positions
bool mCloseOnOpposit; // Close all Positions on Opposit
int mCloseOnSpecificTime; // Close All Trades in Specific Time
int mReuiredSignalVerifications; // Required Verifications for Validate Signals
bool mGetVerificationFromOtherTimeFrames; // Get Verifications from Other Time Frames
//
XSignalInfo mSignalInfos[];