Last Works ...
This commit is contained in:
@@ -331,18 +331,132 @@ class XCX121SMCTestStrategy : public XCX121SMCBaseStrategy
|
||||
dir = X_DIRECTION_NONE;
|
||||
|
||||
//
|
||||
// TODO: Implement ...
|
||||
ENUM_X_DIRECTION marketStructureDir;
|
||||
result = DetectMarketStructure(
|
||||
marketStructureDir,
|
||||
_5MState //
|
||||
);
|
||||
// Detect Market Structures ...
|
||||
|
||||
//
|
||||
// 1D ...
|
||||
mConditions.d1State = _1DState;
|
||||
result = DetectMarketStructure(
|
||||
mConditions.d1MarketDirection,
|
||||
_1DState //
|
||||
);
|
||||
if (!result)
|
||||
{
|
||||
//
|
||||
mConditions.Clean();
|
||||
return result;
|
||||
}
|
||||
bool is1DBullish = IsBullish(mConditions.d1MarketDirection);
|
||||
bool is1DBearish = IsBearish(mConditions.d1MarketDirection);
|
||||
|
||||
//
|
||||
// 4H ...
|
||||
mConditions.h4State = _4HState;
|
||||
result = DetectMarketStructure(
|
||||
mConditions.h4MarketDirection,
|
||||
_4HState //
|
||||
);
|
||||
if (!result)
|
||||
{
|
||||
//
|
||||
mConditions.Clean();
|
||||
return result;
|
||||
}
|
||||
bool is4HBullish = IsBullish(mConditions.h4MarketDirection);
|
||||
bool is4HBearish = IsBearish(mConditions.h4MarketDirection);
|
||||
|
||||
//
|
||||
// 2H ...
|
||||
mConditions.h2State = _2HState;
|
||||
result = DetectMarketStructure(
|
||||
mConditions.h2MarketDirection,
|
||||
_2HState //
|
||||
);
|
||||
if (!result)
|
||||
{
|
||||
//
|
||||
mConditions.Clean();
|
||||
return result;
|
||||
}
|
||||
bool is2HBullish = IsBullish(mConditions.h2MarketDirection);
|
||||
bool is2HBearish = IsBearish(mConditions.h2MarketDirection);
|
||||
|
||||
//
|
||||
// 1H ...
|
||||
mConditions.h1State = _1HState;
|
||||
result = DetectMarketStructure(
|
||||
mConditions.h1MarketDirection,
|
||||
_1HState //
|
||||
);
|
||||
if (!result)
|
||||
{
|
||||
//
|
||||
mConditions.Clean();
|
||||
return result;
|
||||
}
|
||||
bool is1HBullish = IsBullish(mConditions.h1MarketDirection);
|
||||
bool is1HBearish = IsBearish(mConditions.h1MarketDirection);
|
||||
|
||||
//
|
||||
// 15M ...
|
||||
mConditions.m15State = _15MState;
|
||||
result = DetectMarketStructure(
|
||||
mConditions.m15MarketDirection,
|
||||
_15MState //
|
||||
);
|
||||
if (!result)
|
||||
{
|
||||
//
|
||||
mConditions.Clean();
|
||||
return result;
|
||||
}
|
||||
bool is15MBullish = IsBullish(mConditions.m15MarketDirection);
|
||||
bool is15MBearish = IsBearish(mConditions.m15MarketDirection);
|
||||
|
||||
//
|
||||
// 5M ...
|
||||
mConditions.m5State = _5MState;
|
||||
result = DetectMarketStructure(
|
||||
mConditions.m5MarketDirection,
|
||||
_5MState //
|
||||
);
|
||||
if (!result)
|
||||
{
|
||||
//
|
||||
mConditions.Clean();
|
||||
return result;
|
||||
}
|
||||
bool is5MBullish = IsBullish(mConditions.m5MarketDirection);
|
||||
bool is5MBearish = IsBearish(mConditions.m5MarketDirection);
|
||||
|
||||
//
|
||||
// 1M ...
|
||||
mConditions.m1State = _1MState;
|
||||
result = DetectMarketStructure(
|
||||
mConditions.m1MarketDirection,
|
||||
_1MState //
|
||||
);
|
||||
if (!result)
|
||||
{
|
||||
//
|
||||
mConditions.Clean();
|
||||
return result;
|
||||
}
|
||||
bool is1MBullish = IsBullish(mConditions.m1MarketDirection);
|
||||
bool is1MBearish = IsBearish(mConditions.m1MarketDirection);
|
||||
|
||||
//
|
||||
ENUM_X_DIRECTION marketStructure = X_DIRECTION_NONE;
|
||||
result = mConditions.HasMarketStructure(marketStructure);
|
||||
if (!result)
|
||||
{
|
||||
//
|
||||
mConditions.Clean();
|
||||
return result;
|
||||
}
|
||||
|
||||
//
|
||||
DrawState(_5MState);
|
||||
|
||||
//
|
||||
return result;
|
||||
@@ -364,17 +478,12 @@ class XCX121SMCTestStrategy : public XCX121SMCBaseStrategy
|
||||
//
|
||||
bool result = false;
|
||||
|
||||
//
|
||||
// DrawState(state);
|
||||
|
||||
//
|
||||
// Print("Salam");
|
||||
|
||||
//
|
||||
int count = 0;
|
||||
|
||||
//
|
||||
// Filter Untouched Supports ...
|
||||
int untouchedSupportsCount = 0;
|
||||
XCSupportZone *untouchedSupportZones[];
|
||||
count = ArraySize(state.supportZones);
|
||||
if (IsValidSize(count))
|
||||
@@ -436,31 +545,33 @@ class XCX121SMCTestStrategy : public XCX121SMCBaseStrategy
|
||||
}
|
||||
|
||||
//
|
||||
int untouchedSupportsCount = ArraySize(untouchedSupportZones);
|
||||
untouchedSupportsCount = ArraySize(untouchedSupportZones);
|
||||
if (IsValidSize(untouchedSupportsCount))
|
||||
{
|
||||
//
|
||||
for (int i = 0; i < untouchedSupportsCount; i++)
|
||||
{
|
||||
//
|
||||
XCSupportZone *item = untouchedSupportZones[i];
|
||||
// Draw ...
|
||||
// for (int i = 0; i < untouchedSupportsCount; i++)
|
||||
// {
|
||||
// //
|
||||
// XCSupportZone *item = untouchedSupportZones[i];
|
||||
|
||||
//
|
||||
XCSupportZoneObject *iObj;
|
||||
bool isCreated = mPOIDrawer.CreateSupportZone(
|
||||
item,
|
||||
iObj //
|
||||
);
|
||||
if (isCreated)
|
||||
{
|
||||
AddObjectIfNotExists(iObj);
|
||||
}
|
||||
}
|
||||
// //
|
||||
// XCSupportZoneObject *iObj;
|
||||
// bool isCreated = mPOIDrawer.CreateSupportZone(
|
||||
// item,
|
||||
// iObj //
|
||||
// );
|
||||
// if (isCreated)
|
||||
// {
|
||||
// AddObjectIfNotExists(iObj);
|
||||
// }
|
||||
// }
|
||||
}
|
||||
}
|
||||
|
||||
//
|
||||
// Filter Untouched Resistances ...
|
||||
int untouchedResistancesCount = 0;
|
||||
XCResistanceZone *untouchedResistanceZones[];
|
||||
count = ArraySize(state.resistanceZones);
|
||||
if (IsValidSize(count))
|
||||
@@ -522,29 +633,54 @@ class XCX121SMCTestStrategy : public XCX121SMCBaseStrategy
|
||||
}
|
||||
|
||||
//
|
||||
int untouchedResistancesCount = ArraySize(untouchedResistanceZones);
|
||||
untouchedResistancesCount = ArraySize(untouchedResistanceZones);
|
||||
if (IsValidSize(untouchedResistancesCount))
|
||||
{
|
||||
//
|
||||
for (int i = 0; i < untouchedResistancesCount; i++)
|
||||
{
|
||||
//
|
||||
XCResistanceZone *item = untouchedResistanceZones[i];
|
||||
// Draw ...
|
||||
// for (int i = 0; i < untouchedResistancesCount; i++)
|
||||
// {
|
||||
// //
|
||||
// XCResistanceZone *item = untouchedResistanceZones[i];
|
||||
|
||||
//
|
||||
XCResistanceZoneObject *iObj;
|
||||
bool isCreated = mPOIDrawer.CreateResistanceZone(
|
||||
item,
|
||||
iObj //
|
||||
);
|
||||
if (isCreated)
|
||||
{
|
||||
AddObjectIfNotExists(iObj);
|
||||
}
|
||||
}
|
||||
// //
|
||||
// XCResistanceZoneObject *iObj;
|
||||
// bool isCreated = mPOIDrawer.CreateResistanceZone(
|
||||
// item,
|
||||
// iObj //
|
||||
// );
|
||||
// if (isCreated)
|
||||
// {
|
||||
// AddObjectIfNotExists(iObj);
|
||||
// }
|
||||
// }
|
||||
}
|
||||
}
|
||||
|
||||
//
|
||||
bool hasBullishStructure =
|
||||
IsValidSize(untouchedSupportsCount) &&
|
||||
untouchedSupportsCount > untouchedResistancesCount;
|
||||
bool hasBearishStructure =
|
||||
IsValidSize(untouchedResistancesCount) &&
|
||||
untouchedResistancesCount > untouchedSupportsCount;
|
||||
|
||||
//
|
||||
result = (hasBullishStructure &&
|
||||
!hasBearishStructure) ||
|
||||
(hasBearishStructure &&
|
||||
!hasBullishStructure);
|
||||
|
||||
//
|
||||
if (result)
|
||||
{
|
||||
//
|
||||
dir =
|
||||
hasBullishStructure
|
||||
? X_DIRECTION_BULLISH
|
||||
: X_DIRECTION_BEARISH;
|
||||
}
|
||||
|
||||
//
|
||||
return result;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user