This commit is contained in:
2024-12-16 08:29:07 +03:30
parent 2290e174d8
commit e45fee2729
8 changed files with 6153 additions and 2535 deletions
+83 -92
View File
@@ -455,6 +455,7 @@ struct XPVPivotPoint
// Props ...
double value;
int repetition;
datetime time;
ENUM_XPV_PIVOTS type;
//
@@ -474,6 +475,7 @@ struct XPVPivotPoint
{
//
value = 0;
time = NULL;
repetition = 0;
type = XPV_NONE;
}
@@ -492,6 +494,7 @@ struct XPVPivotPoint
result =
//
value > 0 &&
IsValid(time) &&
repetition > 0 &&
type != XPV_NONE
//
@@ -500,6 +503,44 @@ struct XPVPivotPoint
//
return result;
}
/**
* Check current Pivot Point is Peak or not ...
*
* @return ( bool )
*/
bool IsPeak()
{
//
bool result = false;
//
result = IsValid() &&
type == XPV_PEAK;
//
return result;
}
/**
* Check current Pivot Point is Vale or not ...
*
* @return ( bool )
*/
bool IsVale()
{
//
bool result = false;
//
result = IsValid() &&
type == XPV_VALE;
//
return result;
}
//
};
//
@@ -1967,7 +2008,7 @@ ENUM_X_121_SMC_PROVIDERS ParseProvider(string value)
//
// Custom Providers Conditions ...
struct XTestProiderConditions
struct XSMCStrategySetupConditions
{
//
// Props ...
@@ -1978,49 +2019,29 @@ struct XTestProiderConditions
//
double sl;
ENUM_X_DIRECTION dir;
ENUM_X_POSITION_TYPES type;
//
// Setup Props ...
//
bool isNewPeak;
bool isNewVale;
//
bool hasVisionSupplyZone;
XCSupplyZone *visionSupplyZone;
//
bool hasVisionDemandZone;
XCDemandZone *visionDemandZone;
//
bool hasConsolidationSupportZone;
XCSupportZone *consolidationSupportZone;
//
bool hasConsolidationResistanceZone;
XCResistanceZone *consolidationResistanceZone;
datetime setupTime;
datetime triggerTime;
XConsolidationZone zone;
//
double peak;
double vale;
//
bool hasSamePeaks;
bool hasSameVales;
//
datetime setupTime;
datetime triggerTime;
XPVPivotPoint validPeak;
XPVPivotPoint validVale;
//
// Trigger Props ...
//
// Constructor ...
XTestProiderConditions()
XSMCStrategySetupConditions()
{
Clean();
}
@@ -2035,31 +2056,23 @@ struct XTestProiderConditions
{
//
sl = 0;
peak = 0;
vale = 0;
//
isNewPeak = false;
isNewVale = false;
hasSamePeaks = false;
hasSameVales = false;
hasVisionSupplyZone = false;
hasVisionDemandZone = false;
hasConsolidationSupportZone = false;
hasConsolidationResistanceZone = false;
//
zone.Clean();
dir = X_DIRECTION_NONE;
type = X_POSITION_TYPE_NONE;
//
symbol = NULL;
period = NULL;
triggerTime = NULL;
setupTime = NULL;
visionSupplyZone = NULL;
visionDemandZone = NULL;
consolidationSupportZone = NULL;
consolidationResistanceZone = NULL;
triggerTime = NULL;
//
peak = 0;
vale = 0;
validPeak.Clean();
validVale.Clean();
}
/**
@@ -2069,69 +2082,26 @@ struct XTestProiderConditions
*
* @return ( bool )
*/
bool IsSetuped(
ENUM_X_DIRECTION &dir //
)
bool IsSetuped()
{
//
bool result = false;
//
dir = X_DIRECTION_NONE;
//
result = IsValid(setupTime);
result = IsValid(setupTime) &&
HasDirection(dir);
if (!result)
{
return result;
}
//
bool isBullish =
//
isNewVale &&
hasSamePeaks &&
hasSameVales &&
hasVisionDemandZone &&
visionDemandZone != NULL &&
visionDemandZone.IsValid()
//
;
//
bool isBearish =
//
isNewPeak &&
hasSamePeaks &&
hasSameVales &&
hasVisionSupplyZone &&
visionSupplyZone != NULL &&
visionSupplyZone.IsValid()
//
;
//
result =
isBullish ||
isBearish;
if (!result)
{
return result;
}
//
dir =
isBullish
? X_DIRECTION_BULLISH
: X_DIRECTION_BEARISH;
//
return result;
}
/**
* Detect How we Can Trigger Signal ...
*
*
* @return ( bool )
*/
bool CanTrigger()
@@ -2155,6 +2125,27 @@ struct XTestProiderConditions
return result;
}
//
// Helpers ...
void UpdateZone()
{
//
if (!zone.IsValid() ||
!validPeak.IsValid() ||
!validVale.IsValid())
{
return;
}
//
zone.upper = validPeak.value;
zone.lower = validVale.value;
//
zone.Update();
}
//
};