last ...
This commit is contained in:
@@ -37,7 +37,7 @@ class XCX121SMCXINDSignalDetector : public XCBase
|
|||||||
bool useGuards;
|
bool useGuards;
|
||||||
double rfRewar;
|
double rfRewar;
|
||||||
XBoxZone mWaitingBoxes[];
|
XBoxZone mWaitingBoxes[];
|
||||||
XBoxZone mInsideBoxes[];
|
XBoxZone mActivatedBoxes[];
|
||||||
XBoxZone mBreakedBoxes[];
|
XBoxZone mBreakedBoxes[];
|
||||||
XBoxZone mUnAvailableBoxes[];
|
XBoxZone mUnAvailableBoxes[];
|
||||||
X121SMCStrategyXINDSignalConditions mConditions;
|
X121SMCStrategyXINDSignalConditions mConditions;
|
||||||
@@ -1077,7 +1077,7 @@ class XCX121SMCXINDSignalDetector : public XCBase
|
|||||||
)
|
)
|
||||||
{
|
{
|
||||||
//
|
//
|
||||||
int result = ArraySize(mWaitingBoxes) + ArraySize(mInsideBoxes);
|
int result = ArraySize(mWaitingBoxes) + ArraySize(mActivatedBoxes);
|
||||||
|
|
||||||
//
|
//
|
||||||
int count = 0;
|
int count = 0;
|
||||||
@@ -1216,6 +1216,11 @@ class XCX121SMCXINDSignalDetector : public XCBase
|
|||||||
|
|
||||||
//
|
//
|
||||||
// Update Times ...
|
// Update Times ...
|
||||||
|
datetime requireTime = GetBarTime(
|
||||||
|
cState.symbol,
|
||||||
|
cState.period,
|
||||||
|
1 //
|
||||||
|
);
|
||||||
|
|
||||||
//
|
//
|
||||||
count = ArraySize(mWaitingBoxes);
|
count = ArraySize(mWaitingBoxes);
|
||||||
@@ -1225,19 +1230,19 @@ class XCX121SMCXINDSignalDetector : public XCBase
|
|||||||
//
|
//
|
||||||
for (int i = 0; i < count; i++)
|
for (int i = 0; i < count; i++)
|
||||||
{
|
{
|
||||||
mWaitingBoxes[i].to = TimeCurrent();
|
mWaitingBoxes[i].to = requireTime;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
//
|
//
|
||||||
count = ArraySize(mInsideBoxes);
|
count = ArraySize(mActivatedBoxes);
|
||||||
has = IsValidSize(count);
|
has = IsValidSize(count);
|
||||||
if (has)
|
if (has)
|
||||||
{
|
{
|
||||||
//
|
//
|
||||||
for (int i = 0; i < count; i++)
|
for (int i = 0; i < count; i++)
|
||||||
{
|
{
|
||||||
mInsideBoxes[i].to = TimeCurrent();
|
mActivatedBoxes[i].to = requireTime;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -1246,113 +1251,144 @@ class XCX121SMCXINDSignalDetector : public XCBase
|
|||||||
|
|
||||||
//
|
//
|
||||||
// Waiting Boxes ...
|
// Waiting Boxes ...
|
||||||
// count = ArraySize(mWaitingBoxes);
|
count = ArraySize(mWaitingBoxes);
|
||||||
// has = IsValidSize(count);
|
has = IsValidSize(count);
|
||||||
// if (has)
|
if (has)
|
||||||
// {
|
{
|
||||||
// //
|
//
|
||||||
// int mustRemove[];
|
int mustRemove[];
|
||||||
// for (int i = 0; i < count; i++)
|
for (int i = 0; i < count; i++)
|
||||||
// {
|
{
|
||||||
// //
|
//
|
||||||
// mWaitingBoxes[i].to = TimeCurrent();
|
XBoxZone iBox = mWaitingBoxes[i];
|
||||||
// XBoxZone iBox = mWaitingBoxes[i];
|
|
||||||
|
|
||||||
// //
|
//
|
||||||
// bool isValid = IsBoxValid(
|
// Check Box Validation ...
|
||||||
// iBox,
|
bool isValid = IsBoxValid(
|
||||||
// 0,
|
iBox,
|
||||||
// iBox.period //
|
0,
|
||||||
// );
|
iBox.period //
|
||||||
// bool isBreaked = IsBoxBreaked(
|
);
|
||||||
// iBox,
|
|
||||||
// 0,
|
|
||||||
// iBox.period //
|
|
||||||
// );
|
|
||||||
|
|
||||||
// //
|
//
|
||||||
// bool isInside = !isValid && !isBreaked;
|
// Check Box Breaked ...
|
||||||
// if (isInside)
|
bool isBreaked = IsBoxBreaked(
|
||||||
// {
|
iBox,
|
||||||
// //
|
0,
|
||||||
// Add(
|
iBox.period //
|
||||||
// i,
|
);
|
||||||
// mustRemove //
|
|
||||||
// );
|
|
||||||
|
|
||||||
// //
|
//
|
||||||
// AddRef(
|
// Box Waiting ...
|
||||||
// iBox,
|
if (isValid)
|
||||||
// mInsideBoxes //
|
{
|
||||||
// );
|
//
|
||||||
// }
|
iBox.Clean();
|
||||||
|
continue;
|
||||||
|
}
|
||||||
|
|
||||||
// //
|
//
|
||||||
// if (!isInside && isBreaked)
|
// Box Breaked ...
|
||||||
// {
|
if (isBreaked)
|
||||||
// //
|
{
|
||||||
// Add(
|
//
|
||||||
// i,
|
Add(
|
||||||
// mustRemove //
|
i,
|
||||||
// );
|
mustRemove //
|
||||||
|
);
|
||||||
|
|
||||||
// //
|
//
|
||||||
// AddRef(
|
AddRef(
|
||||||
// iBox,
|
iBox,
|
||||||
// mBreakedBoxes //
|
mBreakedBoxes //
|
||||||
// );
|
);
|
||||||
// }
|
|
||||||
// }
|
|
||||||
|
|
||||||
// //
|
//
|
||||||
// CleanupArray(
|
iBox.Clean();
|
||||||
// mustRemove,
|
continue;
|
||||||
// mWaitingBoxes //
|
}
|
||||||
// );
|
|
||||||
// }
|
//
|
||||||
|
// Box Activated ...
|
||||||
|
if (!isValid)
|
||||||
|
{
|
||||||
|
//
|
||||||
|
Add(
|
||||||
|
i,
|
||||||
|
mustRemove //
|
||||||
|
);
|
||||||
|
|
||||||
|
//
|
||||||
|
AddRef(
|
||||||
|
iBox,
|
||||||
|
mActivatedBoxes //
|
||||||
|
);
|
||||||
|
|
||||||
|
//
|
||||||
|
iBox.Clean();
|
||||||
|
continue;
|
||||||
|
}
|
||||||
|
|
||||||
|
//
|
||||||
|
iBox.Clean();
|
||||||
|
}
|
||||||
|
|
||||||
|
//
|
||||||
|
CleanupArray(
|
||||||
|
mustRemove,
|
||||||
|
mWaitingBoxes //
|
||||||
|
);
|
||||||
|
}
|
||||||
|
|
||||||
//
|
//
|
||||||
// Inside Boxes ...
|
// Activated Boxes ...
|
||||||
// count = ArraySize(mInsideBoxes);
|
count = ArraySize(mActivatedBoxes);
|
||||||
// has = IsValidSize(count);
|
has = IsValidSize(count);
|
||||||
// if (has)
|
if (has)
|
||||||
// {
|
{
|
||||||
// //
|
//
|
||||||
// int mustRemove[];
|
int mustRemove[];
|
||||||
// for (int i = 0; i < count; i++)
|
for (int i = 0; i < count; i++)
|
||||||
// {
|
{
|
||||||
// //
|
//
|
||||||
// mInsideBoxes[i].to = TimeCurrent();
|
XBoxZone iBox = mActivatedBoxes[i];
|
||||||
// XBoxZone iBox = mInsideBoxes[i];
|
|
||||||
|
|
||||||
// //
|
//
|
||||||
// bool isBreaked = IsBoxBreaked(
|
// Check Breaked ...
|
||||||
// iBox,
|
bool isBreaked = IsBoxBreaked(
|
||||||
// 0,
|
iBox,
|
||||||
// iBox.period //
|
0,
|
||||||
// );
|
iBox.period //
|
||||||
// if (isBreaked)
|
);
|
||||||
// {
|
if (isBreaked)
|
||||||
// //
|
{
|
||||||
// Add(
|
//
|
||||||
// i,
|
Add(
|
||||||
// mustRemove //
|
i,
|
||||||
// );
|
mustRemove //
|
||||||
|
);
|
||||||
|
|
||||||
// //
|
//
|
||||||
// AddRef(
|
AddRef(
|
||||||
// iBox,
|
iBox,
|
||||||
// mBreakedBoxes //
|
mBreakedBoxes //
|
||||||
// );
|
);
|
||||||
// }
|
|
||||||
// }
|
|
||||||
|
|
||||||
// //
|
//
|
||||||
// CleanupArray(
|
iBox.Clean();
|
||||||
// mustRemove,
|
continue;
|
||||||
// mInsideBoxes //
|
}
|
||||||
// );
|
|
||||||
// }
|
//
|
||||||
|
iBox.Clean();
|
||||||
|
}
|
||||||
|
|
||||||
|
//
|
||||||
|
CleanupArray(
|
||||||
|
mustRemove,
|
||||||
|
mActivatedBoxes //
|
||||||
|
);
|
||||||
|
}
|
||||||
|
|
||||||
//
|
//
|
||||||
// Cleanup Resources ...
|
// Cleanup Resources ...
|
||||||
@@ -1365,7 +1401,7 @@ class XCX121SMCXINDSignalDetector : public XCBase
|
|||||||
cStateEvents.Clean();
|
cStateEvents.Clean();
|
||||||
|
|
||||||
//
|
//
|
||||||
result = ArraySize(mWaitingBoxes) + ArraySize(mInsideBoxes);
|
result = ArraySize(mWaitingBoxes) + ArraySize(mActivatedBoxes);
|
||||||
|
|
||||||
//
|
//
|
||||||
return result;
|
return result;
|
||||||
@@ -1402,8 +1438,8 @@ class XCX121SMCXINDSignalDetector : public XCBase
|
|||||||
}
|
}
|
||||||
|
|
||||||
//
|
//
|
||||||
// Inside Boxes ...
|
// Activated Boxes ...
|
||||||
count = ArraySize(mInsideBoxes);
|
count = ArraySize(mActivatedBoxes);
|
||||||
has = IsValidSize(count);
|
has = IsValidSize(count);
|
||||||
if (has)
|
if (has)
|
||||||
{
|
{
|
||||||
@@ -1411,7 +1447,7 @@ class XCX121SMCXINDSignalDetector : public XCBase
|
|||||||
has = FindBoxIndex(
|
has = FindBoxIndex(
|
||||||
idx,
|
idx,
|
||||||
box,
|
box,
|
||||||
mInsideBoxes //
|
mActivatedBoxes //
|
||||||
);
|
);
|
||||||
result = has;
|
result = has;
|
||||||
if (result)
|
if (result)
|
||||||
@@ -1643,8 +1679,8 @@ class XCX121SMCXINDSignalDetector : public XCBase
|
|||||||
}
|
}
|
||||||
|
|
||||||
//
|
//
|
||||||
// Inside Boxes ...
|
// Activated Boxes ...
|
||||||
count = ArraySize(mInsideBoxes);
|
count = ArraySize(mActivatedBoxes);
|
||||||
has = IsValidSize(count);
|
has = IsValidSize(count);
|
||||||
if (has)
|
if (has)
|
||||||
{
|
{
|
||||||
@@ -1654,13 +1690,13 @@ class XCX121SMCXINDSignalDetector : public XCBase
|
|||||||
//
|
//
|
||||||
XCBoxObject *iObj;
|
XCBoxObject *iObj;
|
||||||
has = drawer.DrawBox(
|
has = drawer.DrawBox(
|
||||||
mInsideBoxes[i],
|
mActivatedBoxes[i],
|
||||||
iObj //
|
iObj //
|
||||||
);
|
);
|
||||||
if (has)
|
if (has)
|
||||||
{
|
{
|
||||||
//
|
//
|
||||||
if (mInsideBoxes[i].IsBullish())
|
if (mActivatedBoxes[i].IsBullish())
|
||||||
{
|
{
|
||||||
iObj.BoxColor(clrYellow);
|
iObj.BoxColor(clrYellow);
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user