last works ...

This commit is contained in:
2025-06-08 18:26:13 +03:30
parent bf70c327d5
commit dc50f29932
2 changed files with 740 additions and 340 deletions
+352
View File
@@ -0,0 +1,352 @@
//
int minRequiredRange = 20;
if (barIndex > maxBarIndex - minRequiredRange - 4)
{
return;
}
//
double iP2SCLL = sLLBuffer[barIndex + 2];
double iP2SCHH = sHHBuffer[barIndex + 2];
//
double iP3SCLL = sLLBuffer[barIndex + 3];
double iP3SCHH = sHHBuffer[barIndex + 3];
//
double iP4SCLL = sLLBuffer[barIndex + 4];
double iP4SCHH = sHHBuffer[barIndex + 4];
//
double iP2MCLL = mLLBuffer[barIndex + 2];
double iP2MCHH = mHHBuffer[barIndex + 2];
//
double iP3MCLL = mLLBuffer[barIndex + 3];
double iP3MCHH = mHHBuffer[barIndex + 3];
//
double iP4MCLL = mLLBuffer[barIndex + 4];
double iP4MCHH = mHHBuffer[barIndex + 4];
//
double iP2LCLL = lLLBuffer[barIndex + 2];
double iP2LCHH = lHHBuffer[barIndex + 2];
//
double iP3LCLL = lLLBuffer[barIndex + 3];
double iP3LCHH = lHHBuffer[barIndex + 3];
//
double iP4LCLL = lLLBuffer[barIndex + 4];
double iP4LCHH = lHHBuffer[barIndex + 4];
//
double iP2HCLL = hLLBuffer[barIndex + 2];
double iP2HCHH = hHHBuffer[barIndex + 2];
//
double iP3HCLL = hLLBuffer[barIndex + 3];
double iP3HCHH = hHHBuffer[barIndex + 3];
//
double iP4HCLL = hLLBuffer[barIndex + 4];
double iP4HCHH = hHHBuffer[barIndex + 4];
//
// Cycle States ...
//
// Create Conditions ...
//
bool isSCMaOverMCMa = iSCMa > iMCMa;
bool isPSCMaOverMCMa = iPSCMa > iPMCMa;
//
bool isSCMaUnderMCMa = iSCMa < iMCMa;
bool isPSCMaUnderMCMa = iPSCMa < iPMCMa;
//
bool isSCMaCrossedOverMCMa =
isSCMaOverMCMa &&
!isPSCMaOverMCMa;
//
bool isSCMaCrossedUnderMCMa =
isSCMaUnderMCMa &&
!isPSCMaUnderMCMa;
//
bool isLCMaOverHCMa = iLCMa > iHCMa;
bool isPLCMaOverHCMa = iPLCMa > iPHCMa;
//
bool isLCMaUnderHCMa = iLCMa < iHCMa;
bool isPLCMaUnderHCMa = iPLCMa < iPHCMa;
//
bool isLCMaCrossedOverHCMa =
isLCMaOverHCMa &&
!isPLCMaOverHCMa;
//
bool isLCMaCrossedUnderHCMa =
isLCMaUnderHCMa &&
!isPLCMaUnderHCMa;
//
// SC State ...
//
bool isSCMaBullish =
iSCMaState == bullishState;
bool isPSCMaBullish =
iPSCMaState == bullishState;
//
bool isSCMaBearish =
iSCMaState == bearishState;
bool isPSCMaBearish =
iPSCMaState == bearishState;
//
bool isSCMaSwitchedToBullish =
isSCMaBullish &&
!isPSCMaBullish;
//
bool isSCMaSwitchedToBearish =
isSCMaBearish &&
!isPSCMaBearish;
//
bool isSCLLOverMCLL =
iSCLL > iMCLL;
bool isPSCLLOverMCLL =
iPSCLL > iPMCLL;
bool isP2SCLLOverMCLL =
iP2SCLL > iP2MCLL;
bool isP3SCLLOverMCLL =
iP3SCLL > iP3MCLL;
bool isP4SCLLOverMCLL =
iP4SCLL > iP4MCLL;
//
bool isSCHHUnderMCHH =
iSCHH < iMCHH;
bool isPSCHHUnderMCHH =
iPSCHH < iPMCHH;
bool isP2SCHHUnderMCHH =
iP2SCHH < iP2MCHH;
bool isP3SCHHUnderMCHH =
iP3SCHH < iP3MCHH;
bool isP4SCHHUnderMCHH =
iP4SCHH < iP4MCHH;
//
bool isSCLLCrossedOverMCLL =
isSCLLOverMCLL &&
!isPSCLLOverMCLL;
bool isPSCLLCrossedOverMCLL =
isPSCLLOverMCLL &&
!isP2SCLLOverMCLL;
bool isP2SCLLCrossedOverMCLL =
isP2SCLLOverMCLL &&
!isP3SCLLOverMCLL;
bool isP3SCLLCrossedOverMCLL =
isP3SCLLOverMCLL &&
!isP4SCLLOverMCLL;
//
bool isSCHHCrossedUnderMCHH =
isSCHHUnderMCHH &&
!isPSCHHUnderMCHH;
bool isPSCHHCrossedUnderMCHH =
isPSCHHUnderMCHH &&
!isP2SCHHUnderMCHH;
bool isP2SCHHCrossedUnderMCHH =
isP2SCHHUnderMCHH &&
!isP3SCHHUnderMCHH;
bool isP3SCHHCrossedUnderMCHH =
isP3SCHHUnderMCHH &&
!isP4SCHHUnderMCHH;
//
// MC State ...
//
bool isMCMaBullish =
iMCMaState == bullishState;
bool isPMCMaBullish =
iPMCMaState == bullishState;
//
bool isMCMaBearish =
iMCMaState == bearishState;
bool isPMCMaBearish =
iPMCMaState == bearishState;
//
bool isMCMaSwitchedToBullish =
isMCMaBullish &&
!isPMCMaBullish;
//
bool isMCMaSwitchedToBearish =
isMCMaBearish &&
!isPMCMaBearish;
//
bool isMCLLOverLCLL =
iMCLL > iLCLL;
bool isPMCLLOverLCLL =
iPMCLL > iPLCLL;
bool isP2MCLLOverLCLL =
iP2MCLL > iP2LCLL;
bool isP3MCLLOverLCLL =
iP3MCLL > iP3LCLL;
bool isP4MCLLOverLCLL =
iP4MCLL > iP4LCLL;
//
bool isMCHHUnderLCHH =
iMCHH < iLCHH;
bool isPMCHHUnderLCHH =
iPMCHH < iPLCHH;
bool isP2MCHHUnderLCHH =
iP2MCHH < iP2LCHH;
bool isP3MCHHUnderLCHH =
iP3MCHH < iP3LCHH;
bool isP4MCHHUnderLCHH =
iP4MCHH < iP4LCHH;
//
bool isMCLLCrossedOverLCLL =
isMCLLOverLCLL &&
!isPMCLLOverLCLL;
bool isPMCLLCrossedOverLCLL =
isPMCLLOverLCLL &&
!isP2MCLLOverLCLL;
bool isP2MCLLCrossedOverLCLL =
isP2MCLLOverLCLL &&
!isP3MCLLOverLCLL;
bool isP3MCLLCrossedOverLCLL =
isP3MCLLOverLCLL &&
!isP4MCLLOverLCLL;
//
bool isMCHHCrossedUnderLCHH =
isMCHHUnderLCHH &&
!isPMCHHUnderLCHH;
bool isPMCHHCrossedUnderLCHH =
isPMCHHUnderLCHH &&
!isP2MCHHUnderLCHH;
bool isP2MCHHCrossedUnderLCHH =
isP2MCHHUnderLCHH &&
!isP3MCHHUnderLCHH;
bool isP3MCHHCrossedUnderLCHH =
isP3MCHHUnderLCHH &&
!isP4MCHHUnderLCHH;
//
// LC State ...
//
bool isLCMaBullish =
iLCMaState == bullishState;
bool isPLCMaBullish =
iPLCMaState == bullishState;
//
bool isLCMaBearish =
iLCMaState == bearishState;
bool isPLCMaBearish =
iPLCMaState == bearishState;
//
bool isLCMaSwitchedToBullish =
isLCMaBullish &&
!isPLCMaBullish;
//
bool isLCMaSwitchedToBearish =
isLCMaBearish &&
!isPLCMaBearish;
//
bool isLCLLOverHCLL =
iLCLL > iHCLL;
bool isPLCLLOverHCLL =
iPLCLL > iPHCLL;
bool isP2LCLLOverHCLL =
iP2LCLL > iP2HCLL;
bool isP3LCLLOverHCLL =
iP3LCLL > iP3HCLL;
bool isP4LCLLOverHCLL =
iP4LCLL > iP4HCLL;
//
bool isLCHHUnderHCHH =
iLCHH < iHCHH;
bool isPLCHHUnderHCHH =
iPLCHH < iPHCHH;
bool isP2LCHHUnderHCHH =
iP2LCHH < iP2HCHH;
bool isP3LCHHUnderHCHH =
iP3LCHH < iP3HCHH;
bool isP4LCHHUnderHCHH =
iP4LCHH < iP4HCHH;
//
bool isLCLLCrossedOverHCLL =
isLCLLOverHCLL &&
!isPLCLLOverHCLL;
bool isPLCLLCrossedOverHCLL =
isPLCLLOverHCLL &&
!isP2LCLLOverHCLL;
bool isP2LCLLCrossedOverHCLL =
isP2LCLLOverHCLL &&
!isP3LCLLOverHCLL;
bool isP3LCLLCrossedOverHCLL =
isP3LCLLOverHCLL &&
!isP4LCLLOverHCLL;
//
bool isLCHHCrossedUnderHCHH =
isLCHHUnderHCHH &&
!isPLCHHUnderHCHH;
bool isPLCHHCrossedUnderHCHH =
isPLCHHUnderHCHH &&
!isP2LCHHUnderHCHH;
bool isP2LCHHCrossedUnderHCHH =
isP2LCHHUnderHCHH &&
!isP3LCHHUnderHCHH;
bool isP3LCHHCrossedUnderHCHH =
isP3LCHHUnderHCHH &&
!isP4LCHHUnderHCHH;
//
// HC State ...
//
bool isHCMaBullish =
iHCMaState == bullishState;
bool isPHCMaBullish =
iPHCMaState == bullishState;
//
bool isHCMaBearish =
iHCMaState == bearishState;
bool isPHCMaBearish =
iPHCMaState == bearishState;
//
bool isHCMaSwitchedToBullish =
isHCMaBullish &&
!isPHCMaBullish;
//
bool isHCMaSwitchedToBearish =
isHCMaBearish &&
!isPHCMaBearish;
+388 -340
View File
@@ -1591,7 +1591,7 @@ void DoProcess(
// //
int minRequiredRange = 20; int minRequiredRange = 20;
if (barIndex > maxBarIndex + minRequiredRange + 4) if (barIndex > maxBarIndex - 1)
{ {
return; return;
} }
@@ -1615,6 +1615,9 @@ void DoProcess(
// //
// Reading Values ... // Reading Values ...
//
// Bars Info ...
// //
double iLow = low[barIndex]; double iLow = low[barIndex];
double iHigh = high[barIndex]; double iHigh = high[barIndex];
@@ -1628,19 +1631,7 @@ void DoProcess(
double iPClose = close[barIndex + 1]; double iPClose = close[barIndex + 1];
// //
double iSCMa = scMaBuffer[barIndex]; // SC ...
double iMCMa = mcMaBuffer[barIndex];
double iLCMa = lcMaBuffer[barIndex];
double iHCMa = hcMaBuffer[barIndex];
//
double iPSCMa = scMaBuffer[barIndex + 1];
double iPMCMa = mcMaBuffer[barIndex + 1];
double iPLCMa = lcMaBuffer[barIndex + 1];
double iPHCMa = hcMaBuffer[barIndex + 1];
//
// SC Range ...
// //
double iSCLL = sLLBuffer[barIndex]; double iSCLL = sLLBuffer[barIndex];
@@ -1651,136 +1642,28 @@ void DoProcess(
double iPSCHH = sHHBuffer[barIndex + 1]; double iPSCHH = sHHBuffer[barIndex + 1];
// //
double iP2SCLL = sLLBuffer[barIndex + 2]; double iSCMa = scMaBuffer[barIndex];
double iP2SCHH = sHHBuffer[barIndex + 2]; double iPSCMa = scMaBuffer[barIndex + 1];
//
double iP3SCLL = sLLBuffer[barIndex + 3];
double iP3SCHH = sHHBuffer[barIndex + 3];
//
double iP4SCLL = sLLBuffer[barIndex + 4];
double iP4SCHH = sHHBuffer[barIndex + 4];
//
// MC Range ...
//
double iMCLL = mLLBuffer[barIndex];
double iMCHH = mHHBuffer[barIndex];
//
double iPMCLL = mLLBuffer[barIndex + 1];
double iPMCHH = mHHBuffer[barIndex + 1];
//
double iP2MCLL = mLLBuffer[barIndex + 2];
double iP2MCHH = mHHBuffer[barIndex + 2];
//
double iP3MCLL = mLLBuffer[barIndex + 3];
double iP3MCHH = mHHBuffer[barIndex + 3];
//
double iP4MCLL = mLLBuffer[barIndex + 4];
double iP4MCHH = mHHBuffer[barIndex + 4];
//
// LC Range ...
//
double iLCLL = lLLBuffer[barIndex];
double iLCHH = lHHBuffer[barIndex];
//
double iPLCLL = lLLBuffer[barIndex + 1];
double iPLCHH = lHHBuffer[barIndex + 1];
//
double iP2LCLL = lLLBuffer[barIndex + 2];
double iP2LCHH = lHHBuffer[barIndex + 2];
//
double iP3LCLL = lLLBuffer[barIndex + 3];
double iP3LCHH = lHHBuffer[barIndex + 3];
//
double iP4LCLL = lLLBuffer[barIndex + 4];
double iP4LCHH = lHHBuffer[barIndex + 4];
//
// HC Range ...
//
double iHCLL = hLLBuffer[barIndex];
double iHCHH = hHHBuffer[barIndex];
//
double iPHCLL = hLLBuffer[barIndex + 1];
double iPHCHH = hHHBuffer[barIndex + 1];
//
double iP2HCLL = hLLBuffer[barIndex + 2];
double iP2HCHH = hHHBuffer[barIndex + 2];
//
double iP3HCLL = hLLBuffer[barIndex + 3];
double iP3HCHH = hHHBuffer[barIndex + 3];
//
double iP4HCLL = hLLBuffer[barIndex + 4];
double iP4HCHH = hHHBuffer[barIndex + 4];
//
// Cycle States ...
// //
double iSCMaState = scMaStateBuffer[barIndex]; double iSCMaState = scMaStateBuffer[barIndex];
double iMCMaState = mcMaStateBuffer[barIndex];
double iLCMaState = lcMaStateBuffer[barIndex];
double iHCMaState = hcMaStateBuffer[barIndex];
//
double iPSCMaState = scMaStateBuffer[barIndex + 1]; double iPSCMaState = scMaStateBuffer[barIndex + 1];
double iPMCMaState = mcMaStateBuffer[barIndex + 1];
double iPLCMaState = lcMaStateBuffer[barIndex + 1];
double iPHCMaState = hcMaStateBuffer[barIndex + 1];
// //
// Create Conditions ...
// //
bool isLCMaOverHCMa = iMCMa > iHCMa;
bool isPLCMaOverHCMa = iPMCMa > iPHCMa;
// //
bool isLCMaUnderHCMa = iMCMa < iHCMa;
bool isPLCMaUnderHCMa = iPMCMa < iPHCMa;
//
bool isLCMaCrossedOverHCMa =
isLCMaOverHCMa &&
!isPLCMaOverHCMa;
//
bool isLCMaCrossedUnderHCMa =
isLCMaUnderHCMa &&
!isPLCMaUnderHCMa;
//
// SC State ...
// //
bool isSCMaBullish = bool isSCMaBullish =
iSCMaState == bullishState; iSCMaState > 0;
bool isPSCMaBullish = bool isPSCMaBullish =
iPSCMaState == bullishState; iPSCMaState > 0;
// //
bool isSCMaBearish = bool isSCMaBearish =
iSCMaState == bearishState; iSCMaState < 0;
bool isPSCMaBearish = bool isPSCMaBearish =
iPSCMaState == bearishState; iPSCMaState < 0;
// //
bool isSCMaSwitchedToBullish = bool isSCMaSwitchedToBullish =
@@ -1793,71 +1676,39 @@ void DoProcess(
!isPSCMaBearish; !isPSCMaBearish;
// //
bool isSCLLOverMCLL = // MC ...
iSCLL > iMCLL;
bool isPSCLLOverMCLL =
iPSCLL > iPMCLL;
bool isP2SCLLOverMCLL =
iP2SCLL > iP2MCLL;
bool isP3SCLLOverMCLL =
iP3SCLL > iP3MCLL;
bool isP4SCLLOverMCLL =
iP4SCLL > iP4MCLL;
// //
bool isSCHHUnderMCHH = double iMCLL = mLLBuffer[barIndex];
iSCHH < iMCHH; double iMCHH = mHHBuffer[barIndex];
bool isPSCHHUnderMCHH =
iPSCHH < iPMCHH;
bool isP2SCHHUnderMCHH =
iP2SCHH < iP2MCHH;
bool isP3SCHHUnderMCHH =
iP3SCHH < iP3MCHH;
bool isP4SCHHUnderMCHH =
iP4SCHH < iP4MCHH;
// //
bool isSCLLCrossedOverMCLL = double iPMCLL = mLLBuffer[barIndex + 1];
isSCLLOverMCLL && double iPMCHH = mHHBuffer[barIndex + 1];
!isPSCLLOverMCLL;
bool isPSCLLCrossedOverMCLL =
isPSCLLOverMCLL &&
!isP2SCLLOverMCLL;
bool isP2SCLLCrossedOverMCLL =
isP2SCLLOverMCLL &&
!isP3SCLLOverMCLL;
bool isP3SCLLCrossedOverMCLL =
isP3SCLLOverMCLL &&
!isP4SCLLOverMCLL;
// //
bool isSCHHCrossedUnderMCHH = double iMCMa = mcMaBuffer[barIndex];
isSCHHUnderMCHH && double iPMCMa = mcMaBuffer[barIndex + 1];
!isPSCHHUnderMCHH;
bool isPSCHHCrossedUnderMCHH =
isPSCHHUnderMCHH &&
!isP2SCHHUnderMCHH;
bool isP2SCHHCrossedUnderMCHH =
isP2SCHHUnderMCHH &&
!isP3SCHHUnderMCHH;
bool isP3SCHHCrossedUnderMCHH =
isP3SCHHUnderMCHH &&
!isP4SCHHUnderMCHH;
// //
// MC State ... double iMCMaState = mcMaStateBuffer[barIndex];
double iPMCMaState = mcMaStateBuffer[barIndex + 1];
//
//
//
// //
bool isMCMaBullish = bool isMCMaBullish =
iMCMaState == bullishState; iMCMaState > 0;
bool isPMCMaBullish = bool isPMCMaBullish =
iPMCMaState == bullishState; iPMCMaState > 0;
// //
bool isMCMaBearish = bool isMCMaBearish =
iMCMaState == bearishState; iMCMaState < 0;
bool isPMCMaBearish = bool isPMCMaBearish =
iPMCMaState == bearishState; iPMCMaState < 0;
// //
bool isMCMaSwitchedToBullish = bool isMCMaSwitchedToBullish =
@@ -1870,71 +1721,113 @@ void DoProcess(
!isPMCMaBearish; !isPMCMaBearish;
// //
bool isMCLLOverLCLL = //
iMCLL > iLCLL; //
bool isPMCLLOverLCLL =
iPMCLL > iPLCLL;
bool isP2MCLLOverLCLL =
iP2MCLL > iP2LCLL;
bool isP3MCLLOverLCLL =
iP3MCLL > iP3LCLL;
bool isP4MCLLOverLCLL =
iP4MCLL > iP4LCLL;
// //
bool isMCHHUnderLCHH = bool isSCMaOverMC =
iMCHH < iLCHH; iSCMa > iMCMa;
bool isPMCHHUnderLCHH = bool isPSCMaOverMC =
iPMCHH < iPLCHH; iPSCMa > iPMCMa;
bool isP2MCHHUnderLCHH =
iP2MCHH < iP2LCHH;
bool isP3MCHHUnderLCHH =
iP3MCHH < iP3LCHH;
bool isP4MCHHUnderLCHH =
iP4MCHH < iP4LCHH;
// //
bool isMCLLCrossedOverLCLL = bool isSCMaUnderMC =
isMCLLOverLCLL && iSCMa < iMCMa;
!isPMCLLOverLCLL; bool isPSCMaUnderMC =
bool isPMCLLCrossedOverLCLL = iPSCMa < iPMCMa;
isPMCLLOverLCLL &&
!isP2MCLLOverLCLL;
bool isP2MCLLCrossedOverLCLL =
isP2MCLLOverLCLL &&
!isP3MCLLOverLCLL;
bool isP3MCLLCrossedOverLCLL =
isP3MCLLOverLCLL &&
!isP4MCLLOverLCLL;
// //
bool isMCHHCrossedUnderLCHH = bool isSCMaCrossedOverMC =
isMCHHUnderLCHH && isSCMaOverMC &&
!isPMCHHUnderLCHH; !isPSCMaOverMC;
bool isPMCHHCrossedUnderLCHH =
isPMCHHUnderLCHH &&
!isP2MCHHUnderLCHH;
bool isP2MCHHCrossedUnderLCHH =
isP2MCHHUnderLCHH &&
!isP3MCHHUnderLCHH;
bool isP3MCHHCrossedUnderLCHH =
isP3MCHHUnderLCHH &&
!isP4MCHHUnderLCHH;
// //
// LC State ... bool isSCMaCrossedUnderMC =
isSCMaUnderMC &&
!isPSCMaUnderMC;
//
//
//
//
bool isSCLLOverMCLL =
iSCLL > iMCLL;
bool isPSCLLOverMCLL =
iPSCLL > iPMCLL;
//
bool isSCLLUnderMCLL =
iSCLL < iMCLL;
bool isPSCLLUnderMCLL =
iPSCLL < iPMCLL;
//
bool isSCHHOverMCHH =
iSCHH > iMCHH;
bool isPSCHHOverMCHH =
iPSCHH > iPMCHH;
//
bool isSCHHUnderMCHH =
iSCHH < iMCHH;
bool isPSCHHUnderMCHH =
iPSCHH < iPMCHH;
//
bool isSCLLCrossedOverMCLL =
isSCLLOverMCLL &&
!isPSCLLOverMCLL;
//
bool isSCLLCrossedUnderMCLL =
isSCLLUnderMCLL &&
!isPSCLLUnderMCLL;
//
bool isSCHHCrossedOverMCHH =
isSCHHOverMCHH &&
!isPSCHHOverMCHH;
//
bool isSCHHCrossedUnderMCHH =
isSCHHUnderMCHH &&
!isPSCHHUnderMCHH;
//
// LC ...
//
double iLCLL = lLLBuffer[barIndex];
double iLCHH = lHHBuffer[barIndex];
//
double iPLCLL = lLLBuffer[barIndex + 1];
double iPLCHH = lHHBuffer[barIndex + 1];
//
double iLCMa = lcMaBuffer[barIndex];
double iPLCMa = lcMaBuffer[barIndex + 1];
//
double iLCMaState = lcMaStateBuffer[barIndex];
double iPLCMaState = lcMaStateBuffer[barIndex + 1];
//
//
//
// //
bool isLCMaBullish = bool isLCMaBullish =
iLCMaState == bullishState; iLCMaState > 0;
bool isPLCMaBullish = bool isPLCMaBullish =
iPLCMaState == bullishState; iPLCMaState > 0;
// //
bool isLCMaBearish = bool isLCMaBearish =
iLCMaState == bearishState; iLCMaState < 0;
bool isPLCMaBearish = bool isPLCMaBearish =
iPLCMaState == bearishState; iPLCMaState < 0;
// //
bool isLCMaSwitchedToBullish = bool isLCMaSwitchedToBullish =
@@ -1947,71 +1840,113 @@ void DoProcess(
!isPLCMaBearish; !isPLCMaBearish;
// //
bool isLCLLOverHCLL = //
iLCLL > iHCLL; //
bool isPLCLLOverHCLL =
iPLCLL > iPHCLL;
bool isP2LCLLOverHCLL =
iP2LCLL > iP2HCLL;
bool isP3LCLLOverHCLL =
iP3LCLL > iP3HCLL;
bool isP4LCLLOverHCLL =
iP4LCLL > iP4HCLL;
// //
bool isLCHHUnderHCHH = bool isMCMaOverLC =
iLCHH < iHCHH; iMCMa > iLCMa;
bool isPLCHHUnderHCHH = bool isPMCMaOverLC =
iPLCHH < iPHCHH; iPMCMa > iPLCMa;
bool isP2LCHHUnderHCHH =
iP2LCHH < iP2HCHH;
bool isP3LCHHUnderHCHH =
iP3LCHH < iP3HCHH;
bool isP4LCHHUnderHCHH =
iP4LCHH < iP4HCHH;
// //
bool isLCLLCrossedOverHCLL = bool isMCMaUnderLC =
isLCLLOverHCLL && iMCMa < iLCMa;
!isPLCLLOverHCLL; bool isPMCMaUnderLC =
bool isPLCLLCrossedOverHCLL = iPMCMa < iPLCMa;
isPLCLLOverHCLL &&
!isP2LCLLOverHCLL;
bool isP2LCLLCrossedOverHCLL =
isP2LCLLOverHCLL &&
!isP3LCLLOverHCLL;
bool isP3LCLLCrossedOverHCLL =
isP3LCLLOverHCLL &&
!isP4LCLLOverHCLL;
// //
bool isLCHHCrossedUnderHCHH = bool isMCMaCrossedOverLC =
isLCHHUnderHCHH && isMCMaOverLC &&
!isPLCHHUnderHCHH; !isPMCMaOverLC;
bool isPLCHHCrossedUnderHCHH =
isPLCHHUnderHCHH &&
!isP2LCHHUnderHCHH;
bool isP2LCHHCrossedUnderHCHH =
isP2LCHHUnderHCHH &&
!isP3LCHHUnderHCHH;
bool isP3LCHHCrossedUnderHCHH =
isP3LCHHUnderHCHH &&
!isP4LCHHUnderHCHH;
// //
// HC State ... bool isMCMaCrossedUnderLC =
isMCMaUnderLC &&
!isPMCMaUnderLC;
//
//
//
//
bool isMCLLOverLCLL =
iMCLL > iLCLL;
bool isPMCLLOverLCLL =
iPMCLL > iPLCLL;
//
bool isMCLLUnderLCLL =
iMCLL < iLCLL;
bool isPMCLLUnderLCLL =
iPMCLL < iPLCLL;
//
bool isMCHHOverLCHH =
iMCHH > iLCHH;
bool isPMCHHOverLCHH =
iPMCHH > iPLCHH;
//
bool isMCHHUnderLCHH =
iMCHH < iLCHH;
bool isPMCHHUnderLCHH =
iPMCHH < iPLCHH;
//
bool isMCLLCrossedOverLCLL =
isMCLLOverLCLL &&
!isPMCLLOverLCLL;
//
bool isMCLLCrossedUnderLCLL =
isMCLLUnderLCLL &&
!isPMCLLUnderLCLL;
//
bool isMCHHCrossedOverLCHH =
isMCHHOverLCHH &&
!isPMCHHOverLCHH;
//
bool isMCHHCrossedUnderLCHH =
isMCHHUnderLCHH &&
!isPMCHHUnderLCHH;
//
// HC ...
//
double iHCLL = hLLBuffer[barIndex];
double iHCHH = hHHBuffer[barIndex];
//
double iPHCLL = hLLBuffer[barIndex + 1];
double iPHCHH = hHHBuffer[barIndex + 1];
//
double iHCMa = hcMaBuffer[barIndex];
double iPHCMa = hcMaBuffer[barIndex + 1];
//
double iHCMaState = hcMaStateBuffer[barIndex];
double iPHCMaState = hcMaStateBuffer[barIndex + 1];
//
//
//
// //
bool isHCMaBullish = bool isHCMaBullish =
iHCMaState == bullishState; iHCMaState > 0;
bool isPHCMaBullish = bool isPHCMaBullish =
iPHCMaState == bullishState; iPHCMaState > 0;
// //
bool isHCMaBearish = bool isHCMaBearish =
iHCMaState == bearishState; iHCMaState < 0;
bool isPHCMaBearish = bool isPHCMaBearish =
iPHCMaState == bearishState; iPHCMaState < 0;
// //
bool isHCMaSwitchedToBullish = bool isHCMaSwitchedToBullish =
@@ -2023,6 +1958,80 @@ void DoProcess(
isHCMaBearish && isHCMaBearish &&
!isPHCMaBearish; !isPHCMaBearish;
//
//
//
//
bool isLCMaOverHC =
iLCMa > iHCMa;
bool isPLCMaOverHC =
iPLCMa > iPHCMa;
//
bool isLCMaUnderHC =
iLCMa < iHCMa;
bool isPLCMaUnderHC =
iPLCMa < iPHCMa;
//
bool isLCMaCrossedOverHC =
isLCMaOverHC &&
!isPLCMaOverHC;
//
bool isLCMaCrossedUnderHC =
isLCMaUnderHC &&
!isPLCMaUnderHC;
//
//
//
//
bool isLCLLOverHCLL =
iLCLL > iHCLL;
bool isPLCLLOverHCLL =
iPLCLL > iPHCLL;
//
bool isLCLLUnderHCLL =
iLCLL < iHCLL;
bool isPLCLLUnderHCLL =
iPLCLL < iPHCLL;
//
bool isLCHHOverHCHH =
iLCHH > iHCHH;
bool isPLCHHOverHCHH =
iPLCHH > iPHCHH;
//
bool isLCHHUnderHCHH =
iLCHH < iHCHH;
bool isPLCHHUnderHCHH =
iPLCHH < iPHCHH;
//
bool isLCLLCrossedOverHCLL =
isLCLLOverHCLL &&
!isPLCLLOverHCLL;
//
bool isLCLLCrossedUnderHCLL =
isLCLLUnderHCLL &&
!isPLCLLUnderHCLL;
//
bool isLCHHCrossedOverHCHH =
isLCHHOverHCHH &&
!isPLCHHOverHCHH;
//
bool isLCHHCrossedUnderHCHH =
isLCHHUnderHCHH &&
!isPLCHHUnderHCHH;
// //
// Check Price Inside Cloud Zone ... // Check Price Inside Cloud Zone ...
@@ -2030,10 +2039,102 @@ void DoProcess(
double iCloudZoneUpper = MathMax(iLCMa, iHCMa); double iCloudZoneUpper = MathMax(iLCMa, iHCMa);
double iCloudZoneLower = MathMin(iLCMa, iHCMa); double iCloudZoneLower = MathMin(iLCMa, iHCMa);
//
bool isICloudZoneUpperBullish =
iCloudZoneUpper == iLCMa
? isLCMaBullish
: isHCMaBullish;
bool isICloudZoneLowerBullish =
iCloudZoneLower == iLCMa
? isLCMaBullish
: isHCMaBullish;
//
bool isICloudZoneUpperBearish =
iCloudZoneUpper == iLCMa
? isLCMaBearish
: isHCMaBearish;
bool isICloudZoneLowerBearish =
iCloudZoneLower == iLCMa
? isLCMaBearish
: isHCMaBearish;
// //
double iPCloudZoneUpper = MathMax(iPLCMa, iPHCMa); double iPCloudZoneUpper = MathMax(iPLCMa, iPHCMa);
double iPCloudZoneLower = MathMin(iPLCMa, iPHCMa); double iPCloudZoneLower = MathMin(iPLCMa, iPHCMa);
//
bool isIPCloudZoneUpperBullish =
iPCloudZoneUpper == iPLCMa
? isPLCMaBullish
: isPHCMaBullish;
bool isIPCloudZoneLowerBullish =
iPCloudZoneLower == iPLCMa
? isPLCMaBullish
: isPHCMaBullish;
//
bool isIPCloudZoneUpperBearish =
iPCloudZoneUpper == iPLCMa
? isPLCMaBearish
: isPHCMaBearish;
bool isIPCloudZoneLowerBearish =
iPCloudZoneLower == iPLCMa
? isPLCMaBearish
: isPHCMaBearish;
//
double iPressureZoneUpper = MathMax(iSCMa, iMCMa);
double iPressureZoneLower = MathMin(iSCMa, iMCMa);
//
bool isIPressureZoneUpperBullish =
iPressureZoneUpper == iSCMa
? isSCMaBullish
: isMCMaBullish;
bool isIPressureZoneLowerBullish =
iPressureZoneLower == iSCMa
? isSCMaBullish
: isMCMaBullish;
//
bool isIPressureZoneUpperBearish =
iPressureZoneUpper == iSCMa
? isSCMaBearish
: isMCMaBearish;
bool isIPressureZoneLowerBearish =
iPressureZoneLower == iSCMa
? isSCMaBearish
: isMCMaBearish;
//
double iPPressureZoneUpper = MathMax(iPSCMa, iPMCMa);
double iPPressureZoneLower = MathMin(iPSCMa, iPMCMa);
//
bool isIPPressureZoneUpperBullish =
iPPressureZoneUpper == iPSCMa
? isPSCMaBullish
: isPMCMaBullish;
bool isIPPressureZoneLowerBullish =
iPPressureZoneLower == iPSCMa
? isPSCMaBullish
: isPMCMaBullish;
//
bool isIPPressureZoneUpperBearish =
iPPressureZoneUpper == iPSCMa
? isPSCMaBearish
: isPMCMaBearish;
bool isIPPressureZoneLowerBearish =
iPPressureZoneLower == iPSCMa
? isPSCMaBearish
: isPMCMaBearish;
//
//
//
// //
bool isBullishPriceInsideCloudZone = bool isBullishPriceInsideCloudZone =
iLow < iCloudZoneUpper && iLow < iCloudZoneUpper &&
@@ -2064,79 +2165,26 @@ void DoProcess(
isBearishPriceInsideCloudZone && isBearishPriceInsideCloudZone &&
!isPBearishPriceInsideCloudZone; !isPBearishPriceInsideCloudZone;
//
bool hasBullishPressure =
iLow > iPressureZoneUpper;
//
bool hasBearishPressure =
iHigh < iPressureZoneLower;
// //
// Detect Cloud Direction ... // Detect Cloud Direction ...
//
bool isLLBullish =
//
isSCLLCrossedOverMCLL &&
isLCLLCrossedOverHCLL &&
iHCLL < iCloudZoneUpper &&
iHCLL < iCloudZoneLower
//
;
//
bool isHHBearish =
//
isSCHHCrossedUnderMCHH &&
isLCHHCrossedUnderHCHH &&
iHCHH > iCloudZoneUpper &&
iHCHH > iCloudZoneLower
//
;
// //
bool isBullish = bool isBullish =
isLLBullish; hasBullishPressure &&
isBullishPriceInsideCloudZone;
// //
bool isBearish = bool isBearish =
isHHBearish; hasBearishPressure &&
isBearishPriceInsideCloudZone;
//
// false;
// (isLCMaUnderHCMa
// ? isLCMaBullish
// : isLCMaOverHCMa
// ? isHCMaBullish
// : false) &&
// iHCLL < iCloudZoneLower;
//
// false;
// (isLCMaOverHCMa
// ? isLCMaBearish
// : isLCMaUnderHCMa
// ? isHCMaBearish
// : false) &&
// iHCHH > iCloudZoneUpper;
//
// Filter Bullish / Berish Directons ...
// //
// isBullish =
// false
// // isBullish &&
// // isBullishPriceInsideCloudZone
// // isSCMaBullish &&
// // isMCMaBullish &&
// // (isLCMaBullish ||
// // isHCMaBullish)
// ;
// //
// isBearish =
// false
// // isBearish &&
// // isBearishPriceInsideCloudZone
// // isSCMaBearish &&
// // isMCMaBearish &&
// // (isLCMaBearish ||
// // isHCMaBearish)
// ;
// //
has = isBullish || has = isBullish ||