last ...
This commit is contained in:
@@ -3328,6 +3328,254 @@ class XCPOIDrawer : public XCBase
|
||||
return result;
|
||||
}
|
||||
|
||||
int DrawStateZones(
|
||||
XStateZones &source,
|
||||
XCBaseObject *&drawnObjects[] //
|
||||
)
|
||||
{
|
||||
//
|
||||
int result = 0;
|
||||
|
||||
//
|
||||
Clean(drawnObjects);
|
||||
|
||||
//
|
||||
if (!source.IsValid())
|
||||
{
|
||||
return result;
|
||||
}
|
||||
|
||||
//
|
||||
// SupportZones ...
|
||||
int count = source.CountSupportZones();
|
||||
if (IsValidSize(count))
|
||||
{
|
||||
//
|
||||
for (int i = 0; i < count; i++)
|
||||
{
|
||||
//
|
||||
XCSupportZone *iZone = source.supportZones[i];
|
||||
XCSupportZoneObject *iObj;
|
||||
|
||||
//
|
||||
bool isCreated = CreateSupportZone(
|
||||
iZone,
|
||||
iObj //
|
||||
);
|
||||
if (isCreated)
|
||||
{
|
||||
//
|
||||
Add(
|
||||
(XCBaseObject *)iObj,
|
||||
drawnObjects //
|
||||
);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
//
|
||||
// ResistanceZones ...
|
||||
count = source.CountResistanceZones();
|
||||
if (IsValidSize(count))
|
||||
{
|
||||
//
|
||||
for (int i = 0; i < count; i++)
|
||||
{
|
||||
//
|
||||
XCResistanceZone *iZone = source.resistanceZones[i];
|
||||
XCResistanceZoneObject *iObj;
|
||||
|
||||
//
|
||||
bool isCreated = CreateResistanceZone(
|
||||
iZone,
|
||||
iObj //
|
||||
);
|
||||
if (isCreated)
|
||||
{
|
||||
//
|
||||
Add(
|
||||
(XCBaseObject *)iObj,
|
||||
drawnObjects //
|
||||
);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
//
|
||||
// SupplyZones ...
|
||||
count = source.CountSupplyZones();
|
||||
if (IsValidSize(count))
|
||||
{
|
||||
//
|
||||
for (int i = 0; i < count; i++)
|
||||
{
|
||||
//
|
||||
XCSupplyZone *iZone = source.supplyZones[i];
|
||||
XCSupplyZoneObject *iObj;
|
||||
|
||||
//
|
||||
bool isCreated = CreateSupplyZone(
|
||||
iZone,
|
||||
iObj //
|
||||
);
|
||||
if (isCreated)
|
||||
{
|
||||
//
|
||||
Add(
|
||||
(XCBaseObject *)iObj,
|
||||
drawnObjects //
|
||||
);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
//
|
||||
// DemandZones ...
|
||||
count = source.CountDemandZones();
|
||||
if (IsValidSize(count))
|
||||
{
|
||||
//
|
||||
for (int i = 0; i < count; i++)
|
||||
{
|
||||
//
|
||||
XCDemandZone *iZone = source.demandZones[i];
|
||||
XCDemandZoneObject *iObj;
|
||||
|
||||
//
|
||||
bool isCreated = CreateDemandZone(
|
||||
iZone,
|
||||
iObj //
|
||||
);
|
||||
if (isCreated)
|
||||
{
|
||||
//
|
||||
Add(
|
||||
(XCBaseObject *)iObj,
|
||||
drawnObjects //
|
||||
);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
//
|
||||
// BullishOrderBlocks ...
|
||||
count = source.CountBullishOrderBlocks();
|
||||
if (IsValidSize(count))
|
||||
{
|
||||
//
|
||||
for (int i = 0; i < count; i++)
|
||||
{
|
||||
//
|
||||
XCOrderBlock *iZone = source.bullishOrderBlocks[i];
|
||||
XCBullishOrderBlockObject *iObj;
|
||||
|
||||
//
|
||||
bool isCreated = CreateBullishOrderBlock(
|
||||
iZone,
|
||||
iObj //
|
||||
);
|
||||
if (isCreated)
|
||||
{
|
||||
//
|
||||
Add(
|
||||
(XCBaseObject *)iObj,
|
||||
drawnObjects //
|
||||
);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
//
|
||||
// BearishOrderBlocks ...
|
||||
count = source.CountBearishOrderBlocks();
|
||||
if (IsValidSize(count))
|
||||
{
|
||||
//
|
||||
for (int i = 0; i < count; i++)
|
||||
{
|
||||
//
|
||||
XCOrderBlock *iZone = source.bearishOrderBlocks[i];
|
||||
XCBearishOrderBlockObject *iObj;
|
||||
|
||||
//
|
||||
bool isCreated = CreateBearishOrderBlock(
|
||||
iZone,
|
||||
iObj //
|
||||
);
|
||||
if (isCreated)
|
||||
{
|
||||
//
|
||||
Add(
|
||||
(XCBaseObject *)iObj,
|
||||
drawnObjects //
|
||||
);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
//
|
||||
// BullishFairValueGaps ...
|
||||
count = source.CountBullishFairValueGaps();
|
||||
if (IsValidSize(count))
|
||||
{
|
||||
//
|
||||
for (int i = 0; i < count; i++)
|
||||
{
|
||||
//
|
||||
XCFVG *iZone = source.bullishFairValueGaps[i];
|
||||
XCBullishFairValueGapObject *iObj;
|
||||
|
||||
//
|
||||
bool isCreated = CreateBullishFairValueGap(
|
||||
iZone,
|
||||
iObj //
|
||||
);
|
||||
if (isCreated)
|
||||
{
|
||||
//
|
||||
Add(
|
||||
(XCBaseObject *)iObj,
|
||||
drawnObjects //
|
||||
);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
//
|
||||
// BearishFairValueGaps ...
|
||||
count = source.CountBearishFairValueGaps();
|
||||
if (IsValidSize(count))
|
||||
{
|
||||
//
|
||||
for (int i = 0; i < count; i++)
|
||||
{
|
||||
//
|
||||
XCFVG *iZone = source.bearishFairValueGaps[i];
|
||||
XCBearishFairValueGapObject *iObj;
|
||||
|
||||
//
|
||||
bool isCreated = CreateBearishFairValueGap(
|
||||
iZone,
|
||||
iObj //
|
||||
);
|
||||
if (isCreated)
|
||||
{
|
||||
//
|
||||
Add(
|
||||
(XCBaseObject *)iObj,
|
||||
drawnObjects //
|
||||
);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
//
|
||||
result = ArraySize(drawnObjects);
|
||||
|
||||
//
|
||||
return result;
|
||||
}
|
||||
|
||||
/**
|
||||
* Draw Specified Market Structure ...
|
||||
*
|
||||
@@ -4223,6 +4471,143 @@ class XCPOIDrawer : public XCBase
|
||||
return result;
|
||||
}
|
||||
|
||||
/**
|
||||
* Draw Specified XFVGOrderBlock Object ...
|
||||
*
|
||||
* @param models: XFVGOrderBlock instance Reference ...
|
||||
*
|
||||
* @return ( int )
|
||||
*/
|
||||
int DrawFVGOrderBlock(
|
||||
XFVGOrderBlock &models[],
|
||||
XCBaseObject *&drawnObjects[] //
|
||||
)
|
||||
{
|
||||
//
|
||||
int result = 0;
|
||||
|
||||
//
|
||||
Clean(drawnObjects);
|
||||
|
||||
//
|
||||
int count = ArraySize(models);
|
||||
if (!IsValidSize(count))
|
||||
{
|
||||
return result;
|
||||
}
|
||||
|
||||
//
|
||||
for (int i = 0; i < count; i++)
|
||||
{
|
||||
//
|
||||
XFVGOrderBlock iModel = models[i];
|
||||
|
||||
//
|
||||
ENUM_X_DIRECTION iDir;
|
||||
bool hasDirection = iModel.GetDirection(iDir);
|
||||
if (!hasDirection)
|
||||
{
|
||||
continue;
|
||||
}
|
||||
|
||||
//
|
||||
bool isBullish = IsBullish(iDir);
|
||||
|
||||
//
|
||||
if (isBullish)
|
||||
{
|
||||
//
|
||||
// Order Block ...
|
||||
XCBullishOrderBlockObject *iOBObj;
|
||||
bool isCreated = CreateBullishOrderBlock(
|
||||
iModel.orderBlock,
|
||||
iOBObj //
|
||||
);
|
||||
if (isCreated)
|
||||
{
|
||||
//
|
||||
Add(
|
||||
(XCBaseObject *)iOBObj,
|
||||
drawnObjects //
|
||||
);
|
||||
}
|
||||
|
||||
//
|
||||
// FVG ...
|
||||
XCBullishFairValueGapObject *iFVGObj;
|
||||
isCreated = CreateBullishFairValueGap(
|
||||
iModel.fairValueGap,
|
||||
iFVGObj //
|
||||
);
|
||||
if (isCreated)
|
||||
{
|
||||
//
|
||||
Add(
|
||||
(XCBaseObject *)iOBObj,
|
||||
drawnObjects //
|
||||
);
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
//
|
||||
// Order Block ...
|
||||
XCBearishOrderBlockObject *iOBObj;
|
||||
bool isCreated = CreateBearishOrderBlock(
|
||||
iModel.orderBlock,
|
||||
iOBObj //
|
||||
);
|
||||
if (isCreated)
|
||||
{
|
||||
//
|
||||
Add(
|
||||
(XCBaseObject *)iOBObj,
|
||||
drawnObjects //
|
||||
);
|
||||
}
|
||||
|
||||
//
|
||||
// FVG ...
|
||||
XCBearishFairValueGapObject *iFVGObj;
|
||||
isCreated = CreateBearishFairValueGap(
|
||||
iModel.fairValueGap,
|
||||
iFVGObj //
|
||||
);
|
||||
if (isCreated)
|
||||
{
|
||||
//
|
||||
Add(
|
||||
(XCBaseObject *)iFVGObj,
|
||||
drawnObjects //
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
//
|
||||
// Price Zone ...
|
||||
// XCBaseObject *stateZoneObjects[];
|
||||
// int stateZoneObjectsCount = DrawStateZones(
|
||||
// iModel.stateZones,
|
||||
// stateZoneObjects //
|
||||
// );
|
||||
// if (IsValidSize(stateZoneObjectsCount))
|
||||
// {
|
||||
// //
|
||||
// Copy(
|
||||
// stateZoneObjects,
|
||||
// drawnObjects,
|
||||
// false // Force Clean ...
|
||||
// );
|
||||
// }
|
||||
}
|
||||
|
||||
//
|
||||
result = ArraySize(drawnObjects);
|
||||
|
||||
//
|
||||
return result;
|
||||
}
|
||||
|
||||
//
|
||||
protected:
|
||||
//
|
||||
|
||||
Reference in New Issue
Block a user