77 lines
2.2 KiB
Plaintext
77 lines
2.2 KiB
Plaintext
if (result)
|
|
{
|
|
//
|
|
XOHCL tmpBar;
|
|
int tmpIDX = -1;
|
|
bool has = false;
|
|
double upper = 0;
|
|
double lower = 0;
|
|
int length = zone.GetAge();
|
|
|
|
//
|
|
// Support ...
|
|
tmpIDX = bar.FindLowestIndex(length, MODE_LOW);
|
|
if (IsValidIndex(tmpIDX))
|
|
{
|
|
//
|
|
if (tmpBar.Init(symbol, period, tmpIDX))
|
|
{
|
|
//
|
|
lower = iLow(symbol, period, tmpIDX);
|
|
upper = bar.FindLowest(length, MODE_CLOSE);
|
|
if (upper <= lower)
|
|
{
|
|
upper = tmpBar.GetDown();
|
|
}
|
|
|
|
//
|
|
has = support.Init(
|
|
symbol,
|
|
period,
|
|
upper,
|
|
lower,
|
|
tmpBar.time,
|
|
bar.time,
|
|
X_DIRECTION_BULLISH,
|
|
ToXString(X_BAR_PATTERN_SUPPORT) //
|
|
);
|
|
|
|
//
|
|
tmpBar.Clean();
|
|
}
|
|
}
|
|
|
|
//
|
|
// Resistance ...
|
|
tmpIDX = bar.FindHighestIndex(length, MODE_HIGH);
|
|
if (IsValidIndex(tmpIDX))
|
|
{
|
|
//
|
|
if (tmpBar.Init(symbol, period, tmpIDX))
|
|
{
|
|
//
|
|
upper = iHigh(symbol, period, tmpIDX);
|
|
lower = bar.FindHighest(length, MODE_CLOSE);
|
|
if (upper <= lower)
|
|
{
|
|
upper = tmpBar.GetUp();
|
|
}
|
|
|
|
//
|
|
has = resistance.Init(
|
|
symbol,
|
|
period,
|
|
upper,
|
|
lower,
|
|
tmpBar.time,
|
|
bar.time,
|
|
X_DIRECTION_BEARISH,
|
|
ToXString(X_BAR_PATTERN_RESISTANCE) //
|
|
);
|
|
|
|
//
|
|
tmpBar.Clean();
|
|
}
|
|
}
|
|
}
|