attach conditions to x121 conditions ...
This commit is contained in:
@@ -22,10 +22,7 @@
|
||||
//
|
||||
// Imports ...
|
||||
#include "../../Classes/x-saherelm.base.class.mq5"
|
||||
#include "../../Helpers/x-saherelm.x3ma.helper.mq5"
|
||||
#include "../../Helpers/x-saherelm.x3vwap.helper.mq5"
|
||||
#include "../../Helpers/x-saherelm.xchsar.helper.mq5"
|
||||
#include "../../Helpers/x-saherelm.xpv.helper.mq5"
|
||||
#include "../../Helpers/x-saherelm.x121.helper.mq5"
|
||||
#include "../../Libraries/x-saherelm.common.lib.mq5"
|
||||
#include "../../Libraries/x-saherelm.x-poi.lib.mq5"
|
||||
#include "../../Libraries/x-saherelm.x-trade.lib.mq5"
|
||||
@@ -436,10 +433,7 @@ struct X121SMCCycleConditions
|
||||
datetime time;
|
||||
|
||||
//
|
||||
XPVConditions xpvConditions;
|
||||
X3MAConditions x3maConditions;
|
||||
X3VWAPConditions x3vwapConditions;
|
||||
XCHSARConditions xchsarConditions;
|
||||
X121Conditions x121Conditions;
|
||||
|
||||
//
|
||||
XPOIState state;
|
||||
@@ -465,10 +459,7 @@ struct X121SMCCycleConditions
|
||||
|
||||
//
|
||||
state.Clean();
|
||||
xpvConditions.Clean();
|
||||
x3maConditions.Clean();
|
||||
x3vwapConditions.Clean();
|
||||
xchsarConditions.Clean();
|
||||
x121Conditions.Clean();
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -492,94 +483,6 @@ struct X121SMCCycleConditions
|
||||
return result;
|
||||
}
|
||||
|
||||
/**
|
||||
* Check Cycle Conditions Has Bullish State ...
|
||||
*
|
||||
* @param bar: XOHCL instance ...
|
||||
*
|
||||
* @return ( bool )
|
||||
*/
|
||||
bool IsBullish(
|
||||
XOHCL &bar //
|
||||
)
|
||||
{
|
||||
//
|
||||
bool result = false;
|
||||
|
||||
//
|
||||
int index = bar.Index();
|
||||
|
||||
//
|
||||
result =
|
||||
//
|
||||
// Check Conditions Validation ...
|
||||
IsValid() &&
|
||||
//
|
||||
// Check Bar Validation ...
|
||||
bar.IsValid() &&
|
||||
//
|
||||
// Check XCHSar Current is Bullish ...
|
||||
xchsarConditions.isCBullish &&
|
||||
//
|
||||
// Check X3VWAP is Bullish State ...
|
||||
x3vwapConditions.isBullishState &&
|
||||
//
|
||||
// Check X3VWAP is Bullish Ordered ...
|
||||
x3vwapConditions.isBullishOrdered &&
|
||||
//
|
||||
// Check Close Over X3MA Fast ...
|
||||
bar.close > x3maConditions.fasts[index]
|
||||
//
|
||||
;
|
||||
|
||||
//
|
||||
return result;
|
||||
}
|
||||
|
||||
/**
|
||||
* Check Cycle Conditions Has Bearish State ...
|
||||
*
|
||||
* @param bar: XOHCL instance ...
|
||||
*
|
||||
* @return ( bool )
|
||||
*/
|
||||
bool IsBearish(
|
||||
XOHCL &bar //
|
||||
)
|
||||
{
|
||||
//
|
||||
bool result = false;
|
||||
|
||||
//
|
||||
int index = bar.Index();
|
||||
|
||||
//
|
||||
result =
|
||||
//
|
||||
// Check Conditions Validation ...
|
||||
IsValid() &&
|
||||
//
|
||||
// Check Bar Validation ...
|
||||
bar.IsValid() &&
|
||||
//
|
||||
// Check XCHSar Current is Bearish ...
|
||||
xchsarConditions.isCBearish &&
|
||||
//
|
||||
// Check X3VWAP is Bearish State ...
|
||||
x3vwapConditions.isBearishState &&
|
||||
//
|
||||
// Check X3VWAP is Bearish Ordered ...
|
||||
x3vwapConditions.isBearishOrdered &&
|
||||
//
|
||||
// Check Close Under X3MA Fast ...
|
||||
bar.close < x3maConditions.fasts[index]
|
||||
//
|
||||
;
|
||||
|
||||
//
|
||||
return result;
|
||||
}
|
||||
|
||||
//
|
||||
// Reporter Functions ...
|
||||
|
||||
@@ -607,15 +510,6 @@ struct X121SMCCycleConditions
|
||||
//
|
||||
double bullScore = 0;
|
||||
double bearScore = 0;
|
||||
|
||||
// //
|
||||
// // XPV ...
|
||||
// pvConditions.GenerateScore(
|
||||
// bullScore,
|
||||
// bearScore //
|
||||
// );
|
||||
// bullishScore += bullScore;
|
||||
// bearishScore += bearScore;
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -656,19 +550,9 @@ struct X121SMCCycleConditions
|
||||
true //
|
||||
);
|
||||
|
||||
// //
|
||||
// // XPV ...
|
||||
// string pvStr = pvConditions.GenerateSummary(
|
||||
// false,
|
||||
// true,
|
||||
// false,
|
||||
// ignoreFalseConditions //
|
||||
// );
|
||||
|
||||
//
|
||||
string conditionsStr =
|
||||
//
|
||||
// pvStr + separator +
|
||||
""
|
||||
//
|
||||
;
|
||||
@@ -805,182 +689,6 @@ struct X121SMCStrategyConditions
|
||||
return result;
|
||||
}
|
||||
|
||||
/**
|
||||
* Check Conditions has Ddirection or not ...
|
||||
*
|
||||
* @param dir: ENUM_X_DIRECTIOn member ...
|
||||
* @param bar: XOHCL instance ...
|
||||
*
|
||||
* @return ( bool )
|
||||
*/
|
||||
bool HasDirection(
|
||||
ENUM_X_DIRECTION &dir,
|
||||
XOHCL &bar //
|
||||
)
|
||||
{
|
||||
//
|
||||
bool result = false;
|
||||
|
||||
//
|
||||
dir = X_DIRECTION_NONE;
|
||||
|
||||
//
|
||||
result = IsValid() &&
|
||||
bar.IsValid() &&
|
||||
bar.Index() > 0;
|
||||
if (!result)
|
||||
{
|
||||
return result;
|
||||
}
|
||||
|
||||
//
|
||||
int index = bar.Index();
|
||||
|
||||
//
|
||||
// Parse Cycles Conditions ...
|
||||
|
||||
//
|
||||
// Vision ...
|
||||
|
||||
//
|
||||
bool isVisionBullish =
|
||||
//
|
||||
// XCHSar Current is Bullish ...
|
||||
visionConditions.xchsarConditions.isCBullish &&
|
||||
//
|
||||
// Close Over X3MA Fast ...
|
||||
bar.close > visionConditions.x3maConditions.fasts[index] &&
|
||||
//
|
||||
// X3VWap Fast is Bullish ...
|
||||
visionConditions.x3vwapConditions.fastStates[index] ==
|
||||
X3VWAP_STATE_BULLISH
|
||||
//
|
||||
;
|
||||
|
||||
//
|
||||
bool isVisionBearish =
|
||||
//
|
||||
// XCHSar Current is Bearish ...
|
||||
visionConditions.xchsarConditions.isCBearish &&
|
||||
//
|
||||
// Close Under X3MA Fast ...
|
||||
bar.close < visionConditions.x3maConditions.fasts[index] &&
|
||||
//
|
||||
// X3VWap Fast is Bearish ...
|
||||
visionConditions.x3vwapConditions.fastStates[index] ==
|
||||
X3VWAP_STATE_BEARISH
|
||||
//
|
||||
;
|
||||
|
||||
//
|
||||
// Check Vision Has Conditions or not ...
|
||||
bool hasVisionConditions =
|
||||
isVisionBullish ||
|
||||
isVisionBearish;
|
||||
result = hasVisionConditions;
|
||||
if (!result)
|
||||
{
|
||||
return result;
|
||||
}
|
||||
|
||||
//
|
||||
// Consolidation ...
|
||||
|
||||
//
|
||||
bool isConsolidationBullish = consolidationConditions.IsBullish(bar);
|
||||
bool isConsolidationBearish = consolidationConditions.IsBearish(bar);
|
||||
bool hasConsolidationConditions =
|
||||
isConsolidationBullish ||
|
||||
isConsolidationBearish;
|
||||
result = hasConsolidationConditions;
|
||||
if (!result)
|
||||
{
|
||||
return result;
|
||||
}
|
||||
|
||||
//
|
||||
// Verification ...
|
||||
|
||||
//
|
||||
bool isVerificationBullish = verificationConditions.IsBullish(bar);
|
||||
bool isVerificationBearish = verificationConditions.IsBearish(bar);
|
||||
bool hasVerificationConditions =
|
||||
isVerificationBullish ||
|
||||
isVerificationBearish;
|
||||
result = hasVerificationConditions;
|
||||
if (!result)
|
||||
{
|
||||
return result;
|
||||
}
|
||||
|
||||
//
|
||||
// Analyse ...
|
||||
|
||||
//
|
||||
bool isAnalyseBullish = analyseConditions.IsBullish(bar);
|
||||
bool isAnalyseBearish = analyseConditions.IsBearish(bar);
|
||||
bool hasAnalyseConditions =
|
||||
isAnalyseBullish ||
|
||||
isAnalyseBearish;
|
||||
result = hasAnalyseConditions;
|
||||
if (!result)
|
||||
{
|
||||
return result;
|
||||
}
|
||||
|
||||
//
|
||||
// Decision ...
|
||||
|
||||
//
|
||||
bool isDecisionBullish = decisionConditions.IsBullish(bar);
|
||||
bool isDecisionBearish = decisionConditions.IsBearish(bar);
|
||||
bool hasDecisionConditions =
|
||||
isDecisionBullish ||
|
||||
isDecisionBearish;
|
||||
result = hasDecisionConditions;
|
||||
if (!result)
|
||||
{
|
||||
return result;
|
||||
}
|
||||
|
||||
//
|
||||
// Analyse Conditions ...
|
||||
bool hasBullishConditions =
|
||||
//
|
||||
isVisionBullish &&
|
||||
isConsolidationBullish &&
|
||||
isVerificationBullish &&
|
||||
isAnalyseBullish &&
|
||||
isDecisionBullish
|
||||
//
|
||||
;
|
||||
bool hasBearishConditions =
|
||||
//
|
||||
isVisionBearish &&
|
||||
isConsolidationBearish &&
|
||||
isVerificationBearish &&
|
||||
isAnalyseBearish &&
|
||||
isDecisionBearish
|
||||
//
|
||||
;
|
||||
result = hasBullishConditions ||
|
||||
hasBearishConditions;
|
||||
if (!result)
|
||||
{
|
||||
return result;
|
||||
}
|
||||
|
||||
//
|
||||
// Specified Conditions Direction ...
|
||||
dir =
|
||||
hasBullishConditions
|
||||
? X_DIRECTION_BULLISH
|
||||
: X_DIRECTION_BEARISH;
|
||||
|
||||
//
|
||||
return result;
|
||||
}
|
||||
|
||||
//
|
||||
// Reporter Functions ...
|
||||
|
||||
@@ -1008,15 +716,6 @@ struct X121SMCStrategyConditions
|
||||
//
|
||||
double bullScore = 0;
|
||||
double bearScore = 0;
|
||||
|
||||
// //
|
||||
// // XPV ...
|
||||
// pvConditions.GenerateScore(
|
||||
// bullScore,
|
||||
// bearScore //
|
||||
// );
|
||||
// bullishScore += bullScore;
|
||||
// bearishScore += bearScore;
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -1057,19 +756,9 @@ struct X121SMCStrategyConditions
|
||||
true //
|
||||
);
|
||||
|
||||
// //
|
||||
// // XPV ...
|
||||
// string pvStr = pvConditions.GenerateSummary(
|
||||
// false,
|
||||
// true,
|
||||
// false,
|
||||
// ignoreFalseConditions //
|
||||
// );
|
||||
|
||||
//
|
||||
string conditionsStr =
|
||||
//
|
||||
// pvStr + separator +
|
||||
""
|
||||
//
|
||||
;
|
||||
|
||||
Reference in New Issue
Block a user