This commit is contained in:
2024-11-18 14:29:50 +03:30
parent 72c4446620
commit c4f9afb68a
3 changed files with 1043 additions and 1010 deletions
-281
View File
@@ -376,105 +376,11 @@ struct X121SMCStrategyConditions
ENUM_TIMEFRAMES period;
datetime time;
//
XPVPivot orderFlow[];
//
XPVConditions xpvConditions;
X3MAConditions x3maConditions;
X3VWAPConditions x3vwapConditions;
//
// D1 ...
//
XPOIState d1State;
ENUM_X_DIRECTION d1MarketDirection;
XCSupportZone *d1SupportZones[];
XCResistanceZone *d1ResistanceZones[];
//
XCSwing *d1SwingHigh;
XCSwing *d1SwingLow;
//
// H4 ...
//
XPOIState h4State;
ENUM_X_DIRECTION h4MarketDirection;
XCSupportZone *h4SupportZones[];
XCResistanceZone *h4ResistanceZones[];
//
XCSwing *h4SwingHigh;
XCSwing *h4SwingLow;
//
// H2 ...
//
XPOIState h2State;
ENUM_X_DIRECTION h2MarketDirection;
XCSupportZone *h2SupportZones[];
XCResistanceZone *h2ResistanceZones[];
//
XCSwing *h2SwingHigh;
XCSwing *h2SwingLow;
//
// H1 ...
//
XPOIState h1State;
ENUM_X_DIRECTION h1MarketDirection;
XCSupportZone *h1SupportZones[];
XCResistanceZone *h1ResistanceZones[];
//
XCSwing *h1SwingHigh;
XCSwing *h1SwingLow;
//
// M15 ...
//
XPOIState m15State;
ENUM_X_DIRECTION m15MarketDirection;
XCSupportZone *m15SupportZones[];
XCResistanceZone *m15ResistanceZones[];
//
XCSwing *m15SwingHigh;
XCSwing *m15SwingLow;
//
// M5 ...
//
XPOIState m5State;
ENUM_X_DIRECTION m5MarketDirection;
XCSupportZone *m5SupportZones[];
XCResistanceZone *m5ResistanceZones[];
//
XCSwing *m5SwingHigh;
XCSwing *m5SwingLow;
//
// M1 ...
//
XPOIState m1State;
ENUM_X_DIRECTION m1MarketDirection;
XCSupportZone *m1SupportZones[];
XCResistanceZone *m1ResistanceZones[];
//
XCSwing *m1SwingHigh;
XCSwing *m1SwingLow;
//
void X121SMCStrategyConditions()
{
@@ -498,100 +404,6 @@ struct X121SMCStrategyConditions
xpvConditions.Clean();
x3maConditions.Clean();
x3vwapConditions.Clean();
//
Clean(orderFlow);
//
// D1 ...
//
d1State.Clean();
d1MarketDirection = X_DIRECTION_NONE;
Clean(d1SupportZones);
Clean(d1ResistanceZones);
//
d1SwingHigh = NULL;
d1SwingLow = NULL;
//
// H4 ...
//
h4State.Clean();
h4MarketDirection = X_DIRECTION_NONE;
Clean(h4SupportZones);
Clean(h4ResistanceZones);
//
h4SwingHigh = NULL;
h4SwingLow = NULL;
//
// H2 ...
//
h2State.Clean();
h2MarketDirection = X_DIRECTION_NONE;
Clean(h2SupportZones);
Clean(h2ResistanceZones);
//
h2SwingHigh = NULL;
h2SwingLow = NULL;
//
// H1 ...
//
h1State.Clean();
h1MarketDirection = X_DIRECTION_NONE;
Clean(h1SupportZones);
Clean(h1ResistanceZones);
//
h1SwingHigh = NULL;
h1SwingLow = NULL;
//
// M15 ...
//
m15State.Clean();
m15MarketDirection = X_DIRECTION_NONE;
Clean(m15SupportZones);
Clean(m15ResistanceZones);
//
m15SwingHigh = NULL;
m15SwingLow = NULL;
//
// M5 ...
//
m5State.Clean();
m5MarketDirection = X_DIRECTION_NONE;
Clean(m5SupportZones);
Clean(m5ResistanceZones);
//
m5SwingHigh = NULL;
m5SwingLow = NULL;
//
// M1 ...
//
m1State.Clean();
m1MarketDirection = X_DIRECTION_NONE;
Clean(m1SupportZones);
Clean(m1ResistanceZones);
//
m1SwingHigh = NULL;
m1SwingLow = NULL;
}
/**
@@ -613,99 +425,6 @@ 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;
}
//
// Reporter Functions ...