last ...
This commit is contained in:
@@ -148,6 +148,7 @@ input bool showHKBand = false; // Show HK Band
|
|||||||
input bool showATRBand = false; // Show ATR Band
|
input bool showATRBand = false; // Show ATR Band
|
||||||
input bool showBarTime = true; // Show Bar Time
|
input bool showBarTime = true; // Show Bar Time
|
||||||
input bool showZigZag = false; // Show ZigZag
|
input bool showZigZag = false; // Show ZigZag
|
||||||
|
input bool showCyclesMa = false; // Show Cycles MA
|
||||||
input bool showFiboZone = false; // Show Fibo Zone
|
input bool showFiboZone = false; // Show Fibo Zone
|
||||||
|
|
||||||
//
|
//
|
||||||
@@ -343,6 +344,7 @@ int OnInit()
|
|||||||
fimaInputs.showHKBand = showHKBand;
|
fimaInputs.showHKBand = showHKBand;
|
||||||
fimaInputs.showATRBand = showATRBand;
|
fimaInputs.showATRBand = showATRBand;
|
||||||
fimaInputs.showZigZag = showZigZag;
|
fimaInputs.showZigZag = showZigZag;
|
||||||
|
fimaInputs.showCyclesMa = showCyclesMa;
|
||||||
fimaInputs.showFiboZone = showFiboZone;
|
fimaInputs.showFiboZone = showFiboZone;
|
||||||
fimaInputs.startCalculationForLastBars = startCalculationForLastBars;
|
fimaInputs.startCalculationForLastBars = startCalculationForLastBars;
|
||||||
fimaInputs.sarArrowCode = sarArrowCode;
|
fimaInputs.sarArrowCode = sarArrowCode;
|
||||||
|
|||||||
@@ -671,6 +671,7 @@ class XCXFIMAHelper : public XCBaseHelper
|
|||||||
mInputs.showHKBand,
|
mInputs.showHKBand,
|
||||||
mInputs.showATRBand,
|
mInputs.showATRBand,
|
||||||
mInputs.showZigZag,
|
mInputs.showZigZag,
|
||||||
|
mInputs.showCyclesMa,
|
||||||
mInputs.showFiboZone,
|
mInputs.showFiboZone,
|
||||||
mInputs.startCalculationForLastBars,
|
mInputs.startCalculationForLastBars,
|
||||||
mInputs.sarArrowCode,
|
mInputs.sarArrowCode,
|
||||||
|
|||||||
@@ -1464,6 +1464,10 @@ void DefineBuffers()
|
|||||||
//
|
//
|
||||||
// MA State ...
|
// MA State ...
|
||||||
|
|
||||||
|
//
|
||||||
|
// Draw Type ...
|
||||||
|
ENUM_DRAW_TYPE cyclesMADrawType = showCyclesMa ? DRAW_LINE : DRAW_NONE;
|
||||||
|
|
||||||
//
|
//
|
||||||
// SC ...
|
// SC ...
|
||||||
|
|
||||||
@@ -1474,6 +1478,7 @@ void DefineBuffers()
|
|||||||
//
|
//
|
||||||
PlotIndexSetInteger(scMaBufferPlotIndex, PLOT_SHOW_DATA, showCyclesMa);
|
PlotIndexSetInteger(scMaBufferPlotIndex, PLOT_SHOW_DATA, showCyclesMa);
|
||||||
PlotIndexSetDouble(scMaBufferPlotIndex, PLOT_EMPTY_VALUE, emptyValue);
|
PlotIndexSetDouble(scMaBufferPlotIndex, PLOT_EMPTY_VALUE, emptyValue);
|
||||||
|
PlotIndexSetInteger(scMaBufferPlotIndex, PLOT_DRAW_TYPE, cyclesMADrawType);
|
||||||
|
|
||||||
//
|
//
|
||||||
ArraySetAsSeries(scMaStateBuffer, true);
|
ArraySetAsSeries(scMaStateBuffer, true);
|
||||||
@@ -1489,6 +1494,7 @@ void DefineBuffers()
|
|||||||
//
|
//
|
||||||
PlotIndexSetInteger(mcMaBufferPlotIndex, PLOT_SHOW_DATA, showCyclesMa);
|
PlotIndexSetInteger(mcMaBufferPlotIndex, PLOT_SHOW_DATA, showCyclesMa);
|
||||||
PlotIndexSetDouble(mcMaBufferPlotIndex, PLOT_EMPTY_VALUE, emptyValue);
|
PlotIndexSetDouble(mcMaBufferPlotIndex, PLOT_EMPTY_VALUE, emptyValue);
|
||||||
|
PlotIndexSetInteger(mcMaBufferPlotIndex, PLOT_DRAW_TYPE, cyclesMADrawType);
|
||||||
|
|
||||||
//
|
//
|
||||||
ArraySetAsSeries(scMaStateBuffer, true);
|
ArraySetAsSeries(scMaStateBuffer, true);
|
||||||
@@ -1504,6 +1510,7 @@ void DefineBuffers()
|
|||||||
//
|
//
|
||||||
PlotIndexSetInteger(lcMaBufferPlotIndex, PLOT_SHOW_DATA, showCyclesMa);
|
PlotIndexSetInteger(lcMaBufferPlotIndex, PLOT_SHOW_DATA, showCyclesMa);
|
||||||
PlotIndexSetDouble(lcMaBufferPlotIndex, PLOT_EMPTY_VALUE, emptyValue);
|
PlotIndexSetDouble(lcMaBufferPlotIndex, PLOT_EMPTY_VALUE, emptyValue);
|
||||||
|
PlotIndexSetInteger(lcMaBufferPlotIndex, PLOT_DRAW_TYPE, cyclesMADrawType);
|
||||||
|
|
||||||
//
|
//
|
||||||
ArraySetAsSeries(lcMaStateBuffer, true);
|
ArraySetAsSeries(lcMaStateBuffer, true);
|
||||||
@@ -1519,6 +1526,7 @@ void DefineBuffers()
|
|||||||
//
|
//
|
||||||
PlotIndexSetInteger(hcMaBufferPlotIndex, PLOT_SHOW_DATA, showCyclesMa);
|
PlotIndexSetInteger(hcMaBufferPlotIndex, PLOT_SHOW_DATA, showCyclesMa);
|
||||||
PlotIndexSetDouble(hcMaBufferPlotIndex, PLOT_EMPTY_VALUE, emptyValue);
|
PlotIndexSetDouble(hcMaBufferPlotIndex, PLOT_EMPTY_VALUE, emptyValue);
|
||||||
|
PlotIndexSetInteger(hcMaBufferPlotIndex, PLOT_DRAW_TYPE, cyclesMADrawType);
|
||||||
|
|
||||||
//
|
//
|
||||||
ArraySetAsSeries(hcMaStateBuffer, true);
|
ArraySetAsSeries(hcMaStateBuffer, true);
|
||||||
|
|||||||
@@ -284,19 +284,19 @@ class XCXFIMAStrategy1Signaller : public XCXFIMABaseSignaller
|
|||||||
{
|
{
|
||||||
//
|
//
|
||||||
// Configure ...
|
// Configure ...
|
||||||
drawLeg = true;
|
drawLeg = false;
|
||||||
drawZones = true;
|
drawZones = false;
|
||||||
drawIZones = true;
|
drawIZones = false;
|
||||||
drawTrends = true;
|
drawTrends = false;
|
||||||
drawSCTrend = true;
|
drawSCTrend = false;
|
||||||
drawMCTrend = true;
|
drawMCTrend = false;
|
||||||
drawLCTrend = true;
|
drawLCTrend = false;
|
||||||
drawHCTrend = true;
|
drawHCTrend = false;
|
||||||
drawSupport = true;
|
drawSupport = false;
|
||||||
drawISupport = true;
|
drawISupport = false;
|
||||||
drawOrderFlow = true;
|
drawOrderFlow = false;
|
||||||
drawResistance = true;
|
drawResistance = false;
|
||||||
drawIResistance = true;
|
drawIResistance = false;
|
||||||
|
|
||||||
//
|
//
|
||||||
manageLegs = true;
|
manageLegs = true;
|
||||||
@@ -1570,8 +1570,18 @@ class XCXFIMAStrategy1Signaller : public XCXFIMABaseSignaller
|
|||||||
bool useSignaller4 = false;
|
bool useSignaller4 = false;
|
||||||
|
|
||||||
//
|
//
|
||||||
// Validator Flags ...
|
XBoxZone tmpZone;
|
||||||
string provider = NULL;
|
string provider = NULL;
|
||||||
|
ENUM_X_DIRECTION tmpDir;
|
||||||
|
|
||||||
|
//
|
||||||
|
bool signaller1HasSignal = false;
|
||||||
|
bool signaller2HasSignal = false;
|
||||||
|
bool signaller3HasSignal = false;
|
||||||
|
bool signaller4HasSignal = false;
|
||||||
|
|
||||||
|
//
|
||||||
|
// Validator Flags ...
|
||||||
bool validateByOrderFlow = false;
|
bool validateByOrderFlow = false;
|
||||||
|
|
||||||
//
|
//
|
||||||
@@ -1615,16 +1625,6 @@ class XCXFIMAStrategy1Signaller : public XCXFIMABaseSignaller
|
|||||||
//
|
//
|
||||||
// Signal Detection Flags ...
|
// Signal Detection Flags ...
|
||||||
|
|
||||||
//
|
|
||||||
XBoxZone tmpZone;
|
|
||||||
ENUM_X_DIRECTION tmpDir;
|
|
||||||
|
|
||||||
//
|
|
||||||
bool signaller1HasSignal = false;
|
|
||||||
bool signaller2HasSignal = false;
|
|
||||||
bool signaller3HasSignal = false;
|
|
||||||
bool signaller4HasSignal = false;
|
|
||||||
|
|
||||||
//
|
//
|
||||||
// Signaller 1 ...
|
// Signaller 1 ...
|
||||||
if (useSignaller1)
|
if (useSignaller1)
|
||||||
@@ -2048,16 +2048,20 @@ class XCXFIMAStrategy1Signaller : public XCXFIMABaseSignaller
|
|||||||
|
|
||||||
//
|
//
|
||||||
XOHCL pBar;
|
XOHCL pBar;
|
||||||
|
XOHCL p2Bar;
|
||||||
bool isBullish = false;
|
bool isBullish = false;
|
||||||
bool isBearish = false;
|
bool isBearish = false;
|
||||||
|
|
||||||
//
|
//
|
||||||
// Read PBar ...
|
// Read PBar ...
|
||||||
result = bar.GetPreviousBar(pBar);
|
result = bar.GetPreviousBar(pBar);
|
||||||
|
result = result &&
|
||||||
|
pBar.GetPreviousBar(p2Bar);
|
||||||
if (!result)
|
if (!result)
|
||||||
{
|
{
|
||||||
//
|
//
|
||||||
pBar.Clean();
|
pBar.Clean();
|
||||||
|
p2Bar.Clean();
|
||||||
return result;
|
return result;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -2105,10 +2109,10 @@ class XCXFIMAStrategy1Signaller : public XCXFIMABaseSignaller
|
|||||||
|
|
||||||
//
|
//
|
||||||
// Reading pBar Patterns ...
|
// Reading pBar Patterns ...
|
||||||
XPatternAnalysis pBarAnalysis;
|
XPatternAnalysis pBarPatterns;
|
||||||
poiDetector.AnalyseBarPatterns(
|
poiDetector.AnalyseBarPatterns(
|
||||||
pBar,
|
pBar,
|
||||||
pBarAnalysis,
|
pBarPatterns,
|
||||||
structureConfig.barsAnalysisConfig //
|
structureConfig.barsAnalysisConfig //
|
||||||
);
|
);
|
||||||
|
|
||||||
@@ -2119,11 +2123,11 @@ class XCXFIMAStrategy1Signaller : public XCXFIMABaseSignaller
|
|||||||
bar.open > pBar.low) &&
|
bar.open > pBar.low) &&
|
||||||
(
|
(
|
||||||
//
|
//
|
||||||
pBarAnalysis.IsPinned(X_DIRECTION_BULLISH) ||
|
pBarPatterns.IsPinned(X_DIRECTION_BULLISH) ||
|
||||||
pBarAnalysis.IsEngulfed(X_DIRECTION_BULLISH) ||
|
pBarPatterns.IsEngulfed(X_DIRECTION_BULLISH) ||
|
||||||
pBarAnalysis.IsMomentum(X_DIRECTION_BULLISH) ||
|
pBarPatterns.IsMomentum(X_DIRECTION_BULLISH) ||
|
||||||
pBarAnalysis.IsPiercing(X_DIRECTION_BULLISH) ||
|
pBarPatterns.IsPiercing(X_DIRECTION_BULLISH) ||
|
||||||
pBarAnalysis.IsSignalKey(X_DIRECTION_BULLISH)
|
pBarPatterns.IsSignalKey(X_DIRECTION_BULLISH)
|
||||||
//
|
//
|
||||||
);
|
);
|
||||||
bool isPBarHasBearishPatterns =
|
bool isPBarHasBearishPatterns =
|
||||||
@@ -2131,11 +2135,11 @@ class XCXFIMAStrategy1Signaller : public XCXFIMABaseSignaller
|
|||||||
bar.open < pBar.high) &&
|
bar.open < pBar.high) &&
|
||||||
(
|
(
|
||||||
//
|
//
|
||||||
pBarAnalysis.IsPinned(X_DIRECTION_BEARISH) ||
|
pBarPatterns.IsPinned(X_DIRECTION_BEARISH) ||
|
||||||
pBarAnalysis.IsEngulfed(X_DIRECTION_BEARISH) ||
|
pBarPatterns.IsEngulfed(X_DIRECTION_BEARISH) ||
|
||||||
pBarAnalysis.IsMomentum(X_DIRECTION_BEARISH) ||
|
pBarPatterns.IsMomentum(X_DIRECTION_BEARISH) ||
|
||||||
pBarAnalysis.IsPiercing(X_DIRECTION_BEARISH) ||
|
pBarPatterns.IsPiercing(X_DIRECTION_BEARISH) ||
|
||||||
pBarAnalysis.IsSignalKey(X_DIRECTION_BEARISH)
|
pBarPatterns.IsSignalKey(X_DIRECTION_BEARISH)
|
||||||
//
|
//
|
||||||
);
|
);
|
||||||
|
|
||||||
@@ -2195,6 +2199,13 @@ class XCXFIMAStrategy1Signaller : public XCXFIMABaseSignaller
|
|||||||
affectedZonesBearish //
|
affectedZonesBearish //
|
||||||
);
|
);
|
||||||
|
|
||||||
|
//
|
||||||
|
// Detecting Boundary Trend ...
|
||||||
|
XTrend boundaryTrend;
|
||||||
|
bool hasBoundaryTrend = fimaParser.HasBoundaryTrend(boundaryTrend, pBar.Index());
|
||||||
|
bool hasBoundaryBullishTrend = hasBoundaryTrend && boundaryTrend.IsBullish();
|
||||||
|
bool hasBoundaryBearishTrend = hasBoundaryTrend && boundaryTrend.IsBearish();
|
||||||
|
|
||||||
//
|
//
|
||||||
// Do ...
|
// Do ...
|
||||||
|
|
||||||
@@ -2255,6 +2266,37 @@ class XCXFIMAStrategy1Signaller : public XCXFIMABaseSignaller
|
|||||||
|
|
||||||
//
|
//
|
||||||
result = zone.IsValid();
|
result = zone.IsValid();
|
||||||
|
|
||||||
|
//
|
||||||
|
// Zone Validations ...
|
||||||
|
if (result)
|
||||||
|
{
|
||||||
|
//
|
||||||
|
if (boundaryTrend.IsValid())
|
||||||
|
{
|
||||||
|
poiDrawer.DrawTrendLine(boundaryTrend, structureDrawConfig.drawConfig);
|
||||||
|
}
|
||||||
|
|
||||||
|
//
|
||||||
|
poiDrawer.DrawZone(zone, structureDrawConfig.drawConfig);
|
||||||
|
poiDrawer.DrawPatternAnalysis(pBarPatterns, structureDrawConfig.barAnalysisDrawConfig);
|
||||||
|
|
||||||
|
//
|
||||||
|
DebugBreak();
|
||||||
|
}
|
||||||
|
|
||||||
|
//
|
||||||
|
result = zone.IsValid();
|
||||||
|
|
||||||
|
//
|
||||||
|
// Reset Flags ...
|
||||||
|
if (!result)
|
||||||
|
{
|
||||||
|
//
|
||||||
|
zone.Clean();
|
||||||
|
isBullish = false;
|
||||||
|
isBearish = false;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
//
|
//
|
||||||
@@ -2273,8 +2315,10 @@ class XCXFIMAStrategy1Signaller : public XCXFIMABaseSignaller
|
|||||||
dir = X_DIRECTION_NONE;
|
dir = X_DIRECTION_NONE;
|
||||||
}
|
}
|
||||||
pBar.Clean();
|
pBar.Clean();
|
||||||
|
p2Bar.Clean();
|
||||||
XClean(zones);
|
XClean(zones);
|
||||||
pBarAnalysis.Clean();
|
pBarPatterns.Clean();
|
||||||
|
boundaryTrend.Clean();
|
||||||
XClean(affectedZones);
|
XClean(affectedZones);
|
||||||
XClean(affectedZonesBullish);
|
XClean(affectedZonesBullish);
|
||||||
XClean(affectedZonesBearish);
|
XClean(affectedZonesBearish);
|
||||||
|
|||||||
Reference in New Issue
Block a user