last ...
This commit is contained in:
@@ -783,6 +783,7 @@ struct X121SMCStrategyXWZWorkingZone
|
|||||||
//
|
//
|
||||||
XBoxZone currSharp;
|
XBoxZone currSharp;
|
||||||
XBoxZone prevSharp;
|
XBoxZone prevSharp;
|
||||||
|
XBoxZone sharpConsolidation;
|
||||||
|
|
||||||
//
|
//
|
||||||
// Retrieve Current Sharp ...
|
// Retrieve Current Sharp ...
|
||||||
@@ -847,13 +848,74 @@ struct X121SMCStrategyXWZWorkingZone
|
|||||||
Clean(tmpBoxes);
|
Clean(tmpBoxes);
|
||||||
|
|
||||||
//
|
//
|
||||||
|
// Preparing Sharp Consolidation Box ...
|
||||||
has = currSharp.IsValid() &&
|
has = currSharp.IsValid() &&
|
||||||
prevSharp.IsValid();
|
prevSharp.IsValid() &&
|
||||||
|
prevSharp.lower < currSharp.upper;
|
||||||
|
if (has)
|
||||||
|
{
|
||||||
|
//
|
||||||
|
sharpConsolidation.type = "XSHCNZ";
|
||||||
|
sharpConsolidation.dir = currSharp.dir;
|
||||||
|
sharpConsolidation.symbol = currSharp.symbol;
|
||||||
|
sharpConsolidation.period = currSharp.period;
|
||||||
|
|
||||||
|
//
|
||||||
|
sharpConsolidation.from = prevSharp.to;
|
||||||
|
sharpConsolidation.to = currSharp.from;
|
||||||
|
|
||||||
|
//
|
||||||
|
int toIDX = GetBarIndex(
|
||||||
|
currSharp.symbol,
|
||||||
|
currSharp.period,
|
||||||
|
sharpConsolidation.to //
|
||||||
|
);
|
||||||
|
int fromIDX = GetBarIndex(
|
||||||
|
currSharp.symbol,
|
||||||
|
currSharp.period,
|
||||||
|
sharpConsolidation.from //
|
||||||
|
);
|
||||||
|
int length = fromIDX - toIDX;
|
||||||
|
|
||||||
|
//
|
||||||
|
XOHCL toBar;
|
||||||
|
has = toBar.Init(
|
||||||
|
sharpConsolidation.symbol,
|
||||||
|
sharpConsolidation.period,
|
||||||
|
toIDX //
|
||||||
|
);
|
||||||
|
|
||||||
|
//
|
||||||
|
if (has)
|
||||||
|
{
|
||||||
|
//
|
||||||
|
double upper = toBar.FindHighest(
|
||||||
|
length,
|
||||||
|
MODE_HIGH //
|
||||||
|
);
|
||||||
|
|
||||||
|
//
|
||||||
|
double lower = toBar.FindLowest(
|
||||||
|
length,
|
||||||
|
MODE_LOW //
|
||||||
|
);
|
||||||
|
|
||||||
|
//
|
||||||
|
sharpConsolidation.upper = upper;
|
||||||
|
sharpConsolidation.lower = lower;
|
||||||
|
}
|
||||||
|
|
||||||
|
//
|
||||||
|
has = sharpConsolidation.IsValid();
|
||||||
|
}
|
||||||
|
|
||||||
|
//
|
||||||
if (has)
|
if (has)
|
||||||
{
|
{
|
||||||
//
|
//
|
||||||
XCBoxObject *iCurrObj;
|
XCBoxObject *iCurrObj;
|
||||||
XCBoxObject *iPrevObj;
|
XCBoxObject *iPrevObj;
|
||||||
|
XCBoxObject *iSharpConsolidationObj;
|
||||||
has = drawer.DrawBox(
|
has = drawer.DrawBox(
|
||||||
currSharp,
|
currSharp,
|
||||||
iCurrObj //
|
iCurrObj //
|
||||||
@@ -864,22 +926,15 @@ struct X121SMCStrategyXWZWorkingZone
|
|||||||
prevSharp,
|
prevSharp,
|
||||||
iPrevObj //
|
iPrevObj //
|
||||||
);
|
);
|
||||||
|
has =
|
||||||
|
has &&
|
||||||
|
drawer.DrawBox(
|
||||||
|
sharpConsolidation,
|
||||||
|
iSharpConsolidationObj //
|
||||||
|
);
|
||||||
if (has)
|
if (has)
|
||||||
{
|
{
|
||||||
//
|
|
||||||
Print("Sharp Detection ...");
|
Print("Sharp Detection ...");
|
||||||
|
|
||||||
//
|
|
||||||
iCurrObj.Delete();
|
|
||||||
iPrevObj.Delete();
|
|
||||||
|
|
||||||
//
|
|
||||||
iCurrObj.Detach();
|
|
||||||
iPrevObj.Detach();
|
|
||||||
|
|
||||||
//
|
|
||||||
ZeroMemory(iCurrObj);
|
|
||||||
ZeroMemory(iPrevObj);
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user