Last Works ...

This commit is contained in:
2024-11-15 20:03:39 +03:30
parent e0b2164515
commit eae679f78d
4 changed files with 418 additions and 71 deletions
+191
View File
@@ -38,6 +38,55 @@ struct X121SMCStrategyConditions
ENUM_TIMEFRAMES period;
datetime time;
//
// D1 ...
XPOIState d1State;
ENUM_X_DIRECTION d1MarketDirection;
XCSupportZone *d1SupportZones[];
XCResistanceZone *d1ResistanceZones[];
//
// H4 ...
XPOIState h4State;
ENUM_X_DIRECTION h4MarketDirection;
XCSupportZone *h4SupportZones[];
XCResistanceZone *h4ResistanceZones[];
//
// H2 ...
XPOIState h2State;
ENUM_X_DIRECTION h2MarketDirection;
XCSupportZone *h2SupportZones[];
XCResistanceZone *h2ResistanceZones[];
//
// H1 ...
XPOIState h1State;
ENUM_X_DIRECTION h1MarketDirection;
XCSupportZone *h1SupportZones[];
XCResistanceZone *h1ResistanceZones[];
//
// M15 ...
XPOIState m15State;
ENUM_X_DIRECTION m15MarketDirection;
XCSupportZone *m15SupportZones[];
XCResistanceZone *m15ResistanceZones[];
//
// M5 ...
XPOIState m5State;
ENUM_X_DIRECTION m5MarketDirection;
XCSupportZone *m5SupportZones[];
XCResistanceZone *m5ResistanceZones[];
//
// M1 ...
XPOIState m1State;
ENUM_X_DIRECTION m1MarketDirection;
XCSupportZone *m1SupportZones[];
XCResistanceZone *m1ResistanceZones[];
//
void X121SMCStrategyConditions()
{
@@ -56,6 +105,55 @@ struct X121SMCStrategyConditions
symbol = NULL;
period = NULL;
time = NULL;
//
// D1 ...
d1State.Clean();
d1MarketDirection = X_DIRECTION_NONE;
Clean(d1SupportZones);
Clean(d1ResistanceZones);
//
// H4 ...
h4State.Clean();
h4MarketDirection = X_DIRECTION_NONE;
Clean(h4SupportZones);
Clean(h4ResistanceZones);
//
// H2 ...
h2State.Clean();
h2MarketDirection = X_DIRECTION_NONE;
Clean(h2SupportZones);
Clean(h2ResistanceZones);
//
// H1 ...
h1State.Clean();
h1MarketDirection = X_DIRECTION_NONE;
Clean(h1SupportZones);
Clean(h1ResistanceZones);
//
// M15 ...
m15State.Clean();
m15MarketDirection = X_DIRECTION_NONE;
Clean(m15SupportZones);
Clean(m15ResistanceZones);
//
// M5 ...
m5State.Clean();
m5MarketDirection = X_DIRECTION_NONE;
Clean(m5SupportZones);
Clean(m5ResistanceZones);
//
// M1 ...
m1State.Clean();
m1MarketDirection = X_DIRECTION_NONE;
Clean(m1SupportZones);
Clean(m1ResistanceZones);
}
/**
@@ -77,6 +175,99 @@ struct X121SMCStrategyConditions
return result;
}
//
// Custom Tools ...
/**
* Check Conditions for Detect Market Structure ...
*
* @param structure: ENUM_X_DIRECTION member, Market Structure Direction reference ...
*
* @return ( bool )
*/
bool HasMarketStructure(
ENUM_X_DIRECTION &structure //
)
{
//
bool result = false;
//
structure = X_DIRECTION_NONE;
//
result = IsValid();
if (!result)
{
return result;
}
//
bool is1DBullish = IsBullish(d1MarketDirection);
bool is1DBearish = IsBearish(d1MarketDirection);
//
bool is4HBullish = IsBullish(h4MarketDirection);
bool is4HBearish = IsBearish(h4MarketDirection);
//
bool is2HBullish = IsBullish(h2MarketDirection);
bool is2HBearish = IsBearish(h2MarketDirection);
//
bool is1HBullish = IsBullish(h1MarketDirection);
bool is1HBearish = IsBearish(h1MarketDirection);
//
bool is15MBullish = IsBullish(m15MarketDirection);
bool is15MBearish = IsBearish(m15MarketDirection);
//
bool is5MBullish = IsBullish(m5MarketDirection);
bool is5MBearish = IsBearish(m5MarketDirection);
//
bool is1MBullish = IsBullish(m1MarketDirection);
bool is1MBearish = IsBearish(m1MarketDirection);
//
bool isStructuresBullish =
//
is1HBullish &&
is15MBullish &&
is5MBullish
//
;
//
bool isStructuresBearish =
//
is1HBearish &&
is15MBearish &&
is5MBearish
//
;
//
bool hasMarketStructure =
isStructuresBullish ||
isStructuresBearish;
result = hasMarketStructure;
if (!result)
{
return result;
}
//
structure =
isStructuresBullish
? X_DIRECTION_BULLISH
: X_DIRECTION_BEARISH;
//
return result;
}
/**
* Generate Provided Scores ...
*