apply all chanes on xatr indicator, remains Helper ...
This commit is contained in:
@@ -4788,6 +4788,105 @@ struct X121SMCStrategyConditionParser
|
||||
(cXConditions.isStrBearish ||
|
||||
cXConditions.isStrSwitchedToBearish);
|
||||
|
||||
//
|
||||
// Detecting Str Box ...
|
||||
XBoxZone strBox;
|
||||
bool hasStrBox = false;
|
||||
if (!hasStrBox)
|
||||
{
|
||||
//
|
||||
hasStrBox =
|
||||
cXConditions.isStrBullish ||
|
||||
cXConditions.isStrBearish;
|
||||
if (hasStrBox)
|
||||
{
|
||||
//
|
||||
ENUM_X_DIRECTION strDir =
|
||||
cXConditions.isStrBullish
|
||||
? X_DIRECTION_BULLISH
|
||||
: X_DIRECTION_BEARISH;
|
||||
|
||||
//
|
||||
XOHCL lastBar;
|
||||
ENUM_X_DIRECTION lastDir;
|
||||
bool hasLast =
|
||||
cHelper
|
||||
.DetectNearestStrSwitched(
|
||||
lastBar,
|
||||
lastDir,
|
||||
zIDX //
|
||||
);
|
||||
|
||||
//
|
||||
XOHCL prevBar;
|
||||
ENUM_X_DIRECTION prevDir;
|
||||
bool hasPrev =
|
||||
hasLast &&
|
||||
cHelper
|
||||
.DetectNearestStrSwitched(
|
||||
prevBar,
|
||||
prevDir,
|
||||
lastBar.Index() + 1 //
|
||||
);
|
||||
|
||||
//
|
||||
hasStrBox =
|
||||
hasLast &&
|
||||
hasPrev;
|
||||
if (hasStrBox)
|
||||
{
|
||||
//
|
||||
int fromIDX = MathMax(
|
||||
lastBar.Index(),
|
||||
prevBar.Index() //
|
||||
);
|
||||
|
||||
//
|
||||
string symbol = cBar.symbol;
|
||||
ENUM_TIMEFRAMES period = cBar.period;
|
||||
|
||||
//
|
||||
datetime from = GetBarTime(
|
||||
symbol,
|
||||
period,
|
||||
fromIDX //
|
||||
);
|
||||
|
||||
//
|
||||
int length = fromIDX - barIndex;
|
||||
|
||||
//
|
||||
double upper = zBar.FindHighest(
|
||||
length,
|
||||
MODE_HIGH //
|
||||
);
|
||||
|
||||
//
|
||||
double lower = zBar.FindLowest(
|
||||
length,
|
||||
MODE_LOW //
|
||||
);
|
||||
|
||||
//
|
||||
strBox.from = from;
|
||||
strBox.dir = strDir;
|
||||
strBox.lower = lower;
|
||||
strBox.upper = upper;
|
||||
strBox.symbol = symbol;
|
||||
strBox.period = period;
|
||||
strBox.type = "XSTRBox";
|
||||
strBox.to = TimeCurrent();
|
||||
|
||||
//
|
||||
hasStrBox =strBox.IsValid();
|
||||
}
|
||||
|
||||
//
|
||||
lastBar.Clean();
|
||||
prevBar.Clean();
|
||||
}
|
||||
}
|
||||
|
||||
//
|
||||
// XFastMa ...
|
||||
|
||||
@@ -4820,6 +4919,7 @@ struct X121SMCStrategyConditionParser
|
||||
isBullish =
|
||||
//
|
||||
// false
|
||||
hasStrBox &&
|
||||
isStrIsBullish &&
|
||||
isFastMaOverStr &&
|
||||
// isDeltaIsBullish &&
|
||||
@@ -4833,6 +4933,7 @@ struct X121SMCStrategyConditionParser
|
||||
isBearish =
|
||||
//
|
||||
// false
|
||||
hasStrBox &&
|
||||
isStrIsBearish &&
|
||||
isFastMaUnderStr &&
|
||||
// isDeltaIsBearish &&
|
||||
@@ -4848,6 +4949,18 @@ struct X121SMCStrategyConditionParser
|
||||
isBearish;
|
||||
if (result)
|
||||
{
|
||||
//
|
||||
XCPOIDrawer *drawer = provider.visionCycleHelper.mPOIDrawer;
|
||||
XCBoxObject *iObj;
|
||||
bool isCreated = drawer.DrawBox(
|
||||
strBox,
|
||||
iObj //
|
||||
);
|
||||
if (isCreated) {
|
||||
//
|
||||
Print("STRBox");
|
||||
}
|
||||
|
||||
//
|
||||
dir =
|
||||
isBullish
|
||||
@@ -4865,7 +4978,7 @@ struct X121SMCStrategyConditionParser
|
||||
double points = GetPoints(box.symbol);
|
||||
|
||||
//
|
||||
double pivot = cXConditions.strBuffer[cIDX];
|
||||
double pivot = cXConditions.strBuffer[cIDX];
|
||||
// isBullish
|
||||
// ? cBar.low - (points * 5)
|
||||
// : cBar.high + (points * 5);
|
||||
@@ -4911,6 +5024,7 @@ struct X121SMCStrategyConditionParser
|
||||
pBar.Clean();
|
||||
pPBar.Clean();
|
||||
cState.Clean();
|
||||
strBox.Clean();
|
||||
cConditions.Clean();
|
||||
cConditions.Clean();
|
||||
ZeroMemory(cHelper);
|
||||
|
||||
Reference in New Issue
Block a user