Add support for Breaked or Rejected Support and Resistance lines in XOHCL struct ...

This commit is contained in:
2024-05-31 00:48:14 +03:30
parent 159717403f
commit 75ecdc6adf
4 changed files with 523 additions and 104 deletions
+192
View File
@@ -1003,6 +1003,198 @@ struct XOHCL
return result;
}
//
// Check a Support Line Rejected or not ...
bool IsSupportRejected(
double price // Support Price
)
{
//
bool result = false;
//
// this is zBar ...
// so we are try to Recieve CBar ...
XOHCL cBar;
result = this.GetPreviousBar(cBar);
if (!result)
{
return result;
}
//
// Now we are going to Recieve PBar ...
XOHCL pBar;
result = cBar.GetPreviousBar(pBar);
if (!result)
{
return result;
}
//
// We Have this (0) Bar, cBar (1) and pBar (2) ...
//
// pBar Down Shadow must break Price Line ...
// cBar and zBar Close must be Above Price Line ...
// also zBar Open must be Above Price Line ...
result =
//
pBar.low < price &&
cBar.close > price &&
this.close > price &&
this.open > price
//
;
//
return result;
}
//
// Check a Support Line Breaked or not ...
bool IsSupportBreaked(
double price // Support Price
)
{
//
bool result = false;
//
// this is zBar ...
// so we are try to Recieve CBar ...
XOHCL cBar;
result = this.GetPreviousBar(cBar);
if (!result)
{
return result;
}
//
// Now we are going to Recieve PBar ...
XOHCL pBar;
result = cBar.GetPreviousBar(pBar);
if (!result)
{
return result;
}
//
// We Have this (0) Bar, cBar (1) and pBar (2) ...
//
// pBar Down Shadow must break Price Line ...
// cBar and zBar Close must be Below Price Line ...
// also zBar Open must be Below Price Line ...
result =
//
pBar.low < price &&
cBar.close < price &&
this.close < price &&
this.open < price
//
;
//
return result;
}
//
// Check a Resistance Line Rejected or not ...
bool IsResistanceRejected(
double price // Resistance Price
)
{
//
bool result = false;
//
// this is zBar ...
// so we are try to Recieve CBar ...
XOHCL cBar;
result = this.GetPreviousBar(cBar);
if (!result)
{
return result;
}
//
// Now we are going to Recieve PBar ...
XOHCL pBar;
result = cBar.GetPreviousBar(pBar);
if (!result)
{
return result;
}
//
// We Have this (0) Bar, cBar (1) and pBar (2) ...
//
// pBar Up Shadow must break Price Line ...
// cBar and zBar Close must be Under Price Line ...
// also zBar Open must be Under Price Line ...
result =
//
pBar.high > price &&
cBar.close < price &&
this.close < price &&
this.open < price
//
;
//
return result;
}
//
// Check a Resistance Line Breaked or not ...
bool IsResistanceBreaked(
double price // Support Price
)
{
//
bool result = false;
//
// this is zBar ...
// so we are try to Recieve CBar ...
XOHCL cBar;
result = this.GetPreviousBar(cBar);
if (!result)
{
return result;
}
//
// Now we are going to Recieve PBar ...
XOHCL pBar;
result = cBar.GetPreviousBar(pBar);
if (!result)
{
return result;
}
//
// We Have this (0) Bar, cBar (1) and pBar (2) ...
//
// pBar Up Shadow must break Price Line ...
// cBar and zBar Close must be Over Price Line ...
// also zBar Open must be Pver Price Line ...
result =
//
pBar.high > price &&
cBar.close > price &&
this.close > price &&
this.open > price
//
;
//
return result;
}
//
// Check Bar is Inside Previus Bar ...
bool IsInsideBar(