Last Works ...
This commit is contained in:
@@ -54,30 +54,36 @@ struct X121SMCStrategyConditions
|
||||
// Conditions ...
|
||||
|
||||
//
|
||||
XOHCL swingHigh;
|
||||
XZone supplyZone;
|
||||
XZone bearishOrderBlock;
|
||||
XZone bearishFVG;
|
||||
XOHCL resistance;
|
||||
XZone bearishOrderBlock;
|
||||
XOHCL bullishMomentumBar;
|
||||
XOHCL bullishRejectionBar;
|
||||
|
||||
//
|
||||
XZone bearishOrderBlocks[];
|
||||
XZone demandZones[];
|
||||
XZone bearishFVGs[];
|
||||
|
||||
//
|
||||
XZone bearishOrderBlocks[];
|
||||
XOHCL swingHighs[];
|
||||
XOHCL resistances[];
|
||||
XOHCL bearishMomentumBars[];
|
||||
XOHCL bearishRejectionBars[];
|
||||
|
||||
//
|
||||
XOHCL support;
|
||||
XOHCL swingLow;
|
||||
XZone demandZone;
|
||||
XZone bullishOrderBlock;
|
||||
XZone bullishFVG;
|
||||
XZone bullishOrderBlock;
|
||||
XOHCL bearishMomentumBar;
|
||||
XOHCL bearishRejectionBar;
|
||||
|
||||
//
|
||||
XZone bullishOrderBlocks[];
|
||||
XZone supplyZones[];
|
||||
XZone bullishFVGs[];
|
||||
|
||||
//
|
||||
XZone bullishOrderBlocks[];
|
||||
XOHCL supports[];
|
||||
XOHCL swingLows[];
|
||||
XOHCL bullishMomentumBars[];
|
||||
@@ -93,8 +99,9 @@ struct X121SMCStrategyConditions
|
||||
//
|
||||
// Tools ...
|
||||
|
||||
//
|
||||
// Cleanup ...
|
||||
/**
|
||||
* Cleanup ...
|
||||
*/
|
||||
void Clean()
|
||||
{
|
||||
//
|
||||
@@ -103,99 +110,63 @@ struct X121SMCStrategyConditions
|
||||
time = NULL;
|
||||
|
||||
//
|
||||
supplyZone.Clean();
|
||||
bearishFVG.Clean();
|
||||
bearishOrderBlock.Clean();
|
||||
|
||||
//
|
||||
Clean(bearishFVGs);
|
||||
Clean(bearishOrderBlocks);
|
||||
|
||||
//
|
||||
demandZone.Clean();
|
||||
bullishFVG.Clean();
|
||||
bullishOrderBlock.Clean();
|
||||
|
||||
//
|
||||
Clean(bullishFVGs);
|
||||
Clean(bullishOrderBlocks);
|
||||
|
||||
//
|
||||
Clean(swingHighs);
|
||||
Clean(resistances);
|
||||
Clean(bearishMomentumBars);
|
||||
Clean(bearishRejectionBars);
|
||||
|
||||
//
|
||||
Clean(swingLows);
|
||||
Clean(supports);
|
||||
Clean(bullishMomentumBars);
|
||||
Clean(bullishRejectionBars);
|
||||
CleanDemand();
|
||||
CleanSupply();
|
||||
}
|
||||
|
||||
/**
|
||||
* Cleanup Demand Related ...
|
||||
*/
|
||||
void CleanDemand()
|
||||
{
|
||||
//
|
||||
support.Clean();
|
||||
swingLow.Clean();
|
||||
demandZone.Clean();
|
||||
bullishFVG.Clean();
|
||||
bullishOrderBlock.Clean();
|
||||
bullishMomentumBar.Clean();
|
||||
bullishRejectionBar.Clean();
|
||||
|
||||
//
|
||||
Clean(supports);
|
||||
Clean(swingLows);
|
||||
Clean(supplyZones);
|
||||
Clean(bullishFVGs);
|
||||
Clean(bullishOrderBlocks);
|
||||
Clean(bullishMomentumBars);
|
||||
Clean(bullishRejectionBars);
|
||||
}
|
||||
|
||||
/**
|
||||
* Cleanup Supply Related ...
|
||||
*/
|
||||
void CleanSupply()
|
||||
{
|
||||
//
|
||||
swingHigh.Clean();
|
||||
supplyZone.Clean();
|
||||
bearishFVG.Clean();
|
||||
resistance.Clean();
|
||||
bearishOrderBlock.Clean();
|
||||
bearishMomentumBar.Clean();
|
||||
bearishRejectionBar.Clean();
|
||||
|
||||
//
|
||||
Clean(swingHighs);
|
||||
Clean(resistances);
|
||||
Clean(demandZones);
|
||||
Clean(bearishFVGs);
|
||||
Clean(resistances);
|
||||
Clean(bearishOrderBlocks);
|
||||
Clean(bearishMomentumBars);
|
||||
Clean(bearishRejectionBars);
|
||||
}
|
||||
|
||||
bool ValidateSupply()
|
||||
{
|
||||
//
|
||||
bool result = false;
|
||||
|
||||
//
|
||||
result = IsValid();
|
||||
if (!result)
|
||||
{
|
||||
return result;
|
||||
}
|
||||
|
||||
//
|
||||
result =
|
||||
//
|
||||
supplyZone.IsValid() &&
|
||||
bearishFVG.IsValid() &&
|
||||
bearishOrderBlock.IsValid() &&
|
||||
(ArraySize(swingHighs) > 0 ||
|
||||
ArraySize(bearishFVGs) > 0 ||
|
||||
ArraySize(resistances) > 0 ||
|
||||
ArraySize(bearishOrderBlocks) > 0 ||
|
||||
ArraySize(bearishMomentumBars) > 0 ||
|
||||
ArraySize(bearishRejectionBars) > 0)
|
||||
//
|
||||
;
|
||||
|
||||
//
|
||||
return result;
|
||||
}
|
||||
|
||||
/**
|
||||
* Validate Demand ...
|
||||
*
|
||||
* @return ( bool )
|
||||
*/
|
||||
bool ValidateDemand()
|
||||
{
|
||||
//
|
||||
@@ -211,11 +182,17 @@ struct X121SMCStrategyConditions
|
||||
//
|
||||
result =
|
||||
//
|
||||
support.IsValid() &&
|
||||
swingLow.IsValid() &&
|
||||
demandZone.IsValid() &&
|
||||
bullishFVG.IsValid() &&
|
||||
bullishOrderBlock.IsValid() &&
|
||||
bullishMomentumBar.IsValid() &&
|
||||
bullishRejectionBar.IsValid() &&
|
||||
//
|
||||
(ArraySize(supports) > 0 ||
|
||||
ArraySize(swingLows) > 0 ||
|
||||
ArraySize(supplyZones) > 0 ||
|
||||
ArraySize(bullishFVGs) > 0 ||
|
||||
ArraySize(bullishOrderBlocks) > 0 ||
|
||||
ArraySize(bullishMomentumBars) > 0 ||
|
||||
@@ -227,6 +204,48 @@ struct X121SMCStrategyConditions
|
||||
return result;
|
||||
}
|
||||
|
||||
/**
|
||||
* Validate Supply ...
|
||||
*
|
||||
* @return ( bool )
|
||||
*/
|
||||
bool ValidateSupply()
|
||||
{
|
||||
//
|
||||
bool result = false;
|
||||
|
||||
//
|
||||
result = IsValid();
|
||||
if (!result)
|
||||
{
|
||||
return result;
|
||||
}
|
||||
|
||||
//
|
||||
result =
|
||||
//
|
||||
swingHigh.IsValid() &&
|
||||
supplyZone.IsValid() &&
|
||||
bearishFVG.IsValid() &&
|
||||
resistance.IsValid() &&
|
||||
bearishOrderBlock.IsValid() &&
|
||||
bearishMomentumBar.IsValid() &&
|
||||
bearishRejectionBar.IsValid() &&
|
||||
//
|
||||
(ArraySize(swingHighs) > 0 ||
|
||||
ArraySize(demandZones) > 0 ||
|
||||
ArraySize(bearishFVGs) > 0 ||
|
||||
ArraySize(resistances) > 0 ||
|
||||
ArraySize(bearishOrderBlocks) > 0 ||
|
||||
ArraySize(bearishMomentumBars) > 0 ||
|
||||
ArraySize(bearishRejectionBars) > 0)
|
||||
//
|
||||
;
|
||||
|
||||
//
|
||||
return result;
|
||||
}
|
||||
|
||||
//
|
||||
// Validate ...
|
||||
bool IsValid()
|
||||
@@ -650,4 +669,188 @@ struct XRange
|
||||
//
|
||||
};
|
||||
|
||||
//
|
||||
struct XRangeStructure
|
||||
{
|
||||
//
|
||||
XRange range;
|
||||
|
||||
//
|
||||
XZone demandZones[];
|
||||
XZone supplyZones[];
|
||||
|
||||
//
|
||||
XZone bearishOrderBlocks[];
|
||||
XZone bearishFVGs[];
|
||||
|
||||
//
|
||||
XOHCL swingHighs[];
|
||||
XOHCL resistances[];
|
||||
XOHCL bearishMomentumBars[];
|
||||
XOHCL bearishRejectionBars[];
|
||||
|
||||
//
|
||||
XZone bullishOrderBlocks[];
|
||||
XZone bullishFVGs[];
|
||||
|
||||
//
|
||||
XOHCL supports[];
|
||||
XOHCL swingLows[];
|
||||
XOHCL bullishMomentumBars[];
|
||||
XOHCL bullishRejectionBars[];
|
||||
|
||||
//
|
||||
// Constructor ...
|
||||
void XRangeStructure()
|
||||
{
|
||||
Clean();
|
||||
}
|
||||
|
||||
//
|
||||
// Tools ...
|
||||
|
||||
/**
|
||||
* Cleanup ...
|
||||
*/
|
||||
void Clean()
|
||||
{
|
||||
//
|
||||
range.Clean();
|
||||
|
||||
//
|
||||
Clean(supports);
|
||||
Clean(swingLows);
|
||||
Clean(swingHighs);
|
||||
Clean(demandZones);
|
||||
Clean(supplyZones);
|
||||
Clean(bearishFVGs);
|
||||
Clean(resistances);
|
||||
Clean(bullishFVGs);
|
||||
Clean(bearishOrderBlocks);
|
||||
Clean(bullishOrderBlocks);
|
||||
Clean(bearishMomentumBars);
|
||||
Clean(bearishRejectionBars);
|
||||
Clean(bullishMomentumBars);
|
||||
Clean(bullishRejectionBars);
|
||||
}
|
||||
|
||||
/**
|
||||
* Validate ...
|
||||
*
|
||||
* @return ( bool )
|
||||
*/
|
||||
bool IsValid()
|
||||
{
|
||||
//
|
||||
bool result = false;
|
||||
|
||||
//
|
||||
result = range.IsValid();
|
||||
if (!result)
|
||||
{
|
||||
return result;
|
||||
}
|
||||
|
||||
//
|
||||
result =
|
||||
//
|
||||
ArraySize(supports) > 0 ||
|
||||
ArraySize(swingLows) > 0 ||
|
||||
ArraySize(swingHighs) > 0 ||
|
||||
ArraySize(demandZones) > 0 ||
|
||||
ArraySize(supplyZones) > 0 ||
|
||||
ArraySize(bearishFVGs) > 0 ||
|
||||
ArraySize(resistances) > 0 ||
|
||||
ArraySize(bullishFVGs) > 0 ||
|
||||
ArraySize(bearishOrderBlocks) > 0 ||
|
||||
ArraySize(bullishOrderBlocks) > 0 ||
|
||||
ArraySize(bearishMomentumBars) > 0 ||
|
||||
ArraySize(bearishRejectionBars) > 0 ||
|
||||
ArraySize(bullishMomentumBars) > 0 ||
|
||||
ArraySize(bullishRejectionBars) > 0
|
||||
//
|
||||
;
|
||||
|
||||
//
|
||||
return result;
|
||||
}
|
||||
|
||||
/**
|
||||
* Generate Tag ...
|
||||
*
|
||||
* @return ( string )
|
||||
*/
|
||||
string GetTag()
|
||||
{
|
||||
//
|
||||
string result = NULL;
|
||||
|
||||
//
|
||||
string hash = range.GetTag();
|
||||
hash = ToMD5(hash);
|
||||
|
||||
//
|
||||
result = X121SMCMarketStructureToken + "_" + hash;
|
||||
|
||||
//
|
||||
return result;
|
||||
}
|
||||
};
|
||||
|
||||
/**
|
||||
* Check a Zone is Between to other Zones ...
|
||||
*
|
||||
* @param source: XZone instance ...
|
||||
* @param upper: XZone instance ...
|
||||
* @param lower: XZone instance ...
|
||||
*
|
||||
* @return ( bool )
|
||||
*/
|
||||
bool IsBetween(
|
||||
XZone &source,
|
||||
XRange &range //
|
||||
)
|
||||
{
|
||||
//
|
||||
bool result = false;
|
||||
|
||||
//
|
||||
result = source.IsValid() &&
|
||||
range.IsValid();
|
||||
if (!result)
|
||||
{
|
||||
return result;
|
||||
}
|
||||
|
||||
//
|
||||
result = source.upper <= range.upper &&
|
||||
source.lower >= range.lower;
|
||||
|
||||
//
|
||||
return result;
|
||||
}
|
||||
bool IsBetween(
|
||||
XOHCL &source,
|
||||
XRange &range //
|
||||
)
|
||||
{
|
||||
//
|
||||
bool result = false;
|
||||
|
||||
//
|
||||
result = source.IsValid() &&
|
||||
range.IsValid();
|
||||
if (!result)
|
||||
{
|
||||
return result;
|
||||
}
|
||||
|
||||
//
|
||||
result = source.high <= range.upper &&
|
||||
source.low >= range.lower;
|
||||
|
||||
//
|
||||
return result;
|
||||
}
|
||||
|
||||
//
|
||||
Reference in New Issue
Block a user