last works on Detecting Pivots ...
- Pivots Detection works Fine; - Analyse Pivots Has some issues and i have to Fix them ...
This commit is contained in:
@@ -147,8 +147,8 @@ XCXFIMAStrategy1Signaller *fima1Signaller; // XFIMA1 Signaller ...
|
||||
XCXFIMAStrategy2Signaller *fima2Signaller; // XFIMA2 Signaller ...
|
||||
|
||||
//
|
||||
// Drawer and Draws ...
|
||||
CArrayObj draws; // Drawn Objects ...
|
||||
// Drawer and eaDraws ...
|
||||
CArrayObj eaDraws; // Drawn Objects ...
|
||||
|
||||
//
|
||||
XBarTracker eaBarTracker; // EA Bar Traker ...
|
||||
@@ -258,6 +258,7 @@ int OnInit()
|
||||
// This is Default Configuration ...
|
||||
fimaInputs.Default();
|
||||
fimaInputs.Hide();
|
||||
fimaInputs.showPV = true;
|
||||
fimaInputs.showZigZag = true;
|
||||
|
||||
//
|
||||
@@ -612,9 +613,9 @@ void OnSignalTriggered(XSignal &signal)
|
||||
|
||||
//
|
||||
bool has = iObj.Create(
|
||||
fima2Signaller.fimaPOIDrawer.ChartIdentification(),
|
||||
fima2Signaller.poiDrawer.ChartIdentification(),
|
||||
iName,
|
||||
fima2Signaller.fimaPOIDrawer.SubWindowIdentification(),
|
||||
fima2Signaller.poiDrawer.SubWindowIdentification(),
|
||||
signal.time //
|
||||
);
|
||||
if (has)
|
||||
@@ -624,7 +625,7 @@ void OnSignalTriggered(XSignal &signal)
|
||||
iObj.Color(iColor);
|
||||
|
||||
//
|
||||
draws.Add(iObj);
|
||||
eaDraws.Add(iObj);
|
||||
}
|
||||
|
||||
//
|
||||
@@ -815,13 +816,23 @@ void DetectPatterns()
|
||||
//
|
||||
// XFIMA Patetrns ...
|
||||
bool detectFIMAPatterns = true;
|
||||
//
|
||||
bool detectFIMAPVPatterns = false;
|
||||
bool detectFIMAMAPatterns = false;
|
||||
bool detectFIMASARPatterns = false;
|
||||
bool detectFIMAZigZagPatterns = false;
|
||||
//
|
||||
bool analyseFIMAPVPivots = true;
|
||||
bool analyseFIMAMAPivots = true;
|
||||
bool analyseFIMASARPivots = true;
|
||||
bool analyseFIMAZigZagPivots = true;
|
||||
|
||||
//
|
||||
// Checking Momentum Bar ...
|
||||
if (detectMomentum)
|
||||
{
|
||||
//
|
||||
bool isMomentum = fima2Signaller.fimaPOIDetector.IsMomentumBar(
|
||||
bool isMomentum = fima2Signaller.poiDetector.IsMomentumBar(
|
||||
cBar,
|
||||
iDir //
|
||||
);
|
||||
@@ -840,7 +851,7 @@ void DetectPatterns()
|
||||
if (detectEngulfed)
|
||||
{
|
||||
//
|
||||
bool isEngulfed = fima2Signaller.fimaPOIDetector.IsEngulfedBar(
|
||||
bool isEngulfed = fima2Signaller.poiDetector.IsEngulfedBar(
|
||||
cBar,
|
||||
iDir //
|
||||
);
|
||||
@@ -859,7 +870,7 @@ void DetectPatterns()
|
||||
if (detectTrueGaped)
|
||||
{
|
||||
//
|
||||
bool isTrueGaped = fima2Signaller.fimaPOIDetector.IsTrueGapedBar(
|
||||
bool isTrueGaped = fima2Signaller.poiDetector.IsTrueGapedBar(
|
||||
cBar,
|
||||
iDir //
|
||||
);
|
||||
@@ -877,7 +888,7 @@ void DetectPatterns()
|
||||
// Checking Pinned Bar ...
|
||||
if (detectPinned)
|
||||
{
|
||||
bool isPinned = fima2Signaller.fimaPOIDetector.IsPinnedBar(
|
||||
bool isPinned = fima2Signaller.poiDetector.IsPinnedBar(
|
||||
cBar,
|
||||
iDir //
|
||||
);
|
||||
@@ -895,7 +906,7 @@ void DetectPatterns()
|
||||
// Checking Star Pattern ...
|
||||
if (detectStarPattern)
|
||||
{
|
||||
bool isStarPattern = fima2Signaller.fimaPOIDetector.IsStartPattern(
|
||||
bool isStarPattern = fima2Signaller.poiDetector.IsStartPattern(
|
||||
cBar,
|
||||
iDir //
|
||||
);
|
||||
@@ -914,7 +925,7 @@ void DetectPatterns()
|
||||
if (detectPiercingPattern)
|
||||
{
|
||||
//
|
||||
bool isPiercingPattern = fima2Signaller.fimaPOIDetector.IsPiercingPattern(
|
||||
bool isPiercingPattern = fima2Signaller.poiDetector.IsPiercingPattern(
|
||||
cBar,
|
||||
iDir //
|
||||
);
|
||||
@@ -933,7 +944,7 @@ void DetectPatterns()
|
||||
if (detectRisingPattern)
|
||||
{
|
||||
//
|
||||
bool isRisingPattern = fima2Signaller.fimaPOIDetector.IsRisingPattern(
|
||||
bool isRisingPattern = fima2Signaller.poiDetector.IsRisingPattern(
|
||||
cBar,
|
||||
iDir //
|
||||
);
|
||||
@@ -953,7 +964,7 @@ void DetectPatterns()
|
||||
{
|
||||
//
|
||||
XOHCL swingBar;
|
||||
bool isFlagPattern = fima2Signaller.fimaPOIDetector.IsFlagPattern(
|
||||
bool isFlagPattern = fima2Signaller.poiDetector.IsFlagPattern(
|
||||
cBar,
|
||||
iDir,
|
||||
swingBar //
|
||||
@@ -974,7 +985,7 @@ void DetectPatterns()
|
||||
if (detectSignalKeyBarPattern)
|
||||
{
|
||||
//
|
||||
bool isSignalKeyBar = fima2Signaller.fimaPOIDetector.IsSignalKeyBarPattern(
|
||||
bool isSignalKeyBar = fima2Signaller.poiDetector.IsSignalKeyBarPattern(
|
||||
cBar,
|
||||
iDir //
|
||||
);
|
||||
@@ -994,7 +1005,7 @@ void DetectPatterns()
|
||||
{
|
||||
//
|
||||
XOHCL swings[];
|
||||
bool hasSwingTrend = fima2Signaller.fimaPOIDetector.HasSwingTrend(
|
||||
bool hasSwingTrend = fima2Signaller.poiDetector.HasSwingTrend(
|
||||
cBar,
|
||||
iDir,
|
||||
swings //
|
||||
@@ -1010,7 +1021,7 @@ void DetectPatterns()
|
||||
|
||||
//
|
||||
CChartObjectTrend *iObj;
|
||||
has = fima2Signaller.fimaPOIDrawer.DrawSwingTrend(
|
||||
has = fima2Signaller.poiDrawer.DrawSwingTrend(
|
||||
swings,
|
||||
iDir,
|
||||
iObj,
|
||||
@@ -1018,7 +1029,7 @@ void DetectPatterns()
|
||||
);
|
||||
if (has)
|
||||
{
|
||||
draws.Add(iObj);
|
||||
eaDraws.Add(iObj);
|
||||
}
|
||||
}
|
||||
SpecifiedClean(swings);
|
||||
@@ -1030,7 +1041,7 @@ void DetectPatterns()
|
||||
{
|
||||
//
|
||||
XOHCL swings[];
|
||||
bool hasSwingTrend = fima2Signaller.fimaPOIDetector.HasSwingTrend(
|
||||
bool hasSwingTrend = fima2Signaller.poiDetector.HasSwingTrend(
|
||||
cBar,
|
||||
iDir,
|
||||
swings //
|
||||
@@ -1067,7 +1078,7 @@ void DetectPatterns()
|
||||
{
|
||||
//
|
||||
XOHCL support;
|
||||
bool hasSupport = fima2Signaller.fimaPOIDetector.HasSupport(
|
||||
bool hasSupport = fima2Signaller.poiDetector.HasSupport(
|
||||
cBar,
|
||||
support //
|
||||
);
|
||||
@@ -1081,13 +1092,13 @@ void DetectPatterns()
|
||||
//
|
||||
// Draw Box ...
|
||||
XCBoxObject *iObj;
|
||||
has = fima2Signaller.fimaPOIDrawer.DrawBox(
|
||||
has = fima2Signaller.poiDrawer.DrawBox(
|
||||
supportBox,
|
||||
iObj //
|
||||
);
|
||||
if (has)
|
||||
{
|
||||
draws.Add(iObj);
|
||||
eaDraws.Add(iObj);
|
||||
}
|
||||
|
||||
//
|
||||
@@ -1106,7 +1117,7 @@ void DetectPatterns()
|
||||
{
|
||||
//
|
||||
XOHCL resistance;
|
||||
bool hasResistance = fima2Signaller.fimaPOIDetector.HasResistance(
|
||||
bool hasResistance = fima2Signaller.poiDetector.HasResistance(
|
||||
cBar,
|
||||
resistance //
|
||||
);
|
||||
@@ -1120,13 +1131,13 @@ void DetectPatterns()
|
||||
//
|
||||
// Draw Box ...
|
||||
XCBoxObject *iObj;
|
||||
has = fima2Signaller.fimaPOIDrawer.DrawBox(
|
||||
has = fima2Signaller.poiDrawer.DrawBox(
|
||||
resistanceBox,
|
||||
iObj //
|
||||
);
|
||||
if (has)
|
||||
{
|
||||
draws.Add(iObj);
|
||||
eaDraws.Add(iObj);
|
||||
}
|
||||
|
||||
//
|
||||
@@ -1143,6 +1154,244 @@ void DetectPatterns()
|
||||
// Detecting FIMA Patterns ...
|
||||
if (detectFIMAPatterns)
|
||||
{
|
||||
//
|
||||
// Check For PV Pivots ...
|
||||
if (detectFIMAPVPatterns)
|
||||
{
|
||||
//
|
||||
XPivot pivots[];
|
||||
int pivotsCount = fima2Signaller.poiDetector.ExtractPVPivots(
|
||||
pivots, // Result ...
|
||||
cBar.Index(), // Bar Index ...
|
||||
50, // Required Number of Pivots ...
|
||||
1500, // Max Allowed Loopback ...
|
||||
10 // Validation Length ...
|
||||
);
|
||||
has = IsValidSize(pivotsCount);
|
||||
if (has)
|
||||
{
|
||||
//
|
||||
CArrayObj *drawnPivots = new CArrayObj();
|
||||
int drawnPivotsCount = fima2Signaller.poiDrawer.DrawPivots(
|
||||
pivots,
|
||||
drawnPivots //
|
||||
);
|
||||
has = IsValidSize(drawnPivotsCount);
|
||||
if (has)
|
||||
{
|
||||
//
|
||||
AddObjects(
|
||||
drawnPivots,
|
||||
eaDraws //
|
||||
);
|
||||
|
||||
//
|
||||
Print("Pivots Extracted ...");
|
||||
}
|
||||
|
||||
//
|
||||
ZeroMemory(drawnPivots);
|
||||
}
|
||||
}
|
||||
|
||||
//
|
||||
// Check for MA Patterns ...
|
||||
if (detectFIMAMAPatterns)
|
||||
{
|
||||
//
|
||||
XPivot pivots[];
|
||||
int pivotsCount = fima2Signaller.poiDetector.ExtractMAPivots(
|
||||
pivots, // Result ...
|
||||
cBar.Index(), // Bar Index ...
|
||||
50, // Required Number of Pivots ...
|
||||
1500, // Max Allowed Loopback ...
|
||||
0 // Validation Length ...
|
||||
);
|
||||
has = IsValidSize(pivotsCount);
|
||||
if (has)
|
||||
{
|
||||
//
|
||||
CArrayObj *drawnPivots = new CArrayObj();
|
||||
int drawnPivotsCount = fima2Signaller.poiDrawer.DrawPivots(
|
||||
pivots,
|
||||
drawnPivots //
|
||||
);
|
||||
has = IsValidSize(drawnPivotsCount);
|
||||
if (has)
|
||||
{
|
||||
//
|
||||
AddObjects(
|
||||
drawnPivots,
|
||||
eaDraws //
|
||||
);
|
||||
|
||||
//
|
||||
Print("Pivots Extracted ...");
|
||||
}
|
||||
|
||||
//
|
||||
ZeroMemory(drawnPivots);
|
||||
}
|
||||
}
|
||||
|
||||
//
|
||||
// Check for SAR Pivots ...
|
||||
if (detectFIMASARPatterns)
|
||||
{
|
||||
//
|
||||
XPivot pivots[];
|
||||
int pivotsCount = fima2Signaller.poiDetector.ExtractSARPivots(
|
||||
pivots, // Result ...
|
||||
cBar.Index(), // Bar Index ...
|
||||
50, // Required Number of Pivots ...
|
||||
1500 // Max Allowed Loopback ...
|
||||
);
|
||||
has = IsValidSize(pivotsCount);
|
||||
if (has)
|
||||
{
|
||||
//
|
||||
CArrayObj *drawnPivots = new CArrayObj();
|
||||
int drawnPivotsCount = fima2Signaller.poiDrawer.DrawPivots(
|
||||
pivots,
|
||||
drawnPivots //
|
||||
);
|
||||
has = IsValidSize(drawnPivotsCount);
|
||||
if (has)
|
||||
{
|
||||
//
|
||||
AddObjects(
|
||||
drawnPivots,
|
||||
eaDraws //
|
||||
);
|
||||
|
||||
//
|
||||
Print("Pivots Extracted ...");
|
||||
}
|
||||
|
||||
//
|
||||
ZeroMemory(drawnPivots);
|
||||
}
|
||||
}
|
||||
|
||||
//
|
||||
// Check for ZigZag Pivots ...
|
||||
if (detectFIMAZigZagPatterns)
|
||||
{
|
||||
//
|
||||
XPivot pivots[];
|
||||
int pivotsCount = fima2Signaller.poiDetector.ExtractZigZagPivots(
|
||||
pivots,
|
||||
0,
|
||||
50,
|
||||
1500 //
|
||||
);
|
||||
has = IsValidSize(pivotsCount);
|
||||
if (has)
|
||||
{
|
||||
//
|
||||
CArrayObj *drawnPivots = new CArrayObj();
|
||||
int drawnPivotsCount = fima2Signaller.poiDrawer.DrawPivots(
|
||||
pivots,
|
||||
drawnPivots //
|
||||
);
|
||||
has = IsValidSize(drawnPivotsCount);
|
||||
if (has)
|
||||
{
|
||||
//
|
||||
AddObjects(
|
||||
drawnPivots,
|
||||
eaDraws //
|
||||
);
|
||||
|
||||
//
|
||||
Print("Pivots Extracted ...");
|
||||
}
|
||||
|
||||
//
|
||||
ZeroMemory(drawnPivots);
|
||||
}
|
||||
}
|
||||
|
||||
//
|
||||
// Analysers ...
|
||||
|
||||
//
|
||||
// Analyse Based on PV ...
|
||||
if (analyseFIMAPVPivots && false)
|
||||
{
|
||||
//
|
||||
XPivotAnalysis analysis;
|
||||
has = fima2Signaller.poiDetector.AnalysePVPivots(
|
||||
analysis, // Result ...
|
||||
cBar.Index(), // Bar Index ...
|
||||
50, // Required Number of Pivots ...
|
||||
1500, // Max Allowed Loopback ...
|
||||
10 // Validation Length ...
|
||||
);
|
||||
if (has)
|
||||
{
|
||||
//
|
||||
// Draw Analysis ...
|
||||
XCPivotAnalysisObject *iObj;
|
||||
has = fima2Signaller.poiDrawer.DrawPivotAnalysis(
|
||||
analysis,
|
||||
iObj //
|
||||
);
|
||||
if (has)
|
||||
{
|
||||
//
|
||||
eaDraws.Add(iObj);
|
||||
|
||||
//
|
||||
Print("FIMA PV Pivots Analysed ...");
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
//
|
||||
// Analyse Based on MA ...
|
||||
if (analyseFIMAMAPivots)
|
||||
{
|
||||
}
|
||||
|
||||
//
|
||||
// Analyse Based on SAR ...
|
||||
if (analyseFIMASARPivots)
|
||||
{
|
||||
}
|
||||
|
||||
//
|
||||
// Analyse Based on ZigZag ...
|
||||
if (analyseFIMAZigZagPivots)
|
||||
{
|
||||
//
|
||||
XPivotAnalysis analysis;
|
||||
has = fima2Signaller.poiDetector.AnalyseZigZagPivots(
|
||||
analysis, // Result ...
|
||||
cBar.Index(), // Bar Index ...
|
||||
50, // Required Number of Pivots ...
|
||||
1500 // Max Allowed Loopback ...
|
||||
);
|
||||
if (has)
|
||||
{
|
||||
//
|
||||
// Draw Analysis ...
|
||||
XCPivotAnalysisObject *iObj;
|
||||
has = fima2Signaller.poiDrawer.DrawPivotAnalysis(
|
||||
analysis,
|
||||
iObj,
|
||||
true // Draw Pivots ...
|
||||
);
|
||||
if (has)
|
||||
{
|
||||
//
|
||||
eaDraws.Add(iObj);
|
||||
|
||||
//
|
||||
Print("FIMA ZigZag Pivots Analysed ...");
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
//
|
||||
|
||||
Reference in New Issue
Block a user