last ...
This commit is contained in:
@@ -260,7 +260,7 @@ class XCBarAnalyser : public XCBase
|
||||
}
|
||||
|
||||
//
|
||||
index = bar.Index();
|
||||
index = bar.Index() + 1;
|
||||
bool canContinue = true;
|
||||
int sameBullishBarsFounded = 0;
|
||||
int sameBearishBarsFounded = 0;
|
||||
@@ -297,12 +297,20 @@ class XCBarAnalyser : public XCBase
|
||||
sameBullishBarsFounded++;
|
||||
canContinueForBearish = false;
|
||||
}
|
||||
else
|
||||
else if (isBearish)
|
||||
{
|
||||
//
|
||||
sameBearishBarsFounded++;
|
||||
canContinueForBullish = false;
|
||||
}
|
||||
else
|
||||
{
|
||||
//
|
||||
sameBullishBarsFounded = 0;
|
||||
sameBearishBarsFounded = 0;
|
||||
canContinueForBullish = false;
|
||||
canContinueForBearish = false;
|
||||
}
|
||||
|
||||
//
|
||||
result = canContinueForBullish ||
|
||||
@@ -348,6 +356,9 @@ class XCBarAnalyser : public XCBase
|
||||
return result;
|
||||
}
|
||||
|
||||
//
|
||||
index--;
|
||||
|
||||
//
|
||||
dir =
|
||||
hasBullishSameBars
|
||||
@@ -2295,7 +2306,7 @@ class XCBarAnalyser : public XCBase
|
||||
}
|
||||
|
||||
//
|
||||
int obIndex = index;
|
||||
int obIndex = index + 1;
|
||||
result = ob.Init(
|
||||
bar.symbol,
|
||||
bar.period,
|
||||
@@ -2368,8 +2379,11 @@ class XCBarAnalyser : public XCBase
|
||||
bool isBullish = IsBullish(dir);
|
||||
|
||||
//
|
||||
int to = bar.Index() + 1;
|
||||
int from = index + 1;
|
||||
int to = bar.Index();
|
||||
int from =
|
||||
index > (to + sameBars)
|
||||
? to + sameBars
|
||||
: index;
|
||||
for (int i = from; i > to; i--)
|
||||
{
|
||||
//
|
||||
|
||||
+247
-244
@@ -1157,7 +1157,7 @@ class XCPOIDetector : public XCBaseAlert
|
||||
//
|
||||
iBar.Clean();
|
||||
mLock = false;
|
||||
mBarTracker.Waits();
|
||||
// mBarTracker.Waits();
|
||||
|
||||
//
|
||||
if (HasChild(events))
|
||||
@@ -1332,251 +1332,8 @@ class XCPOIDetector : public XCBaseAlert
|
||||
}
|
||||
|
||||
//
|
||||
protected:
|
||||
//
|
||||
|
||||
//
|
||||
void CleanCollections()
|
||||
{
|
||||
//
|
||||
Clean(mSwings);
|
||||
Clean(mSwingLows);
|
||||
Clean(mSwingHighs);
|
||||
Clean(mDemandZones);
|
||||
Clean(mSupplyZones);
|
||||
Clean(mOrderBlocks);
|
||||
Clean(mMomentumBars);
|
||||
Clean(mSupportZones);
|
||||
Clean(mRejectionBars);
|
||||
Clean(mFairValueGaps);
|
||||
Clean(mEventListeners);
|
||||
Clean(mResistanceZones);
|
||||
Clean(mBullishOrderBlocks);
|
||||
Clean(mBearishOrderBlocks);
|
||||
Clean(mConsolidationZones);
|
||||
Clean(mBullishMomentumBars);
|
||||
Clean(mBearishMomentumBars);
|
||||
Clean(mBullishRejectionBars);
|
||||
Clean(mBearishRejectionBars);
|
||||
Clean(mBullishFairValueGaps);
|
||||
Clean(mBearishFairValueGaps);
|
||||
Clean(mBullishConsolidationZones);
|
||||
Clean(mBearishConsolidationZones);
|
||||
}
|
||||
|
||||
//
|
||||
void ReverseCollections()
|
||||
{
|
||||
//
|
||||
ArrayReverse(mSwings);
|
||||
ArrayReverse(mSwingLows);
|
||||
ArrayReverse(mSwingHighs);
|
||||
ArrayReverse(mDemandZones);
|
||||
ArrayReverse(mSupplyZones);
|
||||
ArrayReverse(mOrderBlocks);
|
||||
ArrayReverse(mMomentumBars);
|
||||
ArrayReverse(mSupportZones);
|
||||
ArrayReverse(mRejectionBars);
|
||||
ArrayReverse(mFairValueGaps);
|
||||
ArrayReverse(mEventListeners);
|
||||
ArrayReverse(mResistanceZones);
|
||||
ArrayReverse(mBullishOrderBlocks);
|
||||
ArrayReverse(mBearishOrderBlocks);
|
||||
ArrayReverse(mConsolidationZones);
|
||||
ArrayReverse(mBullishMomentumBars);
|
||||
ArrayReverse(mBearishMomentumBars);
|
||||
ArrayReverse(mBullishRejectionBars);
|
||||
ArrayReverse(mBearishRejectionBars);
|
||||
ArrayReverse(mBullishFairValueGaps);
|
||||
ArrayReverse(mBearishFairValueGaps);
|
||||
ArrayReverse(mBullishConsolidationZones);
|
||||
ArrayReverse(mBearishConsolidationZones);
|
||||
}
|
||||
|
||||
//
|
||||
void CleanupUnusedCollections(
|
||||
int maxAllowed = 0 //
|
||||
)
|
||||
{
|
||||
//
|
||||
maxAllowed = MaxRequiredPOIs();
|
||||
|
||||
//
|
||||
if (maxAllowed <= 0)
|
||||
{
|
||||
return;
|
||||
}
|
||||
|
||||
//
|
||||
CleanupArray(
|
||||
mEventListeners,
|
||||
maxAllowed //
|
||||
);
|
||||
|
||||
//
|
||||
CleanupArray(
|
||||
mSwings,
|
||||
maxAllowed //
|
||||
);
|
||||
|
||||
//
|
||||
CleanupArray(
|
||||
mSwingLows,
|
||||
maxAllowed //
|
||||
);
|
||||
|
||||
//
|
||||
CleanupArray(
|
||||
mSwingHighs,
|
||||
maxAllowed //
|
||||
);
|
||||
|
||||
//
|
||||
CleanupArray(
|
||||
mMomentumBars,
|
||||
maxAllowed //
|
||||
);
|
||||
|
||||
//
|
||||
CleanupArray(
|
||||
mBullishMomentumBars,
|
||||
maxAllowed //
|
||||
);
|
||||
|
||||
//
|
||||
CleanupArray(
|
||||
mBearishMomentumBars,
|
||||
maxAllowed //
|
||||
);
|
||||
|
||||
//
|
||||
CleanupArray(
|
||||
mRejectionBars,
|
||||
maxAllowed //
|
||||
);
|
||||
|
||||
//
|
||||
CleanupArray(
|
||||
mBullishRejectionBars,
|
||||
maxAllowed //
|
||||
);
|
||||
|
||||
//
|
||||
CleanupArray(
|
||||
mBearishRejectionBars,
|
||||
maxAllowed //
|
||||
);
|
||||
|
||||
//
|
||||
CleanupArray(
|
||||
mSupportZones,
|
||||
maxAllowed //
|
||||
);
|
||||
|
||||
//
|
||||
CleanupArray(
|
||||
mDemandZones,
|
||||
maxAllowed //
|
||||
);
|
||||
|
||||
//
|
||||
CleanupArray(
|
||||
mSupplyZones,
|
||||
maxAllowed //
|
||||
);
|
||||
|
||||
//
|
||||
CleanupArray(
|
||||
mResistanceZones,
|
||||
maxAllowed //
|
||||
);
|
||||
|
||||
//
|
||||
CleanupArray(
|
||||
mFairValueGaps,
|
||||
maxAllowed //
|
||||
);
|
||||
|
||||
//
|
||||
CleanupArray(
|
||||
mBullishFairValueGaps,
|
||||
maxAllowed //
|
||||
);
|
||||
|
||||
//
|
||||
CleanupArray(
|
||||
mBearishFairValueGaps,
|
||||
maxAllowed //
|
||||
);
|
||||
|
||||
//
|
||||
CleanupArray(
|
||||
mOrderBlocks,
|
||||
maxAllowed //
|
||||
);
|
||||
|
||||
//
|
||||
CleanupArray(
|
||||
mBullishOrderBlocks,
|
||||
maxAllowed //
|
||||
);
|
||||
|
||||
//
|
||||
CleanupArray(
|
||||
mBearishOrderBlocks,
|
||||
maxAllowed //
|
||||
);
|
||||
|
||||
//
|
||||
CleanupArray(
|
||||
mConsolidationZones,
|
||||
maxAllowed //
|
||||
);
|
||||
|
||||
//
|
||||
CleanupArray(
|
||||
mBullishConsolidationZones,
|
||||
maxAllowed //
|
||||
);
|
||||
|
||||
//
|
||||
CleanupArray(
|
||||
mBearishConsolidationZones,
|
||||
maxAllowed //
|
||||
);
|
||||
|
||||
//
|
||||
}
|
||||
|
||||
/**
|
||||
* Notify Event Listeners ...
|
||||
*
|
||||
* @param event: ENUM_XPOI_EVENTS member, Specified Occured Event ...
|
||||
* @param param: XCBasePOI implementation, Specified Event Object ...
|
||||
*/
|
||||
void NotifyEventListeners(
|
||||
ENUM_XPOI_EVENTS event,
|
||||
XCBasePOI *param //
|
||||
)
|
||||
{
|
||||
//
|
||||
int count = ArraySize(mEventListeners);
|
||||
if (!IsValidSize(count))
|
||||
{
|
||||
return;
|
||||
}
|
||||
|
||||
//
|
||||
for (int i = 0; i < count; i++)
|
||||
{
|
||||
//
|
||||
mEventListeners[i](
|
||||
event,
|
||||
param //
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
//
|
||||
//
|
||||
//
|
||||
@@ -3253,6 +3010,252 @@ class XCPOIDetector : public XCBaseAlert
|
||||
return result;
|
||||
}
|
||||
|
||||
//
|
||||
protected:
|
||||
//
|
||||
|
||||
//
|
||||
void CleanCollections()
|
||||
{
|
||||
//
|
||||
Clean(mSwings);
|
||||
Clean(mSwingLows);
|
||||
Clean(mSwingHighs);
|
||||
Clean(mDemandZones);
|
||||
Clean(mSupplyZones);
|
||||
Clean(mOrderBlocks);
|
||||
Clean(mMomentumBars);
|
||||
Clean(mSupportZones);
|
||||
Clean(mRejectionBars);
|
||||
Clean(mFairValueGaps);
|
||||
Clean(mEventListeners);
|
||||
Clean(mResistanceZones);
|
||||
Clean(mBullishOrderBlocks);
|
||||
Clean(mBearishOrderBlocks);
|
||||
Clean(mConsolidationZones);
|
||||
Clean(mBullishMomentumBars);
|
||||
Clean(mBearishMomentumBars);
|
||||
Clean(mBullishRejectionBars);
|
||||
Clean(mBearishRejectionBars);
|
||||
Clean(mBullishFairValueGaps);
|
||||
Clean(mBearishFairValueGaps);
|
||||
Clean(mBullishConsolidationZones);
|
||||
Clean(mBearishConsolidationZones);
|
||||
}
|
||||
|
||||
//
|
||||
void ReverseCollections()
|
||||
{
|
||||
//
|
||||
ArrayReverse(mSwings);
|
||||
ArrayReverse(mSwingLows);
|
||||
ArrayReverse(mSwingHighs);
|
||||
ArrayReverse(mDemandZones);
|
||||
ArrayReverse(mSupplyZones);
|
||||
ArrayReverse(mOrderBlocks);
|
||||
ArrayReverse(mMomentumBars);
|
||||
ArrayReverse(mSupportZones);
|
||||
ArrayReverse(mRejectionBars);
|
||||
ArrayReverse(mFairValueGaps);
|
||||
ArrayReverse(mEventListeners);
|
||||
ArrayReverse(mResistanceZones);
|
||||
ArrayReverse(mBullishOrderBlocks);
|
||||
ArrayReverse(mBearishOrderBlocks);
|
||||
ArrayReverse(mConsolidationZones);
|
||||
ArrayReverse(mBullishMomentumBars);
|
||||
ArrayReverse(mBearishMomentumBars);
|
||||
ArrayReverse(mBullishRejectionBars);
|
||||
ArrayReverse(mBearishRejectionBars);
|
||||
ArrayReverse(mBullishFairValueGaps);
|
||||
ArrayReverse(mBearishFairValueGaps);
|
||||
ArrayReverse(mBullishConsolidationZones);
|
||||
ArrayReverse(mBearishConsolidationZones);
|
||||
}
|
||||
|
||||
//
|
||||
void CleanupUnusedCollections(
|
||||
int maxAllowed = 0 //
|
||||
)
|
||||
{
|
||||
//
|
||||
maxAllowed = MaxRequiredPOIs();
|
||||
|
||||
//
|
||||
if (maxAllowed <= 0)
|
||||
{
|
||||
return;
|
||||
}
|
||||
|
||||
//
|
||||
CleanupArray(
|
||||
mEventListeners,
|
||||
maxAllowed //
|
||||
);
|
||||
|
||||
//
|
||||
CleanupArray(
|
||||
mSwings,
|
||||
maxAllowed //
|
||||
);
|
||||
|
||||
//
|
||||
CleanupArray(
|
||||
mSwingLows,
|
||||
maxAllowed //
|
||||
);
|
||||
|
||||
//
|
||||
CleanupArray(
|
||||
mSwingHighs,
|
||||
maxAllowed //
|
||||
);
|
||||
|
||||
//
|
||||
CleanupArray(
|
||||
mMomentumBars,
|
||||
maxAllowed //
|
||||
);
|
||||
|
||||
//
|
||||
CleanupArray(
|
||||
mBullishMomentumBars,
|
||||
maxAllowed //
|
||||
);
|
||||
|
||||
//
|
||||
CleanupArray(
|
||||
mBearishMomentumBars,
|
||||
maxAllowed //
|
||||
);
|
||||
|
||||
//
|
||||
CleanupArray(
|
||||
mRejectionBars,
|
||||
maxAllowed //
|
||||
);
|
||||
|
||||
//
|
||||
CleanupArray(
|
||||
mBullishRejectionBars,
|
||||
maxAllowed //
|
||||
);
|
||||
|
||||
//
|
||||
CleanupArray(
|
||||
mBearishRejectionBars,
|
||||
maxAllowed //
|
||||
);
|
||||
|
||||
//
|
||||
CleanupArray(
|
||||
mSupportZones,
|
||||
maxAllowed //
|
||||
);
|
||||
|
||||
//
|
||||
CleanupArray(
|
||||
mDemandZones,
|
||||
maxAllowed //
|
||||
);
|
||||
|
||||
//
|
||||
CleanupArray(
|
||||
mSupplyZones,
|
||||
maxAllowed //
|
||||
);
|
||||
|
||||
//
|
||||
CleanupArray(
|
||||
mResistanceZones,
|
||||
maxAllowed //
|
||||
);
|
||||
|
||||
//
|
||||
CleanupArray(
|
||||
mFairValueGaps,
|
||||
maxAllowed //
|
||||
);
|
||||
|
||||
//
|
||||
CleanupArray(
|
||||
mBullishFairValueGaps,
|
||||
maxAllowed //
|
||||
);
|
||||
|
||||
//
|
||||
CleanupArray(
|
||||
mBearishFairValueGaps,
|
||||
maxAllowed //
|
||||
);
|
||||
|
||||
//
|
||||
CleanupArray(
|
||||
mOrderBlocks,
|
||||
maxAllowed //
|
||||
);
|
||||
|
||||
//
|
||||
CleanupArray(
|
||||
mBullishOrderBlocks,
|
||||
maxAllowed //
|
||||
);
|
||||
|
||||
//
|
||||
CleanupArray(
|
||||
mBearishOrderBlocks,
|
||||
maxAllowed //
|
||||
);
|
||||
|
||||
//
|
||||
CleanupArray(
|
||||
mConsolidationZones,
|
||||
maxAllowed //
|
||||
);
|
||||
|
||||
//
|
||||
CleanupArray(
|
||||
mBullishConsolidationZones,
|
||||
maxAllowed //
|
||||
);
|
||||
|
||||
//
|
||||
CleanupArray(
|
||||
mBearishConsolidationZones,
|
||||
maxAllowed //
|
||||
);
|
||||
|
||||
//
|
||||
}
|
||||
|
||||
/**
|
||||
* Notify Event Listeners ...
|
||||
*
|
||||
* @param event: ENUM_XPOI_EVENTS member, Specified Occured Event ...
|
||||
* @param param: XCBasePOI implementation, Specified Event Object ...
|
||||
*/
|
||||
void NotifyEventListeners(
|
||||
ENUM_XPOI_EVENTS event,
|
||||
XCBasePOI *param //
|
||||
)
|
||||
{
|
||||
//
|
||||
int count = ArraySize(mEventListeners);
|
||||
if (!IsValidSize(count))
|
||||
{
|
||||
return;
|
||||
}
|
||||
|
||||
//
|
||||
for (int i = 0; i < count; i++)
|
||||
{
|
||||
//
|
||||
mEventListeners[i](
|
||||
event,
|
||||
param //
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
//
|
||||
private:
|
||||
//
|
||||
|
||||
Reference in New Issue
Block a user