Apply 1r1 GBPUSDb Level 1 fix ...

This commit is contained in:
2024-08-24 01:30:37 +03:30
parent 28ebf1192c
commit 9841c7c2a9
4 changed files with 19644 additions and 14 deletions
+330
View File
@@ -4997,6 +4997,336 @@ public:
return result;
}
//
bool IsBullishSorted(
int barIndex // Bar Index
)
{
//
bool result = false;
//
int cIndex = barIndex;
int pIndex = cIndex + 1;
//
// Current ...
//
XOHCL cCBar;
result = CAsOHCL(cCBar, cIndex);
if (!result)
{
return result;
}
//
XOHCL cPBar;
result = CAsOHCL(cPBar, pIndex);
if (!result)
{
return result;
}
//
// Short ...
//
XOHCL sCBar;
result = SAsOHCL(sCBar, cIndex);
if (!result)
{
return result;
}
//
XOHCL sPBar;
result = SAsOHCL(sPBar, pIndex);
if (!result)
{
return result;
}
//
// Medium ...
//
XOHCL mCBar;
result = MAsOHCL(sCBar, cIndex);
if (!result)
{
return result;
}
//
XOHCL mPBar;
result = MAsOHCL(mPBar, pIndex);
if (!result)
{
return result;
}
//
// Long ...
//
XOHCL lCBar;
result = LAsOHCL(lCBar, cIndex);
if (!result)
{
return result;
}
//
XOHCL lPBar;
result = LAsOHCL(lPBar, pIndex);
if (!result)
{
return result;
}
//
// Hind ...
//
XOHCL hCBar;
result = HAsOHCL(hCBar, cIndex);
if (!result)
{
return result;
}
//
XOHCL hPBar;
result = HAsOHCL(hPBar, pIndex);
if (!result)
{
return result;
}
//
bool isCBullish =
//
cCBar.IsBullish() &&
sCBar.IsBullish() &&
mCBar.IsBullish() &&
lCBar.IsBullish() &&
hCBar.IsBullish()
//
;
//
bool isCSorted =
//
cCBar.high > sCBar.high &&
sCBar.high > mCBar.high &&
mCBar.high > lCBar.high &&
lCBar.high > hCBar.high
//
;
//
bool isCPrepred = isCBullish &&
isCSorted;
//
bool isPBullish =
//
cPBar.IsBullish() &&
sPBar.IsBullish() &&
mPBar.IsBullish() &&
lPBar.IsBullish() &&
hPBar.IsBullish()
//
;
//
bool isPSorted =
//
cPBar.high > sPBar.high &&
sPBar.high > mPBar.high &&
mPBar.high > lPBar.high &&
lPBar.high > hPBar.high
//
;
//
bool isPPrepred = isPBullish &&
isPSorted;
//
result = isCPrepred &&
!isPPrepred;
//
return result;
}
//
bool IsBearishSorted(
int barIndex // Bar Index
)
{
//
bool result = false;
//
int cIndex = barIndex;
int pIndex = cIndex + 1;
//
// Current ...
//
XOHCL cCBar;
result = CAsOHCL(cCBar, cIndex);
if (!result)
{
return result;
}
//
XOHCL cPBar;
result = CAsOHCL(cPBar, pIndex);
if (!result)
{
return result;
}
//
// Short ...
//
XOHCL sCBar;
result = SAsOHCL(sCBar, cIndex);
if (!result)
{
return result;
}
//
XOHCL sPBar;
result = SAsOHCL(sPBar, pIndex);
if (!result)
{
return result;
}
//
// Medium ...
//
XOHCL mCBar;
result = MAsOHCL(sCBar, cIndex);
if (!result)
{
return result;
}
//
XOHCL mPBar;
result = MAsOHCL(mPBar, pIndex);
if (!result)
{
return result;
}
//
// Long ...
//
XOHCL lCBar;
result = LAsOHCL(lCBar, cIndex);
if (!result)
{
return result;
}
//
XOHCL lPBar;
result = LAsOHCL(lPBar, pIndex);
if (!result)
{
return result;
}
//
// Hind ...
//
XOHCL hCBar;
result = HAsOHCL(hCBar, cIndex);
if (!result)
{
return result;
}
//
XOHCL hPBar;
result = HAsOHCL(hPBar, pIndex);
if (!result)
{
return result;
}
//
bool isCBearish =
//
cCBar.IsBearish() &&
sCBar.IsBearish() &&
mCBar.IsBearish() &&
lCBar.IsBearish() &&
hCBar.IsBearish()
//
;
//
bool isCSorted =
//
cCBar.low < sCBar.low &&
sCBar.low < mCBar.low &&
mCBar.low < lCBar.low &&
lCBar.low < hCBar.low
//
;
//
bool isCPrepred = isCBearish &&
isCSorted;
//
bool isPBearish =
//
cPBar.IsBearish() &&
sPBar.IsBearish() &&
mPBar.IsBearish() &&
lPBar.IsBearish() &&
hPBar.IsBearish()
//
;
//
bool isPSorted =
//
cPBar.low < sPBar.low &&
sPBar.low < mPBar.low &&
mPBar.low < lPBar.low &&
lPBar.low < hPBar.low
//
;
//
bool isPPrepred = isPBearish &&
isPSorted;
//
result = isCPrepred &&
!isPPrepred;
//
return result;
}
//
// Check All Cycles Switched to Bullish or not ...
bool IsSwitchedToBullish(
File diff suppressed because it is too large Load Diff
File diff suppressed because it is too large Load Diff
+116 -6
View File
@@ -329,6 +329,36 @@ public:
//
// Common Conditions For Bullish and Bearish Powers ...
//
// For Trend ...
XOHCL tmpHSW[];
XOHCL tmpLSW[];
//
// Detect Bullish/Bearish Patterns and Trends ...
//
// Bullish ...
bool hasBullishPower = cBar.HasBullishPower();
bool hasBullishPattern = HasBullishPattern(cBar);
bool hasBullishPressure = cBar.HasBullishPressure();
bool isBullishTrend = cBar.HasBullishTrend(
tmpHSW,
tmpLSW,
true //
);
//
// Bearish ...
bool hasBearishPower = cBar.HasBearishPower();
bool hasBearishPattern = HasBearishPattern(cBar);
bool hasBearishPressure = cBar.HasBearishPressure();
bool isBearishTrend = cBar.HasBearishTrend(
tmpHSW,
tmpLSW,
false //
);
//
bool notHaveBearishPower = (!chmConditions.hasBearishPower &&
!chhkConditions.hasBearishPower &&
@@ -351,10 +381,18 @@ public:
bool isCHHKFullSwitchedToBullish =
chhkHelper.IsSwitchedToBullish(cIndex);
//
bool isCHHKFullBullishAndSorted =
chhkHelper.IsBullishSorted(cIndex);
//
bool isCHHKFullSwitchedToBearish =
chhkHelper.IsSwitchedToBearish(cIndex);
//
bool isCHHKFullBearishAndSorted =
chhkHelper.IsBearishSorted(cIndex);
//
bool isBearishPowerDecreasing =
//
@@ -410,12 +448,18 @@ public:
//
// Detecting Signals ...
//
// First Conditions ...
//
bool hasLong1 =
//
isBullishTrend &&
(hasBullishPower ||
hasBullishPattern ||
hasBullishPressure) &&
hasBullishDecision &&
notHaveBearishPower &&
isBearishPowerDecreasing &&
isCHHKFullSwitchedToBullish
//
;
@@ -424,7 +468,7 @@ public:
//
pushers++;
Add(
"XCHHKE",
"XCHHKE1",
signallers //
);
@@ -436,9 +480,12 @@ public:
//
bool hasShort1 =
//
isBearishTrend &&
(hasBearishPower ||
hasBearishPattern ||
hasBearishPressure) &&
hasBearishDecision &&
notHaveBullishPower &&
isBullishPowerDecreasing &&
isCHHKFullSwitchedToBearish
//
;
@@ -447,7 +494,62 @@ public:
//
pushers++;
Add(
"XCHHKE",
"XCHHKE1",
signallers //
);
//
sl = short1SL;
type = POSITION_TYPE_SELL;
}
//
// Second Condition ...
//
bool hasLong2 =
//
// isBullishTrend &&
// (hasBullishPower ||
// hasBullishPattern ||
// hasBullishPressure) &&
// hasBullishDecision &&
// notHaveBearishPower &&
isCHHKFullBullishAndSorted
//
;
if (hasLong2)
{
//
pushers++;
Add(
"XCHHKE2",
signallers //
);
//
sl = long1SL;
type = POSITION_TYPE_BUY;
}
//
bool hasShort2 =
//
// isBearishTrend &&
// (hasBearishPower ||
// hasBearishPattern ||
// hasBearishPressure) &&
// hasBearishDecision &&
// notHaveBullishPower &&
isCHHKFullBearishAndSorted
//
;
if (hasShort2)
{
//
pushers++;
Add(
"XCHHKE2",
signallers //
);
@@ -459,14 +561,22 @@ public:
//
hasLong =
//
hasLong1
// hasLong1
// //
// ||
//
hasLong2
//
;
//
hasShort =
//
hasShort1
// hasShort1
// //
// ||
//
hasShort2
//
;