last ...
This commit is contained in:
@@ -219,9 +219,6 @@ bool ToSignal(
|
|||||||
//
|
//
|
||||||
double points = GetPoints(box.symbol);
|
double points = GetPoints(box.symbol);
|
||||||
|
|
||||||
//
|
|
||||||
double risk = box.GetRange();
|
|
||||||
|
|
||||||
//
|
//
|
||||||
double entry =
|
double entry =
|
||||||
isBullish
|
isBullish
|
||||||
@@ -235,6 +232,9 @@ bool ToSignal(
|
|||||||
? box.lower
|
? box.lower
|
||||||
: box.upper;
|
: box.upper;
|
||||||
|
|
||||||
|
//
|
||||||
|
double risk = MathAbs(entry - sl);
|
||||||
|
|
||||||
//
|
//
|
||||||
double tp = 0;
|
double tp = 0;
|
||||||
|
|
||||||
|
|||||||
@@ -264,10 +264,7 @@ void OnTick()
|
|||||||
|
|
||||||
//
|
//
|
||||||
// Detect Signal Setups ...
|
// Detect Signal Setups ...
|
||||||
has = eaSignallers[is].DetectSignalSetup(
|
has = eaSignallers[is].DetectSignalSetup(r2r);
|
||||||
r2r,
|
|
||||||
300 // Max Allowed SL Distance ...
|
|
||||||
);
|
|
||||||
if (has)
|
if (has)
|
||||||
{
|
{
|
||||||
//
|
//
|
||||||
|
|||||||
@@ -25,6 +25,7 @@
|
|||||||
#include "../../Classes/x-saherelm.x-bar.analyser.class.mq5"
|
#include "../../Classes/x-saherelm.x-bar.analyser.class.mq5"
|
||||||
#include "../../Classes/x-saherelm.x-poi.drawer.class.mq5"
|
#include "../../Classes/x-saherelm.x-poi.drawer.class.mq5"
|
||||||
#include "../Helpers/xcaea.helper.mq5"
|
#include "../Helpers/xcaea.helper.mq5"
|
||||||
|
#include "../Libraries/xcaea.trigger.block.lib.mq5"
|
||||||
|
|
||||||
//
|
//
|
||||||
// Definitions ...
|
// Definitions ...
|
||||||
@@ -45,8 +46,6 @@ enum ENUM_XCA_PIVOTS
|
|||||||
XCA_RSI_CUOB, // RSICUOB
|
XCA_RSI_CUOB, // RSICUOB
|
||||||
XCA_TREND_BULL, // TrendBull
|
XCA_TREND_BULL, // TrendBull
|
||||||
XCA_TREND_BEAR, // TrendBear
|
XCA_TREND_BEAR, // TrendBear
|
||||||
XCA_TRIGGER_BULL, // TriggerBull
|
|
||||||
XCA_TRIGGER_BEAR, // TriggerBear
|
|
||||||
};
|
};
|
||||||
|
|
||||||
//
|
//
|
||||||
@@ -91,7 +90,6 @@ ENUM_X_DIRECTION GetDirection(ENUM_XCA_PIVOTS value)
|
|||||||
case XCA_FVG_BULL:
|
case XCA_FVG_BULL:
|
||||||
case XCA_RSI_COOS:
|
case XCA_RSI_COOS:
|
||||||
case XCA_TREND_BULL:
|
case XCA_TREND_BULL:
|
||||||
case XCA_TRIGGER_BULL:
|
|
||||||
result = X_DIRECTION_BULLISH;
|
result = X_DIRECTION_BULLISH;
|
||||||
break;
|
break;
|
||||||
|
|
||||||
@@ -102,7 +100,6 @@ ENUM_X_DIRECTION GetDirection(ENUM_XCA_PIVOTS value)
|
|||||||
case XCA_FVG_BEAR:
|
case XCA_FVG_BEAR:
|
||||||
case XCA_RSI_CUOB:
|
case XCA_RSI_CUOB:
|
||||||
case XCA_TREND_BEAR:
|
case XCA_TREND_BEAR:
|
||||||
case XCA_TRIGGER_BEAR:
|
|
||||||
result = X_DIRECTION_BEARISH;
|
result = X_DIRECTION_BEARISH;
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
@@ -145,12 +142,6 @@ string GetBoxType(ENUM_XCA_PIVOTS value)
|
|||||||
case XCA_TREND_BEAR:
|
case XCA_TREND_BEAR:
|
||||||
result = "XCA_TREND";
|
result = "XCA_TREND";
|
||||||
break;
|
break;
|
||||||
|
|
||||||
//
|
|
||||||
case XCA_TRIGGER_BULL:
|
|
||||||
case XCA_TRIGGER_BEAR:
|
|
||||||
result = "XCA_TRIGGER";
|
|
||||||
break;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
//
|
//
|
||||||
@@ -195,10 +186,6 @@ ENUM_XCA_PIVOTS GetPivotType(XBoxZone &value)
|
|||||||
value.dir == GetDirection(XCA_TREND_BULL);
|
value.dir == GetDirection(XCA_TREND_BULL);
|
||||||
bool isTrendBearish = value.type == GetBoxType(XCA_TREND_BEAR) &&
|
bool isTrendBearish = value.type == GetBoxType(XCA_TREND_BEAR) &&
|
||||||
value.dir == GetDirection(XCA_TREND_BEAR);
|
value.dir == GetDirection(XCA_TREND_BEAR);
|
||||||
bool isTriggerBullish = value.type == GetBoxType(XCA_TRIGGER_BULL) &&
|
|
||||||
value.dir == GetDirection(XCA_TRIGGER_BULL);
|
|
||||||
bool isTriggerBearish = value.type == GetBoxType(XCA_TRIGGER_BEAR) &&
|
|
||||||
value.dir == GetDirection(XCA_TRIGGER_BEAR);
|
|
||||||
|
|
||||||
//
|
//
|
||||||
if (isSWL)
|
if (isSWL)
|
||||||
@@ -249,14 +236,6 @@ ENUM_XCA_PIVOTS GetPivotType(XBoxZone &value)
|
|||||||
{
|
{
|
||||||
result = XCA_TREND_BEAR;
|
result = XCA_TREND_BEAR;
|
||||||
}
|
}
|
||||||
else if (isTriggerBullish)
|
|
||||||
{
|
|
||||||
result = XCA_TRIGGER_BULL;
|
|
||||||
}
|
|
||||||
else if (isTriggerBearish)
|
|
||||||
{
|
|
||||||
result = XCA_TRIGGER_BEAR;
|
|
||||||
}
|
|
||||||
|
|
||||||
//
|
//
|
||||||
return result;
|
return result;
|
||||||
@@ -1023,7 +1002,7 @@ class XCXCAEAPOIDetector : public XCBase
|
|||||||
//
|
//
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
|
|
||||||
//
|
//
|
||||||
// Checking Pivots ...
|
// Checking Pivots ...
|
||||||
|
|
||||||
|
|||||||
File diff suppressed because it is too large
Load Diff
@@ -51,6 +51,8 @@ class XCXCAEASignaller : XCBase
|
|||||||
XCXCAEAHelper *analyseHelper;
|
XCXCAEAHelper *analyseHelper;
|
||||||
XCXCAEAPOIDetector *detector;
|
XCXCAEAPOIDetector *detector;
|
||||||
XCAEAStrategyConditions mConditions;
|
XCAEAStrategyConditions mConditions;
|
||||||
|
bool allowAnalyseDecisionZoneSignalling;
|
||||||
|
bool allowTriggerBlockDecisionZoneSignalling;
|
||||||
XCAEAStrategyConditions mConditionsCollection[];
|
XCAEAStrategyConditions mConditionsCollection[];
|
||||||
|
|
||||||
//
|
//
|
||||||
@@ -92,6 +94,11 @@ class XCXCAEASignaller : XCBase
|
|||||||
allowDrawPOIs = false;
|
allowDrawPOIs = false;
|
||||||
maxAllowedSetupAge = 576;
|
maxAllowedSetupAge = 576;
|
||||||
|
|
||||||
|
//
|
||||||
|
// Signallings ...
|
||||||
|
allowAnalyseDecisionZoneSignalling = false;
|
||||||
|
allowTriggerBlockDecisionZoneSignalling = true;
|
||||||
|
|
||||||
//
|
//
|
||||||
// Initial Bar Tracker ...
|
// Initial Bar Tracker ...
|
||||||
barTraker.Init(
|
barTraker.Init(
|
||||||
@@ -166,13 +173,16 @@ class XCXCAEASignaller : XCBase
|
|||||||
* @return ( bool )
|
* @return ( bool )
|
||||||
*/
|
*/
|
||||||
bool DetectSignalSetup(
|
bool DetectSignalSetup(
|
||||||
double tpReward = 3,
|
double tpReward = 3 //
|
||||||
double maxAllowedSLDistanceInPoint = 100 //
|
|
||||||
)
|
)
|
||||||
{
|
{
|
||||||
//
|
//
|
||||||
bool result = false;
|
bool result = false;
|
||||||
|
|
||||||
|
//
|
||||||
|
// Normalize Args ...
|
||||||
|
tpReward = NormalizeDouble(tpReward, 1);
|
||||||
|
|
||||||
//
|
//
|
||||||
// Check Bar Processing ...
|
// Check Bar Processing ...
|
||||||
if (!barTraker.CanProcessBar())
|
if (!barTraker.CanProcessBar())
|
||||||
@@ -181,59 +191,30 @@ class XCXCAEASignaller : XCBase
|
|||||||
}
|
}
|
||||||
|
|
||||||
//
|
//
|
||||||
|
int idx = -1;
|
||||||
|
int count = 0;
|
||||||
|
int zIndex = 0;
|
||||||
|
bool has = false;
|
||||||
|
int loopback = 10;
|
||||||
bool isBullish = false;
|
bool isBullish = false;
|
||||||
bool isBearish = false;
|
bool isBearish = false;
|
||||||
|
|
||||||
//
|
|
||||||
int zIndex = 0;
|
|
||||||
int cIndex = zIndex + 1;
|
|
||||||
int pIndex = cIndex + 1;
|
|
||||||
int p2Index = pIndex + 1;
|
|
||||||
|
|
||||||
//
|
|
||||||
int loopback = 10;
|
|
||||||
|
|
||||||
//
|
|
||||||
int idx = -1;
|
|
||||||
int count = 0;
|
|
||||||
bool has = false;
|
|
||||||
|
|
||||||
//
|
|
||||||
double ask = GetAsk(symbol);
|
|
||||||
double bid = GetBid(symbol);
|
|
||||||
datetime cTime = TimeCurrent();
|
|
||||||
double points = GetPoints(symbol);
|
|
||||||
|
|
||||||
//
|
//
|
||||||
XOHCL zBar;
|
XOHCL zBar;
|
||||||
XOHCL cBar;
|
|
||||||
XOHCL pBar;
|
|
||||||
XOHCL pPBar;
|
|
||||||
result = zBar.Init(
|
result = zBar.Init(
|
||||||
symbol,
|
symbol,
|
||||||
period,
|
period,
|
||||||
zIndex //
|
zIndex //
|
||||||
);
|
);
|
||||||
result =
|
|
||||||
result &&
|
|
||||||
zBar.GetPreviousBar(cBar);
|
|
||||||
result =
|
|
||||||
result &&
|
|
||||||
cBar.GetPreviousBar(pBar);
|
|
||||||
result =
|
|
||||||
result &&
|
|
||||||
pBar.GetPreviousBar(pPBar);
|
|
||||||
if (!result)
|
if (!result)
|
||||||
{
|
{
|
||||||
//
|
//
|
||||||
zBar.Clean();
|
zBar.Clean();
|
||||||
cBar.Clean();
|
|
||||||
pBar.Clean();
|
|
||||||
pPBar.Clean();
|
|
||||||
|
|
||||||
//
|
//
|
||||||
return result;
|
return result;
|
||||||
}
|
}
|
||||||
|
datetime cTime = zBar.time;
|
||||||
|
|
||||||
//
|
//
|
||||||
// Detect Pivots ...
|
// Detect Pivots ...
|
||||||
@@ -262,23 +243,42 @@ class XCXCAEASignaller : XCBase
|
|||||||
ENUM_X_DIRECTION decisionZoneDir = X_DIRECTION_NONE;
|
ENUM_X_DIRECTION decisionZoneDir = X_DIRECTION_NONE;
|
||||||
|
|
||||||
//
|
//
|
||||||
// Checking Signal's Decision Zone ...
|
// Check Decision Zone Detection Based On Several Signalling ...
|
||||||
// On Analyse Time Frame ...
|
|
||||||
hasDecisionZone = DetectDecisionZone(
|
//
|
||||||
analyseHelper,
|
// Analyse DecisionZone ...
|
||||||
drawer,
|
// In this Used Case we fond an Analyse TF OB
|
||||||
decisionZone,
|
// then waits for trigger on it ...
|
||||||
decisionZoneDir,
|
if (allowAnalyseDecisionZoneSignalling)
|
||||||
unavailables,
|
{
|
||||||
conditions,
|
//
|
||||||
zIndex,
|
// Checking Signal's Decision Zone ...
|
||||||
loopback //
|
// On Analyse Time Frame ...
|
||||||
);
|
hasDecisionZone = DetectDecisionZone(
|
||||||
|
analyseHelper,
|
||||||
|
drawer,
|
||||||
|
decisionZone,
|
||||||
|
decisionZoneDir,
|
||||||
|
unavailables,
|
||||||
|
conditions,
|
||||||
|
zIndex,
|
||||||
|
loopback //
|
||||||
|
);
|
||||||
|
|
||||||
|
//
|
||||||
|
// Here we Can Validate Decision Zone ...
|
||||||
|
if (hasDecisionZone)
|
||||||
|
{
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
//
|
//
|
||||||
// Here we Can Validate Decision Zone ...
|
// TriggerBlock Decision Zone ...
|
||||||
if (hasDecisionZone)
|
// In this Used Case we found a Tigger Block and use it
|
||||||
{
|
// for Triggering ...
|
||||||
|
if (!hasDecisionZone &&
|
||||||
|
allowTriggerBlockDecisionZoneSignalling) {
|
||||||
|
//
|
||||||
}
|
}
|
||||||
|
|
||||||
//
|
//
|
||||||
@@ -339,11 +339,6 @@ class XCXCAEASignaller : XCBase
|
|||||||
|
|
||||||
//
|
//
|
||||||
zBar.Clean();
|
zBar.Clean();
|
||||||
cBar.Clean();
|
|
||||||
pBar.Clean();
|
|
||||||
pPBar.Clean();
|
|
||||||
|
|
||||||
//
|
|
||||||
conditions.Clean();
|
conditions.Clean();
|
||||||
decisionZone.Clean();
|
decisionZone.Clean();
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user