This commit is contained in:
2025-03-01 04:52:23 +03:30
parent c3bc38befb
commit 1d554ec21d
5 changed files with 882 additions and 429 deletions
+460 -364
View File
@@ -630,6 +630,16 @@ struct X121SMCStrategyXWZWorkingZone
continue;
}
//
// Checking Price Validation ...
has = cBar.high < tmpSupplies[i].Lower();
if (!has)
{
//
iBox.Clean();
continue;
}
//
Add(
tmpSupplies[i],
@@ -718,6 +728,16 @@ struct X121SMCStrategyXWZWorkingZone
continue;
}
//
// Checking Price Validation ...
has = cBar.low > tmpDemands[i].Upper();
if (!has)
{
//
iBox.Clean();
continue;
}
//
Add(
tmpDemands[i],
@@ -728,7 +748,7 @@ struct X121SMCStrategyXWZWorkingZone
iBox.Clean();
}
}
Clean(demandZones);
Clean(tmpDemands);
//
// Support Zones ...
@@ -806,6 +826,16 @@ struct X121SMCStrategyXWZWorkingZone
continue;
}
//
// Checking Price Validation ...
has = cBar.low > tmpSupports[i].Upper();
if (!has)
{
//
iBox.Clean();
continue;
}
//
Add(
tmpSupports[i],
@@ -894,6 +924,16 @@ struct X121SMCStrategyXWZWorkingZone
continue;
}
//
// Checking Price Validation ...
has = cBar.high < tmpResistances[i].Lower();
if (!has)
{
//
iBox.Clean();
continue;
}
//
Add(
tmpResistances[i],
@@ -909,353 +949,397 @@ struct X121SMCStrategyXWZWorkingZone
//
// STF TTF ...
//
// Supply Zones ...
count = stfState.FilterSupplyZones(
tmpSupplies,
NULL,
XZONE_STATE_PASSED,
false,
XZONE_STATE_FAILED,
false,
XZONE_STATE_FAILED,
false,
XZONE_STATE_IGNORED,
false //
);
has = IsValidSize(count);
if (has)
{
//
for (int i = 0; i < count; i++)
{
//
XBoxZone iBox;
has = ToBox(
iBox,
tmpSupplies[i] //
);
if (!has)
{
//
iBox.Clean();
continue;
}
// //
// // Supply Zones ...
// count = stfState.FilterSupplyZones(
// tmpSupplies,
// NULL,
// XZONE_STATE_PASSED,
// false,
// XZONE_STATE_FAILED,
// false,
// XZONE_STATE_FAILED,
// false,
// XZONE_STATE_IGNORED,
// false //
// );
// has = IsValidSize(count);
// if (has)
// {
// //
// for (int i = 0; i < count; i++)
// {
// //
// XBoxZone iBox;
// has = ToBox(
// iBox,
// tmpSupplies[i] //
// );
// if (!has)
// {
// //
// iBox.Clean();
// continue;
// }
//
// Find Index ...
// //
// // Find Index ...
//
idx = FindIndex(
iBox,
insideBoxes //
);
has = !IsValidIndex(idx);
if (!has)
{
//
iBox.Clean();
continue;
}
// //
// idx = FindIndex(
// iBox,
// insideBoxes //
// );
// has = !IsValidIndex(idx);
// if (!has)
// {
// //
// iBox.Clean();
// continue;
// }
//
idx = FindIndex(
iBox,
breakedBoxes //
);
has = !IsValidIndex(idx);
if (!has)
{
//
iBox.Clean();
continue;
}
// //
// idx = FindIndex(
// iBox,
// breakedBoxes //
// );
// has = !IsValidIndex(idx);
// if (!has)
// {
// //
// iBox.Clean();
// continue;
// }
//
idx = FindIndex(
tmpSupplies[i],
supplyZones //
);
has = !IsValidIndex(idx);
if (!has)
{
//
iBox.Clean();
continue;
}
// //
// idx = FindIndex(
// tmpSupplies[i],
// supplyZones //
// );
// has = !IsValidIndex(idx);
// if (!has)
// {
// //
// iBox.Clean();
// continue;
// }
//
Add(
tmpSupplies[i],
supplyZones //
);
// //
// // Checking Price Validation ...
// has = cBar.high < tmpSupplies[i].Lower();
// if (!has)
// {
// //
// iBox.Clean();
// continue;
// }
//
iBox.Clean();
}
}
Clean(tmpSupplies);
// //
// Add(
// tmpSupplies[i],
// supplyZones //
// );
// //
// iBox.Clean();
// }
// }
// Clean(tmpSupplies);
// //
// // Demand Zones ...
// count = stfState.FilterDemandZones(
// tmpDemands,
// NULL,
// XZONE_STATE_PASSED,
// false,
// XZONE_STATE_FAILED,
// false,
// XZONE_STATE_FAILED,
// false,
// XZONE_STATE_IGNORED,
// false //
// );
// has = IsValidSize(count);
// if (has)
// {
// //
// for (int i = 0; i < count; i++)
// {
// //
// XBoxZone iBox;
// has = ToBox(
// iBox,
// tmpDemands[i] //
// );
// if (!has)
// {
// //
// iBox.Clean();
// continue;
// }
// //
// // Find Index ...
// //
// idx = FindIndex(
// iBox,
// insideBoxes //
// );
// has = !IsValidIndex(idx);
// if (!has)
// {
// //
// iBox.Clean();
// continue;
// }
// //
// idx = FindIndex(
// iBox,
// breakedBoxes //
// );
// has = !IsValidIndex(idx);
// if (!has)
// {
// //
// iBox.Clean();
// continue;
// }
// //
// idx = FindIndex(
// tmpDemands[i],
// demandZones //
// );
// has = !IsValidIndex(idx);
// if (!has)
// {
// //
// iBox.Clean();
// continue;
// }
// //
// // Checking Price Validation ...
// has = cBar.low > tmpDemands[i].Upper();
// if (!has)
// {
// //
// iBox.Clean();
// continue;
// }
// //
// Add(
// tmpDemands[i],
// demandZones //
// );
// //
// iBox.Clean();
// }
// }
// Clean(tmpDemands);
// //
// // Support Zones ...
// count = ttfState.FilterSupportZones(
// tmpSupports,
// period,
// XZONE_STATE_PASSED,
// false,
// XZONE_STATE_FAILED,
// false,
// XZONE_STATE_FAILED,
// false,
// XZONE_STATE_IGNORED,
// false //
// );
// has = IsValidSize(count);
// if (has)
// {
// //
// for (int i = 0; i < count; i++)
// {
// //
// XBoxZone iBox;
// has = ToBox(
// iBox,
// tmpSupports[i] //
// );
// if (!has)
// {
// //
// iBox.Clean();
// continue;
// }
// //
// // Find Index ...
// //
// idx = FindIndex(
// iBox,
// insideBoxes //
// );
// has = !IsValidIndex(idx);
// if (!has)
// {
// //
// iBox.Clean();
// continue;
// }
// //
// idx = FindIndex(
// iBox,
// breakedBoxes //
// );
// has = !IsValidIndex(idx);
// if (!has)
// {
// //
// iBox.Clean();
// continue;
// }
// //
// idx = FindIndex(
// tmpSupports[i],
// supportZones //
// );
// has = !IsValidIndex(idx);
// if (!has)
// {
// //
// iBox.Clean();
// continue;
// }
// //
// // Checking Price Validation ...
// has = cBar.low > tmpSupports[i].Upper();
// if (!has)
// {
// //
// iBox.Clean();
// continue;
// }
// //
// Add(
// tmpSupports[i],
// supportZones //
// );
// //
// iBox.Clean();
// }
// }
// Clean(tmpSupports);
// //
// // Resistance Zones ..
// count = ttfState.FilterResistanceZones(
// tmpResistances,
// period,
// XZONE_STATE_PASSED,
// false,
// XZONE_STATE_FAILED,
// false,
// XZONE_STATE_FAILED,
// false,
// XZONE_STATE_IGNORED,
// false //
// );
// has = IsValidSize(count);
// if (has)
// {
// //
// for (int i = 0; i < count; i++)
// {
// //
// XBoxZone iBox;
// has = ToBox(
// iBox,
// tmpResistances[i] //
// );
// if (!has)
// {
// //
// iBox.Clean();
// continue;
// }
// //
// // Find Index ...
// //
// idx = FindIndex(
// iBox,
// insideBoxes //
// );
// has = !IsValidIndex(idx);
// if (!has)
// {
// //
// iBox.Clean();
// continue;
// }
// //
// idx = FindIndex(
// iBox,
// breakedBoxes //
// );
// has = !IsValidIndex(idx);
// if (!has)
// {
// //
// iBox.Clean();
// continue;
// }
// //
// idx = FindIndex(
// tmpResistances[i],
// resistanceZones //
// );
// has = !IsValidIndex(idx);
// if (!has)
// {
// //
// iBox.Clean();
// continue;
// }
// //
// // Checking Price Validation ...
// has = cBar.high < tmpResistances[i].Lower();
// if (!has)
// {
// //
// iBox.Clean();
// continue;
// }
// //
// Add(
// tmpResistances[i],
// resistanceZones //
// );
// //
// iBox.Clean();
// }
// }
// Clean(tmpResistances);
//
// Demand Zones ...
count = stfState.FilterDemandZones(
tmpDemands,
NULL,
XZONE_STATE_PASSED,
false,
XZONE_STATE_FAILED,
false,
XZONE_STATE_FAILED,
false,
XZONE_STATE_IGNORED,
false //
);
has = IsValidSize(count);
if (has)
{
//
for (int i = 0; i < count; i++)
{
//
XBoxZone iBox;
has = ToBox(
iBox,
tmpDemands[i] //
);
if (!has)
{
//
iBox.Clean();
continue;
}
//
// Find Index ...
//
idx = FindIndex(
iBox,
insideBoxes //
);
has = !IsValidIndex(idx);
if (!has)
{
//
iBox.Clean();
continue;
}
//
idx = FindIndex(
iBox,
breakedBoxes //
);
has = !IsValidIndex(idx);
if (!has)
{
//
iBox.Clean();
continue;
}
//
idx = FindIndex(
tmpDemands[i],
demandZones //
);
has = !IsValidIndex(idx);
if (!has)
{
//
iBox.Clean();
continue;
}
//
Add(
tmpDemands[i],
demandZones //
);
//
iBox.Clean();
}
}
Clean(demandZones);
//
// Support Zones ...
count = ttfState.FilterSupportZones(
tmpSupports,
period,
XZONE_STATE_PASSED,
false,
XZONE_STATE_FAILED,
false,
XZONE_STATE_FAILED,
false,
XZONE_STATE_IGNORED,
false //
);
has = IsValidSize(count);
if (has)
{
//
for (int i = 0; i < count; i++)
{
//
XBoxZone iBox;
has = ToBox(
iBox,
tmpSupports[i] //
);
if (!has)
{
//
iBox.Clean();
continue;
}
//
// Find Index ...
//
idx = FindIndex(
iBox,
insideBoxes //
);
has = !IsValidIndex(idx);
if (!has)
{
//
iBox.Clean();
continue;
}
//
idx = FindIndex(
iBox,
breakedBoxes //
);
has = !IsValidIndex(idx);
if (!has)
{
//
iBox.Clean();
continue;
}
//
idx = FindIndex(
tmpSupports[i],
supportZones //
);
has = !IsValidIndex(idx);
if (!has)
{
//
iBox.Clean();
continue;
}
//
Add(
tmpSupports[i],
supportZones //
);
//
iBox.Clean();
}
}
Clean(tmpSupports);
//
// Resistance Zones ..
count = ttfState.FilterResistanceZones(
tmpResistances,
period,
XZONE_STATE_PASSED,
false,
XZONE_STATE_FAILED,
false,
XZONE_STATE_FAILED,
false,
XZONE_STATE_IGNORED,
false //
);
has = IsValidSize(count);
if (has)
{
//
for (int i = 0; i < count; i++)
{
//
XBoxZone iBox;
has = ToBox(
iBox,
tmpResistances[i] //
);
if (!has)
{
//
iBox.Clean();
continue;
}
//
// Find Index ...
//
idx = FindIndex(
iBox,
insideBoxes //
);
has = !IsValidIndex(idx);
if (!has)
{
//
iBox.Clean();
continue;
}
//
idx = FindIndex(
iBox,
breakedBoxes //
);
has = !IsValidIndex(idx);
if (!has)
{
//
iBox.Clean();
continue;
}
//
idx = FindIndex(
tmpResistances[i],
resistanceZones //
);
has = !IsValidIndex(idx);
if (!has)
{
//
iBox.Clean();
continue;
}
//
Add(
tmpResistances[i],
resistanceZones //
);
//
iBox.Clean();
}
}
Clean(tmpResistances);
//
// Consolidation Zones ...
@@ -2222,6 +2306,33 @@ struct X121SMCStrategyXWZWorkingZone
}
}
//
// Demand Zone ...
if (drawDemandZone)
{
//
has = HasDemandZone();
if (has)
{
//
XCDemandZoneObject *iObj;
isCreated = drawer.CreateDemandZone(
demandZone,
iObj //
);
//
if (isCreated)
{
mWorkingZoneObjects.Add(iObj);
}
}
}
//
//
//
//
// Supply Zones ...
if (drawSupplyZones)
@@ -2250,29 +2361,6 @@ struct X121SMCStrategyXWZWorkingZone
}
}
//
// Demand Zone ...
if (drawDemandZone)
{
//
has = HasDemandZone();
if (has)
{
//
XCDemandZoneObject *iObj;
isCreated = drawer.CreateDemandZone(
demandZone,
iObj //
);
//
if (isCreated)
{
mWorkingZoneObjects.Add(iObj);
}
}
}
//
// Demand Zones ...
if (drawDemandZones)
@@ -2357,6 +2445,10 @@ struct X121SMCStrategyXWZWorkingZone
}
}
//
//
//
//
// Waiting Zones ...
if (drawWaitingZones)
@@ -2503,6 +2595,10 @@ struct X121SMCStrategyXWZWorkingZone
}
}
//
//
//
//
// Quarters ...
has = IsValid();
@@ -2692,7 +2788,7 @@ struct X121SMCStrategyXWZSignalConditions
double targets[];
//
XOBFVG signalZone;
XBoxZone signalBox;
//
ENUM_X121SMC_XWZ_PRIORITY priority;
@@ -2825,7 +2921,7 @@ struct X121SMCStrategyXWZSignalConditions
//
Clean(sls);
Clean(targets);
signalZone.Clean();
signalBox.Clean();
//
provider = X121SMC_XWZ_PROVIDER_NONE;
@@ -3107,7 +3203,7 @@ bool DetectSelectedZoneConditions(
*
* @return ( bool )
*/
bool DetectSelectedZoneConditions(
bool DetectSelectedBoxConditions(
bool &isReversal,
XBoxZone &zone,
XPOIState &state,