last ...
This commit is contained in:
@@ -36,6 +36,7 @@ class XCX121SMCXINDSignalDetector : public XCBase
|
||||
// Props ...
|
||||
bool useGuards;
|
||||
double rfRewar;
|
||||
bool isPassedBoxes;
|
||||
XBoxZone mWaitingBoxes[];
|
||||
XBoxZone mBreakedBoxes[];
|
||||
XBoxZone mActivatedBoxes[];
|
||||
@@ -1135,61 +1136,126 @@ class XCX121SMCXINDSignalDetector : public XCBase
|
||||
// Detecting New Boxes ...
|
||||
|
||||
//
|
||||
XBoxZone tmpBoxes[];
|
||||
count = cState.FairValueGapsAsBox(tmpBoxes);
|
||||
has = IsValidSize(count);
|
||||
if (has)
|
||||
// At First Try Check All Exists FVGs
|
||||
// then Only Check Youngest FVG ...
|
||||
if (!isPassedBoxes)
|
||||
{
|
||||
//
|
||||
for (int i = 0; i < count; i++)
|
||||
XBoxZone tmpBoxes[];
|
||||
count = cState.FairValueGapsAsBox(tmpBoxes);
|
||||
has = IsValidSize(count);
|
||||
if (has)
|
||||
{
|
||||
//
|
||||
XBoxZone iBox = tmpBoxes[i];
|
||||
|
||||
//
|
||||
// Regular Validation of Boxes ...
|
||||
bool isValid = IsBoxValid(
|
||||
iBox,
|
||||
0,
|
||||
iBox.period //
|
||||
);
|
||||
if (!isValid)
|
||||
for (int i = 0; i < count; i++)
|
||||
{
|
||||
//
|
||||
iBox.Clean();
|
||||
continue;
|
||||
}
|
||||
XBoxZone iBox = tmpBoxes[i];
|
||||
|
||||
//
|
||||
// Conditional Validation of FVG Boxes ...
|
||||
isValid = IsFVGBoxValid(
|
||||
iBox,
|
||||
vCycle,
|
||||
provider //
|
||||
);
|
||||
if (!isValid)
|
||||
{
|
||||
//
|
||||
iBox.Clean();
|
||||
continue;
|
||||
}
|
||||
|
||||
//
|
||||
has = IsBoxExists(iBox);
|
||||
if (!has)
|
||||
{
|
||||
//
|
||||
AddRef(
|
||||
// Regular Validation of Boxes ...
|
||||
bool isValid = IsBoxValid(
|
||||
iBox,
|
||||
mWaitingBoxes //
|
||||
0,
|
||||
iBox.period //
|
||||
);
|
||||
}
|
||||
if (!isValid)
|
||||
{
|
||||
//
|
||||
iBox.Clean();
|
||||
continue;
|
||||
}
|
||||
|
||||
//
|
||||
iBox.Clean();
|
||||
//
|
||||
// Conditional Validation of FVG Boxes ...
|
||||
isValid = IsFVGBoxValid(
|
||||
iBox,
|
||||
vCycle,
|
||||
provider //
|
||||
);
|
||||
if (!isValid)
|
||||
{
|
||||
//
|
||||
iBox.Clean();
|
||||
continue;
|
||||
}
|
||||
|
||||
//
|
||||
has = IsBoxExists(iBox);
|
||||
if (!has)
|
||||
{
|
||||
//
|
||||
AddRef(
|
||||
iBox,
|
||||
mWaitingBoxes //
|
||||
);
|
||||
}
|
||||
|
||||
//
|
||||
iBox.Clean();
|
||||
}
|
||||
}
|
||||
Clean(tmpBoxes);
|
||||
|
||||
//
|
||||
isPassedBoxes = true;
|
||||
}
|
||||
else
|
||||
{
|
||||
//
|
||||
XBoxZone iBox;
|
||||
has = cStateEvents.hasNewFairValueGap;
|
||||
if (has)
|
||||
{
|
||||
//
|
||||
int idx = GetYoungest(cState.fairValueGaps);
|
||||
has = IsValidIndex(idx);
|
||||
if (has)
|
||||
{
|
||||
//
|
||||
has = ToBox(
|
||||
iBox,
|
||||
cState.fairValueGaps[idx] //
|
||||
);
|
||||
if (has)
|
||||
{
|
||||
//
|
||||
// Regular Validation of Boxes ...
|
||||
bool isValid = IsBoxValid(
|
||||
iBox,
|
||||
0,
|
||||
iBox.period //
|
||||
);
|
||||
if (isValid)
|
||||
{
|
||||
//
|
||||
// Conditional Validation of FVG Boxes ...
|
||||
isValid = IsFVGBoxValid(
|
||||
iBox,
|
||||
vCycle,
|
||||
provider //
|
||||
);
|
||||
if (isValid)
|
||||
{
|
||||
//
|
||||
has = IsBoxExists(iBox);
|
||||
if (!has)
|
||||
{
|
||||
//
|
||||
AddRef(
|
||||
iBox,
|
||||
mWaitingBoxes //
|
||||
);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
//
|
||||
iBox.Clean();
|
||||
}
|
||||
Clean(tmpBoxes);
|
||||
|
||||
//
|
||||
// Update Times ...
|
||||
@@ -1854,6 +1920,7 @@ class XCX121SMCXINDSignalDetector : public XCBase
|
||||
//
|
||||
rfRewar = 2;
|
||||
useGuards = false;
|
||||
isPassedBoxes = false;
|
||||
}
|
||||
|
||||
/**
|
||||
|
||||
@@ -357,16 +357,17 @@ bool IsFVGBoxValid(
|
||||
selectedBox.symbol,
|
||||
selectedBox.period,
|
||||
selectedBox.from //
|
||||
) + 1;
|
||||
) +
|
||||
1;
|
||||
result = IsValidIndex(fromIndex);
|
||||
|
||||
//
|
||||
// To Index ...
|
||||
int toIndex = GetBarIndex(
|
||||
selectedBox.symbol,
|
||||
selectedBox.period,
|
||||
selectedBox.to //
|
||||
);
|
||||
selectedBox.symbol,
|
||||
selectedBox.period,
|
||||
selectedBox.to //
|
||||
);
|
||||
if (toIndex < 1)
|
||||
{
|
||||
toIndex = 1;
|
||||
@@ -603,14 +604,16 @@ bool IsFVGBoxValid(
|
||||
//
|
||||
bool isBullish =
|
||||
isBoxBullish &&
|
||||
!hasBearishOrConditions &&
|
||||
hasBullishAndConditions;
|
||||
!hasBearishOrConditions // &&
|
||||
// hasBullishAndConditions
|
||||
;
|
||||
|
||||
//
|
||||
bool isBearish =
|
||||
!isBoxBullish &&
|
||||
!hasBullishOrConditions &&
|
||||
hasBearishAndConditions;
|
||||
!hasBullishOrConditions // &&
|
||||
// hasBearishAndConditions
|
||||
;
|
||||
|
||||
//
|
||||
result = isBullish ||
|
||||
|
||||
Reference in New Issue
Block a user