last ...
This commit is contained in:
@@ -31,10 +31,7 @@
|
||||
enum ENUM_X121SMC_XWZ_PROVIDERS
|
||||
{
|
||||
X121SMC_XWZ_PROVIDER_NONE,
|
||||
X121SMC_XWZ_PROVIDER_PVHK,
|
||||
X121SMC_XWZ_PROVIDER_ACTIVATED_MA,
|
||||
X121SMC_XWZ_PROVIDER_ACTIVATED_BOX,
|
||||
X121SMC_XWZ_PROVIDER_ACTIVATED_AREA,
|
||||
X121SMC_XWZ_PROVIDER_XHKMA,
|
||||
};
|
||||
|
||||
//
|
||||
@@ -478,6 +475,11 @@ struct X121SMCStrategyXWZWorkingZone
|
||||
//
|
||||
bool result = false;
|
||||
|
||||
//
|
||||
int idx = -1;
|
||||
int count = 0;
|
||||
bool has = false;
|
||||
|
||||
//
|
||||
if (barIndex < 0)
|
||||
{
|
||||
@@ -487,12 +489,14 @@ struct X121SMCStrategyXWZWorkingZone
|
||||
//
|
||||
// Select Cycle ...
|
||||
XPOIState cState;
|
||||
XPOIStateEvents cStateEvents;
|
||||
X121Conditions cXConditions;
|
||||
XC121SMCCycleHelper *cHelper;
|
||||
X121SMCCycleConditions cConditions;
|
||||
result = provider.SelectCycle(
|
||||
cycle,
|
||||
cState,
|
||||
cStateEvents,
|
||||
cXConditions,
|
||||
cHelper,
|
||||
cConditions //
|
||||
@@ -503,6 +507,7 @@ struct X121SMCStrategyXWZWorkingZone
|
||||
cState.Clean();
|
||||
ZeroMemory(cHelper);
|
||||
cConditions.Clean();
|
||||
cStateEvents.Clean();
|
||||
cXConditions.Clean();
|
||||
|
||||
//
|
||||
@@ -510,30 +515,231 @@ struct X121SMCStrategyXWZWorkingZone
|
||||
}
|
||||
|
||||
//
|
||||
// Select Validate Rejection Boxes ...
|
||||
XBoxZone rejections[];
|
||||
int count = cHelper
|
||||
.DetectRejections(
|
||||
rejections,
|
||||
barIndex //
|
||||
);
|
||||
// Select Rejection Boxes ...
|
||||
|
||||
// //
|
||||
// // Select Validate Rejection Boxes ...
|
||||
// XBoxZone rejections[];
|
||||
// int count = cHelper
|
||||
// .DetectRejections(
|
||||
// rejections,
|
||||
// barIndex //
|
||||
// );
|
||||
|
||||
// //
|
||||
// result = IsValidSize(count);
|
||||
// if (result)
|
||||
// {
|
||||
// //
|
||||
// for (int i = 0; i < count; i++)
|
||||
// {
|
||||
// //
|
||||
// has = IsExists(rejections[i]);
|
||||
// if (!has)
|
||||
// {
|
||||
// //
|
||||
// AddRef(
|
||||
// rejections[i],
|
||||
// waitingBoxes //
|
||||
// );
|
||||
// }
|
||||
// }
|
||||
// }
|
||||
|
||||
//
|
||||
result = IsValidSize(count);
|
||||
if (result)
|
||||
// Select Order Blocks ...
|
||||
// if (cStateEvents.hasNewOrderBlock)
|
||||
// {
|
||||
// //
|
||||
// idx = GetYoungest(cState.orderBlocks);
|
||||
// has = IsValidIndex(idx);
|
||||
// if (has)
|
||||
// {
|
||||
// //
|
||||
// XCOrderBlock *iOB = cState.orderBlocks[idx];
|
||||
|
||||
// //
|
||||
// XBoxZone iBox;
|
||||
// has = ToBox(
|
||||
// iBox,
|
||||
// iOB //
|
||||
// );
|
||||
// if (has)
|
||||
// {
|
||||
// //
|
||||
// has = IsExists(iBox);
|
||||
// if (!has)
|
||||
// {
|
||||
// //
|
||||
// AddRef(
|
||||
// iBox,
|
||||
// waitingBoxes //
|
||||
// );
|
||||
// }
|
||||
// }
|
||||
// }
|
||||
// }
|
||||
|
||||
//
|
||||
// Select Fair Value Gaps ...
|
||||
// if (cStateEvents.hasNewFairValueGap)
|
||||
// {
|
||||
// //
|
||||
// idx = GetYoungest(cState.fairValueGaps);
|
||||
// has = IsValidIndex(idx);
|
||||
// if (has)
|
||||
// {
|
||||
// //
|
||||
// XCFVG *iOB = cState.fairValueGaps[idx];
|
||||
|
||||
// //
|
||||
// XBoxZone iBox;
|
||||
// has = ToBox(
|
||||
// iBox,
|
||||
// iOB //
|
||||
// );
|
||||
// if (has)
|
||||
// {
|
||||
// //
|
||||
// has = IsExists(iBox);
|
||||
// if (!has)
|
||||
// {
|
||||
// //
|
||||
// AddRef(
|
||||
// iBox,
|
||||
// waitingBoxes //
|
||||
// );
|
||||
// }
|
||||
// }
|
||||
// }
|
||||
// }
|
||||
|
||||
//
|
||||
// Select Supply/Demand Zones ...
|
||||
// if (cStateEvents.hasNewSupplyZone)
|
||||
// {
|
||||
// //
|
||||
// idx = GetYoungest(cState.supplyZones);
|
||||
// has = IsValidIndex(idx);
|
||||
// if (has)
|
||||
// {
|
||||
// //
|
||||
// XCSupplyZone *iSupply = cState.supplyZones[idx];
|
||||
|
||||
// //
|
||||
// XBoxZone iBox;
|
||||
// has = ToBox(
|
||||
// iBox,
|
||||
// iSupply //
|
||||
// );
|
||||
// if (has)
|
||||
// {
|
||||
// //
|
||||
// has = IsExists(iBox);
|
||||
// if (!has)
|
||||
// {
|
||||
// //
|
||||
// AddRef(
|
||||
// iBox,
|
||||
// waitingBoxes //
|
||||
// );
|
||||
// }
|
||||
// }
|
||||
// }
|
||||
// }
|
||||
// if (cStateEvents.hasNewDemandZone)
|
||||
// {
|
||||
// //
|
||||
// idx = GetYoungest(cState.demandZones);
|
||||
// has = IsValidIndex(idx);
|
||||
// if (has)
|
||||
// {
|
||||
// //
|
||||
// XCDemandZone *iDemand = cState.demandZones[idx];
|
||||
|
||||
// //
|
||||
// XBoxZone iBox;
|
||||
// has = ToBox(
|
||||
// iBox,
|
||||
// iDemand //
|
||||
// );
|
||||
// if (has)
|
||||
// {
|
||||
// //
|
||||
// has = IsExists(iBox);
|
||||
// if (!has)
|
||||
// {
|
||||
// //
|
||||
// AddRef(
|
||||
// iBox,
|
||||
// waitingBoxes //
|
||||
// );
|
||||
// }
|
||||
// }
|
||||
// }
|
||||
// }
|
||||
|
||||
//
|
||||
// Select Support/Resistance Zones ...
|
||||
if (cStateEvents.hasNewSupportZone)
|
||||
{
|
||||
//
|
||||
for (int i = 0; i < count; i++)
|
||||
idx = GetYoungest(cState.supportZones);
|
||||
has = IsValidIndex(idx);
|
||||
if (has)
|
||||
{
|
||||
//
|
||||
bool has = IsExists(rejections[i]);
|
||||
if (!has)
|
||||
XCSupportZone *iSupport = cState.supportZones[idx];
|
||||
|
||||
//
|
||||
XBoxZone iBox;
|
||||
has = ToBox(
|
||||
iBox,
|
||||
iSupport //
|
||||
);
|
||||
if (has)
|
||||
{
|
||||
//
|
||||
AddRef(
|
||||
rejections[i],
|
||||
waitingBoxes //
|
||||
);
|
||||
has = IsExists(iBox);
|
||||
if (!has)
|
||||
{
|
||||
//
|
||||
AddRef(
|
||||
iBox,
|
||||
waitingBoxes //
|
||||
);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
if (cStateEvents.hasNewResistanceZone)
|
||||
{
|
||||
//
|
||||
idx = GetYoungest(cState.resistanceZones);
|
||||
has = IsValidIndex(idx);
|
||||
if (has)
|
||||
{
|
||||
//
|
||||
XCResistanceZone *iResistance = cState.resistanceZones[idx];
|
||||
|
||||
//
|
||||
XBoxZone iBox;
|
||||
has = ToBox(
|
||||
iBox,
|
||||
iResistance //
|
||||
);
|
||||
if (has)
|
||||
{
|
||||
//
|
||||
has = IsExists(iBox);
|
||||
if (!has)
|
||||
{
|
||||
//
|
||||
AddRef(
|
||||
iBox,
|
||||
waitingBoxes //
|
||||
);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -550,6 +756,7 @@ struct X121SMCStrategyXWZWorkingZone
|
||||
ZeroMemory(cHelper);
|
||||
cConditions.Clean();
|
||||
cXConditions.Clean();
|
||||
cStateEvents.Clean();
|
||||
|
||||
//
|
||||
return result;
|
||||
@@ -765,6 +972,13 @@ struct X121SMCStrategyXWZWorkingZone
|
||||
return result;
|
||||
}
|
||||
|
||||
/**
|
||||
* Detect Trend Based On Boxes ...
|
||||
*
|
||||
* @param dir: ENUM_X_DIRECTION ember ...
|
||||
*
|
||||
* @return ( bool )
|
||||
*/
|
||||
bool DetectTreand(
|
||||
ENUM_X_DIRECTION &dir //
|
||||
)
|
||||
@@ -1014,6 +1228,7 @@ struct X121SMCStrategyXWZWorkingZone
|
||||
box,
|
||||
holderBox,
|
||||
dir,
|
||||
waitingBoxes,
|
||||
provider,
|
||||
X_CYCLE_ANALYSE,
|
||||
barIndex //
|
||||
@@ -1032,7 +1247,7 @@ struct X121SMCStrategyXWZWorkingZone
|
||||
//
|
||||
if (isSenario1Happend)
|
||||
{
|
||||
signalProvider = X121SMC_XWZ_PROVIDER_PVHK;
|
||||
signalProvider = X121SMC_XWZ_PROVIDER_XHKMA;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1045,50 +1260,50 @@ struct X121SMCStrategyXWZWorkingZone
|
||||
bool isSenario2Happend = false;
|
||||
bool isSenario2Bullish = false;
|
||||
bool isSenario2Bearish = false;
|
||||
if (useSenario2)
|
||||
{
|
||||
//
|
||||
// Senario 2 Working Based on
|
||||
// Breaked Boxes ...
|
||||
// Since we Works only
|
||||
// when Has UnAvailable Boxes ...
|
||||
has = HasBreakedBoxes();
|
||||
if (has)
|
||||
{
|
||||
//
|
||||
ENUM_X_DIRECTION overalTrend;
|
||||
bool hasTrend = DetectOveralDirection(overalTrend);
|
||||
// if (useSenario2)
|
||||
// {
|
||||
// //
|
||||
// // Senario 2 Working Based on
|
||||
// // Breaked Boxes ...
|
||||
// // Since we Works only
|
||||
// // when Has UnAvailable Boxes ...
|
||||
// has = HasBreakedBoxes();
|
||||
// if (has)
|
||||
// {
|
||||
// //
|
||||
// ENUM_X_DIRECTION overalTrend;
|
||||
// bool hasTrend = DetectOveralDirection(overalTrend);
|
||||
|
||||
if (hasTrend)
|
||||
{
|
||||
//
|
||||
isSenario2Happend = cParser.HasSenario2Conditions(
|
||||
X_CYCLE_DECISION,
|
||||
breakedBoxes,
|
||||
box,
|
||||
dir,
|
||||
provider,
|
||||
barIndex //
|
||||
);
|
||||
// if (hasTrend)
|
||||
// {
|
||||
// //
|
||||
// isSenario2Happend = cParser.HasSenario2Conditions(
|
||||
// X_CYCLE_DECISION,
|
||||
// breakedBoxes,
|
||||
// box,
|
||||
// dir,
|
||||
// provider,
|
||||
// barIndex //
|
||||
// );
|
||||
|
||||
//
|
||||
isSenario2Bullish =
|
||||
isSenario2Happend &&
|
||||
IsBullish(dir);
|
||||
// //
|
||||
// isSenario2Bullish =
|
||||
// isSenario2Happend &&
|
||||
// IsBullish(dir);
|
||||
|
||||
//
|
||||
isSenario2Bearish =
|
||||
isSenario2Happend &&
|
||||
IsBearish(dir);
|
||||
// //
|
||||
// isSenario2Bearish =
|
||||
// isSenario2Happend &&
|
||||
// IsBearish(dir);
|
||||
|
||||
//
|
||||
if (isSenario2Happend)
|
||||
{
|
||||
signalProvider = X121SMC_XWZ_PROVIDER_ACTIVATED_BOX;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
// //
|
||||
// if (isSenario2Happend)
|
||||
// {
|
||||
// signalProvider = X121SMC_XWZ_PROVIDER_ACTIVATED_BOX;
|
||||
// }
|
||||
// }
|
||||
// }
|
||||
// }
|
||||
|
||||
//
|
||||
// Senario 3:
|
||||
@@ -1098,9 +1313,9 @@ struct X121SMCStrategyXWZWorkingZone
|
||||
bool isSenario3Happend = false;
|
||||
bool isSenario3Bullish = false;
|
||||
bool isSenario3Bearish = false;
|
||||
if (useSenario3)
|
||||
{
|
||||
}
|
||||
// if (useSenario3)
|
||||
// {
|
||||
// }
|
||||
|
||||
//
|
||||
// Senario 4:
|
||||
@@ -1111,35 +1326,35 @@ struct X121SMCStrategyXWZWorkingZone
|
||||
bool isSenario4Happend = false;
|
||||
bool isSenario4Bullish = false;
|
||||
bool isSenario4Bearish = false;
|
||||
if (useSenario4)
|
||||
{
|
||||
//
|
||||
isSenario4Happend = cParser.HasSenario4Conditions(
|
||||
X_CYCLE_ANALYSE,
|
||||
box,
|
||||
holderBox,
|
||||
dir,
|
||||
provider,
|
||||
X_CYCLE_CONSOLIDATION,
|
||||
barIndex //
|
||||
);
|
||||
// if (useSenario4)
|
||||
// {
|
||||
// //
|
||||
// isSenario4Happend = cParser.HasSenario4Conditions(
|
||||
// X_CYCLE_ANALYSE,
|
||||
// box,
|
||||
// holderBox,
|
||||
// dir,
|
||||
// provider,
|
||||
// X_CYCLE_CONSOLIDATION,
|
||||
// barIndex //
|
||||
// );
|
||||
|
||||
//
|
||||
isSenario4Bullish =
|
||||
isSenario4Happend &&
|
||||
IsBullish(dir);
|
||||
// //
|
||||
// isSenario4Bullish =
|
||||
// isSenario4Happend &&
|
||||
// IsBullish(dir);
|
||||
|
||||
//
|
||||
isSenario4Bearish =
|
||||
isSenario4Happend &&
|
||||
IsBearish(dir);
|
||||
// //
|
||||
// isSenario4Bearish =
|
||||
// isSenario4Happend &&
|
||||
// IsBearish(dir);
|
||||
|
||||
//
|
||||
if (isSenario4Happend)
|
||||
{
|
||||
signalProvider = X121SMC_XWZ_PROVIDER_ACTIVATED_BOX;
|
||||
}
|
||||
}
|
||||
// //
|
||||
// if (isSenario4Happend)
|
||||
// {
|
||||
// signalProvider = X121SMC_XWZ_PROVIDER_ACTIVATED_BOX;
|
||||
// }
|
||||
// }
|
||||
|
||||
//
|
||||
// Senario 5:
|
||||
@@ -1149,9 +1364,9 @@ struct X121SMCStrategyXWZWorkingZone
|
||||
bool isSenario5Happend = false;
|
||||
bool isSenario5Bullish = false;
|
||||
bool isSenario5Bearish = false;
|
||||
if (useSenario5)
|
||||
{
|
||||
}
|
||||
// if (useSenario5)
|
||||
// {
|
||||
// }
|
||||
|
||||
//
|
||||
// Summarize All Senario(s) Conditions ...
|
||||
|
||||
Reference in New Issue
Block a user