last ...
This commit is contained in:
@@ -25,8 +25,6 @@
|
||||
//
|
||||
// Imports ...
|
||||
#include "../Classes/x-saherelm.x-backtester.expert.class.mq5"
|
||||
#include "../Classes/x-saherelm.x-market.pattern.class.mq5"
|
||||
#include "../Classes/x-saherelm.x-poi.drawer.class.mq5"
|
||||
#include "../XFIMAEA/Classes/x-saherelm.xfima.signaller.class.mq5"
|
||||
|
||||
//
|
||||
@@ -140,10 +138,8 @@ input int valeArrowCode = 159; // Vales Arrow Code
|
||||
|
||||
//
|
||||
// Requirements ...
|
||||
string eaLogTag; // EA Log Prefix ...
|
||||
XCBackTesterEA *eaExpert; // EA Expert ...
|
||||
XCXFIMAPOIDetector *fimaPOIDetector; // EA Fima POI Detector ...
|
||||
XCMarketPatternDetector *eaPatternDetector; // EA Pattern Detector ...
|
||||
string eaLogTag; // EA Log Prefix ...
|
||||
XCBackTesterEA *eaExpert; // EA Expert ...
|
||||
|
||||
//
|
||||
// Registered Signallers ...
|
||||
@@ -152,8 +148,7 @@ XCXFIMAStrategy2Signaller *fima2Signaller; // XFIMA2 Signaller ...
|
||||
|
||||
//
|
||||
// Drawer and Draws ...
|
||||
XCPOIDrawer *eaDrawer; // Ea POI Drawer ...
|
||||
CArrayObj draws; // Drawn Objects ...
|
||||
CArrayObj draws; // Drawn Objects ...
|
||||
|
||||
//
|
||||
XBarTracker eaBarTracker; // EA Bar Traker ...
|
||||
@@ -384,17 +379,6 @@ int OnInit()
|
||||
return INIT_FAILED;
|
||||
}
|
||||
|
||||
//
|
||||
// Instantiate Market Pattern Detector ...
|
||||
eaPatternDetector = new XCMarketPatternDetector();
|
||||
|
||||
//
|
||||
fimaPOIDetector = new XCXFIMAPOIDetector();
|
||||
|
||||
//
|
||||
// Instantiate POI Drawer ...
|
||||
eaDrawer = new XCPOIDrawer();
|
||||
|
||||
//
|
||||
Print(ShortName, ": Initialized Successfully ...");
|
||||
return INIT_SUCCEEDED;
|
||||
@@ -427,14 +411,6 @@ void OnDeinit(const int reason)
|
||||
//
|
||||
eaBarTracker.Clean();
|
||||
|
||||
//
|
||||
delete eaDrawer;
|
||||
ZeroMemory(eaDrawer);
|
||||
|
||||
//
|
||||
delete eaPatternDetector;
|
||||
ZeroMemory(eaPatternDetector);
|
||||
|
||||
//
|
||||
delete fima1Signaller;
|
||||
ZeroMemory(fima1Signaller);
|
||||
@@ -443,10 +419,6 @@ void OnDeinit(const int reason)
|
||||
delete fima2Signaller;
|
||||
ZeroMemory(fima2Signaller);
|
||||
|
||||
//
|
||||
delete fimaPOIDetector;
|
||||
ZeroMemory(fimaPOIDetector);
|
||||
|
||||
//
|
||||
delete eaExpert;
|
||||
ZeroMemory(eaExpert);
|
||||
@@ -641,9 +613,9 @@ void OnSignalTriggered(XSignal &signal)
|
||||
|
||||
//
|
||||
bool has = iObj.Create(
|
||||
eaDrawer.ChartIdentification(),
|
||||
fima2Signaller.fimaPOIDrawer.ChartIdentification(),
|
||||
iName,
|
||||
eaDrawer.SubWindowIdentification(),
|
||||
fima2Signaller.fimaPOIDrawer.SubWindowIdentification(),
|
||||
signal.time //
|
||||
);
|
||||
if (has)
|
||||
@@ -851,7 +823,7 @@ void DetectPatterns()
|
||||
if (detectMomentum)
|
||||
{
|
||||
//
|
||||
bool isMomentum = eaPatternDetector.IsMomentumBar(
|
||||
bool isMomentum = fima2Signaller.fimaPOIDetector.IsMomentumBar(
|
||||
cBar,
|
||||
iDir //
|
||||
);
|
||||
@@ -870,7 +842,7 @@ void DetectPatterns()
|
||||
if (detectEngulfed)
|
||||
{
|
||||
//
|
||||
bool isEngulfed = eaPatternDetector.IsEngulfedBar(
|
||||
bool isEngulfed = fima2Signaller.fimaPOIDetector.IsEngulfedBar(
|
||||
cBar,
|
||||
iDir //
|
||||
);
|
||||
@@ -889,7 +861,7 @@ void DetectPatterns()
|
||||
if (detectTrueGaped)
|
||||
{
|
||||
//
|
||||
bool isTrueGaped = eaPatternDetector.IsTrueGapedBar(
|
||||
bool isTrueGaped = fima2Signaller.fimaPOIDetector.IsTrueGapedBar(
|
||||
cBar,
|
||||
iDir //
|
||||
);
|
||||
@@ -907,7 +879,7 @@ void DetectPatterns()
|
||||
// Checking Pinned Bar ...
|
||||
if (detectPinned)
|
||||
{
|
||||
bool isPinned = eaPatternDetector.IsPinnedBar(
|
||||
bool isPinned = fima2Signaller.fimaPOIDetector.IsPinnedBar(
|
||||
cBar,
|
||||
iDir //
|
||||
);
|
||||
@@ -925,7 +897,7 @@ void DetectPatterns()
|
||||
// Checking Star Pattern ...
|
||||
if (detectStarPattern)
|
||||
{
|
||||
bool isStarPattern = eaPatternDetector.IsStartPattern(
|
||||
bool isStarPattern = fima2Signaller.fimaPOIDetector.IsStartPattern(
|
||||
cBar,
|
||||
iDir //
|
||||
);
|
||||
@@ -944,7 +916,7 @@ void DetectPatterns()
|
||||
if (detectPiercingPattern)
|
||||
{
|
||||
//
|
||||
bool isPiercingPattern = eaPatternDetector.IsPiercingPattern(
|
||||
bool isPiercingPattern = fima2Signaller.fimaPOIDetector.IsPiercingPattern(
|
||||
cBar,
|
||||
iDir //
|
||||
);
|
||||
@@ -963,7 +935,7 @@ void DetectPatterns()
|
||||
if (detectRisingPattern)
|
||||
{
|
||||
//
|
||||
bool isRisingPattern = eaPatternDetector.IsRisingPattern(
|
||||
bool isRisingPattern = fima2Signaller.fimaPOIDetector.IsRisingPattern(
|
||||
cBar,
|
||||
iDir //
|
||||
);
|
||||
@@ -983,7 +955,7 @@ void DetectPatterns()
|
||||
{
|
||||
//
|
||||
XOHCL swingBar;
|
||||
bool isFlagPattern = eaPatternDetector.IsFlagPattern(
|
||||
bool isFlagPattern = fima2Signaller.fimaPOIDetector.IsFlagPattern(
|
||||
cBar,
|
||||
iDir,
|
||||
swingBar //
|
||||
@@ -1004,7 +976,7 @@ void DetectPatterns()
|
||||
if (detectSignalKeyBarPattern)
|
||||
{
|
||||
//
|
||||
bool isSignalKeyBar = eaPatternDetector.IsSignalKeyBarPattern(
|
||||
bool isSignalKeyBar = fima2Signaller.fimaPOIDetector.IsSignalKeyBarPattern(
|
||||
cBar,
|
||||
iDir //
|
||||
);
|
||||
@@ -1024,7 +996,7 @@ void DetectPatterns()
|
||||
{
|
||||
//
|
||||
XOHCL swings[];
|
||||
bool hasSwingTrend = eaPatternDetector.HasSwingTrend(
|
||||
bool hasSwingTrend = fima2Signaller.fimaPOIDetector.HasSwingTrend(
|
||||
cBar,
|
||||
iDir,
|
||||
swings //
|
||||
@@ -1040,7 +1012,7 @@ void DetectPatterns()
|
||||
|
||||
//
|
||||
CChartObjectTrend *iObj;
|
||||
has = eaDrawer.DrawSwingTrend(
|
||||
has = fima2Signaller.fimaPOIDrawer.DrawSwingTrend(
|
||||
swings,
|
||||
iDir,
|
||||
iObj,
|
||||
@@ -1060,7 +1032,7 @@ void DetectPatterns()
|
||||
{
|
||||
//
|
||||
XOHCL swings[];
|
||||
bool hasSwingTrend = eaPatternDetector.HasSwingTrend(
|
||||
bool hasSwingTrend = fima2Signaller.fimaPOIDetector.HasSwingTrend(
|
||||
cBar,
|
||||
iDir,
|
||||
swings //
|
||||
@@ -1097,7 +1069,7 @@ void DetectPatterns()
|
||||
{
|
||||
//
|
||||
XOHCL support;
|
||||
bool hasSupport = eaPatternDetector.HasSupport(
|
||||
bool hasSupport = fima2Signaller.fimaPOIDetector.HasSupport(
|
||||
cBar,
|
||||
support //
|
||||
);
|
||||
@@ -1111,20 +1083,12 @@ void DetectPatterns()
|
||||
//
|
||||
// Draw Box ...
|
||||
XCBoxObject *iObj;
|
||||
has = eaDrawer.DrawBox(
|
||||
has = fima2Signaller.fimaPOIDrawer.DrawBox(
|
||||
supportBox,
|
||||
iObj //
|
||||
);
|
||||
if (has)
|
||||
{
|
||||
//
|
||||
// Apply Style ...
|
||||
eaDrawer.ApplyStyle(
|
||||
iObj,
|
||||
eaDrawer.boxBullishStyle //
|
||||
);
|
||||
|
||||
//
|
||||
draws.Add(iObj);
|
||||
}
|
||||
|
||||
@@ -1144,7 +1108,7 @@ void DetectPatterns()
|
||||
{
|
||||
//
|
||||
XOHCL resistance;
|
||||
bool hasResistance = eaPatternDetector.HasResistance(
|
||||
bool hasResistance = fima2Signaller.fimaPOIDetector.HasResistance(
|
||||
cBar,
|
||||
resistance //
|
||||
);
|
||||
@@ -1158,20 +1122,12 @@ void DetectPatterns()
|
||||
//
|
||||
// Draw Box ...
|
||||
XCBoxObject *iObj;
|
||||
has = eaDrawer.DrawBox(
|
||||
has = fima2Signaller.fimaPOIDrawer.DrawBox(
|
||||
resistanceBox,
|
||||
iObj //
|
||||
);
|
||||
if (has)
|
||||
{
|
||||
//
|
||||
// Apply Style ...
|
||||
eaDrawer.ApplyStyle(
|
||||
iObj,
|
||||
eaDrawer.boxBearishStyle //
|
||||
);
|
||||
|
||||
//
|
||||
draws.Add(iObj);
|
||||
}
|
||||
|
||||
@@ -1194,93 +1150,30 @@ void DetectPatterns()
|
||||
if (detectZIGZAGPatterns)
|
||||
{
|
||||
//
|
||||
XZigZagPoint zigzags[];
|
||||
int zigzagsCount = fimaPOIDetector.GetZigZagPoint(
|
||||
// Detect Market Analysis ...
|
||||
XZigZagAnalysis zAnalysis;
|
||||
has = fima2Signaller.fimaPOIDetector.AnalyseMarketUsingZigZag(
|
||||
cBar,
|
||||
cBar.period,
|
||||
fima2Signaller.fimaHelper,
|
||||
zigzags,
|
||||
zAnalysis,
|
||||
15 //
|
||||
);
|
||||
has = IsValidSize(zigzagsCount);
|
||||
if (has)
|
||||
{
|
||||
//
|
||||
// Analyse Using ZigZag ...
|
||||
XZigZagAnalysis cZGAnalysis;
|
||||
Print(ShortName + zAnalysis.GetMessage());
|
||||
|
||||
//
|
||||
// Check ZG Analysis Exists ...
|
||||
has = cZGAnalysis.Analyse(
|
||||
cBar,
|
||||
zigzags //
|
||||
XCZigZagAnalysisObject *iObj;
|
||||
has = fima2Signaller.fimaPOIDrawer.DrawZigZagMarketAnalysis(
|
||||
iObj,
|
||||
zAnalysis //
|
||||
);
|
||||
|
||||
//
|
||||
// Check Exists ZG Analysis isn't Same Trend as Prev ...
|
||||
has =
|
||||
has &&
|
||||
(!zigzagAnalysis.IsValid()
|
||||
? true
|
||||
: !zigzagAnalysis.IsSameTrendAs(cZGAnalysis));
|
||||
if (has)
|
||||
{
|
||||
//
|
||||
// Update Prev Analysis ...
|
||||
zigzagAnalysis = cZGAnalysis;
|
||||
|
||||
//
|
||||
// Notify Only When New Trending Happens ...
|
||||
Print("Detected ZigZags Pivots Analysis: ", zigzagAnalysis.GetMessage());
|
||||
|
||||
//
|
||||
// Draw Trend Line ...
|
||||
|
||||
//
|
||||
string iObjID = zigzagAnalysis.GetObjectID();
|
||||
string iNameType = ToXString(zigzagAnalysis.dir) + "_Trend";
|
||||
|
||||
//
|
||||
// Upper Line ...
|
||||
string iUpperName = iNameType + "_Upper_" + iObjID;
|
||||
CChartObjectTrend *iUpperObj;
|
||||
has = eaDrawer.DrawTrendLine(
|
||||
zigzagAnalysis.lastPeak.value,
|
||||
zigzagAnalysis.lastPeak.time,
|
||||
zigzagAnalysis.recentPeak.value,
|
||||
zigzagAnalysis.recentPeak.time,
|
||||
iUpperObj,
|
||||
ToMD5(iUpperName),
|
||||
true //
|
||||
);
|
||||
|
||||
//
|
||||
// Lower Line ...
|
||||
string iLowerName = iNameType + "_Lower_" + iObjID;
|
||||
CChartObjectTrend *iLowerObj;
|
||||
has =
|
||||
has &&
|
||||
eaDrawer.DrawTrendLine(
|
||||
zigzagAnalysis.lastVale.value,
|
||||
zigzagAnalysis.lastVale.time,
|
||||
zigzagAnalysis.recentVale.value,
|
||||
zigzagAnalysis.recentVale.time,
|
||||
iLowerObj,
|
||||
ToMD5(iLowerName),
|
||||
true //
|
||||
);
|
||||
|
||||
//
|
||||
if (has) {
|
||||
//
|
||||
// Apply Style on Trend Lines ...
|
||||
|
||||
//
|
||||
draws.Add(iUpperObj);
|
||||
draws.Add(iLowerObj);
|
||||
}
|
||||
draws.Add(iObj);
|
||||
}
|
||||
|
||||
//
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user