last works ...
This commit is contained in:
File diff suppressed because it is too large
Load Diff
@@ -7467,6 +7467,158 @@ class XCXFIMAHelperParser : XCBase
|
|||||||
return result;
|
return result;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Retrieve Cycles MA(s) ...
|
||||||
|
*
|
||||||
|
* @param scMA: double, reference to holds cycle value ...
|
||||||
|
* @param mcMA: double, reference to holds cycle value ...
|
||||||
|
* @param lcMA: double, reference to holds cycle value ...
|
||||||
|
* @param hcMA: double, reference to holds cycle value ...
|
||||||
|
* @param barIndex: int, Specified Bar Index ...
|
||||||
|
*/
|
||||||
|
void GetCycleMAs(
|
||||||
|
double &scMA,
|
||||||
|
double &mcMA,
|
||||||
|
double &lcMA,
|
||||||
|
double &hcMA,
|
||||||
|
int barIndex = 0 //
|
||||||
|
)
|
||||||
|
{
|
||||||
|
//
|
||||||
|
// Prepare ...
|
||||||
|
scMA = EMPTY_VALUE;
|
||||||
|
mcMA = EMPTY_VALUE;
|
||||||
|
lcMA = EMPTY_VALUE;
|
||||||
|
hcMA = EMPTY_VALUE;
|
||||||
|
|
||||||
|
//
|
||||||
|
// Normalize ...
|
||||||
|
barIndex = NormalizeBarIndex(barIndex);
|
||||||
|
|
||||||
|
//
|
||||||
|
// Validate ...
|
||||||
|
bool has = IsValid();
|
||||||
|
if (!has)
|
||||||
|
{
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
//
|
||||||
|
scMA = helper.GetSCMA(barIndex);
|
||||||
|
mcMA = helper.GetMCMA(barIndex);
|
||||||
|
lcMA = helper.GetLCMA(barIndex);
|
||||||
|
hcMA = helper.GetHCMA(barIndex);
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Retrieve Cycles MA State(s) ...
|
||||||
|
*
|
||||||
|
* @param scMAState: double, reference to holds cycle value ...
|
||||||
|
* @param mcMAState: double, reference to holds cycle value ...
|
||||||
|
* @param lcMAState: double, reference to holds cycle value ...
|
||||||
|
* @param hcMAState: double, reference to holds cycle value ...
|
||||||
|
* @param barIndex: int, Specified Bar Index ...
|
||||||
|
*/
|
||||||
|
void GetCycleMAStates(
|
||||||
|
double &scMAState,
|
||||||
|
double &mcMAState,
|
||||||
|
double &lcMAState,
|
||||||
|
double &hcMAState,
|
||||||
|
int barIndex = 0 //
|
||||||
|
)
|
||||||
|
{
|
||||||
|
//
|
||||||
|
// Prepare ...
|
||||||
|
scMAState = EMPTY_VALUE;
|
||||||
|
mcMAState = EMPTY_VALUE;
|
||||||
|
lcMAState = EMPTY_VALUE;
|
||||||
|
hcMAState = EMPTY_VALUE;
|
||||||
|
|
||||||
|
//
|
||||||
|
// Normalize ...
|
||||||
|
barIndex = NormalizeBarIndex(barIndex);
|
||||||
|
|
||||||
|
//
|
||||||
|
// Validate ...
|
||||||
|
bool has = IsValid();
|
||||||
|
if (!has)
|
||||||
|
{
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
//
|
||||||
|
scMAState = helper.GetSCMAState(barIndex);
|
||||||
|
mcMAState = helper.GetMCMAState(barIndex);
|
||||||
|
lcMAState = helper.GetLCMAState(barIndex);
|
||||||
|
hcMAState = helper.GetHCMAState(barIndex);
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Check Cycle Hind and Long is Bullish or not ...
|
||||||
|
*
|
||||||
|
* @param barIndex: int, Specified Bar Index ...
|
||||||
|
*
|
||||||
|
* @return ( bool )
|
||||||
|
*/
|
||||||
|
bool IsCycleMABullish(int barIndex = 0)
|
||||||
|
{
|
||||||
|
//
|
||||||
|
bool result = false;
|
||||||
|
|
||||||
|
//
|
||||||
|
// Normalize ...
|
||||||
|
barIndex = NormalizeBarIndex(barIndex);
|
||||||
|
|
||||||
|
//
|
||||||
|
// Validate ...
|
||||||
|
result = IsValid();
|
||||||
|
if (!result)
|
||||||
|
{
|
||||||
|
return result;
|
||||||
|
}
|
||||||
|
|
||||||
|
//
|
||||||
|
result =
|
||||||
|
IsLCMABullish(barIndex) &&
|
||||||
|
IsHCMABullish(barIndex);
|
||||||
|
|
||||||
|
//
|
||||||
|
return result;
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Check Cycle Hind and Long is Bearish or not ...
|
||||||
|
*
|
||||||
|
* @param barIndex: int, Specified Bar Index ...
|
||||||
|
*
|
||||||
|
* @return ( bool )
|
||||||
|
*/
|
||||||
|
bool IsCycleMABearish(int barIndex = 0)
|
||||||
|
{
|
||||||
|
//
|
||||||
|
bool result = false;
|
||||||
|
|
||||||
|
//
|
||||||
|
// Normalize ...
|
||||||
|
barIndex = NormalizeBarIndex(barIndex);
|
||||||
|
|
||||||
|
//
|
||||||
|
// Validate ...
|
||||||
|
result = IsValid();
|
||||||
|
if (!result)
|
||||||
|
{
|
||||||
|
return result;
|
||||||
|
}
|
||||||
|
|
||||||
|
//
|
||||||
|
result =
|
||||||
|
IsLCMABearish(barIndex) &&
|
||||||
|
IsHCMABearish(barIndex);
|
||||||
|
|
||||||
|
//
|
||||||
|
return result;
|
||||||
|
}
|
||||||
|
|
||||||
//
|
//
|
||||||
// Boundary Tools ...
|
// Boundary Tools ...
|
||||||
// =============================
|
// =============================
|
||||||
|
|||||||
@@ -298,6 +298,13 @@ class XCXFIMAStrategy1Signaller : public XCXFIMABaseSignaller
|
|||||||
drawResistance = true;
|
drawResistance = true;
|
||||||
drawIResistance = true;
|
drawIResistance = true;
|
||||||
|
|
||||||
|
//
|
||||||
|
manageLegs = true;
|
||||||
|
manageZones = true;
|
||||||
|
manageIZones = true;
|
||||||
|
manageTrends = false;
|
||||||
|
manageOrderFlow = true;
|
||||||
|
|
||||||
//
|
//
|
||||||
structureConfig.Default();
|
structureConfig.Default();
|
||||||
structureDrawConfig.Default();
|
structureDrawConfig.Default();
|
||||||
@@ -632,6 +639,7 @@ class XCXFIMAStrategy1Signaller : public XCXFIMABaseSignaller
|
|||||||
|
|
||||||
XLeg leg; // Exists Leg ...
|
XLeg leg; // Exists Leg ...
|
||||||
bool drawLeg; // Draw Leg ...
|
bool drawLeg; // Draw Leg ...
|
||||||
|
bool manageLegs;
|
||||||
|
|
||||||
//
|
//
|
||||||
bool HasLeg()
|
bool HasLeg()
|
||||||
@@ -756,6 +764,7 @@ class XCXFIMAStrategy1Signaller : public XCXFIMABaseSignaller
|
|||||||
//
|
//
|
||||||
bool drawOrderFlow;
|
bool drawOrderFlow;
|
||||||
XBoxZone orderFlow[];
|
XBoxZone orderFlow[];
|
||||||
|
bool manageOrderFlow;
|
||||||
ENUM_X_DIRECTION orderFlowDir;
|
ENUM_X_DIRECTION orderFlowDir;
|
||||||
|
|
||||||
//
|
//
|
||||||
@@ -943,6 +952,7 @@ class XCXFIMAStrategy1Signaller : public XCXFIMABaseSignaller
|
|||||||
XBoxZone resistance;
|
XBoxZone resistance;
|
||||||
bool drawZones;
|
bool drawZones;
|
||||||
bool drawSupport;
|
bool drawSupport;
|
||||||
|
bool manageZones;
|
||||||
bool drawResistance;
|
bool drawResistance;
|
||||||
|
|
||||||
//
|
//
|
||||||
@@ -1214,6 +1224,7 @@ class XCXFIMAStrategy1Signaller : public XCXFIMABaseSignaller
|
|||||||
XBoxZone iResistance;
|
XBoxZone iResistance;
|
||||||
bool drawIZones;
|
bool drawIZones;
|
||||||
bool drawISupport;
|
bool drawISupport;
|
||||||
|
bool manageIZones;
|
||||||
bool drawIResistance;
|
bool drawIResistance;
|
||||||
|
|
||||||
//
|
//
|
||||||
@@ -1385,6 +1396,7 @@ class XCXFIMAStrategy1Signaller : public XCXFIMABaseSignaller
|
|||||||
bool drawMCTrend;
|
bool drawMCTrend;
|
||||||
bool drawLCTrend;
|
bool drawLCTrend;
|
||||||
bool drawHCTrend;
|
bool drawHCTrend;
|
||||||
|
bool manageTrends;
|
||||||
|
|
||||||
//
|
//
|
||||||
bool HasTrend()
|
bool HasTrend()
|
||||||
@@ -1552,10 +1564,10 @@ class XCXFIMAStrategy1Signaller : public XCXFIMABaseSignaller
|
|||||||
|
|
||||||
//
|
//
|
||||||
// Signaller Flags ...
|
// Signaller Flags ...
|
||||||
bool useSignaller1 = false;
|
bool useSignaller1 = true;
|
||||||
bool useSignaller2 = false;
|
bool useSignaller2 = false;
|
||||||
bool useSignaller3 = true;
|
bool useSignaller3 = false;
|
||||||
bool useSignaller4 = true;
|
bool useSignaller4 = false;
|
||||||
|
|
||||||
//
|
//
|
||||||
// Validator Flags ...
|
// Validator Flags ...
|
||||||
@@ -1600,82 +1612,154 @@ class XCXFIMAStrategy1Signaller : public XCXFIMABaseSignaller
|
|||||||
// Analyse Market Strucutre ...
|
// Analyse Market Strucutre ...
|
||||||
XFIMAMarketStructure marketStructure;
|
XFIMAMarketStructure marketStructure;
|
||||||
|
|
||||||
|
//
|
||||||
|
// 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 (!result && useSignaller1)
|
if (useSignaller1)
|
||||||
{
|
{
|
||||||
//
|
//
|
||||||
result = Strategy1HasSignal(
|
signaller1HasSignal = Strategy1HasSignal(
|
||||||
bar,
|
bar,
|
||||||
zone,
|
tmpZone,
|
||||||
targets,
|
targets,
|
||||||
dir //
|
tmpDir //
|
||||||
);
|
);
|
||||||
|
|
||||||
//
|
//
|
||||||
if (result)
|
if (signaller1HasSignal)
|
||||||
{
|
{
|
||||||
provider = "1";
|
//
|
||||||
|
provider += "1";
|
||||||
|
|
||||||
|
//
|
||||||
|
if (!zone.IsValid())
|
||||||
|
{
|
||||||
|
//
|
||||||
|
dir = tmpDir;
|
||||||
|
zone = tmpZone;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
//
|
||||||
|
tmpZone.Clean();
|
||||||
|
tmpDir = X_DIRECTION_NONE;
|
||||||
|
}
|
||||||
|
|
||||||
//
|
//
|
||||||
// Signaller 2 ...
|
// Signaller 2 ...
|
||||||
if (!result && useSignaller2)
|
if (useSignaller2)
|
||||||
{
|
{
|
||||||
//
|
//
|
||||||
result = Strategy2HasSignal(
|
signaller2HasSignal = Strategy2HasSignal(
|
||||||
bar,
|
bar,
|
||||||
zone,
|
tmpZone,
|
||||||
targets,
|
targets,
|
||||||
dir //
|
tmpDir //
|
||||||
);
|
);
|
||||||
|
|
||||||
//
|
//
|
||||||
if (result)
|
if (signaller2HasSignal)
|
||||||
{
|
{
|
||||||
provider = "2";
|
//
|
||||||
|
provider += "2";
|
||||||
|
|
||||||
|
//
|
||||||
|
if (!zone.IsValid())
|
||||||
|
{
|
||||||
|
//
|
||||||
|
dir = tmpDir;
|
||||||
|
zone = tmpZone;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
//
|
||||||
|
tmpZone.Clean();
|
||||||
|
tmpDir = X_DIRECTION_NONE;
|
||||||
|
}
|
||||||
|
|
||||||
//
|
//
|
||||||
// Signaller 3 ...
|
// Signaller 3 ...
|
||||||
if (!result && useSignaller3)
|
if (useSignaller3)
|
||||||
{
|
{
|
||||||
//
|
//
|
||||||
result = Strategy3HasSignal(
|
signaller3HasSignal = Strategy3HasSignal(
|
||||||
bar,
|
bar,
|
||||||
zone,
|
tmpZone,
|
||||||
targets,
|
targets,
|
||||||
dir //
|
tmpDir //
|
||||||
);
|
);
|
||||||
|
|
||||||
//
|
//
|
||||||
if (result)
|
if (signaller3HasSignal)
|
||||||
{
|
{
|
||||||
provider = "3";
|
//
|
||||||
|
provider += "3";
|
||||||
|
|
||||||
|
//
|
||||||
|
if (!zone.IsValid())
|
||||||
|
{
|
||||||
|
//
|
||||||
|
dir = tmpDir;
|
||||||
|
zone = tmpZone;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
//
|
||||||
|
tmpZone.Clean();
|
||||||
|
tmpDir = X_DIRECTION_NONE;
|
||||||
|
}
|
||||||
|
|
||||||
//
|
//
|
||||||
// Signaller 4 ...
|
// Signaller 4 ...
|
||||||
if (!result && useSignaller4)
|
if (useSignaller4)
|
||||||
{
|
{
|
||||||
//
|
//
|
||||||
result = Strategy4HasSignal(
|
signaller4HasSignal = Strategy4HasSignal(
|
||||||
bar,
|
bar,
|
||||||
zone,
|
tmpZone,
|
||||||
targets,
|
targets,
|
||||||
dir //
|
tmpDir //
|
||||||
);
|
);
|
||||||
|
|
||||||
//
|
//
|
||||||
if (result)
|
if (signaller4HasSignal)
|
||||||
{
|
{
|
||||||
provider = "4";
|
//
|
||||||
|
provider += "4";
|
||||||
|
|
||||||
|
//
|
||||||
|
if (!zone.IsValid())
|
||||||
|
{
|
||||||
|
//
|
||||||
|
dir = tmpDir;
|
||||||
|
zone = tmpZone;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
//
|
||||||
|
tmpZone.Clean();
|
||||||
|
tmpDir = X_DIRECTION_NONE;
|
||||||
|
}
|
||||||
|
|
||||||
|
//
|
||||||
|
// Summarize Signallers Result ...
|
||||||
|
result = signaller1HasSignal ||
|
||||||
|
signaller2HasSignal ||
|
||||||
|
signaller3HasSignal ||
|
||||||
|
signaller4HasSignal;
|
||||||
|
|
||||||
//
|
//
|
||||||
// Signal Validating ...
|
// Signal Validating ...
|
||||||
|
|
||||||
@@ -1849,6 +1933,7 @@ class XCXFIMAStrategy1Signaller : public XCXFIMABaseSignaller
|
|||||||
|
|
||||||
//
|
//
|
||||||
// Draw Market Structure ...
|
// Draw Market Structure ...
|
||||||
|
|
||||||
//
|
//
|
||||||
// Analyse Market Structure if Required ...
|
// Analyse Market Structure if Required ...
|
||||||
if (!marketStructure.IsValid())
|
if (!marketStructure.IsValid())
|
||||||
@@ -1898,6 +1983,7 @@ class XCXFIMAStrategy1Signaller : public XCXFIMABaseSignaller
|
|||||||
|
|
||||||
//
|
//
|
||||||
// Other Drawing Materials ...
|
// Other Drawing Materials ...
|
||||||
|
Print("Signaller Providers: ", provider);
|
||||||
}
|
}
|
||||||
|
|
||||||
//
|
//
|
||||||
@@ -1912,6 +1998,7 @@ class XCXFIMAStrategy1Signaller : public XCXFIMABaseSignaller
|
|||||||
|
|
||||||
//
|
//
|
||||||
// Cleanup ...
|
// Cleanup ...
|
||||||
|
tmpZone.Clean();
|
||||||
iDrawConfig.Clean();
|
iDrawConfig.Clean();
|
||||||
marketStructure.Clean();
|
marketStructure.Clean();
|
||||||
|
|
||||||
@@ -2197,7 +2284,20 @@ class XCXFIMAStrategy1Signaller : public XCXFIMABaseSignaller
|
|||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Check Bar Has Signal Based on Strategy 3 ...
|
* Check Bar Has Signal Based on Strategy 2 ...
|
||||||
|
*
|
||||||
|
* Strategy 2:
|
||||||
|
* ===========
|
||||||
|
* - Works Based On PBar Patterns Focused on PinBar ...
|
||||||
|
* - Looking for a Bar Directional Pattern Happens ...
|
||||||
|
* - Validate Fast Ma Over/Under Slow ...
|
||||||
|
* - Validate P2Peak/Vale doesnt Under or Over Last (InDirectional) ...
|
||||||
|
* - Validate P2Bar Has Directional Market Strucuture Zone (OB, FVG, Support/Resistance) ...
|
||||||
|
*
|
||||||
|
* Manipulations:
|
||||||
|
* ================
|
||||||
|
* there are Some Flags properties to Change Validations in Strategy ...
|
||||||
|
* we can use them for Testing Purposes ...
|
||||||
*
|
*
|
||||||
* @param bar: XOHCL, reference to Bar ...
|
* @param bar: XOHCL, reference to Bar ...
|
||||||
* @param zone: XBoxZone, reference to holds affected zone ...
|
* @param zone: XBoxZone, reference to holds affected zone ...
|
||||||
@@ -2236,6 +2336,7 @@ class XCXFIMAStrategy1Signaller : public XCXFIMABaseSignaller
|
|||||||
//
|
//
|
||||||
XOHCL pBar;
|
XOHCL pBar;
|
||||||
XOHCL p2Bar;
|
XOHCL p2Bar;
|
||||||
|
XOHCL p3Bar;
|
||||||
bool isBullish = false;
|
bool isBullish = false;
|
||||||
bool isBearish = false;
|
bool isBearish = false;
|
||||||
|
|
||||||
@@ -2244,11 +2345,14 @@ class XCXFIMAStrategy1Signaller : public XCXFIMABaseSignaller
|
|||||||
result = bar.GetPreviousBar(pBar);
|
result = bar.GetPreviousBar(pBar);
|
||||||
result = result &&
|
result = result &&
|
||||||
pBar.GetPreviousBar(p2Bar);
|
pBar.GetPreviousBar(p2Bar);
|
||||||
|
result = result &&
|
||||||
|
p2Bar.GetPreviousBar(p3Bar);
|
||||||
if (!result)
|
if (!result)
|
||||||
{
|
{
|
||||||
//
|
//
|
||||||
pBar.Clean();
|
pBar.Clean();
|
||||||
p2Bar.Clean();
|
p2Bar.Clean();
|
||||||
|
p3Bar.Clean();
|
||||||
|
|
||||||
//
|
//
|
||||||
return result;
|
return result;
|
||||||
@@ -2256,37 +2360,59 @@ 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 //
|
||||||
);
|
);
|
||||||
|
bool hasSupport = pBarPatterns.IsSupport();
|
||||||
|
bool hasResistance = pBarPatterns.IsResistance();
|
||||||
|
|
||||||
|
//
|
||||||
|
// Check Boundary Trend ...
|
||||||
|
XTrend boundaryTrend;
|
||||||
|
bool hasBoundaryTrend = fimaParser.HasBoundaryTrend(boundaryTrend, pBar.Index());
|
||||||
|
bool hasBoundaryBullishTrend = hasBoundaryTrend && boundaryTrend.IsBullish();
|
||||||
|
bool hasBoundaryBearishTrend = hasBoundaryTrend && boundaryTrend.IsBearish();
|
||||||
|
|
||||||
//
|
//
|
||||||
// Check Bar Patterns ...
|
// Check Bar Patterns ...
|
||||||
|
|
||||||
|
//
|
||||||
|
// Bars Sequences ...
|
||||||
|
bool hasBullishSequence = p3Bar.IsBearish() &&
|
||||||
|
pBar.IsBullish();
|
||||||
|
bool hasBearishSequence = p3Bar.IsBullish() &&
|
||||||
|
pBar.IsBearish();
|
||||||
|
|
||||||
|
//
|
||||||
|
// Bullish ...
|
||||||
bool isPBarHasBullishPatterns =
|
bool isPBarHasBullishPatterns =
|
||||||
(bar.close > pBar.low ||
|
(bar.close > pBar.low ||
|
||||||
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)
|
||||||
//
|
//
|
||||||
);
|
);
|
||||||
|
|
||||||
|
//
|
||||||
|
// Bearish ...
|
||||||
bool isPBarHasBearishPatterns =
|
bool isPBarHasBearishPatterns =
|
||||||
(bar.close < pBar.high ||
|
(bar.close < pBar.high ||
|
||||||
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)
|
||||||
//
|
//
|
||||||
);
|
);
|
||||||
|
|
||||||
@@ -2329,17 +2455,34 @@ class XCXFIMAStrategy1Signaller : public XCXFIMABaseSignaller
|
|||||||
isP2BarPinned &&
|
isP2BarPinned &&
|
||||||
IsXBearish(p2Dir);
|
IsXBearish(p2Dir);
|
||||||
|
|
||||||
|
//
|
||||||
|
// Check Based On LC and HC MA State ...
|
||||||
|
|
||||||
|
//
|
||||||
|
bool isLCMABullish = fimaParser.IsLCMABullish(pBar.Index());
|
||||||
|
bool isHCMABullish = fimaParser.IsHCMABullish(pBar.Index());
|
||||||
|
bool isCycleMABullish = isLCMABullish && isHCMABullish;
|
||||||
|
|
||||||
|
//
|
||||||
|
bool isLCMABearish = fimaParser.IsLCMABearish(pBar.Index());
|
||||||
|
bool isHCMABearish = fimaParser.IsHCMABearish(pBar.Index());
|
||||||
|
bool isCycleMABearish = isLCMABearish && isHCMABearish;
|
||||||
|
|
||||||
//
|
//
|
||||||
// Do ...
|
// Do ...
|
||||||
|
|
||||||
//
|
//
|
||||||
isBullish =
|
isBullish =
|
||||||
//
|
//
|
||||||
|
hasSupport &&
|
||||||
isFastOverLast &&
|
isFastOverLast &&
|
||||||
isValeUnderLast &&
|
isValeUnderLast &&
|
||||||
|
isCycleMABullish &&
|
||||||
|
hasBullishSequence &&
|
||||||
!isP2PeakUnderLast &&
|
!isP2PeakUnderLast &&
|
||||||
isPBarCloseOverFast &&
|
isPBarCloseOverFast &&
|
||||||
isP2BarBullishPinned &&
|
isP2BarBullishPinned &&
|
||||||
|
hasBoundaryBullishTrend &&
|
||||||
isPBarHasBullishPatterns
|
isPBarHasBullishPatterns
|
||||||
//
|
//
|
||||||
;
|
;
|
||||||
@@ -2347,11 +2490,15 @@ class XCXFIMAStrategy1Signaller : public XCXFIMABaseSignaller
|
|||||||
//
|
//
|
||||||
isBearish =
|
isBearish =
|
||||||
//
|
//
|
||||||
|
hasResistance &&
|
||||||
isPeakOverLast &&
|
isPeakOverLast &&
|
||||||
isFastUnderLast &&
|
isFastUnderLast &&
|
||||||
|
isCycleMABearish &&
|
||||||
!isP2ValeOverLast &&
|
!isP2ValeOverLast &&
|
||||||
|
hasBearishSequence &&
|
||||||
isPBarCloseUnderFast &&
|
isPBarCloseUnderFast &&
|
||||||
isP2BarBearishPinned &&
|
isP2BarBearishPinned &&
|
||||||
|
hasBoundaryBearishTrend &&
|
||||||
isPBarHasBearishPatterns
|
isPBarHasBearishPatterns
|
||||||
//
|
//
|
||||||
;
|
;
|
||||||
@@ -2386,61 +2533,19 @@ class XCXFIMAStrategy1Signaller : public XCXFIMABaseSignaller
|
|||||||
);
|
);
|
||||||
|
|
||||||
//
|
//
|
||||||
// Manage Stops ...
|
// Draws ...
|
||||||
if (result)
|
if (result)
|
||||||
{
|
{
|
||||||
//
|
//
|
||||||
double entry = GetEntry(zone.symbol, zone.dir);
|
// XPOIDrawConfig iConfig = structureDrawConfig.drawConfig;
|
||||||
double riskSide = zone.IsBullish() ? zone.lower : zone.upper;
|
// iConfig.trendRayLeft = false;
|
||||||
double risk = MathAbs(entry - riskSide);
|
// iConfig.trendRayRight = false;
|
||||||
|
// poiDrawer.DrawTrendLine(boundaryTrend, iConfig);
|
||||||
|
// poiDrawer.DrawZone(zone, structureDrawConfig.drawConfig);
|
||||||
|
// iConfig.Clean();
|
||||||
|
|
||||||
//
|
//
|
||||||
// Collecting Affected Zones ...
|
// DebugBreak();
|
||||||
XBoxZone tmps[];
|
|
||||||
XBoxZone zones[];
|
|
||||||
XBoxZone actedZones[];
|
|
||||||
XBoxZone insideZones[];
|
|
||||||
XBoxZone breakedZones[];
|
|
||||||
XBoxZone affectedZones[];
|
|
||||||
|
|
||||||
//
|
|
||||||
// Support and Resistances ...
|
|
||||||
poiDetector.CollectZones(bar, tmps);
|
|
||||||
Copy(tmps, zones, false);
|
|
||||||
|
|
||||||
//
|
|
||||||
// OBS ...
|
|
||||||
poiDetector.CollectOBs(bar, tmps);
|
|
||||||
Copy(tmps, zones, false);
|
|
||||||
|
|
||||||
//
|
|
||||||
// FVGs ...
|
|
||||||
poiDetector.CollectFVGs(bar, tmps);
|
|
||||||
Copy(tmps, zones, false);
|
|
||||||
|
|
||||||
//
|
|
||||||
ExtractAffectedZones(bar, zones, affectedZones);
|
|
||||||
|
|
||||||
//
|
|
||||||
// Acteds Zones ...
|
|
||||||
ExtractActeds(bar, actedZones, affectedZones);
|
|
||||||
|
|
||||||
//
|
|
||||||
// Inside Zones ...
|
|
||||||
ExtractInsides(bar, insideZones, affectedZones);
|
|
||||||
|
|
||||||
//
|
|
||||||
// Breaked Zones ...
|
|
||||||
ExtractBreakeds(bar, breakedZones, affectedZones);
|
|
||||||
|
|
||||||
//
|
|
||||||
// Cleanup ...
|
|
||||||
XClean(tmps);
|
|
||||||
XClean(zones);
|
|
||||||
XClean(actedZones);
|
|
||||||
XClean(insideZones);
|
|
||||||
XClean(breakedZones);
|
|
||||||
XClean(affectedZones);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
//
|
//
|
||||||
@@ -2464,13 +2569,31 @@ class XCXFIMAStrategy1Signaller : public XCXFIMABaseSignaller
|
|||||||
}
|
}
|
||||||
pBar.Clean();
|
pBar.Clean();
|
||||||
p2Bar.Clean();
|
p2Bar.Clean();
|
||||||
|
p3Bar.Clean();
|
||||||
|
pBarPatterns.Clean();
|
||||||
|
boundaryTrend.Clean();
|
||||||
|
|
||||||
//
|
//
|
||||||
return result;
|
return result;
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Check Bar Has Signal Based on Strategy 4 ...
|
* Check Bar Has Signal Based on Strategy 3 ...
|
||||||
|
*
|
||||||
|
* Strategy 3:
|
||||||
|
* ===========
|
||||||
|
* - Works Based On Breaked Support or Resistances ...
|
||||||
|
* - Looking for a Support or Resistance to Breaked ...
|
||||||
|
* - Validate Breaker Bar to Change Peak or Vale ...
|
||||||
|
* - Validate Bar Opposit Side of Breaker Bar's Shadow ...
|
||||||
|
* - Validate by Checking Market Strucutre to Has Directional Zone
|
||||||
|
* (Support for Resistance Break / Resistance for Support Break) ...
|
||||||
|
* - Validate Breaker Bar to Has Directional FVG ...
|
||||||
|
*
|
||||||
|
* Manipulations:
|
||||||
|
* ================
|
||||||
|
* there are Some Flags properties to Change Validations in Strategy ...
|
||||||
|
* we can use them for Testing Purposes ...
|
||||||
*
|
*
|
||||||
* @param bar: XOHCL, reference to Bar ...
|
* @param bar: XOHCL, reference to Bar ...
|
||||||
* @param zone: XBoxZone, reference to holds affected zone ...
|
* @param zone: XBoxZone, reference to holds affected zone ...
|
||||||
@@ -2750,17 +2873,17 @@ class XCXFIMAStrategy1Signaller : public XCXFIMABaseSignaller
|
|||||||
// Draw ...
|
// Draw ...
|
||||||
if (result)
|
if (result)
|
||||||
{
|
{
|
||||||
//
|
// //
|
||||||
XPOIDrawConfig iConfig = structureDrawConfig.drawConfig;
|
// XPOIDrawConfig iConfig = structureDrawConfig.drawConfig;
|
||||||
iConfig.trendRayLeft = false;
|
// iConfig.trendRayLeft = false;
|
||||||
iConfig.trendRayRight = false;
|
// iConfig.trendRayRight = false;
|
||||||
|
|
||||||
//
|
// //
|
||||||
poiDrawer.DrawTrendLine(zoneTrend, iConfig);
|
// poiDrawer.DrawTrendLine(zoneTrend, iConfig);
|
||||||
poiDrawer.DrawTrendLine(zoneToTrend, iConfig);
|
// poiDrawer.DrawTrendLine(zoneToTrend, iConfig);
|
||||||
|
|
||||||
//
|
// //
|
||||||
iConfig.Clean();
|
// iConfig.Clean();
|
||||||
}
|
}
|
||||||
|
|
||||||
//
|
//
|
||||||
@@ -3423,7 +3546,7 @@ class XCXFIMAStrategy1Signaller : public XCXFIMABaseSignaller
|
|||||||
iTarget.doRFOnEntry = true;
|
iTarget.doRFOnEntry = true;
|
||||||
iTarget.target = highRiskTP;
|
iTarget.target = highRiskTP;
|
||||||
iTarget.volumeMultiplier = 0.8;
|
iTarget.volumeMultiplier = 0.8;
|
||||||
AddRef(iTarget, targets);
|
// AddRef(iTarget, targets);
|
||||||
|
|
||||||
//
|
//
|
||||||
// Cleanup ...
|
// Cleanup ...
|
||||||
|
|||||||
Reference in New Issue
Block a user