last ...
This commit is contained in:
@@ -1002,12 +1002,63 @@ class XCX121XKIStrategy1Signaller : public XCX121XKIBaseSignaller
|
|||||||
barIndex,
|
barIndex,
|
||||||
bar.symbol,
|
bar.symbol,
|
||||||
bar.period, // Minor ...
|
bar.period, // Minor ...
|
||||||
PERIOD_H1, // Major ...
|
PERIOD_H1, // Major ...
|
||||||
50,
|
50,
|
||||||
14,
|
14,
|
||||||
21,
|
21,
|
||||||
0 //
|
0 //
|
||||||
);
|
);
|
||||||
|
|
||||||
|
//
|
||||||
|
isBullish = majorSupport.IsValid() &&
|
||||||
|
minorSupport.IsValid() &&
|
||||||
|
poiDetector.HasCandlestickDirection(
|
||||||
|
iBar,
|
||||||
|
X_DIRECTION_BULLISH //
|
||||||
|
) &&
|
||||||
|
IsTFBullishPattern(barIndex, PERIOD_M5) &&
|
||||||
|
minorSupport.lower <= majorSupport.upper &&
|
||||||
|
poiDetector.IsNearZone(iBar.close, minorSupport, 10);
|
||||||
|
|
||||||
|
//
|
||||||
|
isBearish = majorResistance.IsValid() &&
|
||||||
|
minorResistance.IsValid() &&
|
||||||
|
poiDetector.HasCandlestickDirection(
|
||||||
|
iBar,
|
||||||
|
X_DIRECTION_BEARISH //
|
||||||
|
) &&
|
||||||
|
IsTFBearishPattern(barIndex, PERIOD_M5) &&
|
||||||
|
minorResistance.upper >= majorResistance.lower &&
|
||||||
|
poiDetector.IsNearZone(iBar.close, minorResistance, 10);
|
||||||
|
|
||||||
|
//
|
||||||
|
// Retrieve Base Conditions ...
|
||||||
|
// isBullish =
|
||||||
|
// isBullish &&
|
||||||
|
// IsBullishPOILongEntry(barIndex);
|
||||||
|
// isBearish =
|
||||||
|
// isBearish &&
|
||||||
|
// IsBearishPOIShortEntry(barIndex);
|
||||||
|
|
||||||
|
//
|
||||||
|
// Validate Conditions ...
|
||||||
|
result = isBullish || isBearish;
|
||||||
|
if (!result)
|
||||||
|
{
|
||||||
|
//
|
||||||
|
iBar.Clean();
|
||||||
|
XClean(supports);
|
||||||
|
XClean(resistances);
|
||||||
|
minorSupport.Clean();
|
||||||
|
majorSupport.Clean();
|
||||||
|
minorResistance.Clean();
|
||||||
|
majorResistance.Clean();
|
||||||
|
|
||||||
|
//
|
||||||
|
return result;
|
||||||
|
}
|
||||||
|
|
||||||
|
//
|
||||||
bool draw = true;
|
bool draw = true;
|
||||||
if (draw)
|
if (draw)
|
||||||
{
|
{
|
||||||
@@ -1063,19 +1114,6 @@ class XCX121XKIStrategy1Signaller : public XCX121XKIBaseSignaller
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
// //
|
|
||||||
// // Retrieve Base Conditions ...
|
|
||||||
// bool isBullish = IsBullishPOILongEntry(barIndex);
|
|
||||||
// bool isBearish = IsBearishPOIShortEntry(barIndex);
|
|
||||||
|
|
||||||
// //
|
|
||||||
// // Validate Conditions ...
|
|
||||||
// result = isBullish || isBearish;
|
|
||||||
// if (!result)
|
|
||||||
// {
|
|
||||||
// return result;
|
|
||||||
// }
|
|
||||||
|
|
||||||
// //
|
// //
|
||||||
// // Do Validation and Filtering Market Structure if required ...
|
// // Do Validation and Filtering Market Structure if required ...
|
||||||
|
|
||||||
@@ -1319,6 +1357,14 @@ class XCX121XKIStrategy1Signaller : public XCX121XKIBaseSignaller
|
|||||||
{
|
{
|
||||||
//
|
//
|
||||||
iBar.Clean();
|
iBar.Clean();
|
||||||
|
XClean(supports);
|
||||||
|
XClean(resistances);
|
||||||
|
minorSupport.Clean();
|
||||||
|
majorSupport.Clean();
|
||||||
|
minorResistance.Clean();
|
||||||
|
majorResistance.Clean();
|
||||||
|
|
||||||
|
//
|
||||||
return result;
|
return result;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -1330,12 +1376,14 @@ class XCX121XKIStrategy1Signaller : public XCX121XKIBaseSignaller
|
|||||||
//
|
//
|
||||||
double upper = isBullish
|
double upper = isBullish
|
||||||
? entry
|
? entry
|
||||||
: iBar.high;
|
: minorSupport.upper;
|
||||||
double lower = isBullish
|
double lower = isBullish
|
||||||
? iBar.low
|
? minorResistance.lower
|
||||||
: entry;
|
: entry;
|
||||||
datetime to = bar.time;
|
datetime to = bar.time;
|
||||||
datetime from = iBar.BeforeOn();
|
datetime from = isBullish
|
||||||
|
? minorSupport.from
|
||||||
|
: minorResistance.from;
|
||||||
result = zone.Init(
|
result = zone.Init(
|
||||||
iBar.symbol,
|
iBar.symbol,
|
||||||
iBar.period,
|
iBar.period,
|
||||||
@@ -1361,7 +1409,14 @@ class XCX121XKIStrategy1Signaller : public XCX121XKIBaseSignaller
|
|||||||
}
|
}
|
||||||
|
|
||||||
//
|
//
|
||||||
|
// Cleanup Resources ...
|
||||||
iBar.Clean();
|
iBar.Clean();
|
||||||
|
XClean(supports);
|
||||||
|
XClean(resistances);
|
||||||
|
minorSupport.Clean();
|
||||||
|
majorSupport.Clean();
|
||||||
|
minorResistance.Clean();
|
||||||
|
majorResistance.Clean();
|
||||||
|
|
||||||
//
|
//
|
||||||
result =
|
result =
|
||||||
|
|||||||
@@ -1912,6 +1912,36 @@ class XCX121XKIPOIDetector : public XCMarketPatternDetector
|
|||||||
//
|
//
|
||||||
return result;
|
return result;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
bool IsNearZone(
|
||||||
|
double price,
|
||||||
|
XBoxZone &zone,
|
||||||
|
double threshold = 0 //
|
||||||
|
)
|
||||||
|
{
|
||||||
|
//
|
||||||
|
bool result = false;
|
||||||
|
|
||||||
|
//
|
||||||
|
result =
|
||||||
|
zone.IsValid() &&
|
||||||
|
NotEmptyZero(price);
|
||||||
|
if (!result)
|
||||||
|
{
|
||||||
|
return result;
|
||||||
|
}
|
||||||
|
|
||||||
|
//
|
||||||
|
double points = GetPoints(zone.symbol);
|
||||||
|
double distance = points * threshold;
|
||||||
|
|
||||||
|
//
|
||||||
|
result = price >= zone.lower - distance &&
|
||||||
|
price <= zone.upper + distance;
|
||||||
|
|
||||||
|
//
|
||||||
|
return result;
|
||||||
|
}
|
||||||
// #endregion
|
// #endregion
|
||||||
|
|
||||||
//
|
//
|
||||||
|
|||||||
Reference in New Issue
Block a user