Last Works ...
This commit is contained in:
@@ -1286,33 +1286,42 @@ class XCPOIDrawer : public XCBase
|
|||||||
SubWindowIdentification(0);
|
SubWindowIdentification(0);
|
||||||
|
|
||||||
//
|
//
|
||||||
SwingLowWidth(3);
|
int arrowWidth = 1;
|
||||||
|
|
||||||
|
//
|
||||||
SwingLowArrow(108);
|
SwingLowArrow(108);
|
||||||
SwingLowColor(clrAqua);
|
SwingLowColor(clrAqua);
|
||||||
|
SwingLowWidth(arrowWidth);
|
||||||
|
|
||||||
//
|
//
|
||||||
SwingHighWidth(3);
|
|
||||||
SwingHighArrow(108);
|
SwingHighArrow(108);
|
||||||
|
SwingHighWidth(arrowWidth);
|
||||||
SwingHighColor(clrMagenta);
|
SwingHighColor(clrMagenta);
|
||||||
|
|
||||||
//
|
//
|
||||||
BullishMomentumBarWidth(3);
|
arrowWidth++;
|
||||||
|
|
||||||
|
//
|
||||||
BullishMomentumBarArrow(225);
|
BullishMomentumBarArrow(225);
|
||||||
|
BullishMomentumBarWidth(arrowWidth);
|
||||||
BullishMomentumBarColor(clrAqua);
|
BullishMomentumBarColor(clrAqua);
|
||||||
|
|
||||||
//
|
//
|
||||||
BearishMomentumBarWidth(3);
|
|
||||||
BearishMomentumBarArrow(226);
|
BearishMomentumBarArrow(226);
|
||||||
|
BearishMomentumBarWidth(arrowWidth);
|
||||||
BearishMomentumBarColor(clrMagenta);
|
BearishMomentumBarColor(clrMagenta);
|
||||||
|
|
||||||
//
|
//
|
||||||
BullishRejectionBarWidth(3);
|
arrowWidth++;
|
||||||
|
|
||||||
|
//
|
||||||
BullishRejectionBarArrow(217);
|
BullishRejectionBarArrow(217);
|
||||||
|
BullishRejectionBarWidth(arrowWidth);
|
||||||
BullishRejectionBarColor(clrAqua);
|
BullishRejectionBarColor(clrAqua);
|
||||||
|
|
||||||
//
|
//
|
||||||
BearishRejectionBarWidth(3);
|
|
||||||
BearishRejectionBarArrow(218);
|
BearishRejectionBarArrow(218);
|
||||||
|
BearishRejectionBarWidth(arrowWidth);
|
||||||
BearishRejectionBarColor(clrMagenta);
|
BearishRejectionBarColor(clrMagenta);
|
||||||
|
|
||||||
//
|
//
|
||||||
@@ -2273,8 +2282,8 @@ class XCPOIDrawer : public XCBase
|
|||||||
|
|
||||||
bool CreateTicksZone(
|
bool CreateTicksZone(
|
||||||
XCTicksZone &zone,
|
XCTicksZone &zone,
|
||||||
XCTicksZoneObject *&object
|
XCTicksZoneObject *&object)
|
||||||
) {
|
{
|
||||||
//
|
//
|
||||||
bool result = false;
|
bool result = false;
|
||||||
|
|
||||||
|
|||||||
@@ -31,6 +31,8 @@
|
|||||||
|
|
||||||
const string X121SMCStrategyToken = "X121SMC";
|
const string X121SMCStrategyToken = "X121SMC";
|
||||||
|
|
||||||
|
//
|
||||||
|
// Model Signalling Conditions ...
|
||||||
struct X121SMCStrategyConditions
|
struct X121SMCStrategyConditions
|
||||||
{
|
{
|
||||||
//
|
//
|
||||||
@@ -40,53 +42,95 @@ struct X121SMCStrategyConditions
|
|||||||
|
|
||||||
//
|
//
|
||||||
// D1 ...
|
// D1 ...
|
||||||
|
|
||||||
|
//
|
||||||
XPOIState d1State;
|
XPOIState d1State;
|
||||||
ENUM_X_DIRECTION d1MarketDirection;
|
ENUM_X_DIRECTION d1MarketDirection;
|
||||||
XCSupportZone *d1SupportZones[];
|
XCSupportZone *d1SupportZones[];
|
||||||
XCResistanceZone *d1ResistanceZones[];
|
XCResistanceZone *d1ResistanceZones[];
|
||||||
|
|
||||||
|
//
|
||||||
|
XCSwing *d1SwingHigh;
|
||||||
|
XCSwing *d1SwingLow;
|
||||||
|
|
||||||
//
|
//
|
||||||
// H4 ...
|
// H4 ...
|
||||||
|
|
||||||
|
//
|
||||||
XPOIState h4State;
|
XPOIState h4State;
|
||||||
ENUM_X_DIRECTION h4MarketDirection;
|
ENUM_X_DIRECTION h4MarketDirection;
|
||||||
XCSupportZone *h4SupportZones[];
|
XCSupportZone *h4SupportZones[];
|
||||||
XCResistanceZone *h4ResistanceZones[];
|
XCResistanceZone *h4ResistanceZones[];
|
||||||
|
|
||||||
|
//
|
||||||
|
XCSwing *h4SwingHigh;
|
||||||
|
XCSwing *h4SwingLow;
|
||||||
|
|
||||||
//
|
//
|
||||||
// H2 ...
|
// H2 ...
|
||||||
|
|
||||||
|
//
|
||||||
XPOIState h2State;
|
XPOIState h2State;
|
||||||
ENUM_X_DIRECTION h2MarketDirection;
|
ENUM_X_DIRECTION h2MarketDirection;
|
||||||
XCSupportZone *h2SupportZones[];
|
XCSupportZone *h2SupportZones[];
|
||||||
XCResistanceZone *h2ResistanceZones[];
|
XCResistanceZone *h2ResistanceZones[];
|
||||||
|
|
||||||
|
//
|
||||||
|
XCSwing *h2SwingHigh;
|
||||||
|
XCSwing *h2SwingLow;
|
||||||
|
|
||||||
//
|
//
|
||||||
// H1 ...
|
// H1 ...
|
||||||
|
|
||||||
|
//
|
||||||
XPOIState h1State;
|
XPOIState h1State;
|
||||||
ENUM_X_DIRECTION h1MarketDirection;
|
ENUM_X_DIRECTION h1MarketDirection;
|
||||||
XCSupportZone *h1SupportZones[];
|
XCSupportZone *h1SupportZones[];
|
||||||
XCResistanceZone *h1ResistanceZones[];
|
XCResistanceZone *h1ResistanceZones[];
|
||||||
|
|
||||||
|
//
|
||||||
|
XCSwing *h1SwingHigh;
|
||||||
|
XCSwing *h1SwingLow;
|
||||||
|
|
||||||
//
|
//
|
||||||
// M15 ...
|
// M15 ...
|
||||||
|
|
||||||
|
//
|
||||||
XPOIState m15State;
|
XPOIState m15State;
|
||||||
ENUM_X_DIRECTION m15MarketDirection;
|
ENUM_X_DIRECTION m15MarketDirection;
|
||||||
XCSupportZone *m15SupportZones[];
|
XCSupportZone *m15SupportZones[];
|
||||||
XCResistanceZone *m15ResistanceZones[];
|
XCResistanceZone *m15ResistanceZones[];
|
||||||
|
|
||||||
|
//
|
||||||
|
XCSwing *m15SwingHigh;
|
||||||
|
XCSwing *m15SwingLow;
|
||||||
|
|
||||||
//
|
//
|
||||||
// M5 ...
|
// M5 ...
|
||||||
|
|
||||||
|
//
|
||||||
XPOIState m5State;
|
XPOIState m5State;
|
||||||
ENUM_X_DIRECTION m5MarketDirection;
|
ENUM_X_DIRECTION m5MarketDirection;
|
||||||
XCSupportZone *m5SupportZones[];
|
XCSupportZone *m5SupportZones[];
|
||||||
XCResistanceZone *m5ResistanceZones[];
|
XCResistanceZone *m5ResistanceZones[];
|
||||||
|
|
||||||
|
//
|
||||||
|
XCSwing *m5SwingHigh;
|
||||||
|
XCSwing *m5SwingLow;
|
||||||
|
|
||||||
//
|
//
|
||||||
// M1 ...
|
// M1 ...
|
||||||
|
|
||||||
|
//
|
||||||
XPOIState m1State;
|
XPOIState m1State;
|
||||||
ENUM_X_DIRECTION m1MarketDirection;
|
ENUM_X_DIRECTION m1MarketDirection;
|
||||||
XCSupportZone *m1SupportZones[];
|
XCSupportZone *m1SupportZones[];
|
||||||
XCResistanceZone *m1ResistanceZones[];
|
XCResistanceZone *m1ResistanceZones[];
|
||||||
|
|
||||||
|
//
|
||||||
|
XCSwing *m1SwingHigh;
|
||||||
|
XCSwing *m1SwingLow;
|
||||||
|
|
||||||
//
|
//
|
||||||
void X121SMCStrategyConditions()
|
void X121SMCStrategyConditions()
|
||||||
{
|
{
|
||||||
@@ -108,52 +152,94 @@ struct X121SMCStrategyConditions
|
|||||||
|
|
||||||
//
|
//
|
||||||
// D1 ...
|
// D1 ...
|
||||||
|
|
||||||
|
//
|
||||||
d1State.Clean();
|
d1State.Clean();
|
||||||
d1MarketDirection = X_DIRECTION_NONE;
|
d1MarketDirection = X_DIRECTION_NONE;
|
||||||
Clean(d1SupportZones);
|
Clean(d1SupportZones);
|
||||||
Clean(d1ResistanceZones);
|
Clean(d1ResistanceZones);
|
||||||
|
|
||||||
|
//
|
||||||
|
d1SwingHigh = NULL;
|
||||||
|
d1SwingLow = NULL;
|
||||||
|
|
||||||
//
|
//
|
||||||
// H4 ...
|
// H4 ...
|
||||||
|
|
||||||
|
//
|
||||||
h4State.Clean();
|
h4State.Clean();
|
||||||
h4MarketDirection = X_DIRECTION_NONE;
|
h4MarketDirection = X_DIRECTION_NONE;
|
||||||
Clean(h4SupportZones);
|
Clean(h4SupportZones);
|
||||||
Clean(h4ResistanceZones);
|
Clean(h4ResistanceZones);
|
||||||
|
|
||||||
|
//
|
||||||
|
h4SwingHigh = NULL;
|
||||||
|
h4SwingLow = NULL;
|
||||||
|
|
||||||
//
|
//
|
||||||
// H2 ...
|
// H2 ...
|
||||||
|
|
||||||
|
//
|
||||||
h2State.Clean();
|
h2State.Clean();
|
||||||
h2MarketDirection = X_DIRECTION_NONE;
|
h2MarketDirection = X_DIRECTION_NONE;
|
||||||
Clean(h2SupportZones);
|
Clean(h2SupportZones);
|
||||||
Clean(h2ResistanceZones);
|
Clean(h2ResistanceZones);
|
||||||
|
|
||||||
|
//
|
||||||
|
h2SwingHigh = NULL;
|
||||||
|
h2SwingLow = NULL;
|
||||||
|
|
||||||
//
|
//
|
||||||
// H1 ...
|
// H1 ...
|
||||||
|
|
||||||
|
//
|
||||||
h1State.Clean();
|
h1State.Clean();
|
||||||
h1MarketDirection = X_DIRECTION_NONE;
|
h1MarketDirection = X_DIRECTION_NONE;
|
||||||
Clean(h1SupportZones);
|
Clean(h1SupportZones);
|
||||||
Clean(h1ResistanceZones);
|
Clean(h1ResistanceZones);
|
||||||
|
|
||||||
|
//
|
||||||
|
h1SwingHigh = NULL;
|
||||||
|
h1SwingLow = NULL;
|
||||||
|
|
||||||
//
|
//
|
||||||
// M15 ...
|
// M15 ...
|
||||||
|
|
||||||
|
//
|
||||||
m15State.Clean();
|
m15State.Clean();
|
||||||
m15MarketDirection = X_DIRECTION_NONE;
|
m15MarketDirection = X_DIRECTION_NONE;
|
||||||
Clean(m15SupportZones);
|
Clean(m15SupportZones);
|
||||||
Clean(m15ResistanceZones);
|
Clean(m15ResistanceZones);
|
||||||
|
|
||||||
|
//
|
||||||
|
m15SwingHigh = NULL;
|
||||||
|
m15SwingLow = NULL;
|
||||||
|
|
||||||
//
|
//
|
||||||
// M5 ...
|
// M5 ...
|
||||||
|
|
||||||
|
//
|
||||||
m5State.Clean();
|
m5State.Clean();
|
||||||
m5MarketDirection = X_DIRECTION_NONE;
|
m5MarketDirection = X_DIRECTION_NONE;
|
||||||
Clean(m5SupportZones);
|
Clean(m5SupportZones);
|
||||||
Clean(m5ResistanceZones);
|
Clean(m5ResistanceZones);
|
||||||
|
|
||||||
|
//
|
||||||
|
m5SwingHigh = NULL;
|
||||||
|
m5SwingLow = NULL;
|
||||||
|
|
||||||
//
|
//
|
||||||
// M1 ...
|
// M1 ...
|
||||||
|
|
||||||
|
//
|
||||||
m1State.Clean();
|
m1State.Clean();
|
||||||
m1MarketDirection = X_DIRECTION_NONE;
|
m1MarketDirection = X_DIRECTION_NONE;
|
||||||
Clean(m1SupportZones);
|
Clean(m1SupportZones);
|
||||||
Clean(m1ResistanceZones);
|
Clean(m1ResistanceZones);
|
||||||
|
|
||||||
|
//
|
||||||
|
m1SwingHigh = NULL;
|
||||||
|
m1SwingLow = NULL;
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@@ -268,6 +354,9 @@ struct X121SMCStrategyConditions
|
|||||||
return result;
|
return result;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
//
|
||||||
|
// Reporter Functions ...
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Generate Provided Scores ...
|
* Generate Provided Scores ...
|
||||||
*
|
*
|
||||||
|
|||||||
@@ -176,8 +176,7 @@ class XCX121SMCTestStrategy : public XCX121SMCBaseStrategy
|
|||||||
|
|
||||||
//
|
//
|
||||||
// Try to Implement SMC Based Conditions ...
|
// Try to Implement SMC Based Conditions ...
|
||||||
ENUM_X_DIRECTION dir = X_DIRECTION_NONE;
|
result = DetectConditions();
|
||||||
result = DetectConditions(dir);
|
|
||||||
if (!result)
|
if (!result)
|
||||||
{
|
{
|
||||||
return result;
|
return result;
|
||||||
@@ -316,7 +315,12 @@ class XCX121SMCTestStrategy : public XCX121SMCBaseStrategy
|
|||||||
//
|
//
|
||||||
// Actions ...
|
// Actions ...
|
||||||
|
|
||||||
bool DetectConditions(ENUM_X_DIRECTION &dir)
|
/**
|
||||||
|
* Detect and Parse Market Conditions ...
|
||||||
|
*
|
||||||
|
* @return ( bool )
|
||||||
|
*/
|
||||||
|
bool DetectConditions()
|
||||||
{
|
{
|
||||||
//
|
//
|
||||||
bool result = false;
|
bool result = false;
|
||||||
@@ -327,9 +331,6 @@ class XCX121SMCTestStrategy : public XCX121SMCBaseStrategy
|
|||||||
mConditions.period = GetPeriod();
|
mConditions.period = GetPeriod();
|
||||||
mConditions.time = TimeCurrent();
|
mConditions.time = TimeCurrent();
|
||||||
|
|
||||||
//
|
|
||||||
dir = X_DIRECTION_NONE;
|
|
||||||
|
|
||||||
//
|
//
|
||||||
// Detect Market Structures ...
|
// Detect Market Structures ...
|
||||||
|
|
||||||
@@ -338,6 +339,8 @@ class XCX121SMCTestStrategy : public XCX121SMCBaseStrategy
|
|||||||
mConditions.d1State = _1DState;
|
mConditions.d1State = _1DState;
|
||||||
result = DetectMarketStructure(
|
result = DetectMarketStructure(
|
||||||
mConditions.d1MarketDirection,
|
mConditions.d1MarketDirection,
|
||||||
|
mConditions.d1SupportZones,
|
||||||
|
mConditions.d1ResistanceZones,
|
||||||
_1DState //
|
_1DState //
|
||||||
);
|
);
|
||||||
if (!result)
|
if (!result)
|
||||||
@@ -346,14 +349,14 @@ class XCX121SMCTestStrategy : public XCX121SMCBaseStrategy
|
|||||||
mConditions.Clean();
|
mConditions.Clean();
|
||||||
return result;
|
return result;
|
||||||
}
|
}
|
||||||
bool is1DBullish = IsBullish(mConditions.d1MarketDirection);
|
|
||||||
bool is1DBearish = IsBearish(mConditions.d1MarketDirection);
|
|
||||||
|
|
||||||
//
|
//
|
||||||
// 4H ...
|
// 4H ...
|
||||||
mConditions.h4State = _4HState;
|
mConditions.h4State = _4HState;
|
||||||
result = DetectMarketStructure(
|
result = DetectMarketStructure(
|
||||||
mConditions.h4MarketDirection,
|
mConditions.h4MarketDirection,
|
||||||
|
mConditions.h4SupportZones,
|
||||||
|
mConditions.h4ResistanceZones,
|
||||||
_4HState //
|
_4HState //
|
||||||
);
|
);
|
||||||
if (!result)
|
if (!result)
|
||||||
@@ -362,14 +365,14 @@ class XCX121SMCTestStrategy : public XCX121SMCBaseStrategy
|
|||||||
mConditions.Clean();
|
mConditions.Clean();
|
||||||
return result;
|
return result;
|
||||||
}
|
}
|
||||||
bool is4HBullish = IsBullish(mConditions.h4MarketDirection);
|
|
||||||
bool is4HBearish = IsBearish(mConditions.h4MarketDirection);
|
|
||||||
|
|
||||||
//
|
//
|
||||||
// 2H ...
|
// 2H ...
|
||||||
mConditions.h2State = _2HState;
|
mConditions.h2State = _2HState;
|
||||||
result = DetectMarketStructure(
|
result = DetectMarketStructure(
|
||||||
mConditions.h2MarketDirection,
|
mConditions.h2MarketDirection,
|
||||||
|
mConditions.h2SupportZones,
|
||||||
|
mConditions.h2ResistanceZones,
|
||||||
_2HState //
|
_2HState //
|
||||||
);
|
);
|
||||||
if (!result)
|
if (!result)
|
||||||
@@ -378,14 +381,14 @@ class XCX121SMCTestStrategy : public XCX121SMCBaseStrategy
|
|||||||
mConditions.Clean();
|
mConditions.Clean();
|
||||||
return result;
|
return result;
|
||||||
}
|
}
|
||||||
bool is2HBullish = IsBullish(mConditions.h2MarketDirection);
|
|
||||||
bool is2HBearish = IsBearish(mConditions.h2MarketDirection);
|
|
||||||
|
|
||||||
//
|
//
|
||||||
// 1H ...
|
// 1H ...
|
||||||
mConditions.h1State = _1HState;
|
mConditions.h1State = _1HState;
|
||||||
result = DetectMarketStructure(
|
result = DetectMarketStructure(
|
||||||
mConditions.h1MarketDirection,
|
mConditions.h1MarketDirection,
|
||||||
|
mConditions.h1SupportZones,
|
||||||
|
mConditions.h1ResistanceZones,
|
||||||
_1HState //
|
_1HState //
|
||||||
);
|
);
|
||||||
if (!result)
|
if (!result)
|
||||||
@@ -394,14 +397,14 @@ class XCX121SMCTestStrategy : public XCX121SMCBaseStrategy
|
|||||||
mConditions.Clean();
|
mConditions.Clean();
|
||||||
return result;
|
return result;
|
||||||
}
|
}
|
||||||
bool is1HBullish = IsBullish(mConditions.h1MarketDirection);
|
|
||||||
bool is1HBearish = IsBearish(mConditions.h1MarketDirection);
|
|
||||||
|
|
||||||
//
|
//
|
||||||
// 15M ...
|
// 15M ...
|
||||||
mConditions.m15State = _15MState;
|
mConditions.m15State = _15MState;
|
||||||
result = DetectMarketStructure(
|
result = DetectMarketStructure(
|
||||||
mConditions.m15MarketDirection,
|
mConditions.m15MarketDirection,
|
||||||
|
mConditions.m15SupportZones,
|
||||||
|
mConditions.m15ResistanceZones,
|
||||||
_15MState //
|
_15MState //
|
||||||
);
|
);
|
||||||
if (!result)
|
if (!result)
|
||||||
@@ -410,14 +413,14 @@ class XCX121SMCTestStrategy : public XCX121SMCBaseStrategy
|
|||||||
mConditions.Clean();
|
mConditions.Clean();
|
||||||
return result;
|
return result;
|
||||||
}
|
}
|
||||||
bool is15MBullish = IsBullish(mConditions.m15MarketDirection);
|
|
||||||
bool is15MBearish = IsBearish(mConditions.m15MarketDirection);
|
|
||||||
|
|
||||||
//
|
//
|
||||||
// 5M ...
|
// 5M ...
|
||||||
mConditions.m5State = _5MState;
|
mConditions.m5State = _5MState;
|
||||||
result = DetectMarketStructure(
|
result = DetectMarketStructure(
|
||||||
mConditions.m5MarketDirection,
|
mConditions.m5MarketDirection,
|
||||||
|
mConditions.m5SupportZones,
|
||||||
|
mConditions.m5ResistanceZones,
|
||||||
_5MState //
|
_5MState //
|
||||||
);
|
);
|
||||||
if (!result)
|
if (!result)
|
||||||
@@ -426,14 +429,14 @@ class XCX121SMCTestStrategy : public XCX121SMCBaseStrategy
|
|||||||
mConditions.Clean();
|
mConditions.Clean();
|
||||||
return result;
|
return result;
|
||||||
}
|
}
|
||||||
bool is5MBullish = IsBullish(mConditions.m5MarketDirection);
|
|
||||||
bool is5MBearish = IsBearish(mConditions.m5MarketDirection);
|
|
||||||
|
|
||||||
//
|
//
|
||||||
// 1M ...
|
// 1M ...
|
||||||
mConditions.m1State = _1MState;
|
mConditions.m1State = _1MState;
|
||||||
result = DetectMarketStructure(
|
result = DetectMarketStructure(
|
||||||
mConditions.m1MarketDirection,
|
mConditions.m1MarketDirection,
|
||||||
|
mConditions.m1SupportZones,
|
||||||
|
mConditions.m1ResistanceZones,
|
||||||
_1MState //
|
_1MState //
|
||||||
);
|
);
|
||||||
if (!result)
|
if (!result)
|
||||||
@@ -442,10 +445,9 @@ class XCX121SMCTestStrategy : public XCX121SMCBaseStrategy
|
|||||||
mConditions.Clean();
|
mConditions.Clean();
|
||||||
return result;
|
return result;
|
||||||
}
|
}
|
||||||
bool is1MBullish = IsBullish(mConditions.m1MarketDirection);
|
|
||||||
bool is1MBearish = IsBearish(mConditions.m1MarketDirection);
|
|
||||||
|
|
||||||
//
|
//
|
||||||
|
// 1H-15M-5M ...
|
||||||
ENUM_X_DIRECTION marketStructure = X_DIRECTION_NONE;
|
ENUM_X_DIRECTION marketStructure = X_DIRECTION_NONE;
|
||||||
result = mConditions.HasMarketStructure(marketStructure);
|
result = mConditions.HasMarketStructure(marketStructure);
|
||||||
if (!result)
|
if (!result)
|
||||||
@@ -456,7 +458,339 @@ class XCX121SMCTestStrategy : public XCX121SMCBaseStrategy
|
|||||||
}
|
}
|
||||||
|
|
||||||
//
|
//
|
||||||
DrawState(_5MState);
|
// Detect Swing High and Swing Low ...
|
||||||
|
// 1H-15M-5M ...
|
||||||
|
int count = 0;
|
||||||
|
|
||||||
|
//
|
||||||
|
// 1H ...
|
||||||
|
|
||||||
|
//
|
||||||
|
XCSwing *h1SwingLows[];
|
||||||
|
XCSwing *h1SwingHighs[];
|
||||||
|
XCSupportZone *h1SupportZone = NULL;
|
||||||
|
XCResistanceZone *h1ResistanceZone = NULL;
|
||||||
|
|
||||||
|
//
|
||||||
|
count = ArraySize(mConditions.h1SupportZones);
|
||||||
|
if (IsValidSize(count))
|
||||||
|
{
|
||||||
|
//
|
||||||
|
for (int i = 0; i < count; i++)
|
||||||
|
{
|
||||||
|
//
|
||||||
|
XCSupportZone *item = mConditions.h1SupportZones[i];
|
||||||
|
|
||||||
|
//
|
||||||
|
bool canSelect =
|
||||||
|
h1SupportZone == NULL ||
|
||||||
|
h1SupportZone.Lower() < item.Lower();
|
||||||
|
if (canSelect)
|
||||||
|
{
|
||||||
|
h1SupportZone = item;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
if (h1SupportZone != NULL)
|
||||||
|
{
|
||||||
|
//
|
||||||
|
// Detect Swings ...
|
||||||
|
count = ArraySize(mConditions.h1State.swingLows);
|
||||||
|
if (IsValidSize(count))
|
||||||
|
{
|
||||||
|
//
|
||||||
|
double upper = h1SupportZone.Upper();
|
||||||
|
double lower = h1SupportZone.Lower();
|
||||||
|
|
||||||
|
//
|
||||||
|
for (int i = 0; i < count; i++)
|
||||||
|
{
|
||||||
|
//
|
||||||
|
XCSwing *item = mConditions.h1State.swingLows[i];
|
||||||
|
|
||||||
|
//
|
||||||
|
XOHCL iBar;
|
||||||
|
bool isFilled = item.FillBar(iBar);
|
||||||
|
if (!isFilled)
|
||||||
|
{
|
||||||
|
continue;
|
||||||
|
}
|
||||||
|
|
||||||
|
//
|
||||||
|
bool canSelect = (iBar.high <= upper &&
|
||||||
|
iBar.low >= lower) ||
|
||||||
|
(iBar.high >= upper &&
|
||||||
|
iBar.low <= lower);
|
||||||
|
if (canSelect)
|
||||||
|
{
|
||||||
|
//
|
||||||
|
Add(
|
||||||
|
item,
|
||||||
|
h1SwingLows //
|
||||||
|
);
|
||||||
|
|
||||||
|
//
|
||||||
|
// Draw ...
|
||||||
|
XCSwingLowObject *iObj;
|
||||||
|
bool isCreated = mPOIDrawer.CreateSwingLow(
|
||||||
|
item,
|
||||||
|
iObj //
|
||||||
|
);
|
||||||
|
if (isCreated)
|
||||||
|
{
|
||||||
|
AddObjectIfNotExists(iObj);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
//
|
||||||
|
// Draw ...
|
||||||
|
XCSupportZoneObject *iObj;
|
||||||
|
bool isCreated = mPOIDrawer.CreateSupportZone(
|
||||||
|
h1SupportZone,
|
||||||
|
iObj //
|
||||||
|
);
|
||||||
|
if (isCreated)
|
||||||
|
{
|
||||||
|
AddObjectIfNotExists(iObj);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
//
|
||||||
|
count = ArraySize(mConditions.h1ResistanceZones);
|
||||||
|
if (IsValidSize(count))
|
||||||
|
{
|
||||||
|
//
|
||||||
|
for (int i = 0; i < count; i++)
|
||||||
|
{
|
||||||
|
//
|
||||||
|
XCResistanceZone *item = mConditions.h1ResistanceZones[i];
|
||||||
|
|
||||||
|
//
|
||||||
|
bool canSelect =
|
||||||
|
h1ResistanceZone == NULL ||
|
||||||
|
h1ResistanceZone.Upper() > item.Upper();
|
||||||
|
if (canSelect)
|
||||||
|
{
|
||||||
|
h1ResistanceZone = item;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
if (h1ResistanceZone != NULL)
|
||||||
|
{
|
||||||
|
//
|
||||||
|
// Detect Swings ...
|
||||||
|
count = ArraySize(mConditions.h1State.swingHighs);
|
||||||
|
if (IsValidSize(count))
|
||||||
|
{
|
||||||
|
//
|
||||||
|
double upper = h1ResistanceZone.Upper();
|
||||||
|
double lower = h1ResistanceZone.Lower();
|
||||||
|
|
||||||
|
//
|
||||||
|
for (int i = 0; i < count; i++)
|
||||||
|
{
|
||||||
|
//
|
||||||
|
XCSwing *item = mConditions.h1State.swingHighs[i];
|
||||||
|
|
||||||
|
//
|
||||||
|
XOHCL iBar;
|
||||||
|
bool isFilled = item.FillBar(iBar);
|
||||||
|
if (!isFilled)
|
||||||
|
{
|
||||||
|
continue;
|
||||||
|
}
|
||||||
|
|
||||||
|
//
|
||||||
|
bool canSelect = (iBar.high <= upper &&
|
||||||
|
iBar.low >= lower) ||
|
||||||
|
(iBar.high >= upper &&
|
||||||
|
iBar.low <= lower);
|
||||||
|
if (canSelect)
|
||||||
|
{
|
||||||
|
//
|
||||||
|
Add(
|
||||||
|
item,
|
||||||
|
h1SwingHighs //
|
||||||
|
);
|
||||||
|
|
||||||
|
//
|
||||||
|
// Draw ...
|
||||||
|
XCSwingHighObject *iObj;
|
||||||
|
bool isCreated = mPOIDrawer.CreateSwingHigh(
|
||||||
|
item,
|
||||||
|
iObj //
|
||||||
|
);
|
||||||
|
if (isCreated)
|
||||||
|
{
|
||||||
|
AddObjectIfNotExists(iObj);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
//
|
||||||
|
// Draw ...
|
||||||
|
XCResistanceZoneObject *iObj;
|
||||||
|
bool isCreated = mPOIDrawer.CreateResistanceZone(
|
||||||
|
h1ResistanceZone,
|
||||||
|
iObj //
|
||||||
|
);
|
||||||
|
if (isCreated)
|
||||||
|
{
|
||||||
|
AddObjectIfNotExists(iObj);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
//
|
||||||
|
// 15M ...
|
||||||
|
|
||||||
|
//
|
||||||
|
XCSupportZone *m15SupportZone = NULL;
|
||||||
|
count = ArraySize(mConditions.m15SupportZones);
|
||||||
|
if (IsValidSize(count))
|
||||||
|
{
|
||||||
|
//
|
||||||
|
for (int i = 0; i < count; i++)
|
||||||
|
{
|
||||||
|
//
|
||||||
|
XCSupportZone *item = mConditions.m15SupportZones[i];
|
||||||
|
|
||||||
|
//
|
||||||
|
bool canSelect =
|
||||||
|
m15SupportZone == NULL ||
|
||||||
|
m15SupportZone.Lower() < item.Lower();
|
||||||
|
if (canSelect)
|
||||||
|
{
|
||||||
|
m15SupportZone = item;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
if (m15SupportZone != NULL)
|
||||||
|
{
|
||||||
|
//
|
||||||
|
XCSupportZoneObject *iObj;
|
||||||
|
bool isCreated = mPOIDrawer.CreateSupportZone(
|
||||||
|
m15SupportZone,
|
||||||
|
iObj //
|
||||||
|
);
|
||||||
|
if (isCreated)
|
||||||
|
{
|
||||||
|
AddObjectIfNotExists(iObj);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
//
|
||||||
|
XCResistanceZone *m15ResistanceZone = NULL;
|
||||||
|
count = ArraySize(mConditions.m15ResistanceZones);
|
||||||
|
if (IsValidSize(count))
|
||||||
|
{
|
||||||
|
//
|
||||||
|
for (int i = 0; i < count; i++)
|
||||||
|
{
|
||||||
|
//
|
||||||
|
XCResistanceZone *item = mConditions.m15ResistanceZones[i];
|
||||||
|
|
||||||
|
//
|
||||||
|
bool canSelect =
|
||||||
|
m15ResistanceZone == NULL ||
|
||||||
|
m15ResistanceZone.Upper() > item.Upper();
|
||||||
|
if (canSelect)
|
||||||
|
{
|
||||||
|
m15ResistanceZone = item;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
if (m15ResistanceZone != NULL)
|
||||||
|
{
|
||||||
|
//
|
||||||
|
XCResistanceZoneObject *iObj;
|
||||||
|
bool isCreated = mPOIDrawer.CreateResistanceZone(
|
||||||
|
m15ResistanceZone,
|
||||||
|
iObj //
|
||||||
|
);
|
||||||
|
if (isCreated)
|
||||||
|
{
|
||||||
|
AddObjectIfNotExists(iObj);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
//
|
||||||
|
// 5M ...
|
||||||
|
|
||||||
|
//
|
||||||
|
XCSupportZone *m5SupportZone = NULL;
|
||||||
|
count = ArraySize(mConditions.m5SupportZones);
|
||||||
|
if (IsValidSize(count))
|
||||||
|
{
|
||||||
|
//
|
||||||
|
for (int i = 0; i < count; i++)
|
||||||
|
{
|
||||||
|
//
|
||||||
|
XCSupportZone *item = mConditions.m5SupportZones[i];
|
||||||
|
|
||||||
|
//
|
||||||
|
bool canSelect =
|
||||||
|
m5SupportZone == NULL ||
|
||||||
|
m5SupportZone.Lower() < item.Lower();
|
||||||
|
if (canSelect)
|
||||||
|
{
|
||||||
|
m5SupportZone = item;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
if (m5SupportZone != NULL)
|
||||||
|
{
|
||||||
|
//
|
||||||
|
XCSupportZoneObject *iObj;
|
||||||
|
bool isCreated = mPOIDrawer.CreateSupportZone(
|
||||||
|
m5SupportZone,
|
||||||
|
iObj //
|
||||||
|
);
|
||||||
|
if (isCreated)
|
||||||
|
{
|
||||||
|
AddObjectIfNotExists(iObj);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
//
|
||||||
|
XCResistanceZone *m5ResistanceZone = NULL;
|
||||||
|
count = ArraySize(mConditions.m5ResistanceZones);
|
||||||
|
if (IsValidSize(count))
|
||||||
|
{
|
||||||
|
//
|
||||||
|
for (int i = 0; i < count; i++)
|
||||||
|
{
|
||||||
|
//
|
||||||
|
XCResistanceZone *item = mConditions.m5ResistanceZones[i];
|
||||||
|
|
||||||
|
//
|
||||||
|
bool canSelect =
|
||||||
|
m5ResistanceZone == NULL ||
|
||||||
|
m5ResistanceZone.Upper() > item.Upper();
|
||||||
|
if (canSelect)
|
||||||
|
{
|
||||||
|
m5ResistanceZone = item;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
if (m5ResistanceZone != NULL)
|
||||||
|
{
|
||||||
|
//
|
||||||
|
XCResistanceZoneObject *iObj;
|
||||||
|
bool isCreated = mPOIDrawer.CreateResistanceZone(
|
||||||
|
m5ResistanceZone,
|
||||||
|
iObj //
|
||||||
|
);
|
||||||
|
if (isCreated)
|
||||||
|
{
|
||||||
|
AddObjectIfNotExists(iObj);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
//
|
||||||
|
// DrawState(_5MState);
|
||||||
|
|
||||||
//
|
//
|
||||||
return result;
|
return result;
|
||||||
@@ -472,6 +806,8 @@ class XCX121SMCTestStrategy : public XCX121SMCBaseStrategy
|
|||||||
*/
|
*/
|
||||||
bool DetectMarketStructure(
|
bool DetectMarketStructure(
|
||||||
ENUM_X_DIRECTION &dir,
|
ENUM_X_DIRECTION &dir,
|
||||||
|
XCSupportZone *&supportZones[],
|
||||||
|
XCResistanceZone *&resistanceZones[],
|
||||||
XPOIState &state //
|
XPOIState &state //
|
||||||
)
|
)
|
||||||
{
|
{
|
||||||
@@ -483,8 +819,8 @@ class XCX121SMCTestStrategy : public XCX121SMCBaseStrategy
|
|||||||
|
|
||||||
//
|
//
|
||||||
// Filter Untouched Supports ...
|
// Filter Untouched Supports ...
|
||||||
|
Clean(supportZones);
|
||||||
int untouchedSupportsCount = 0;
|
int untouchedSupportsCount = 0;
|
||||||
XCSupportZone *untouchedSupportZones[];
|
|
||||||
count = ArraySize(state.supportZones);
|
count = ArraySize(state.supportZones);
|
||||||
if (IsValidSize(count))
|
if (IsValidSize(count))
|
||||||
{
|
{
|
||||||
@@ -539,13 +875,13 @@ class XCX121SMCTestStrategy : public XCX121SMCBaseStrategy
|
|||||||
//
|
//
|
||||||
Add(
|
Add(
|
||||||
item,
|
item,
|
||||||
untouchedSupportZones //
|
supportZones //
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
//
|
//
|
||||||
untouchedSupportsCount = ArraySize(untouchedSupportZones);
|
untouchedSupportsCount = ArraySize(supportZones);
|
||||||
if (IsValidSize(untouchedSupportsCount))
|
if (IsValidSize(untouchedSupportsCount))
|
||||||
{
|
{
|
||||||
//
|
//
|
||||||
@@ -553,7 +889,7 @@ class XCX121SMCTestStrategy : public XCX121SMCBaseStrategy
|
|||||||
// for (int i = 0; i < untouchedSupportsCount; i++)
|
// for (int i = 0; i < untouchedSupportsCount; i++)
|
||||||
// {
|
// {
|
||||||
// //
|
// //
|
||||||
// XCSupportZone *item = untouchedSupportZones[i];
|
// XCSupportZone *item = supportZones[i];
|
||||||
|
|
||||||
// //
|
// //
|
||||||
// XCSupportZoneObject *iObj;
|
// XCSupportZoneObject *iObj;
|
||||||
@@ -571,8 +907,8 @@ class XCX121SMCTestStrategy : public XCX121SMCBaseStrategy
|
|||||||
|
|
||||||
//
|
//
|
||||||
// Filter Untouched Resistances ...
|
// Filter Untouched Resistances ...
|
||||||
|
Clean(resistanceZones);
|
||||||
int untouchedResistancesCount = 0;
|
int untouchedResistancesCount = 0;
|
||||||
XCResistanceZone *untouchedResistanceZones[];
|
|
||||||
count = ArraySize(state.resistanceZones);
|
count = ArraySize(state.resistanceZones);
|
||||||
if (IsValidSize(count))
|
if (IsValidSize(count))
|
||||||
{
|
{
|
||||||
@@ -627,13 +963,13 @@ class XCX121SMCTestStrategy : public XCX121SMCBaseStrategy
|
|||||||
//
|
//
|
||||||
Add(
|
Add(
|
||||||
item,
|
item,
|
||||||
untouchedResistanceZones //
|
resistanceZones //
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
//
|
//
|
||||||
untouchedResistancesCount = ArraySize(untouchedResistanceZones);
|
untouchedResistancesCount = ArraySize(resistanceZones);
|
||||||
if (IsValidSize(untouchedResistancesCount))
|
if (IsValidSize(untouchedResistancesCount))
|
||||||
{
|
{
|
||||||
//
|
//
|
||||||
@@ -641,7 +977,7 @@ class XCX121SMCTestStrategy : public XCX121SMCBaseStrategy
|
|||||||
// for (int i = 0; i < untouchedResistancesCount; i++)
|
// for (int i = 0; i < untouchedResistancesCount; i++)
|
||||||
// {
|
// {
|
||||||
// //
|
// //
|
||||||
// XCResistanceZone *item = untouchedResistanceZones[i];
|
// XCResistanceZone *item = resistanceZones[i];
|
||||||
|
|
||||||
// //
|
// //
|
||||||
// XCResistanceZoneObject *iObj;
|
// XCResistanceZoneObject *iObj;
|
||||||
|
|||||||
Reference in New Issue
Block a user