last ...
This commit is contained in:
@@ -2592,7 +2592,7 @@ class XCRRObject : public XCBaseObject
|
||||
|
||||
//
|
||||
datetime time1 = rr.time;
|
||||
datetime time2 = (datetime)((int)rr.time + 2 * PeriodSeconds(rr.period));
|
||||
datetime time2 = (datetime)((int)rr.time + 5 * PeriodSeconds(rr.period));
|
||||
|
||||
//
|
||||
result = mFibo.Create(
|
||||
|
||||
@@ -2668,3 +2668,65 @@ bool IsReject(
|
||||
// //
|
||||
// longSLBuffer[bar_index] = iLongSL;
|
||||
// shortSLBuffer[bar_index] = iShortSL;
|
||||
|
||||
|
||||
///////////////////////////////////////////////////
|
||||
|
||||
//
|
||||
// Draw ...
|
||||
bool isBullish = signalZone.ob.IsBullish();
|
||||
bool isCreated = false;
|
||||
XCBaseObject *iObj = NULL;
|
||||
if (isBullish)
|
||||
{
|
||||
//
|
||||
XCBullishOrderBlockObject *mObj;
|
||||
isCreated = visionCycleHelper.mPOIDrawer
|
||||
.CreateBullishOrderBlock(
|
||||
signalZone.ob,
|
||||
mObj //
|
||||
);
|
||||
|
||||
//
|
||||
if (isCreated)
|
||||
{
|
||||
//
|
||||
mObj.ZoneWidth(2);
|
||||
mObj.ZoneColor(clrGold);
|
||||
mObj.ZoneStyle(STYLE_SOLID);
|
||||
|
||||
//
|
||||
iObj = (XCBaseObject *)mObj;
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
//
|
||||
XCBearishOrderBlockObject *mObj;
|
||||
isCreated = visionCycleHelper.mPOIDrawer
|
||||
.CreateBearishOrderBlock(
|
||||
signalZone.ob,
|
||||
mObj //
|
||||
);
|
||||
|
||||
//
|
||||
if (isCreated)
|
||||
{
|
||||
//
|
||||
mObj.ZoneWidth(2);
|
||||
mObj.ZoneColor(clrGold);
|
||||
mObj.ZoneStyle(STYLE_SOLID);
|
||||
|
||||
//
|
||||
iObj = (XCBaseObject *)mObj;
|
||||
}
|
||||
}
|
||||
|
||||
//
|
||||
if (isCreated)
|
||||
{
|
||||
mWorkingZoneObjects.Add(iObj);
|
||||
}
|
||||
|
||||
//
|
||||
Print("Signal Zone ...");
|
||||
|
||||
@@ -1170,6 +1170,376 @@ struct X121Conditions
|
||||
//
|
||||
bullishScore = 0;
|
||||
bearishScore = 0;
|
||||
|
||||
//
|
||||
double minScore = 0.5;
|
||||
double score = 1;
|
||||
double highScore = 1.5;
|
||||
|
||||
//
|
||||
// SLOPES ...
|
||||
|
||||
//
|
||||
if (isRsiSlopeBullish)
|
||||
{
|
||||
bullishScore += minScore;
|
||||
}
|
||||
if (isStrSlopeBullish)
|
||||
{
|
||||
bullishScore += minScore;
|
||||
}
|
||||
if (isAtrUpperSlopeBullish)
|
||||
{
|
||||
bullishScore += minScore;
|
||||
}
|
||||
if (isAtrLowerSlopeBullish)
|
||||
{
|
||||
bullishScore += minScore;
|
||||
}
|
||||
if (isVwapFastSlopeBullish)
|
||||
{
|
||||
bullishScore += minScore;
|
||||
}
|
||||
if (isVwapMidSlopeBullish)
|
||||
{
|
||||
bullishScore += minScore;
|
||||
}
|
||||
if (isVwapSlowSlopeBullish)
|
||||
{
|
||||
bullishScore += minScore;
|
||||
}
|
||||
|
||||
//
|
||||
if (isRsiSlopeBearish)
|
||||
{
|
||||
bearishScore += minScore;
|
||||
}
|
||||
if (isStrSlopeBearish)
|
||||
{
|
||||
bearishScore += minScore;
|
||||
}
|
||||
if (isAtrUpperSlopeBearish)
|
||||
{
|
||||
bearishScore += minScore;
|
||||
}
|
||||
if (isAtrLowerSlopeBearish)
|
||||
{
|
||||
bearishScore += minScore;
|
||||
}
|
||||
if (isVwapFastSlopeBearish)
|
||||
{
|
||||
bearishScore += minScore;
|
||||
}
|
||||
if (isVwapMidSlopeBearish)
|
||||
{
|
||||
bearishScore += minScore;
|
||||
}
|
||||
if (isVwapSlowSlopeBearish)
|
||||
{
|
||||
bearishScore += minScore;
|
||||
}
|
||||
|
||||
//
|
||||
// COMPLEX ...
|
||||
|
||||
//
|
||||
if (isRsiOverSold)
|
||||
{
|
||||
bullishScore += score;
|
||||
}
|
||||
if (isRsiCrossedUnderOverSold)
|
||||
{
|
||||
bullishScore += highScore;
|
||||
}
|
||||
|
||||
//
|
||||
if (isRsiOverBought)
|
||||
{
|
||||
bearishScore += score;
|
||||
}
|
||||
if (isRsiCrossedOverOverBought)
|
||||
{
|
||||
bearishScore += highScore;
|
||||
}
|
||||
|
||||
//
|
||||
// TODO: ...
|
||||
// there many other complex conditions which may used lter ...
|
||||
//
|
||||
|
||||
//
|
||||
// XTREND ...
|
||||
|
||||
//
|
||||
if (isTrendBullish)
|
||||
{
|
||||
bullishScore += minScore;
|
||||
}
|
||||
if (isTrendSwitchedToBullish)
|
||||
{
|
||||
bullishScore += score;
|
||||
}
|
||||
|
||||
//
|
||||
if (isTrendBearish)
|
||||
{
|
||||
bearishScore += minScore;
|
||||
}
|
||||
if (isTrendSwitchedToBearish)
|
||||
{
|
||||
bearishScore += score;
|
||||
}
|
||||
|
||||
//
|
||||
// XSAR ...
|
||||
|
||||
//
|
||||
if (isSarBullish)
|
||||
{
|
||||
bullishScore += minScore;
|
||||
}
|
||||
if (isSarSwitchedToBullish)
|
||||
{
|
||||
bullishScore += score;
|
||||
}
|
||||
|
||||
//
|
||||
if (isSarBearish)
|
||||
{
|
||||
bearishScore += minScore;
|
||||
}
|
||||
if (isSarSwitchedToBearish)
|
||||
{
|
||||
bearishScore += score;
|
||||
}
|
||||
|
||||
//
|
||||
// XSTR ...
|
||||
|
||||
//
|
||||
if (isStrBullish)
|
||||
{
|
||||
bullishScore += minScore;
|
||||
}
|
||||
if (isStrSwitchedToBullish)
|
||||
{
|
||||
bullishScore += score;
|
||||
}
|
||||
|
||||
//
|
||||
if (isStrBearish)
|
||||
{
|
||||
bearishScore += minScore;
|
||||
}
|
||||
if (isStrSwitchedToBearish)
|
||||
{
|
||||
bearishScore += score;
|
||||
}
|
||||
|
||||
//
|
||||
// XCHE ...
|
||||
|
||||
//
|
||||
if (isCheBullish)
|
||||
{
|
||||
bullishScore += score;
|
||||
}
|
||||
if (isCheSwitchedToBullish)
|
||||
{
|
||||
bullishScore += highScore;
|
||||
}
|
||||
if (isChe1Bullish &&
|
||||
!isCheBullish &&
|
||||
!isCheSwitchedToBullish)
|
||||
{
|
||||
bullishScore += minScore;
|
||||
}
|
||||
if (isChe1SwitchedToBullish &&
|
||||
!isCheBullish &&
|
||||
!isCheSwitchedToBullish)
|
||||
{
|
||||
bullishScore += minScore;
|
||||
}
|
||||
|
||||
//
|
||||
if (isCheBearish)
|
||||
{
|
||||
bearishScore += score;
|
||||
}
|
||||
if (isCheSwitchedToBearish)
|
||||
{
|
||||
bearishScore += highScore;
|
||||
}
|
||||
if (isChe1Bearish &&
|
||||
!isCheBearish &&
|
||||
!isCheSwitchedToBearish)
|
||||
{
|
||||
bearishScore += minScore;
|
||||
}
|
||||
if (isChe1SwitchedToBearish &&
|
||||
!isCheBearish &&
|
||||
!isCheSwitchedToBearish)
|
||||
{
|
||||
bearishScore += minScore;
|
||||
}
|
||||
|
||||
//
|
||||
// XVWAP ...
|
||||
|
||||
//
|
||||
if (isVWapBullishState)
|
||||
{
|
||||
bullishScore += score;
|
||||
}
|
||||
if (isVWapBullishOrdered)
|
||||
{
|
||||
bullishScore += score;
|
||||
}
|
||||
if (isVWapSwitchedToBullishState)
|
||||
{
|
||||
bullishScore += highScore;
|
||||
}
|
||||
if (isVWapSwitchedToBullishOrdered)
|
||||
{
|
||||
bullishScore += highScore;
|
||||
}
|
||||
if (!isVWapBullishState &&
|
||||
!isVWapSwitchedToBullishState)
|
||||
{
|
||||
//
|
||||
if (isVWapFastBullish)
|
||||
{
|
||||
bullishScore += minScore;
|
||||
}
|
||||
if (isVWapSlowBullish)
|
||||
{
|
||||
bullishScore += minScore;
|
||||
}
|
||||
}
|
||||
if (!isVWapBullishOrdered &&
|
||||
!isVWapSwitchedToBullishOrdered)
|
||||
{
|
||||
//
|
||||
if (isVWapFastOverMid)
|
||||
{
|
||||
bullishScore += minScore;
|
||||
}
|
||||
if (isVWapMidOverSlow)
|
||||
{
|
||||
bullishScore += minScore;
|
||||
}
|
||||
}
|
||||
|
||||
//
|
||||
if (isVWapBearishState)
|
||||
{
|
||||
bearishScore += score;
|
||||
}
|
||||
if (isVWapBearishOrdered)
|
||||
{
|
||||
bearishScore += score;
|
||||
}
|
||||
if (isVWapSwitchedToBearishState)
|
||||
{
|
||||
bearishScore += highScore;
|
||||
}
|
||||
if (isVWapSwitchedToBearishOrdered)
|
||||
{
|
||||
bearishScore += highScore;
|
||||
}
|
||||
if (!isVWapBearishState &&
|
||||
!isVWapSwitchedToBearishState)
|
||||
{
|
||||
//
|
||||
if (isVWapFastBearish)
|
||||
{
|
||||
bearishScore += minScore;
|
||||
}
|
||||
if (isVWapSlowBearish)
|
||||
{
|
||||
bearishScore += minScore;
|
||||
}
|
||||
}
|
||||
if (!isVWapBearishOrdered &&
|
||||
!isVWapSwitchedToBearishOrdered)
|
||||
{
|
||||
//
|
||||
if (isVWapFastUnderMid)
|
||||
{
|
||||
bearishScore += minScore;
|
||||
}
|
||||
if (isVWapMidUnderSlow)
|
||||
{
|
||||
bearishScore += minScore;
|
||||
}
|
||||
}
|
||||
|
||||
//
|
||||
// XSMHK ...
|
||||
|
||||
//
|
||||
if (isSMHKBullish)
|
||||
{
|
||||
bullishScore += minScore;
|
||||
}
|
||||
if (isRawHKBullish)
|
||||
{
|
||||
bullishScore += minScore;
|
||||
}
|
||||
if (isClosedOverSMHK)
|
||||
{
|
||||
bullishScore += minScore;
|
||||
}
|
||||
if (isClosedOverRawHK)
|
||||
{
|
||||
bullishScore += minScore;
|
||||
}
|
||||
if (isRawHKClosedOverSMHK)
|
||||
{
|
||||
bullishScore += minScore;
|
||||
}
|
||||
if (isSMHKSwitchedToBullish)
|
||||
{
|
||||
bullishScore += highScore;
|
||||
}
|
||||
if (isRawHKSwitchedToBullish)
|
||||
{
|
||||
bullishScore += highScore;
|
||||
}
|
||||
|
||||
//
|
||||
if (isSMHKBearish)
|
||||
{
|
||||
bearishScore += minScore;
|
||||
}
|
||||
if (isRawHKBearish)
|
||||
{
|
||||
bearishScore += minScore;
|
||||
}
|
||||
if (isClosedUnderSMHK)
|
||||
{
|
||||
bearishScore += minScore;
|
||||
}
|
||||
if (isClosedUnderRawHK)
|
||||
{
|
||||
bearishScore += minScore;
|
||||
}
|
||||
if (isRawHKClosedUnderSMHK)
|
||||
{
|
||||
bearishScore += minScore;
|
||||
}
|
||||
if (isSMHKSwitchedToBearish)
|
||||
{
|
||||
bearishScore += highScore;
|
||||
}
|
||||
if (isRawHKSwitchedToBullish)
|
||||
{
|
||||
bearishScore += highScore;
|
||||
}
|
||||
|
||||
//
|
||||
//
|
||||
//
|
||||
}
|
||||
|
||||
/**
|
||||
|
||||
@@ -23,19 +23,11 @@
|
||||
// Definitions ...
|
||||
|
||||
//
|
||||
enum ENUM_XWZ_REJECTION_TYPES
|
||||
{
|
||||
XWZ_REJECTION_BAR, // Only Bar Reject
|
||||
XWZ_REJECTION_STRONG_BAR, // Directional Bar Reject
|
||||
XWZ_REJECTION_PRESSURED_BAR, // Bar Reject using Pressure
|
||||
XWZ_REJECTION_STRONG_PRESSURED_BAR, // Strong Bar Reject using Pressure
|
||||
};
|
||||
|
||||
//
|
||||
#define ShortName "X121 XWZ"
|
||||
#define ShortName "X121_XWZ"
|
||||
|
||||
//
|
||||
// Includes Common Library ...
|
||||
#include "../Classes/x-saherelm.x-alert.class.mq5"
|
||||
#include "../Classes/x-saherelm.x-bar.analyser.class.mq5"
|
||||
#include "../Classes/x-saherelm.x-poi.drawer.class.mq5"
|
||||
#include "../Libraries/x-saherelm.common.lib.mq5"
|
||||
@@ -59,14 +51,21 @@ input ENUM_MA_METHOD maMethod = MODE_EMA; // MA Method
|
||||
|
||||
//
|
||||
input group "ATR StopLoss";
|
||||
input int atrLength = 14; // ATR Length
|
||||
input int atrMultiplier = 2; // ATR Multiplier
|
||||
input int atrLength = 14; // ATR Length
|
||||
input double atrMultiplier = 2; // ATR Multiplier
|
||||
|
||||
//
|
||||
input group "ADX Detection";
|
||||
input int adxLength = 14; // ADX Length
|
||||
input double adxThreshold = 25; // ADX Threshold for Strong Trends
|
||||
|
||||
//
|
||||
input group "Alert";
|
||||
input bool mXWZEnableAlerts = true; // Enable Alerts
|
||||
input bool mXWZPushAlerts = false; // Push Alerts
|
||||
input bool mXWZMailAlerts = false; // Mail Alerts
|
||||
input bool mXWZTerminalAlerts = false; // Terminal Alerts
|
||||
|
||||
//
|
||||
// Presentation ...
|
||||
input group "Presentation";
|
||||
@@ -85,7 +84,7 @@ input bool showRejection = true; // Show Rejection Bars
|
||||
|
||||
//
|
||||
input group "POI Presentation";
|
||||
input bool showPOIs = true; // Show POI(s)
|
||||
input bool showPOIs = false; // Show POI(s)
|
||||
input bool showActivatedPOIs = true; // Show Activated POI(s)
|
||||
input bool showOrderBlocks = true; // Show Order Blocks
|
||||
input bool showFairValueGaps = true; // Show Fair Value Gaps
|
||||
@@ -308,6 +307,7 @@ int atrHandler = INVALID_HANDLE;
|
||||
int adxHandler = INVALID_HANDLE;
|
||||
|
||||
//
|
||||
XCAlert *mXWZAlert;
|
||||
CArrayObj mXWZDrawnObjects;
|
||||
XCPOIDrawer *mXWZPOIDrawer;
|
||||
XCBarAnalyser *mXWZBarAnalyser;
|
||||
@@ -316,17 +316,21 @@ XCBarAnalyser *mXWZBarAnalyser;
|
||||
datetime lastBullishTrend = NULL;
|
||||
datetime lastBearishTrend = NULL;
|
||||
|
||||
//
|
||||
datetime lastCrossedOverMA = NULL;
|
||||
datetime lastCrossedUnderMA = NULL;
|
||||
|
||||
//
|
||||
// POI(s) ...
|
||||
|
||||
//
|
||||
bool mXWZDetectOrderBlocks = true;
|
||||
bool mXWZDetectFairValueGaps = true;
|
||||
bool mXWZDetectSupportZones = true;
|
||||
bool mXWZDetectResistanceZones = true;
|
||||
bool mXWZDetectFairValueGaps = false;
|
||||
bool mXWZDetectSupportZones = false;
|
||||
bool mXWZDetectResistanceZones = false;
|
||||
|
||||
//
|
||||
bool filterPOIsUsingMa = true; // Filter POI(s) Using MA
|
||||
bool filterPOIsUsingMa = false; // Filter POI(s) Using MA
|
||||
bool filterPOIsUsingZones = false; // Filter POI(s) Using Zones
|
||||
|
||||
//
|
||||
@@ -436,6 +440,10 @@ int OnInit()
|
||||
mXWZPOIDrawer = new XCPOIDrawer();
|
||||
ConfigurePOIDrawer();
|
||||
|
||||
//
|
||||
mXWZAlert = new XCAlert();
|
||||
ConfigureAlert();
|
||||
|
||||
//
|
||||
mXWZBarAnalyser = new XCBarAnalyser();
|
||||
|
||||
@@ -472,6 +480,7 @@ void OnDeinit(const int reason)
|
||||
mXWZDrawnObjects.Clear();
|
||||
|
||||
//
|
||||
ZeroMemory(mXWZAlert);
|
||||
ZeroMemory(mXWZPOIDrawer);
|
||||
ZeroMemory(mXWZBarAnalyser);
|
||||
|
||||
@@ -1112,6 +1121,7 @@ void CalculateValues(
|
||||
pBar.Clean();
|
||||
return;
|
||||
}
|
||||
int pIndex = pBar.Index();
|
||||
|
||||
//
|
||||
// Calculate Applied Price ...
|
||||
@@ -1126,6 +1136,7 @@ void CalculateValues(
|
||||
|
||||
//
|
||||
double iMa = maBuffer[bar_index];
|
||||
double iMaPrev = maBuffer[pIndex];
|
||||
double iAtr = atrBuffer[bar_index];
|
||||
double iAdx = adxBuffer[bar_index];
|
||||
double iAppliedAtr = iAtr * atrMultiplier;
|
||||
@@ -1157,6 +1168,33 @@ void CalculateValues(
|
||||
bool hasLastResistance = lastResistance != NULL &&
|
||||
lastResistance.IsValid();
|
||||
|
||||
//
|
||||
// Calculate Crossing Over / Under Ma ...
|
||||
bool isCrossedOverMA =
|
||||
//
|
||||
iBar.low > iMa &&
|
||||
(pBar.low <= iMaPrev &&
|
||||
(pBar.GetUp() <= iMaPrev ||
|
||||
pBar.GetDown() <= iMaPrev))
|
||||
//
|
||||
;
|
||||
bool isCrossedUnderMA =
|
||||
//
|
||||
iBar.high < iMa &&
|
||||
(pBar.high >= iMaPrev &&
|
||||
(pBar.GetUp() >= iMaPrev ||
|
||||
pBar.GetDown() >= iMaPrev))
|
||||
//
|
||||
;
|
||||
lastCrossedOverMA =
|
||||
isCrossedOverMA
|
||||
? iBar.time
|
||||
: lastCrossedOverMA;
|
||||
lastCrossedUnderMA =
|
||||
isCrossedUnderMA
|
||||
? iBar.time
|
||||
: lastCrossedUnderMA;
|
||||
|
||||
//
|
||||
// SL Buffers ...
|
||||
|
||||
@@ -1594,7 +1632,7 @@ void CalculateValues(
|
||||
: iSwingLowValue < iMa
|
||||
? iSwingLowValue
|
||||
: 0;
|
||||
}
|
||||
}
|
||||
|
||||
//
|
||||
if (isSwingHigh)
|
||||
@@ -1629,6 +1667,22 @@ void CalculateValues(
|
||||
swingHighBuffer[bar_index] = iSwingHighValue;
|
||||
}
|
||||
|
||||
//
|
||||
//
|
||||
//
|
||||
|
||||
//
|
||||
DetectSignals(
|
||||
bar_index,
|
||||
prevCalculated,
|
||||
ratesTotal,
|
||||
open,
|
||||
high,
|
||||
close,
|
||||
low,
|
||||
tickVolume //
|
||||
);
|
||||
|
||||
//
|
||||
// Cleanup Resources ...
|
||||
|
||||
@@ -1637,6 +1691,339 @@ void CalculateValues(
|
||||
pBar.Clean();
|
||||
}
|
||||
|
||||
//
|
||||
void ConfigureAlert()
|
||||
{
|
||||
//
|
||||
mXWZAlert.SetPrefix(ShortName);
|
||||
|
||||
//
|
||||
mXWZAlert.SetPushAlerts(mXWZPushAlerts);
|
||||
mXWZAlert.SetMailAlerts(mXWZMailAlerts);
|
||||
mXWZAlert.SetEnableAlerts(mXWZEnableAlerts);
|
||||
mXWZAlert.SetTerminalAlerts(mXWZTerminalAlerts);
|
||||
}
|
||||
|
||||
//
|
||||
void DetectSignals(
|
||||
int barIndex,
|
||||
const int prevCalculated,
|
||||
const int ratesTotal,
|
||||
const double &open[],
|
||||
const double &high[],
|
||||
const double &close[],
|
||||
const double &low[],
|
||||
const long &tickVolume[] //
|
||||
)
|
||||
{
|
||||
//
|
||||
// Calculate Signals ...
|
||||
|
||||
//
|
||||
XOHCL bar;
|
||||
XOHCL pBar;
|
||||
XOHCL ppBar;
|
||||
bool isInited = bar.Init(
|
||||
_Symbol,
|
||||
_Period,
|
||||
barIndex //
|
||||
);
|
||||
if (!isInited)
|
||||
{
|
||||
return;
|
||||
}
|
||||
|
||||
//
|
||||
isInited = bar.GetPreviousBar(pBar);
|
||||
if (!isInited)
|
||||
{
|
||||
return;
|
||||
}
|
||||
|
||||
//
|
||||
isInited = pBar.GetPreviousBar(ppBar);
|
||||
if (!isInited)
|
||||
{
|
||||
return;
|
||||
}
|
||||
|
||||
//
|
||||
int pIDX = pBar.Index();
|
||||
int ppIDX = ppBar.Index();
|
||||
|
||||
//
|
||||
// Reading Buffers ...
|
||||
|
||||
//
|
||||
double ma = maBuffer[barIndex];
|
||||
double maPrev = maBuffer[pIDX];
|
||||
double maPPrev = maBuffer[ppIDX];
|
||||
|
||||
//
|
||||
// Pin Bar ...
|
||||
bool isBullisPinned = bullishPinBuffer[pIDX] > 0;
|
||||
bool isBearisPinned = bearishPinBuffer[pIDX] > 0;
|
||||
|
||||
//
|
||||
// Engulf Bar ...
|
||||
bool isBullisEngulfed = bullishEngulfBuffer[pIDX] > 0;
|
||||
bool isBearisEngulfed = bearishEngulfBuffer[pIDX] > 0;
|
||||
|
||||
//
|
||||
// Rejection Bar ...
|
||||
bool isBullishRejected = bullishRejectionBuffer[pIDX] > 0;
|
||||
bool isBearishRejected = bearishRejectionBuffer[pIDX] > 0;
|
||||
|
||||
//
|
||||
// Momentum Bar ...
|
||||
bool isBullishMomentum = bullishMomentumBuffer[pIDX] > 0;
|
||||
bool isBearishMomentum = bearishMomentumBuffer[pIDX] > 0;
|
||||
|
||||
//
|
||||
// Checking Pullback ...
|
||||
ENUM_X_DIRECTION pullbackDir;
|
||||
bool hasPullback = mXWZBarAnalyser.HasPullBack(
|
||||
pullbackDir,
|
||||
bar //
|
||||
);
|
||||
bool hasBullishPullback =
|
||||
hasPullback &&
|
||||
IsBullish(pullbackDir);
|
||||
bool hasBearishPullback =
|
||||
hasPullback &&
|
||||
IsBearish(pullbackDir);
|
||||
|
||||
//
|
||||
// Order Block Parsing ...
|
||||
|
||||
// //
|
||||
// bool isMACrossedOverBullishOB =
|
||||
// //
|
||||
// lastBullOB != NULL &&
|
||||
// lastBullOB.IsValid() &&
|
||||
// //
|
||||
// IsInside(
|
||||
// maPPrev,
|
||||
// lastBullOB //
|
||||
// ) &&
|
||||
// //
|
||||
// IsAbove(
|
||||
// maPrev,
|
||||
// lastBullOB //
|
||||
// )
|
||||
// //
|
||||
// ;
|
||||
|
||||
// //
|
||||
// bool isMACrossedUnderBearishOB =
|
||||
// //
|
||||
// lastBearOB != NULL &&
|
||||
// lastBearOB.IsValid() &&
|
||||
// //
|
||||
// IsInside(
|
||||
// maPPrev,
|
||||
// lastBearOB //
|
||||
// ) &&
|
||||
// //
|
||||
// IsBelow(
|
||||
// maPrev,
|
||||
// lastBearOB //
|
||||
// )
|
||||
// //
|
||||
// ;
|
||||
|
||||
//
|
||||
// Bullish ...
|
||||
// --------------
|
||||
// -[] a Bullish Wave Which Crossed Over MA ...
|
||||
// -[] Trend is Bullish ...
|
||||
// -[] PullBack to MA ...
|
||||
// -[] Has a Bllish Rejection ...
|
||||
bool hasBullishSignal =
|
||||
//
|
||||
pBar.IsBullish() &&
|
||||
pBar.low < maPrev &&
|
||||
pBar.GetDown() >= maPrev &&
|
||||
//
|
||||
bar.open >= ma &&
|
||||
//
|
||||
hasBearishPullback &&
|
||||
//
|
||||
false
|
||||
//
|
||||
;
|
||||
|
||||
//
|
||||
// Bearish ...
|
||||
// --------------
|
||||
// -[] a Bearish Wave Which Crossed Under MA ...
|
||||
// -[] Trend is Bearish ...
|
||||
// -[] PullBack to MA ...
|
||||
// -[] Has a Bearish Rejection ...
|
||||
bool hasBearishSignal =
|
||||
//
|
||||
false
|
||||
// pBar.IsBearish() &&
|
||||
// pBar.high > maPrev &&
|
||||
// pBar.GetUp() <= maPrev &&
|
||||
// //
|
||||
// bar.open <= ma &&
|
||||
// //
|
||||
// true
|
||||
//
|
||||
;
|
||||
|
||||
//
|
||||
// Draw ...
|
||||
//
|
||||
|
||||
//
|
||||
long chartID = mXWZPOIDrawer.ChartIdentification();
|
||||
int window = mXWZPOIDrawer.SubWindowIdentification();
|
||||
|
||||
// //
|
||||
// if (isMACrossedOverBullishOB)
|
||||
// {
|
||||
// //
|
||||
// string name =
|
||||
// "Bullish_" +
|
||||
// ToMD5(ToFormatString(pBar.time));
|
||||
|
||||
// //
|
||||
// CChartObjectVLine *iLine;
|
||||
// iLine = new CChartObjectVLine();
|
||||
// bool isCreated = iLine.Create(
|
||||
// chartID,
|
||||
// name,
|
||||
// window,
|
||||
// pBar.time //
|
||||
// );
|
||||
// if (isCreated)
|
||||
// {
|
||||
// //
|
||||
// iLine.Color(clrAqua);
|
||||
|
||||
// //
|
||||
// mXWZDrawnObjects.Add(iLine);
|
||||
// }
|
||||
// }
|
||||
|
||||
// //
|
||||
// if (isMACrossedUnderBearishOB)
|
||||
// {
|
||||
// //
|
||||
// string name =
|
||||
// "Bearish_" +
|
||||
// ToMD5(ToFormatString(pBar.time));
|
||||
|
||||
// //
|
||||
// CChartObjectVLine *iLine;
|
||||
// iLine = new CChartObjectVLine();
|
||||
// bool isCreated = iLine.Create(
|
||||
// chartID,
|
||||
// name,
|
||||
// window,
|
||||
// pBar.time //
|
||||
// );
|
||||
// if (isCreated)
|
||||
// {
|
||||
// //
|
||||
// iLine.Color(clrMagenta);
|
||||
|
||||
// //
|
||||
// mXWZDrawnObjects.Add(iLine);
|
||||
// }
|
||||
// }
|
||||
|
||||
//
|
||||
bool hasSignal =
|
||||
(hasBullishSignal ||
|
||||
hasBearishSignal);
|
||||
if (hasSignal)
|
||||
{
|
||||
//
|
||||
long chartID = mXWZPOIDrawer.ChartIdentification();
|
||||
int window = mXWZPOIDrawer.SubWindowIdentification();
|
||||
string name =
|
||||
(hasBullishSignal
|
||||
? "Bullish_"
|
||||
: "Bearish_") +
|
||||
"Signal_" + ToMD5(ToFormatString(bar.time));
|
||||
color signalColor =
|
||||
hasBullishSignal
|
||||
? clrYellow
|
||||
: clrOrange;
|
||||
|
||||
//
|
||||
CChartObjectVLine *iSignal;
|
||||
iSignal = new CChartObjectVLine();
|
||||
bool isCreated = iSignal.Create(
|
||||
chartID,
|
||||
name,
|
||||
window,
|
||||
bar.time //
|
||||
);
|
||||
if (isCreated)
|
||||
{
|
||||
//
|
||||
iSignal.Color(signalColor);
|
||||
|
||||
//
|
||||
mXWZDrawnObjects.Add(iSignal);
|
||||
}
|
||||
|
||||
//
|
||||
bool drawRR = false;
|
||||
if (drawRR)
|
||||
{
|
||||
//
|
||||
XRR iSigRR;
|
||||
ENUM_X_POSITION_TYPES type =
|
||||
hasBullishSignal
|
||||
? X_POSITION_TYPE_LONG
|
||||
: X_POSITION_TYPE_SHORT;
|
||||
double sl = hasBullishSignal
|
||||
? longSLBuffer[barIndex]
|
||||
: shortSLBuffer[barIndex];
|
||||
|
||||
//
|
||||
isCreated = iSigRR.Init(
|
||||
_Symbol,
|
||||
_Period,
|
||||
sl,
|
||||
bar.open,
|
||||
type,
|
||||
ShortName //
|
||||
);
|
||||
if (!isCreated)
|
||||
{
|
||||
return;
|
||||
}
|
||||
|
||||
//
|
||||
iSigRR.time = pBar.NextAt();
|
||||
|
||||
//
|
||||
XCRRObject *iObj;
|
||||
isCreated = mXWZPOIDrawer.CreateRR(
|
||||
iSigRR,
|
||||
iObj //
|
||||
);
|
||||
if (isCreated)
|
||||
{
|
||||
mXWZDrawnObjects.Add(iObj);
|
||||
}
|
||||
|
||||
//
|
||||
iSigRR.Clean();
|
||||
}
|
||||
}
|
||||
|
||||
//
|
||||
bar.Clean();
|
||||
pBar.Clean();
|
||||
}
|
||||
|
||||
//
|
||||
// POIS Functions ...
|
||||
|
||||
|
||||
File diff suppressed because it is too large
Load Diff
@@ -26,6 +26,14 @@
|
||||
#include "../Libraries/x-121.smc.guard.lib.mq5"
|
||||
#include "../Libraries/x-121.smc.lib.mq5"
|
||||
|
||||
//
|
||||
enum ENUM_X121SMC_XWZ_PROVIDERS
|
||||
{
|
||||
X121SMC_XWZ_PROVIDER_NONE,
|
||||
X121SMC_XWZ_PROVIDER_ACTIVATED_ZONE,
|
||||
X121SMC_XWZ_PROVIDER_PRICE_INSIDE_ZONE,
|
||||
};
|
||||
|
||||
//
|
||||
enum ENUM_X121SMC_XWZ_PRIORITY
|
||||
{
|
||||
@@ -1143,8 +1151,13 @@ struct X121SMCStrategyXWZSignalConditions
|
||||
double pivot;
|
||||
double point;
|
||||
|
||||
//
|
||||
XOBFVG targetZone;
|
||||
XOBFVG signalZone;
|
||||
|
||||
//
|
||||
ENUM_X121SMC_XWZ_PRIORITY priority;
|
||||
ENUM_X121SMC_XWZ_PROVIDERS provider;
|
||||
|
||||
//
|
||||
// Constructor ...
|
||||
@@ -1271,6 +1284,13 @@ struct X121SMCStrategyXWZSignalConditions
|
||||
target = 0;
|
||||
reward = 0;
|
||||
amountPercent = 0;
|
||||
|
||||
//
|
||||
targetZone.Clean();
|
||||
signalZone.Clean();
|
||||
|
||||
//
|
||||
provider = X121SMC_XWZ_PROVIDER_NONE;
|
||||
}
|
||||
|
||||
//
|
||||
|
||||
@@ -887,9 +887,9 @@ class XCX121SMCStrategy : public XCX121SMCBaseStrategy
|
||||
|
||||
//
|
||||
// XVWAP ...
|
||||
x121Inputs.xvwapInputs.showVWapFast = showAll || false;
|
||||
x121Inputs.xvwapInputs.showVWapMedium = showAll || false;
|
||||
x121Inputs.xvwapInputs.showVWapSlow = showAll || false;
|
||||
x121Inputs.xvwapInputs.showVWapFast = showAll || true;
|
||||
x121Inputs.xvwapInputs.showVWapMedium = showAll || true;
|
||||
x121Inputs.xvwapInputs.showVWapSlow = showAll || true;
|
||||
|
||||
//
|
||||
// Initialize Cycle Helpers ...
|
||||
|
||||
Reference in New Issue
Block a user