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