last ...
This commit is contained in:
@@ -307,6 +307,30 @@ struct XCHMAConditions
|
||||
//
|
||||
bool isRetestFastSlow;
|
||||
|
||||
//
|
||||
bool isFastSupport;
|
||||
bool isSlowSupport;
|
||||
|
||||
//
|
||||
bool isFastResistance;
|
||||
bool isSlowResistance;
|
||||
|
||||
//
|
||||
bool isRejectedFastAsResistance;
|
||||
bool isRejectedSlowAsResistance;
|
||||
|
||||
//
|
||||
bool isRejectedFastAsSupport;
|
||||
bool isRejectedSlowAsSupport;
|
||||
|
||||
//
|
||||
bool isBreakedFastAsResistance;
|
||||
bool isBreakedSlowAsResistance;
|
||||
|
||||
//
|
||||
bool isBreakedFastAsSupport;
|
||||
bool isBreakedSlowAsSupport;
|
||||
|
||||
//
|
||||
bool isFastOverMax;
|
||||
bool isFastUnderMax;
|
||||
@@ -695,6 +719,18 @@ struct XCHMAConditions
|
||||
isCloseUnderSlow = false;
|
||||
isCloseCrossedUnderSlow = false;
|
||||
isRetestFastSlow = false;
|
||||
isFastSupport = false;
|
||||
isSlowSupport = false;
|
||||
isFastResistance = false;
|
||||
isSlowResistance = false;
|
||||
isRejectedFastAsResistance = false;
|
||||
isRejectedSlowAsResistance = false;
|
||||
isRejectedFastAsSupport = false;
|
||||
isRejectedSlowAsSupport = false;
|
||||
isBreakedFastAsResistance = false;
|
||||
isBreakedSlowAsResistance = false;
|
||||
isBreakedFastAsSupport = false;
|
||||
isBreakedSlowAsSupport = false;
|
||||
isFastOverMax = false;
|
||||
isFastUnderMax = false;
|
||||
isFastOverMin = false;
|
||||
@@ -930,6 +966,42 @@ struct XCHMAConditions
|
||||
if (isRetestFastSlow)
|
||||
{
|
||||
}
|
||||
if (isFastSupport)
|
||||
{
|
||||
}
|
||||
if (isSlowSupport)
|
||||
{
|
||||
}
|
||||
if (isFastResistance)
|
||||
{
|
||||
}
|
||||
if (isSlowResistance)
|
||||
{
|
||||
}
|
||||
if (isRejectedFastAsResistance)
|
||||
{
|
||||
}
|
||||
if (isRejectedSlowAsResistance)
|
||||
{
|
||||
}
|
||||
if (isRejectedFastAsSupport)
|
||||
{
|
||||
}
|
||||
if (isRejectedSlowAsSupport)
|
||||
{
|
||||
}
|
||||
if (isBreakedFastAsResistance)
|
||||
{
|
||||
}
|
||||
if (isBreakedSlowAsResistance)
|
||||
{
|
||||
}
|
||||
if (isBreakedFastAsSupport)
|
||||
{
|
||||
}
|
||||
if (isBreakedSlowAsSupport)
|
||||
{
|
||||
}
|
||||
if (isFastOverMax)
|
||||
{
|
||||
}
|
||||
@@ -1485,6 +1557,18 @@ struct XCHMAConditions
|
||||
ToString("isCloseUnderSlow", isCloseUnderSlow, ignoreFalseConditions, separator) +
|
||||
ToString("isCloseCrossedUnderSlow", isCloseCrossedUnderSlow, ignoreFalseConditions, separator) +
|
||||
ToString("isRetestFastSlow", isRetestFastSlow, ignoreFalseConditions, separator) +
|
||||
ToString("isFastSupport", isFastSupport, ignoreFalseConditions, separator) +
|
||||
ToString("isSlowSupport", isSlowSupport, ignoreFalseConditions, separator) +
|
||||
ToString("isFastResistance", isFastResistance, ignoreFalseConditions, separator) +
|
||||
ToString("isSlowResistance", isSlowResistance, ignoreFalseConditions, separator) +
|
||||
ToString("isRejectedFastAsResistance", isRejectedFastAsResistance, ignoreFalseConditions, separator) +
|
||||
ToString("isRejectedSlowAsResistance", isRejectedSlowAsResistance, ignoreFalseConditions, separator) +
|
||||
ToString("isRejectedFastAsSupport", isRejectedFastAsSupport, ignoreFalseConditions, separator) +
|
||||
ToString("isRejectedSlowAsSupport", isRejectedSlowAsSupport, ignoreFalseConditions, separator) +
|
||||
ToString("isBreakedFastAsResistance", isBreakedFastAsResistance, ignoreFalseConditions, separator) +
|
||||
ToString("isBreakedSlowAsResistance", isBreakedSlowAsResistance, ignoreFalseConditions, separator) +
|
||||
ToString("isBreakedFastAsSupport", isBreakedFastAsSupport, ignoreFalseConditions, separator) +
|
||||
ToString("isBreakedSlowAsSupport", isBreakedSlowAsSupport, ignoreFalseConditions, separator) +
|
||||
ToString("isFastOverMax", isFastOverMax, ignoreFalseConditions, separator) +
|
||||
ToString("isFastUnderMax", isFastUnderMax, ignoreFalseConditions, separator) +
|
||||
ToString("isFastOverMin", isFastOverMin, ignoreFalseConditions, separator) +
|
||||
@@ -3066,6 +3150,26 @@ public:
|
||||
MODE_LOW //
|
||||
);
|
||||
|
||||
//
|
||||
XOHCL ppBar;
|
||||
result = ppBar.Init(
|
||||
mSymbol,
|
||||
mPeriod,
|
||||
ppIndex //
|
||||
);
|
||||
if (!result)
|
||||
{
|
||||
return result;
|
||||
}
|
||||
double phhValue = ppBar.FindHighest(
|
||||
loopback * 2,
|
||||
MODE_HIGH //
|
||||
);
|
||||
double pllValue = ppBar.FindLowest(
|
||||
loopback * 2,
|
||||
MODE_LOW //
|
||||
);
|
||||
|
||||
//
|
||||
double allValues[];
|
||||
double maxValue = 0;
|
||||
@@ -3172,6 +3276,267 @@ public:
|
||||
//
|
||||
);
|
||||
|
||||
//
|
||||
// Calculate Support and Resistance Behaviour for Fast and Slow ...
|
||||
|
||||
//
|
||||
// Supports Happens when Lowest Low of atleast n Number of Bars
|
||||
// are above line ...
|
||||
bool isFastSupport = pllValue > conditions.fast[ppIndex];
|
||||
bool isSlowSupport = pllValue > conditions.slow[ppIndex];
|
||||
|
||||
//
|
||||
// Resistance Happens when Highest High of atleast n NUmber of Bars
|
||||
// are below line ...
|
||||
bool isFastResistance = phhValue < conditions.fast[ppIndex];
|
||||
bool isSlowResistance = phhValue < conditions.slow[ppIndex];
|
||||
|
||||
//
|
||||
// Rejection occure by Shaddows ...
|
||||
// this mean Previous Bar Shadows breaked Line but Close doesnt make sense ...
|
||||
// price rejected ...
|
||||
|
||||
//
|
||||
bool isRejectedFastAsSupport =
|
||||
//
|
||||
!isFastSupport
|
||||
? false
|
||||
: (
|
||||
//
|
||||
// Check Bar State ...
|
||||
(ppBar.low > conditions.fast[ppIndex])
|
||||
//
|
||||
&&
|
||||
//
|
||||
// Check Shadow Break ...
|
||||
(pBar.high > conditions.fast[pIndex] &&
|
||||
//
|
||||
// Touch ...
|
||||
pBar.low < conditions.fast[pIndex])
|
||||
//
|
||||
&&
|
||||
//
|
||||
// Check Close Bar for Rejection ...
|
||||
(cBar.close > conditions.fast[cIndex] &&
|
||||
cBar.IsBullish())
|
||||
//
|
||||
)
|
||||
//
|
||||
;
|
||||
|
||||
//
|
||||
bool isRejectedSlowAsSupport =
|
||||
//
|
||||
!isSlowSupport
|
||||
? false
|
||||
: (
|
||||
//
|
||||
// Check Bar State ...
|
||||
(ppBar.low > conditions.slow[ppIndex])
|
||||
//
|
||||
&&
|
||||
//
|
||||
// Check Shadow Break ...
|
||||
(pBar.high > conditions.slow[pIndex] &&
|
||||
//
|
||||
// Touch ...
|
||||
pBar.low < conditions.slow[pIndex])
|
||||
//
|
||||
&&
|
||||
//
|
||||
// Check Close Bar for Rejection ...
|
||||
(cBar.close > conditions.slow[cIndex] &&
|
||||
cBar.IsBullish())
|
||||
//
|
||||
)
|
||||
//
|
||||
;
|
||||
|
||||
//
|
||||
bool isRejectedFastAsResistance =
|
||||
//
|
||||
!isFastResistance
|
||||
? false
|
||||
: (
|
||||
//
|
||||
// Check Bar State ...
|
||||
(ppBar.high < conditions.fast[ppIndex])
|
||||
//
|
||||
&&
|
||||
//
|
||||
// Check Shadow Break ...
|
||||
(pBar.low < conditions.fast[pIndex] &&
|
||||
//
|
||||
// Touch ...
|
||||
pBar.high > conditions.fast[pIndex])
|
||||
//
|
||||
&&
|
||||
//
|
||||
// Check Close Bar for Rejection ...
|
||||
(cBar.close < conditions.fast[cIndex] &&
|
||||
cBar.IsBearish())
|
||||
//
|
||||
)
|
||||
//
|
||||
;
|
||||
|
||||
//
|
||||
bool isRejectedSlowAsResistance =
|
||||
//
|
||||
!isSlowResistance
|
||||
? false
|
||||
: (
|
||||
//
|
||||
// Check Bar State ...
|
||||
(ppBar.high < conditions.slow[ppIndex])
|
||||
//
|
||||
&&
|
||||
//
|
||||
// Check Shadow Break ...
|
||||
(pBar.low < conditions.slow[pIndex] &&
|
||||
//
|
||||
// Touch ...
|
||||
pBar.high > conditions.slow[pIndex])
|
||||
//
|
||||
&&
|
||||
//
|
||||
// Check Close Bar for Rejection ...
|
||||
(cBar.close < conditions.slow[cIndex] &&
|
||||
cBar.IsBearish())
|
||||
//
|
||||
)
|
||||
//
|
||||
;
|
||||
|
||||
//
|
||||
// Breakes occures by Price Close ...
|
||||
// this means Previous Bar Close in One Side of line and next Close on another Side ...
|
||||
// also Fibo 0.5 of Candle Body appears on opposit side ...
|
||||
|
||||
//
|
||||
bool isBreakedFastAsSupport =
|
||||
//
|
||||
!isFastSupport
|
||||
? false
|
||||
: (
|
||||
//
|
||||
// Check Bar State ...
|
||||
(ppBar.low > conditions.fast[ppIndex])
|
||||
//
|
||||
&&
|
||||
//
|
||||
// Check Shadow Break ...
|
||||
(pBar.high > conditions.fast[pIndex] &&
|
||||
//
|
||||
// Touch ...
|
||||
pBar.low < conditions.fast[pIndex] &&
|
||||
//
|
||||
// Calculate 50% ...
|
||||
(conditions.fast[pIndex] - pBar.GetDown() > (pBar.GetBody() / 100) * 50))
|
||||
//
|
||||
&&
|
||||
//
|
||||
// Check Close Bar for Breakout ...
|
||||
(cBar.close < conditions.fast[cIndex] &&
|
||||
cBar.IsBearish())
|
||||
//
|
||||
)
|
||||
//
|
||||
;
|
||||
|
||||
//
|
||||
bool isBreakedSlowAsSupport =
|
||||
//
|
||||
!isSlowSupport
|
||||
? false
|
||||
: (
|
||||
//
|
||||
// Check Bar State ...
|
||||
(ppBar.low > conditions.slow[ppIndex])
|
||||
//
|
||||
&&
|
||||
//
|
||||
// Check Shadow Break ...
|
||||
(pBar.high > conditions.slow[pIndex] &&
|
||||
//
|
||||
// Touch ...
|
||||
pBar.low < conditions.slow[pIndex] &&
|
||||
//
|
||||
// Calculate 50% ...
|
||||
(conditions.slow[pIndex] - pBar.GetDown() > (pBar.GetBody() / 100) * 50))
|
||||
//
|
||||
&&
|
||||
//
|
||||
// Check Close Bar for Breakout ...
|
||||
(cBar.close < conditions.slow[cIndex] &&
|
||||
cBar.IsBearish())
|
||||
//
|
||||
)
|
||||
//
|
||||
;
|
||||
|
||||
//
|
||||
bool isBreakedFastAsResistance =
|
||||
//
|
||||
!isFastResistance
|
||||
? false
|
||||
: (
|
||||
//
|
||||
// Check Bar State ...
|
||||
(ppBar.high < conditions.fast[ppIndex])
|
||||
//
|
||||
&&
|
||||
//
|
||||
// Check Shadow Break ...
|
||||
(pBar.low < conditions.fast[pIndex] &&
|
||||
//
|
||||
// Touch ...
|
||||
pBar.high > conditions.fast[pIndex] &&
|
||||
//
|
||||
// Calculate 50% ...
|
||||
(pBar.GetUp() - conditions.fast[pIndex] > (pBar.GetBody() / 100) * 50))
|
||||
//
|
||||
&&
|
||||
//
|
||||
// Check Close Bar for Breakout ...
|
||||
(cBar.close > conditions.fast[cIndex] &&
|
||||
cBar.IsBullish())
|
||||
//
|
||||
)
|
||||
//
|
||||
;
|
||||
|
||||
//
|
||||
bool isBreakedSlowAsResistance =
|
||||
//
|
||||
!isSlowResistance
|
||||
? false
|
||||
: (
|
||||
//
|
||||
// Check Bar State ...
|
||||
(ppBar.high < conditions.slow[ppIndex])
|
||||
//
|
||||
&&
|
||||
//
|
||||
// Check Shadow Break ...
|
||||
(pBar.low < conditions.slow[pIndex] &&
|
||||
//
|
||||
// Touch ...
|
||||
pBar.high > conditions.slow[pIndex] &&
|
||||
//
|
||||
// Calculate 50% ...
|
||||
(pBar.GetUp() - conditions.slow[pIndex] > (pBar.GetBody() / 100) * 50))
|
||||
//
|
||||
&&
|
||||
//
|
||||
// Check Close Bar for Breakout ...
|
||||
(cBar.close > conditions.slow[cIndex] &&
|
||||
cBar.IsBullish())
|
||||
//
|
||||
)
|
||||
//
|
||||
;
|
||||
|
||||
//
|
||||
// Current ...
|
||||
|
||||
@@ -3685,6 +4050,18 @@ public:
|
||||
conditions.isCloseUnderSlow = isCloseUnderSlow;
|
||||
conditions.isCloseCrossedUnderSlow = isCloseCrossedUnderSlow;
|
||||
conditions.isRetestFastSlow = isRetestFastSlow;
|
||||
conditions.isFastSupport = isFastSupport;
|
||||
conditions.isSlowSupport = isSlowSupport;
|
||||
conditions.isFastResistance = isFastResistance;
|
||||
conditions.isSlowResistance = isSlowResistance;
|
||||
conditions.isRejectedFastAsResistance = isRejectedFastAsResistance;
|
||||
conditions.isRejectedSlowAsResistance = isRejectedSlowAsResistance;
|
||||
conditions.isRejectedFastAsSupport = isRejectedFastAsSupport;
|
||||
conditions.isRejectedSlowAsSupport = isRejectedSlowAsSupport;
|
||||
conditions.isBreakedFastAsResistance = isBreakedFastAsResistance;
|
||||
conditions.isBreakedSlowAsResistance = isBreakedSlowAsResistance;
|
||||
conditions.isBreakedFastAsSupport = isBreakedFastAsSupport;
|
||||
conditions.isBreakedSlowAsSupport = isBreakedSlowAsSupport;
|
||||
conditions.isFastOverMax = isFastOverMax;
|
||||
conditions.isFastUnderMax = isFastUnderMax;
|
||||
conditions.isFastOverMin = isFastOverMin;
|
||||
|
||||
Reference in New Issue
Block a user