last ...
This commit is contained in:
@@ -470,7 +470,8 @@ struct XPVPivotPoint
|
||||
/**
|
||||
* Cleanup ...
|
||||
*/
|
||||
void Clean() {
|
||||
void Clean()
|
||||
{
|
||||
//
|
||||
value = 0;
|
||||
repetition = 0;
|
||||
@@ -479,19 +480,20 @@ struct XPVPivotPoint
|
||||
|
||||
/**
|
||||
* Validate ...
|
||||
*
|
||||
*
|
||||
* @return ( bool )
|
||||
*/
|
||||
bool IsValid() {
|
||||
bool IsValid()
|
||||
{
|
||||
//
|
||||
bool result = false;
|
||||
|
||||
//
|
||||
result =
|
||||
result =
|
||||
//
|
||||
value > 0 &&
|
||||
repetition > 0 &&
|
||||
type != XPV_NONE
|
||||
type != XPV_NONE
|
||||
//
|
||||
;
|
||||
|
||||
@@ -1965,5 +1967,195 @@ ENUM_X_121_SMC_PROVIDERS ParseProvider(string value)
|
||||
|
||||
//
|
||||
// Custom Providers Conditions ...
|
||||
struct XTestProiderConditions
|
||||
{
|
||||
//
|
||||
// Props ...
|
||||
|
||||
//
|
||||
string symbol;
|
||||
ENUM_TIMEFRAMES period;
|
||||
|
||||
//
|
||||
double sl;
|
||||
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;
|
||||
|
||||
//
|
||||
double peak;
|
||||
double vale;
|
||||
|
||||
//
|
||||
bool hasSamePeaks;
|
||||
bool hasSameVales;
|
||||
|
||||
//
|
||||
datetime setupTime;
|
||||
datetime triggerTime;
|
||||
|
||||
//
|
||||
// Trigger Props ...
|
||||
|
||||
//
|
||||
// Constructor ...
|
||||
XTestProiderConditions()
|
||||
{
|
||||
Clean();
|
||||
}
|
||||
|
||||
//
|
||||
// Tools ...
|
||||
|
||||
/**
|
||||
* Cleaning Up ...
|
||||
*/
|
||||
void Clean()
|
||||
{
|
||||
//
|
||||
sl = 0;
|
||||
peak = 0;
|
||||
vale = 0;
|
||||
|
||||
//
|
||||
isNewPeak = false;
|
||||
isNewVale = false;
|
||||
hasSamePeaks = false;
|
||||
hasSameVales = false;
|
||||
hasVisionSupplyZone = false;
|
||||
hasVisionDemandZone = false;
|
||||
hasConsolidationSupportZone = false;
|
||||
hasConsolidationResistanceZone = false;
|
||||
|
||||
//
|
||||
type = X_POSITION_TYPE_NONE;
|
||||
|
||||
//
|
||||
symbol = NULL;
|
||||
period = NULL;
|
||||
triggerTime = NULL;
|
||||
setupTime = NULL;
|
||||
visionSupplyZone = NULL;
|
||||
visionDemandZone = NULL;
|
||||
consolidationSupportZone = NULL;
|
||||
consolidationResistanceZone = NULL;
|
||||
}
|
||||
|
||||
/**
|
||||
* Check Condition is Setting Up ...
|
||||
*
|
||||
* @param dir: ENUM_X_DIRECTION member, Setting Up Direction ...
|
||||
*
|
||||
* @return ( bool )
|
||||
*/
|
||||
bool IsSetuped(
|
||||
ENUM_X_DIRECTION &dir //
|
||||
)
|
||||
{
|
||||
//
|
||||
bool result = false;
|
||||
|
||||
//
|
||||
dir = X_DIRECTION_NONE;
|
||||
|
||||
//
|
||||
result = IsValid(setupTime);
|
||||
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()
|
||||
{
|
||||
//
|
||||
bool result = false;
|
||||
|
||||
//
|
||||
result =
|
||||
//
|
||||
sl > 0 &&
|
||||
IsValid(symbol) &&
|
||||
IsValid(period) &&
|
||||
IsValid(triggerTime) &&
|
||||
type != X_POSITION_TYPE_ALL &&
|
||||
type != X_POSITION_TYPE_NONE
|
||||
//
|
||||
;
|
||||
|
||||
//
|
||||
return result;
|
||||
}
|
||||
|
||||
//
|
||||
};
|
||||
|
||||
//
|
||||
Reference in New Issue
Block a user