last ...
This commit is contained in:
@@ -2923,6 +2923,434 @@ class XCPOIDrawer : public XCBase
|
|||||||
return result;
|
return result;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Draw Price Zone ...
|
||||||
|
*
|
||||||
|
* @param zone: XPriceZones instance Reference ...
|
||||||
|
* @param forDir: ENUM_X_DIRECTION member ...
|
||||||
|
*
|
||||||
|
* @return ( int )
|
||||||
|
*/
|
||||||
|
int DrawPriceZone(
|
||||||
|
XPriceZones &zone,
|
||||||
|
XCBaseObject *&drawnObjects[],
|
||||||
|
ENUM_X_DIRECTION forDir = X_DIRECTION_NONE //
|
||||||
|
)
|
||||||
|
{
|
||||||
|
//
|
||||||
|
int result = 0;
|
||||||
|
|
||||||
|
//
|
||||||
|
Clean(drawnObjects);
|
||||||
|
|
||||||
|
//
|
||||||
|
if (!zone.IsValid())
|
||||||
|
{
|
||||||
|
return result;
|
||||||
|
}
|
||||||
|
|
||||||
|
//
|
||||||
|
bool isBullish = IsBullish(forDir);
|
||||||
|
bool isAll = forDir == X_DIRECTION_ALL ||
|
||||||
|
forDir == X_DIRECTION_NONE;
|
||||||
|
|
||||||
|
//
|
||||||
|
if (isAll || isBullish)
|
||||||
|
{
|
||||||
|
//
|
||||||
|
// Support Zone ...
|
||||||
|
if (zone.HasSupportZone())
|
||||||
|
{
|
||||||
|
//
|
||||||
|
XCSupportZoneObject *iObj;
|
||||||
|
bool isCreated = CreateSupportZone(
|
||||||
|
zone.supportZone,
|
||||||
|
iObj //
|
||||||
|
);
|
||||||
|
if (isCreated)
|
||||||
|
{
|
||||||
|
//
|
||||||
|
Add(
|
||||||
|
(XCBaseObject *)iObj,
|
||||||
|
drawnObjects //
|
||||||
|
);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
//
|
||||||
|
// Demand Zone ...
|
||||||
|
if (zone.HasDemandZone())
|
||||||
|
{
|
||||||
|
//
|
||||||
|
XCDemandZoneObject *iObj;
|
||||||
|
bool isCreated = CreateDemandZone(
|
||||||
|
zone.demandZone,
|
||||||
|
iObj //
|
||||||
|
);
|
||||||
|
if (isCreated)
|
||||||
|
{
|
||||||
|
//
|
||||||
|
Add(
|
||||||
|
(XCBaseObject *)iObj,
|
||||||
|
drawnObjects //
|
||||||
|
);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
//
|
||||||
|
// OrderBlock ...
|
||||||
|
if (zone.HasOrderBlock() &&
|
||||||
|
zone.orderBlock.IsBullish())
|
||||||
|
{
|
||||||
|
//
|
||||||
|
XCBullishOrderBlockObject *iObj;
|
||||||
|
bool isCreated = CreateBullishOrderBlock(
|
||||||
|
zone.orderBlock,
|
||||||
|
iObj //
|
||||||
|
);
|
||||||
|
if (isCreated)
|
||||||
|
{
|
||||||
|
//
|
||||||
|
Add(
|
||||||
|
(XCBaseObject *)iObj,
|
||||||
|
drawnObjects //
|
||||||
|
);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
//
|
||||||
|
// FairValueGap ...
|
||||||
|
if (zone.HasFairValueGap() &&
|
||||||
|
zone.fairValueGap.IsBullish())
|
||||||
|
{
|
||||||
|
//
|
||||||
|
XCBullishFairValueGapObject *iObj;
|
||||||
|
bool isCreated = CreateBullishFairValueGap(
|
||||||
|
zone.fairValueGap,
|
||||||
|
iObj //
|
||||||
|
);
|
||||||
|
if (isCreated)
|
||||||
|
{
|
||||||
|
//
|
||||||
|
Add(
|
||||||
|
(XCBaseObject *)iObj,
|
||||||
|
drawnObjects //
|
||||||
|
);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
//
|
||||||
|
if (isAll || !isBullish)
|
||||||
|
{
|
||||||
|
//
|
||||||
|
// Resistance Zone ...
|
||||||
|
if (zone.HasResistanceZone())
|
||||||
|
{
|
||||||
|
//
|
||||||
|
XCResistanceZoneObject *iObj;
|
||||||
|
bool isCreated = CreateResistanceZone(
|
||||||
|
zone.resistanceZone,
|
||||||
|
iObj //
|
||||||
|
);
|
||||||
|
if (isCreated)
|
||||||
|
{
|
||||||
|
//
|
||||||
|
Add(
|
||||||
|
(XCBaseObject *)iObj,
|
||||||
|
drawnObjects //
|
||||||
|
);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
//
|
||||||
|
// Supply Zone ...
|
||||||
|
if (zone.HasSupplyZone())
|
||||||
|
{
|
||||||
|
//
|
||||||
|
XCSupplyZoneObject *iObj;
|
||||||
|
bool isCreated = CreateSupplyZone(
|
||||||
|
zone.supplyZone,
|
||||||
|
iObj //
|
||||||
|
);
|
||||||
|
if (isCreated)
|
||||||
|
{
|
||||||
|
//
|
||||||
|
Add(
|
||||||
|
(XCBaseObject *)iObj,
|
||||||
|
drawnObjects //
|
||||||
|
);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
//
|
||||||
|
// OrderBlock ...
|
||||||
|
if (zone.HasOrderBlock() &&
|
||||||
|
zone.orderBlock.IsBearish())
|
||||||
|
{
|
||||||
|
//
|
||||||
|
XCBearishOrderBlockObject *iObj;
|
||||||
|
bool isCreated = CreateBearishOrderBlock(
|
||||||
|
zone.orderBlock,
|
||||||
|
iObj //
|
||||||
|
);
|
||||||
|
if (isCreated)
|
||||||
|
{
|
||||||
|
//
|
||||||
|
Add(
|
||||||
|
(XCBaseObject *)iObj,
|
||||||
|
drawnObjects //
|
||||||
|
);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
//
|
||||||
|
// FairValueGap ...
|
||||||
|
if (zone.HasFairValueGap() &&
|
||||||
|
zone.fairValueGap.IsBearish())
|
||||||
|
{
|
||||||
|
//
|
||||||
|
XCBearishFairValueGapObject *iObj;
|
||||||
|
bool isCreated = CreateBearishFairValueGap(
|
||||||
|
zone.fairValueGap,
|
||||||
|
iObj //
|
||||||
|
);
|
||||||
|
if (isCreated)
|
||||||
|
{
|
||||||
|
//
|
||||||
|
Add(
|
||||||
|
(XCBaseObject *)iObj,
|
||||||
|
drawnObjects //
|
||||||
|
);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
//
|
||||||
|
result = ArraySize(drawnObjects);
|
||||||
|
|
||||||
|
//
|
||||||
|
return result;
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Draw Specified Market Structure ...
|
||||||
|
*
|
||||||
|
* @param model: XMarketStructure instance Reference ...
|
||||||
|
*
|
||||||
|
* @return ( int )
|
||||||
|
*/
|
||||||
|
int DrawMarketStructure(
|
||||||
|
XMarketStructure &model,
|
||||||
|
XCBaseObject *&drawnObjects[] //
|
||||||
|
)
|
||||||
|
{
|
||||||
|
//
|
||||||
|
int result = 0;
|
||||||
|
|
||||||
|
//
|
||||||
|
Clean(drawnObjects);
|
||||||
|
|
||||||
|
//
|
||||||
|
datetime cTime = TimeCurrent();
|
||||||
|
|
||||||
|
//
|
||||||
|
bool isValid =
|
||||||
|
model.IsValid();
|
||||||
|
if (!isValid)
|
||||||
|
{
|
||||||
|
return result;
|
||||||
|
}
|
||||||
|
|
||||||
|
//
|
||||||
|
if (model.lowestValeBar.IsValid())
|
||||||
|
{
|
||||||
|
//
|
||||||
|
XCOHCLObject *iObj;
|
||||||
|
bool isCreated = CreateBar(
|
||||||
|
model.lowestValeBar,
|
||||||
|
iObj //
|
||||||
|
);
|
||||||
|
|
||||||
|
//
|
||||||
|
if (isCreated)
|
||||||
|
{
|
||||||
|
//
|
||||||
|
Add(
|
||||||
|
(XCBaseObject *)iObj,
|
||||||
|
drawnObjects //
|
||||||
|
);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
//
|
||||||
|
if (model.lowestValePeakBreakeUpBar.IsValid())
|
||||||
|
{
|
||||||
|
//
|
||||||
|
XCOHCLObject *iObj;
|
||||||
|
bool isCreated = CreateBar(
|
||||||
|
model.lowestValePeakBreakeUpBar,
|
||||||
|
iObj //
|
||||||
|
);
|
||||||
|
|
||||||
|
//
|
||||||
|
if (isCreated)
|
||||||
|
{
|
||||||
|
//
|
||||||
|
Add(
|
||||||
|
(XCBaseObject *)iObj,
|
||||||
|
drawnObjects //
|
||||||
|
);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
//
|
||||||
|
if (model.valeAboveLowestValePeakBar.IsValid())
|
||||||
|
{
|
||||||
|
//
|
||||||
|
XCOHCLObject *iObj;
|
||||||
|
bool isCreated = CreateBar(
|
||||||
|
model.valeAboveLowestValePeakBar,
|
||||||
|
iObj //
|
||||||
|
);
|
||||||
|
|
||||||
|
//
|
||||||
|
if (isCreated)
|
||||||
|
{
|
||||||
|
//
|
||||||
|
Add(
|
||||||
|
(XCBaseObject *)iObj,
|
||||||
|
drawnObjects //
|
||||||
|
);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
//
|
||||||
|
if (model.highestPeakBar.IsValid())
|
||||||
|
{
|
||||||
|
//
|
||||||
|
XCOHCLObject *iObj;
|
||||||
|
bool isCreated = CreateBar(
|
||||||
|
model.highestPeakBar,
|
||||||
|
iObj //
|
||||||
|
);
|
||||||
|
|
||||||
|
//
|
||||||
|
if (isCreated)
|
||||||
|
{
|
||||||
|
//
|
||||||
|
Add(
|
||||||
|
(XCBaseObject *)iObj,
|
||||||
|
drawnObjects //
|
||||||
|
);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
//
|
||||||
|
if (model.peakBelowHighestPeakValeBar.IsValid())
|
||||||
|
{
|
||||||
|
//
|
||||||
|
XCOHCLObject *iObj;
|
||||||
|
bool isCreated = CreateBar(
|
||||||
|
model.peakBelowHighestPeakValeBar,
|
||||||
|
iObj //
|
||||||
|
);
|
||||||
|
|
||||||
|
//
|
||||||
|
if (isCreated)
|
||||||
|
{
|
||||||
|
//
|
||||||
|
Add(
|
||||||
|
(XCBaseObject *)iObj,
|
||||||
|
drawnObjects //
|
||||||
|
);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
//
|
||||||
|
if (model.highestPeakValeBreakeDownBar.IsValid())
|
||||||
|
{
|
||||||
|
//
|
||||||
|
XCOHCLObject *iObj;
|
||||||
|
bool isCreated = CreateBar(
|
||||||
|
model.highestPeakValeBreakeDownBar,
|
||||||
|
iObj //
|
||||||
|
);
|
||||||
|
|
||||||
|
//
|
||||||
|
if (isCreated)
|
||||||
|
{
|
||||||
|
//
|
||||||
|
Add(
|
||||||
|
(XCBaseObject *)iObj,
|
||||||
|
drawnObjects //
|
||||||
|
);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
//
|
||||||
|
if (HasChild(model.valePriceZones))
|
||||||
|
{
|
||||||
|
//
|
||||||
|
int count = ArraySize(model.valePriceZones);
|
||||||
|
for (int i = 0; i < count; i++)
|
||||||
|
{
|
||||||
|
//
|
||||||
|
XPriceZones ipZone = model.valePriceZones[i];
|
||||||
|
|
||||||
|
//
|
||||||
|
XCBaseObject *ipObjects[];
|
||||||
|
int ipDrawnObjects = DrawPriceZone(
|
||||||
|
ipZone,
|
||||||
|
ipObjects //
|
||||||
|
);
|
||||||
|
if (IsValidSize(ipObjects))
|
||||||
|
{
|
||||||
|
//
|
||||||
|
Copy(
|
||||||
|
ipObjects,
|
||||||
|
drawnObjects,
|
||||||
|
false //
|
||||||
|
);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
//
|
||||||
|
if (HasChild(model.peakPriceZones))
|
||||||
|
{
|
||||||
|
//
|
||||||
|
int count = ArraySize(model.peakPriceZones);
|
||||||
|
for (int i = 0; i < count; i++)
|
||||||
|
{
|
||||||
|
//
|
||||||
|
XPriceZones ipZone = model.peakPriceZones[i];
|
||||||
|
|
||||||
|
//
|
||||||
|
XCBaseObject *ipObjects[];
|
||||||
|
int ipDrawnObjects = DrawPriceZone(
|
||||||
|
ipZone,
|
||||||
|
ipObjects //
|
||||||
|
);
|
||||||
|
if (IsValidSize(ipObjects))
|
||||||
|
{
|
||||||
|
//
|
||||||
|
Copy(
|
||||||
|
ipObjects,
|
||||||
|
drawnObjects,
|
||||||
|
false //
|
||||||
|
);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
//
|
||||||
|
result = ArraySize(drawnObjects);
|
||||||
|
|
||||||
|
//
|
||||||
|
return result;
|
||||||
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Draw Specified POI State ...
|
* Draw Specified POI State ...
|
||||||
*
|
*
|
||||||
|
|||||||
@@ -128,6 +128,12 @@ struct X121Inputs
|
|||||||
double sarStep; // Step
|
double sarStep; // Step
|
||||||
double sarMax; // Maximum
|
double sarMax; // Maximum
|
||||||
|
|
||||||
|
//
|
||||||
|
// RSI ...
|
||||||
|
int rsiLength; // RSI Length
|
||||||
|
double rsiOverSoldLevel; // RSI Over Sold Level
|
||||||
|
double rsiOverBoughtLevel; // RSI Over Bought Level
|
||||||
|
|
||||||
//
|
//
|
||||||
// Atr Detection ...
|
// Atr Detection ...
|
||||||
int atrLength; // Length
|
int atrLength; // Length
|
||||||
@@ -250,6 +256,12 @@ struct X121Inputs
|
|||||||
hhMode = MODE_HIGH;
|
hhMode = MODE_HIGH;
|
||||||
llMode = MODE_LOW;
|
llMode = MODE_LOW;
|
||||||
|
|
||||||
|
//
|
||||||
|
// RSI ...
|
||||||
|
rsiLength = 0;
|
||||||
|
rsiOverSoldLevel = 0;
|
||||||
|
rsiOverBoughtLevel = 0;
|
||||||
|
|
||||||
//
|
//
|
||||||
// Paraboli Sar Detection ...
|
// Paraboli Sar Detection ...
|
||||||
sarStep = 0;
|
sarStep = 0;
|
||||||
@@ -368,6 +380,12 @@ struct X121Inputs
|
|||||||
hhMode = MODE_HIGH;
|
hhMode = MODE_HIGH;
|
||||||
llMode = MODE_LOW;
|
llMode = MODE_LOW;
|
||||||
|
|
||||||
|
//
|
||||||
|
// RSI ...
|
||||||
|
rsiLength = 14;
|
||||||
|
rsiOverSoldLevel = 30;
|
||||||
|
rsiOverBoughtLevel = 70;
|
||||||
|
|
||||||
//
|
//
|
||||||
// Paraboli Sar Detection ...
|
// Paraboli Sar Detection ...
|
||||||
sarStep = 0.02;
|
sarStep = 0.02;
|
||||||
@@ -466,6 +484,11 @@ struct X121Inputs
|
|||||||
//
|
//
|
||||||
result =
|
result =
|
||||||
//
|
//
|
||||||
|
// RSI ...
|
||||||
|
rsiLength > 0 &&
|
||||||
|
rsiOverSoldLevel > 0 &&
|
||||||
|
rsiOverBoughtLevel > 0 &&
|
||||||
|
rsiOverSoldLevel < rsiOverBoughtLevel &&
|
||||||
// PSAR ...
|
// PSAR ...
|
||||||
sarMax > 0 &&
|
sarMax > 0 &&
|
||||||
sarStep > 0 &&
|
sarStep > 0 &&
|
||||||
@@ -514,6 +537,7 @@ struct X121Inputs
|
|||||||
//
|
//
|
||||||
// ATR ...
|
// ATR ...
|
||||||
result = MathMax(result, atrLength);
|
result = MathMax(result, atrLength);
|
||||||
|
result = MathMax(result, rsiLength);
|
||||||
|
|
||||||
//
|
//
|
||||||
return result;
|
return result;
|
||||||
@@ -571,12 +595,24 @@ struct X121Conditions
|
|||||||
double vwapFastStateBuffer[];
|
double vwapFastStateBuffer[];
|
||||||
double vwapMidStateBuffer[];
|
double vwapMidStateBuffer[];
|
||||||
double vwapSlowStateBuffer[];
|
double vwapSlowStateBuffer[];
|
||||||
double validPeaksBuffer[];
|
double rsiBuffer[];
|
||||||
double validValesBuffer[];
|
|
||||||
|
|
||||||
//
|
//
|
||||||
// Conditions ...
|
// Conditions ...
|
||||||
|
|
||||||
|
//
|
||||||
|
// XRSI ...
|
||||||
|
|
||||||
|
//
|
||||||
|
bool isRSIOverBought;
|
||||||
|
bool isRSICrossedOverOverBought;
|
||||||
|
bool isRSICrossedUnderOverBought;
|
||||||
|
|
||||||
|
//
|
||||||
|
bool isRSIOverSold;
|
||||||
|
bool isRSICrossedUnderOverSold;
|
||||||
|
bool isRSICrossedOverOverSold;
|
||||||
|
|
||||||
//
|
//
|
||||||
// XSAR ...
|
// XSAR ...
|
||||||
|
|
||||||
@@ -746,8 +782,7 @@ struct X121Conditions
|
|||||||
Clean(vwapFastStateBuffer);
|
Clean(vwapFastStateBuffer);
|
||||||
Clean(vwapMidStateBuffer);
|
Clean(vwapMidStateBuffer);
|
||||||
Clean(vwapSlowStateBuffer);
|
Clean(vwapSlowStateBuffer);
|
||||||
Clean(validPeaksBuffer);
|
Clean(rsiBuffer);
|
||||||
Clean(validValesBuffer);
|
|
||||||
|
|
||||||
//
|
//
|
||||||
ArraySetAsSeries(peaksBuffer, true);
|
ArraySetAsSeries(peaksBuffer, true);
|
||||||
@@ -789,12 +824,24 @@ struct X121Conditions
|
|||||||
ArraySetAsSeries(vwapFastStateBuffer, true);
|
ArraySetAsSeries(vwapFastStateBuffer, true);
|
||||||
ArraySetAsSeries(vwapMidStateBuffer, true);
|
ArraySetAsSeries(vwapMidStateBuffer, true);
|
||||||
ArraySetAsSeries(vwapSlowStateBuffer, true);
|
ArraySetAsSeries(vwapSlowStateBuffer, true);
|
||||||
ArraySetAsSeries(validPeaksBuffer, true);
|
ArraySetAsSeries(rsiBuffer, true);
|
||||||
ArraySetAsSeries(validValesBuffer, true);
|
|
||||||
|
|
||||||
//
|
//
|
||||||
// Conditions ...
|
// Conditions ...
|
||||||
|
|
||||||
|
//
|
||||||
|
// XRSI ...
|
||||||
|
|
||||||
|
//
|
||||||
|
isRSIOverBought = false;
|
||||||
|
isRSICrossedUnderOverBought = false;
|
||||||
|
isRSICrossedOverOverBought = false;
|
||||||
|
|
||||||
|
//
|
||||||
|
isRSIOverSold = false;
|
||||||
|
isRSICrossedOverOverSold = false;
|
||||||
|
isRSICrossedUnderOverSold = false;
|
||||||
|
|
||||||
//
|
//
|
||||||
// XSAR ...
|
// XSAR ...
|
||||||
|
|
||||||
@@ -1089,6 +1136,7 @@ class XCX121Helper : public XCBaseHelper
|
|||||||
// Deconstructor ...
|
// Deconstructor ...
|
||||||
~XCX121Helper()
|
~XCX121Helper()
|
||||||
{
|
{
|
||||||
|
IndicatorRelease(mRSIHandler);
|
||||||
}
|
}
|
||||||
|
|
||||||
//
|
//
|
||||||
@@ -1168,6 +1216,7 @@ class XCX121Helper : public XCBaseHelper
|
|||||||
ArraySetAsSeries(vwapFastStateBuffer, true);
|
ArraySetAsSeries(vwapFastStateBuffer, true);
|
||||||
ArraySetAsSeries(vwapMidStateBuffer, true);
|
ArraySetAsSeries(vwapMidStateBuffer, true);
|
||||||
ArraySetAsSeries(vwapSlowStateBuffer, true);
|
ArraySetAsSeries(vwapSlowStateBuffer, true);
|
||||||
|
ArraySetAsSeries(rsiBuffer, true);
|
||||||
|
|
||||||
//
|
//
|
||||||
mHandler = iCustom(
|
mHandler = iCustom(
|
||||||
@@ -1290,6 +1339,19 @@ class XCX121Helper : public XCBaseHelper
|
|||||||
return result;
|
return result;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
//
|
||||||
|
mRSIHandler = iRSI(
|
||||||
|
symbol,
|
||||||
|
period,
|
||||||
|
mInputs.rsiLength,
|
||||||
|
PRICE_CLOSE //
|
||||||
|
);
|
||||||
|
result = mRSIHandler != INVALID_HANDLE;
|
||||||
|
if (!result)
|
||||||
|
{
|
||||||
|
return result;
|
||||||
|
}
|
||||||
|
|
||||||
//
|
//
|
||||||
return result;
|
return result;
|
||||||
}
|
}
|
||||||
@@ -1324,18 +1386,60 @@ class XCX121Helper : public XCBaseHelper
|
|||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
//
|
||||||
* Retrieve DON Chain Length ...
|
// Implement Value Getters ...
|
||||||
*
|
|
||||||
* @return ( int )
|
//
|
||||||
*/
|
// XRSI ...
|
||||||
int GetDonChainLength()
|
|
||||||
|
//
|
||||||
|
double GetRSI(
|
||||||
|
int barIndex // Bar Index
|
||||||
|
)
|
||||||
{
|
{
|
||||||
return mInputs.donchainLength;
|
//
|
||||||
|
if (barIndex < 0)
|
||||||
|
{
|
||||||
|
barIndex = 0;
|
||||||
|
}
|
||||||
|
|
||||||
|
//
|
||||||
|
Calculate();
|
||||||
|
|
||||||
|
//
|
||||||
|
int count = ArraySize(rsiBuffer);
|
||||||
|
if (barIndex >= count)
|
||||||
|
{
|
||||||
|
barIndex = count - 1;
|
||||||
|
}
|
||||||
|
|
||||||
|
//
|
||||||
|
return rsiBuffer[barIndex];
|
||||||
}
|
}
|
||||||
|
|
||||||
//
|
//
|
||||||
// Implement Value Getters ...
|
int CopyRSI(
|
||||||
|
int start, // Start
|
||||||
|
int count, // Number of Items for read
|
||||||
|
double &buffer[], // Dest Buffer
|
||||||
|
bool forceClean = true // Force To Clean buffer
|
||||||
|
)
|
||||||
|
{
|
||||||
|
//
|
||||||
|
// Update Calculations ...
|
||||||
|
Calculate();
|
||||||
|
|
||||||
|
//
|
||||||
|
// Copy Items ...
|
||||||
|
return Copy(
|
||||||
|
start,
|
||||||
|
count,
|
||||||
|
rsiBuffer,
|
||||||
|
buffer,
|
||||||
|
forceClean
|
||||||
|
//
|
||||||
|
);
|
||||||
|
}
|
||||||
|
|
||||||
//
|
//
|
||||||
// SAR ...
|
// SAR ...
|
||||||
@@ -3717,6 +3821,13 @@ class XCX121Helper : public XCBaseHelper
|
|||||||
//
|
//
|
||||||
// Buffers ...
|
// Buffers ...
|
||||||
|
|
||||||
|
//
|
||||||
|
CopyRSI(
|
||||||
|
zIndex,
|
||||||
|
loopback,
|
||||||
|
conditions.rsiBuffer //
|
||||||
|
);
|
||||||
|
|
||||||
//
|
//
|
||||||
CopySar(
|
CopySar(
|
||||||
zIndex,
|
zIndex,
|
||||||
@@ -3997,6 +4108,29 @@ class XCX121Helper : public XCBaseHelper
|
|||||||
int cIDX = 1;
|
int cIDX = 1;
|
||||||
int pIDX = cIDX + 1;
|
int pIDX = cIDX + 1;
|
||||||
|
|
||||||
|
//
|
||||||
|
// XRSI ...
|
||||||
|
|
||||||
|
//
|
||||||
|
bool isRSIOverBought = conditions.rsiBuffer[cIDX] > mInputs.rsiOverBoughtLevel;
|
||||||
|
bool isRSIOverBoughtPrev = conditions.rsiBuffer[pIDX] > mInputs.rsiOverBoughtLevel;
|
||||||
|
|
||||||
|
//
|
||||||
|
bool isRSICrossedOverOverBought = isRSIOverBought &&
|
||||||
|
!isRSIOverBoughtPrev;
|
||||||
|
bool isRSICrossedUnderOverBought = !isRSIOverBought &&
|
||||||
|
isRSIOverBoughtPrev;
|
||||||
|
|
||||||
|
//
|
||||||
|
bool isRSIOverSold = conditions.rsiBuffer[cIDX] < mInputs.rsiOverSoldLevel;
|
||||||
|
bool isRSIOverSoldPrev = conditions.rsiBuffer[pIDX] < mInputs.rsiOverSoldLevel;
|
||||||
|
|
||||||
|
//
|
||||||
|
bool isRSICrossedUnderOverSold = isRSIOverSold &&
|
||||||
|
!isRSIOverSoldPrev;
|
||||||
|
bool isRSICrossedOverOverSold = !isRSIOverSold &&
|
||||||
|
isRSIOverSoldPrev;
|
||||||
|
|
||||||
//
|
//
|
||||||
// XSAR ...
|
// XSAR ...
|
||||||
|
|
||||||
@@ -4174,6 +4308,12 @@ class XCX121Helper : public XCBaseHelper
|
|||||||
|
|
||||||
//
|
//
|
||||||
// Set ...
|
// Set ...
|
||||||
|
conditions.isRSIOverBought = isRSIOverBought;
|
||||||
|
conditions.isRSICrossedOverOverBought = isRSICrossedOverOverBought;
|
||||||
|
conditions.isRSICrossedUnderOverBought = isRSICrossedUnderOverBought;
|
||||||
|
conditions.isRSIOverSold = isRSIOverSold;
|
||||||
|
conditions.isRSICrossedUnderOverSold = isRSICrossedUnderOverSold;
|
||||||
|
conditions.isRSICrossedOverOverSold = isRSICrossedOverOverSold;
|
||||||
conditions.isSarBullish = isSarBullish;
|
conditions.isSarBullish = isSarBullish;
|
||||||
conditions.isSarBearish = isSarBearish;
|
conditions.isSarBearish = isSarBearish;
|
||||||
conditions.isSarSwitchedToBullish = isSarSwitchedToBullish;
|
conditions.isSarSwitchedToBullish = isSarSwitchedToBullish;
|
||||||
@@ -4245,6 +4385,9 @@ class XCX121Helper : public XCBaseHelper
|
|||||||
//
|
//
|
||||||
// Buffers ...
|
// Buffers ...
|
||||||
|
|
||||||
|
//
|
||||||
|
int mRSIHandler; // RSI Handler ...
|
||||||
|
|
||||||
//
|
//
|
||||||
// Buffers ...
|
// Buffers ...
|
||||||
double peaksBuffer[];
|
double peaksBuffer[];
|
||||||
@@ -4286,8 +4429,7 @@ class XCX121Helper : public XCBaseHelper
|
|||||||
double vwapFastStateBuffer[];
|
double vwapFastStateBuffer[];
|
||||||
double vwapMidStateBuffer[];
|
double vwapMidStateBuffer[];
|
||||||
double vwapSlowStateBuffer[];
|
double vwapSlowStateBuffer[];
|
||||||
double validPeaksBuffer[];
|
double rsiBuffer[];
|
||||||
double validValesBuffer[];
|
|
||||||
|
|
||||||
//
|
//
|
||||||
// Tools ...
|
// Tools ...
|
||||||
@@ -4307,6 +4449,17 @@ class XCX121Helper : public XCBaseHelper
|
|||||||
//
|
//
|
||||||
// Buffers ...
|
// Buffers ...
|
||||||
|
|
||||||
|
//
|
||||||
|
// RSI ...
|
||||||
|
CopyBuffer(
|
||||||
|
mRSIHandler,
|
||||||
|
0,
|
||||||
|
0,
|
||||||
|
totalBars,
|
||||||
|
rsiBuffer
|
||||||
|
//
|
||||||
|
);
|
||||||
|
|
||||||
//
|
//
|
||||||
// XSAR ...
|
// XSAR ...
|
||||||
CopyBuffer(
|
CopyBuffer(
|
||||||
|
|||||||
@@ -6821,6 +6821,19 @@ int AddRef(
|
|||||||
return result;
|
return result;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
//
|
||||||
|
// Check Specified Array Has Childs or not ...
|
||||||
|
template <typename T>
|
||||||
|
bool HasChild(T &buffer[])
|
||||||
|
{
|
||||||
|
return IsValidSize(ArraySize(buffer));
|
||||||
|
}
|
||||||
|
template <typename T>
|
||||||
|
bool SpecificHasChild(T &buffer[])
|
||||||
|
{
|
||||||
|
return HasChild(buffer);
|
||||||
|
}
|
||||||
|
|
||||||
//
|
//
|
||||||
// Remove Specified Item from an Array ...
|
// Remove Specified Item from an Array ...
|
||||||
template <typename T>
|
template <typename T>
|
||||||
|
|||||||
@@ -5400,7 +5400,7 @@ struct XPriceZones
|
|||||||
};
|
};
|
||||||
|
|
||||||
//
|
//
|
||||||
// TODO: Complete this ...
|
// Market Strucutre Model ...
|
||||||
struct XMarketStructure
|
struct XMarketStructure
|
||||||
{
|
{
|
||||||
//
|
//
|
||||||
@@ -5412,7 +5412,11 @@ struct XMarketStructure
|
|||||||
|
|
||||||
//
|
//
|
||||||
XPVPivotPoint vales[];
|
XPVPivotPoint vales[];
|
||||||
|
XPriceZones valePriceZones[];
|
||||||
|
|
||||||
|
//
|
||||||
XPVPivotPoint peaks[];
|
XPVPivotPoint peaks[];
|
||||||
|
XPriceZones peakPriceZones[];
|
||||||
|
|
||||||
//
|
//
|
||||||
XOHCL lowestValeBar;
|
XOHCL lowestValeBar;
|
||||||
@@ -5423,6 +5427,136 @@ struct XMarketStructure
|
|||||||
XOHCL highestPeakBar;
|
XOHCL highestPeakBar;
|
||||||
XOHCL peakBelowHighestPeakValeBar;
|
XOHCL peakBelowHighestPeakValeBar;
|
||||||
XOHCL highestPeakValeBreakeDownBar;
|
XOHCL highestPeakValeBreakeDownBar;
|
||||||
|
|
||||||
|
//
|
||||||
|
XMarketStructure()
|
||||||
|
{
|
||||||
|
Clean();
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Cleanup ...
|
||||||
|
*/
|
||||||
|
void Clean()
|
||||||
|
{
|
||||||
|
//
|
||||||
|
symbol = NULL;
|
||||||
|
period = NULL;
|
||||||
|
bias = X_DIRECTION_NONE;
|
||||||
|
|
||||||
|
//
|
||||||
|
Clean(vales);
|
||||||
|
Clean(peaks);
|
||||||
|
Clean(valePriceZones);
|
||||||
|
Clean(peakPriceZones);
|
||||||
|
|
||||||
|
//
|
||||||
|
lowestValeBar.Clean();
|
||||||
|
lowestValePeakBreakeUpBar.Clean();
|
||||||
|
valeAboveLowestValePeakBar.Clean();
|
||||||
|
|
||||||
|
//
|
||||||
|
highestPeakBar.Clean();
|
||||||
|
peakBelowHighestPeakValeBar.Clean();
|
||||||
|
highestPeakValeBreakeDownBar.Clean();
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Validate Model ...
|
||||||
|
*
|
||||||
|
* @return ( bool )
|
||||||
|
*/
|
||||||
|
bool IsValid()
|
||||||
|
{
|
||||||
|
//
|
||||||
|
bool result = false;
|
||||||
|
|
||||||
|
//
|
||||||
|
result =
|
||||||
|
IsValid(symbol) &&
|
||||||
|
IsValid(period) &&
|
||||||
|
bias != X_DIRECTION_NONE;
|
||||||
|
|
||||||
|
//
|
||||||
|
return result;
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Check Bullish Trend ...
|
||||||
|
*
|
||||||
|
* @return ( bool )
|
||||||
|
*/
|
||||||
|
bool IsBullish()
|
||||||
|
{
|
||||||
|
//
|
||||||
|
bool result = false;
|
||||||
|
|
||||||
|
//
|
||||||
|
result =
|
||||||
|
//
|
||||||
|
IsValid() &&
|
||||||
|
IsBullish(bias) &&
|
||||||
|
HasChild(peaks) &&
|
||||||
|
HasDirection(bias) &&
|
||||||
|
lowestValeBar.IsValid() &&
|
||||||
|
HasChild(peakPriceZones) &&
|
||||||
|
lowestValePeakBreakeUpBar.IsValid() &&
|
||||||
|
valeAboveLowestValePeakBar.IsValid()
|
||||||
|
//
|
||||||
|
;
|
||||||
|
|
||||||
|
//
|
||||||
|
return result;
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Check Bearish Trend ...
|
||||||
|
*
|
||||||
|
* @return ( bool )
|
||||||
|
*/
|
||||||
|
bool IsBearish()
|
||||||
|
{
|
||||||
|
//
|
||||||
|
bool result = false;
|
||||||
|
|
||||||
|
//
|
||||||
|
result =
|
||||||
|
//
|
||||||
|
IsValid() &&
|
||||||
|
IsBearish(bias) &&
|
||||||
|
HasChild(vales) &&
|
||||||
|
HasDirection(bias) &&
|
||||||
|
highestPeakBar.IsValid() &&
|
||||||
|
HasChild(valePriceZones) &&
|
||||||
|
peakBelowHighestPeakValeBar.IsValid() &&
|
||||||
|
highestPeakValeBreakeDownBar.IsValid()
|
||||||
|
//
|
||||||
|
;
|
||||||
|
|
||||||
|
//
|
||||||
|
return result;
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Check Has Trend ...
|
||||||
|
*
|
||||||
|
* @return ( bool )
|
||||||
|
*/
|
||||||
|
bool HasTrend()
|
||||||
|
{
|
||||||
|
//
|
||||||
|
bool result = false;
|
||||||
|
|
||||||
|
//
|
||||||
|
result = IsValid() &&
|
||||||
|
(IsBullish() ||
|
||||||
|
IsBearish());
|
||||||
|
|
||||||
|
//
|
||||||
|
return result;
|
||||||
|
}
|
||||||
|
|
||||||
|
//
|
||||||
};
|
};
|
||||||
|
|
||||||
//
|
//
|
||||||
|
|||||||
@@ -519,15 +519,22 @@ class XC121SMCCycleHelper : public XCBase
|
|||||||
return result;
|
return result;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Detect Market Structure ...
|
||||||
|
*
|
||||||
|
* @param model: XMarketStructure instance Reference ...
|
||||||
|
*
|
||||||
|
* @return ( bool )
|
||||||
|
*/
|
||||||
bool DetectMarketStructure(
|
bool DetectMarketStructure(
|
||||||
ENUM_X_DIRECTION &dir //
|
XMarketStructure &model //
|
||||||
)
|
)
|
||||||
{
|
{
|
||||||
//
|
//
|
||||||
bool result = false;
|
bool result = false;
|
||||||
|
|
||||||
//
|
//
|
||||||
dir = X_DIRECTION_NONE;
|
model.Clean();
|
||||||
|
|
||||||
//
|
//
|
||||||
int barIndex = 0;
|
int barIndex = 0;
|
||||||
@@ -536,6 +543,10 @@ class XC121SMCCycleHelper : public XCBase
|
|||||||
string symbol = GetSymbol();
|
string symbol = GetSymbol();
|
||||||
ENUM_TIMEFRAMES period = GetPeriod();
|
ENUM_TIMEFRAMES period = GetPeriod();
|
||||||
|
|
||||||
|
//
|
||||||
|
model.symbol = symbol;
|
||||||
|
model.period = period;
|
||||||
|
|
||||||
//
|
//
|
||||||
int highestPeakIndex = -1;
|
int highestPeakIndex = -1;
|
||||||
double highestPeakVale = 0;
|
double highestPeakVale = 0;
|
||||||
@@ -565,7 +576,7 @@ class XC121SMCCycleHelper : public XCBase
|
|||||||
}
|
}
|
||||||
|
|
||||||
//
|
//
|
||||||
dir =
|
model.bias =
|
||||||
highestPeakIndex < lowestValeIndex
|
highestPeakIndex < lowestValeIndex
|
||||||
? X_DIRECTION_BEARISH
|
? X_DIRECTION_BEARISH
|
||||||
: highestPeakIndex > lowestValeIndex
|
: highestPeakIndex > lowestValeIndex
|
||||||
@@ -573,14 +584,14 @@ class XC121SMCCycleHelper : public XCBase
|
|||||||
: X_DIRECTION_NONE;
|
: X_DIRECTION_NONE;
|
||||||
|
|
||||||
//
|
//
|
||||||
result = HasDirection(dir);
|
result = HasDirection(model.bias);
|
||||||
if (!result)
|
if (!result)
|
||||||
{
|
{
|
||||||
return result;
|
return result;
|
||||||
}
|
}
|
||||||
|
|
||||||
//
|
//
|
||||||
bool isBullish = IsBullish(dir);
|
bool isBullish = IsBullish(model.bias);
|
||||||
|
|
||||||
//
|
//
|
||||||
// Looking for Change Of Character Proved ...
|
// Looking for Change Of Character Proved ...
|
||||||
@@ -714,14 +725,10 @@ class XC121SMCCycleHelper : public XCBase
|
|||||||
// based on Detected Range ...
|
// based on Detected Range ...
|
||||||
|
|
||||||
//
|
//
|
||||||
XPVPivotPoint vales[];
|
|
||||||
XPVPivotPoint peaks[];
|
|
||||||
XPVPivotPoint iPeakPoint;
|
XPVPivotPoint iPeakPoint;
|
||||||
XPVPivotPoint iValePoint;
|
XPVPivotPoint iValePoint;
|
||||||
XPriceZones peakPriceZone;
|
XPriceZones peakPriceZone;
|
||||||
XPriceZones valePriceZone;
|
XPriceZones valePriceZone;
|
||||||
XPriceZones peakPriceZones[];
|
|
||||||
XPriceZones valePriceZones[];
|
|
||||||
|
|
||||||
//
|
//
|
||||||
XPOIState state;
|
XPOIState state;
|
||||||
@@ -730,7 +737,7 @@ class XC121SMCCycleHelper : public XCBase
|
|||||||
);
|
);
|
||||||
|
|
||||||
//
|
//
|
||||||
int minRepetition = 5; // ValidPivotRepetition();
|
int minRepetition = 5;
|
||||||
|
|
||||||
//
|
//
|
||||||
int from =
|
int from =
|
||||||
@@ -788,13 +795,13 @@ class XC121SMCCycleHelper : public XCBase
|
|||||||
//
|
//
|
||||||
AddRef(
|
AddRef(
|
||||||
iPeakPoint,
|
iPeakPoint,
|
||||||
peaks //
|
model.peaks //
|
||||||
);
|
);
|
||||||
|
|
||||||
//
|
//
|
||||||
AddRef(
|
AddRef(
|
||||||
peakPriceZone,
|
peakPriceZone,
|
||||||
peakPriceZones //
|
model.peakPriceZones //
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -838,13 +845,13 @@ class XC121SMCCycleHelper : public XCBase
|
|||||||
//
|
//
|
||||||
AddRef(
|
AddRef(
|
||||||
iValePoint,
|
iValePoint,
|
||||||
vales //
|
model.vales //
|
||||||
);
|
);
|
||||||
|
|
||||||
//
|
//
|
||||||
AddRef(
|
AddRef(
|
||||||
valePriceZone,
|
valePriceZone,
|
||||||
valePriceZones //
|
model.valePriceZones //
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -865,306 +872,102 @@ class XC121SMCCycleHelper : public XCBase
|
|||||||
// in Bearish Bias we Looking for Peaks Oder ...
|
// in Bearish Bias we Looking for Peaks Oder ...
|
||||||
|
|
||||||
//
|
//
|
||||||
// Draw ...
|
// Bullish Bias Drawn ...
|
||||||
XCBaseObject *drawnObjects[];
|
|
||||||
|
|
||||||
//
|
|
||||||
// Bearish Bias ...
|
|
||||||
if (isBullish)
|
if (isBullish)
|
||||||
{
|
{
|
||||||
//
|
//
|
||||||
// Draw Lowest Vale Bar ...
|
|
||||||
XOHCL lowestValeBar;
|
|
||||||
result = GetBar(
|
result = GetBar(
|
||||||
lowestValeBar,
|
model.lowestValeBar,
|
||||||
lowestValeIndex //
|
lowestValeIndex //
|
||||||
);
|
);
|
||||||
if (!result)
|
if (!result)
|
||||||
{
|
{
|
||||||
return result;
|
return result;
|
||||||
}
|
}
|
||||||
XCOHCLObject *iLowestValeBarObj;
|
|
||||||
bool isCreated = mPOIDetector.mDrawer.CreateBar(
|
|
||||||
lowestValeBar,
|
|
||||||
iLowestValeBarObj,
|
|
||||||
TimeCurrent() //
|
|
||||||
);
|
|
||||||
if (isCreated)
|
|
||||||
{
|
|
||||||
//
|
|
||||||
Add(
|
|
||||||
(XCBaseObject *)iLowestValeBarObj,
|
|
||||||
drawnObjects //
|
|
||||||
);
|
|
||||||
}
|
|
||||||
|
|
||||||
//
|
//
|
||||||
// Draw Lowest Vale Peak Breaker Bar ...
|
|
||||||
XOHCL lowestValePeakBreakeUpBar;
|
|
||||||
if (isValidBreakeUpLowestValePeak)
|
if (isValidBreakeUpLowestValePeak)
|
||||||
{
|
{
|
||||||
//
|
//
|
||||||
result = GetBar(
|
result = GetBar(
|
||||||
lowestValePeakBreakeUpBar,
|
model.lowestValePeakBreakeUpBar,
|
||||||
lowestValePeakBreakeUpIndex //
|
lowestValePeakBreakeUpIndex //
|
||||||
);
|
);
|
||||||
if (!result)
|
if (!result)
|
||||||
{
|
{
|
||||||
return result;
|
return result;
|
||||||
}
|
}
|
||||||
|
|
||||||
//
|
|
||||||
XCOHCLObject *iObj;
|
|
||||||
bool isCreated = mPOIDetector.mDrawer.CreateBar(
|
|
||||||
lowestValePeakBreakeUpBar,
|
|
||||||
iObj,
|
|
||||||
TimeCurrent() //
|
|
||||||
);
|
|
||||||
if (isCreated)
|
|
||||||
{
|
|
||||||
//
|
|
||||||
Add(
|
|
||||||
(XCBaseObject *)iObj,
|
|
||||||
drawnObjects //
|
|
||||||
);
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
//
|
//
|
||||||
// Draw Vale Above Lowest Vale Peak ...
|
|
||||||
XOHCL valeAboveLowestValePeakBar;
|
|
||||||
if (isValidValeAboveLowestValePeak)
|
if (isValidValeAboveLowestValePeak)
|
||||||
{
|
{
|
||||||
//
|
//
|
||||||
result = GetBar(valeAboveLowestValePeakBar,
|
result = GetBar(
|
||||||
valeAboveLowestValePeakIndex //
|
model.valeAboveLowestValePeakBar,
|
||||||
|
valeAboveLowestValePeakIndex //
|
||||||
);
|
);
|
||||||
if (!result)
|
if (!result)
|
||||||
{
|
{
|
||||||
return result;
|
return result;
|
||||||
}
|
}
|
||||||
|
|
||||||
//
|
|
||||||
XCOHCLObject *iObj;
|
|
||||||
bool isCreated = mPOIDetector.mDrawer.CreateBar(
|
|
||||||
valeAboveLowestValePeakBar,
|
|
||||||
iObj,
|
|
||||||
TimeCurrent() //
|
|
||||||
);
|
|
||||||
if (isCreated)
|
|
||||||
{
|
|
||||||
//
|
|
||||||
Add(
|
|
||||||
(XCBaseObject *)iObj,
|
|
||||||
drawnObjects //
|
|
||||||
);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
//
|
|
||||||
// Draw Vales ...
|
|
||||||
int valesCount = ArraySize(vales);
|
|
||||||
if (IsValidSize(valesCount))
|
|
||||||
{
|
|
||||||
//
|
|
||||||
for (int i = 0; i < valesCount; i++)
|
|
||||||
{
|
|
||||||
//
|
|
||||||
iValePoint = vales[i];
|
|
||||||
|
|
||||||
//
|
|
||||||
CChartObjectTrend *iValeObj;
|
|
||||||
iValeObj = new CChartObjectTrend();
|
|
||||||
|
|
||||||
//
|
|
||||||
string iValeName = "XVALE_" + ToString(iValePoint.value);
|
|
||||||
|
|
||||||
//
|
|
||||||
long chartID = mPOIDetector.mDrawer.ChartIdentification();
|
|
||||||
int window = mPOIDetector.mDrawer.SubWindowIdentification();
|
|
||||||
|
|
||||||
//
|
|
||||||
bool isCreate = iValeObj.Create(
|
|
||||||
chartID,
|
|
||||||
iValeName,
|
|
||||||
window,
|
|
||||||
iValePoint.time,
|
|
||||||
iValePoint.value,
|
|
||||||
TimeCurrent(),
|
|
||||||
iValePoint.value //
|
|
||||||
);
|
|
||||||
if (isCreated)
|
|
||||||
{
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
//
|
|
||||||
// Draw Price Zone ...
|
|
||||||
valesCount = ArraySize(valePriceZones);
|
|
||||||
if (IsValidSize(valesCount))
|
|
||||||
{
|
|
||||||
//
|
|
||||||
for (int i = 0; i < valesCount; i++)
|
|
||||||
{
|
|
||||||
//
|
|
||||||
XPriceZones iZone = valePriceZones[i];
|
|
||||||
|
|
||||||
//
|
|
||||||
bool hasSupport = iZone.HasSupportZone();
|
|
||||||
if (hasSupport)
|
|
||||||
{
|
|
||||||
//
|
|
||||||
XCSupportZoneObject *iObj;
|
|
||||||
bool isCreated = mPOIDetector.mDrawer.CreateSupportZone(
|
|
||||||
iZone.supportZone,
|
|
||||||
iObj //
|
|
||||||
);
|
|
||||||
if (isCreated)
|
|
||||||
{
|
|
||||||
//
|
|
||||||
Add(
|
|
||||||
(XCBaseObject *)iObj,
|
|
||||||
drawnObjects //
|
|
||||||
);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
//
|
//
|
||||||
// Bullish Bias Drawn ...
|
// Bearish Bias Drawn ...
|
||||||
if (!isBullish)
|
if (!isBullish)
|
||||||
{
|
{
|
||||||
//
|
//
|
||||||
// Draw Highest Peak Bar ...
|
|
||||||
XOHCL highestPeakBar;
|
|
||||||
result = GetBar(
|
result = GetBar(
|
||||||
highestPeakBar,
|
model.highestPeakBar,
|
||||||
highestPeakIndex //
|
highestPeakIndex //
|
||||||
);
|
);
|
||||||
if (!result)
|
if (!result)
|
||||||
{
|
{
|
||||||
return result;
|
return result;
|
||||||
}
|
}
|
||||||
XCOHCLObject *iHighestPeakBarObj;
|
|
||||||
bool isCreated = mPOIDetector.mDrawer.CreateBar(
|
|
||||||
highestPeakBar,
|
|
||||||
iHighestPeakBarObj,
|
|
||||||
TimeCurrent() //
|
|
||||||
);
|
|
||||||
if (isCreated)
|
|
||||||
{
|
|
||||||
//
|
|
||||||
Add(
|
|
||||||
(XCBaseObject *)iHighestPeakBarObj,
|
|
||||||
drawnObjects //
|
|
||||||
);
|
|
||||||
}
|
|
||||||
|
|
||||||
//
|
//
|
||||||
// Draw Highest Peak Vale Breaker Bar ...
|
|
||||||
XOHCL highestPeakValeBreakeDownBar;
|
|
||||||
if (isValidBreakeDownHighestPeakVale)
|
if (isValidBreakeDownHighestPeakVale)
|
||||||
{
|
{
|
||||||
//
|
//
|
||||||
result = GetBar(
|
result = GetBar(
|
||||||
highestPeakValeBreakeDownBar,
|
model.highestPeakValeBreakeDownBar,
|
||||||
highestPeakValeBreakeDownIndex //
|
highestPeakValeBreakeDownIndex //
|
||||||
);
|
);
|
||||||
if (!result)
|
if (!result)
|
||||||
{
|
{
|
||||||
return result;
|
return result;
|
||||||
}
|
}
|
||||||
|
|
||||||
//
|
|
||||||
XCOHCLObject *iObj;
|
|
||||||
bool isCreated = mPOIDetector.mDrawer.CreateBar(
|
|
||||||
highestPeakValeBreakeDownBar,
|
|
||||||
iObj,
|
|
||||||
TimeCurrent() //
|
|
||||||
);
|
|
||||||
if (isCreated)
|
|
||||||
{
|
|
||||||
//
|
|
||||||
Add(
|
|
||||||
(XCBaseObject *)iObj,
|
|
||||||
drawnObjects //
|
|
||||||
);
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
//
|
//
|
||||||
// Draw Peak Below Highest Peak Vale ...
|
|
||||||
XOHCL peakBelowHighestPeakValeBar;
|
|
||||||
if (isValidPeakBelowHighestPeakVale)
|
if (isValidPeakBelowHighestPeakVale)
|
||||||
{
|
{
|
||||||
//
|
//
|
||||||
result = GetBar(peakBelowHighestPeakValeBar,
|
result = GetBar(
|
||||||
peakBelowHighestPeakValeIndex //
|
model.peakBelowHighestPeakValeBar,
|
||||||
|
peakBelowHighestPeakValeIndex //
|
||||||
);
|
);
|
||||||
if (!result)
|
if (!result)
|
||||||
{
|
{
|
||||||
return result;
|
return result;
|
||||||
}
|
}
|
||||||
|
|
||||||
//
|
|
||||||
XCOHCLObject *iObj;
|
|
||||||
bool isCreated = mPOIDetector.mDrawer.CreateBar(
|
|
||||||
peakBelowHighestPeakValeBar,
|
|
||||||
iObj,
|
|
||||||
TimeCurrent() //
|
|
||||||
);
|
|
||||||
if (isCreated)
|
|
||||||
{
|
|
||||||
//
|
|
||||||
Add(
|
|
||||||
(XCBaseObject *)iObj,
|
|
||||||
drawnObjects //
|
|
||||||
);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
//
|
|
||||||
// Draw Peaks ...
|
|
||||||
int peaksCount = ArraySize(peaks);
|
|
||||||
if (IsValidSize(peaksCount))
|
|
||||||
{
|
|
||||||
//
|
|
||||||
for (int i = 0; i < peaksCount; i++)
|
|
||||||
{
|
|
||||||
//
|
|
||||||
iPeakPoint = peaks[i];
|
|
||||||
|
|
||||||
//
|
|
||||||
CChartObjectTrend *iPeakObj;
|
|
||||||
iPeakObj = new CChartObjectTrend();
|
|
||||||
|
|
||||||
//
|
|
||||||
string iPeakName = "XPEAK_" + ToString(iPeakPoint.value);
|
|
||||||
|
|
||||||
//
|
|
||||||
long chartID = mPOIDetector.mDrawer.ChartIdentification();
|
|
||||||
int window = mPOIDetector.mDrawer.SubWindowIdentification();
|
|
||||||
|
|
||||||
//
|
|
||||||
bool isCreate = iPeakObj.Create(
|
|
||||||
chartID,
|
|
||||||
iPeakName,
|
|
||||||
window,
|
|
||||||
iPeakPoint.time,
|
|
||||||
iPeakPoint.value,
|
|
||||||
TimeCurrent(),
|
|
||||||
iPeakPoint.value //
|
|
||||||
);
|
|
||||||
if (isCreated)
|
|
||||||
{
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
//
|
||||||
|
result = model.IsValid();
|
||||||
|
|
||||||
|
//
|
||||||
|
// TODO: Remove this ...
|
||||||
|
XCBaseObject *objects[];
|
||||||
|
int dObjects = mPOIDetector.mDrawer.DrawMarketStructure(
|
||||||
|
model,
|
||||||
|
objects //
|
||||||
|
);
|
||||||
|
|
||||||
//
|
//
|
||||||
return result;
|
return result;
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -246,8 +246,7 @@ bool DetectX121SMCTestSiganlSetup(
|
|||||||
|
|
||||||
//
|
//
|
||||||
int zoneValidationDivider = 10;
|
int zoneValidationDivider = 10;
|
||||||
int validPivotRepetition = triggerCycleHelper.mX121Helper
|
int validPivotRepetition = 10;
|
||||||
.GetDonChainLength();
|
|
||||||
|
|
||||||
//
|
//
|
||||||
double selectedSL = 0;
|
double selectedSL = 0;
|
||||||
@@ -492,8 +491,7 @@ bool DetectX121SMCTestSiganlTrigger(
|
|||||||
|
|
||||||
//
|
//
|
||||||
int zoneValidationDivider = 10;
|
int zoneValidationDivider = 10;
|
||||||
int validPivotRepetition = triggerCycleHelper.mX121Helper
|
int validPivotRepetition = 10;
|
||||||
.GetDonChainLength();
|
|
||||||
|
|
||||||
//
|
//
|
||||||
double selectedSL = 0;
|
double selectedSL = 0;
|
||||||
|
|||||||
@@ -647,10 +647,10 @@ bool DetectX121SMCXTWPVSiganlSetup(
|
|||||||
// Setup Conditions ...
|
// Setup Conditions ...
|
||||||
|
|
||||||
//
|
//
|
||||||
ENUM_X_DIRECTION biasDir;
|
XMarketStructure marketStructure;
|
||||||
bool hasMarketStructure =
|
bool hasMarketStructure =
|
||||||
analyseCycleHelper
|
analyseCycleHelper
|
||||||
.DetectMarketStructure(biasDir);
|
.DetectMarketStructure(marketStructure);
|
||||||
|
|
||||||
//
|
//
|
||||||
XOHCL analyseCBar;
|
XOHCL analyseCBar;
|
||||||
|
|||||||
@@ -693,14 +693,14 @@ class XCX121SMCStrategy : public XCX121SMCBaseStrategy
|
|||||||
x121Inputs.showFibo4Levels = false;
|
x121Inputs.showFibo4Levels = false;
|
||||||
|
|
||||||
//
|
//
|
||||||
x121Inputs.showSar = false;
|
x121Inputs.showSar = true;
|
||||||
x121Inputs.showPeaks = true;
|
x121Inputs.showPeaks = true;
|
||||||
x121Inputs.showVales = true;
|
x121Inputs.showVales = true;
|
||||||
x121Inputs.showVWap = false;
|
x121Inputs.showVWap = false;
|
||||||
x121Inputs.showDonchain = true;
|
x121Inputs.showDonchain = true;
|
||||||
|
|
||||||
//
|
//
|
||||||
x121Inputs.showOpen = true;
|
x121Inputs.showOpen = false;
|
||||||
x121Inputs.showHigh = true;
|
x121Inputs.showHigh = true;
|
||||||
x121Inputs.showClose = true;
|
x121Inputs.showClose = true;
|
||||||
x121Inputs.showLow = true;
|
x121Inputs.showLow = true;
|
||||||
|
|||||||
Reference in New Issue
Block a user