This commit is contained in:
2024-12-22 00:48:24 +03:30
parent c76d037971
commit 72430436bb
@@ -50,7 +50,8 @@ enum ENUM_X_CYCLE_EVENTS
VWAP_ORDER_CHANGE_ETECTED,
VWAP_STATE_CHANGE_DETCTED,
CONSOLIDATION_BREAKED_DETECTED,
PIVOT_DETECTED,
PIVOT_STARTED,
PIVOT_ENDED,
};
class XC121SMCCycleHelper : public XCBase
@@ -1376,7 +1377,11 @@ class XC121SMCCycleHelper : public XCBase
return result;
}
//
/**
* Get Current Active Pivot ...
*
* @param pivot: XPVPivot instance reference ...
*/
void GetActivePivot(XPVPivot &pivot)
{
//
@@ -1384,6 +1389,44 @@ class XC121SMCCycleHelper : public XCBase
pivot = mActivePivot;
}
/**
* Count Calculated Pivots ...
*
* @return ( int )
*/
int CountPivots()
{
return ArraySize(mPivots);
}
/**
* Fill Pivots ...
*
* @param pivots: XPVPivot instance Reference Array ...
*
* @return ( int )
*/
int FillPivots(XPVPivot &pivots[])
{
//
int result = 0;
//
Clean(pivots);
//
Copy(
mPivots,
pivots //
);
//
result = ArraySize(pivots);
//
return result;
}
//
// Virtuals ...
@@ -1485,6 +1528,7 @@ class XC121SMCCycleHelper : public XCBase
//
bool isNewPeak = conditions.x121Conditions.isNewPeak;
double peak = conditions.x121Conditions.peaksBuffer[0];
bool isNewPeakOverLast = conditions.x121Conditions.isNewPeakOverLast;
bool isNewPeakUnderLast = conditions.x121Conditions.isNewPeakUnderLast;
@@ -1529,6 +1573,7 @@ class XC121SMCCycleHelper : public XCBase
//
bool isNewVale = conditions.x121Conditions.isNewVale;
double vale = conditions.x121Conditions.valesBuffer[0];
bool isNewValeOverLast = conditions.x121Conditions.isNewValeOverLast;
bool isNewValeUnderLast = conditions.x121Conditions.isNewValeUnderLast;
@@ -1907,7 +1952,14 @@ class XC121SMCCycleHelper : public XCBase
//
if (!IsValid(mActivePivot.from))
{
//
mActivePivot.from = cTime;
//
Add(
PIVOT_STARTED,
events //
);
}
mActivePivot.to = cTime;
@@ -1975,22 +2027,54 @@ class XC121SMCCycleHelper : public XCBase
XCTickZone *iTZ = mActivePivot.state.ticksZone.GetZone(i);
//
bool isBarInside =
changeBar.low >= iTZ.low &&
changeBar.high <= iTZ.high;
if (isBarInside)
double pivot =
isNewPeak
? peak
: vale;
bool isPivotInsideZone =
pivot >= iTZ.low &&
pivot <= iTZ.high;
if (isPivotInsideZone)
{
//
cTZoneIDX = i;
break;
}
//
bool isBarInside =
changeBar.low >= iTZ.low &&
changeBar.high <= iTZ.high;
// if (isBarInside)
// {
// //
// cTZoneIDX = i;
// break;
// }
}
//
if (IsValidIndex(cTZoneIDX))
// Last Zone ...
// We Can Break Active Zone ...
if (IsValidIndex(cTZoneIDX) && cTZoneIDX == count - 1)
{
//
Print("ZoneIndex: ", cTZoneIDX);
//
AddRef(
mActivePivot,
mPivots //
);
//
Add(
PIVOT_ENDED,
events //
);
//
mActivePivot.Clean();
}
}
}