last ...
This commit is contained in:
@@ -2513,6 +2513,647 @@ class XCPOIDrawer : public XCBase
|
||||
return result;
|
||||
}
|
||||
|
||||
/**
|
||||
* Draw Specified POI State ...
|
||||
*
|
||||
* @param state: XPOIState instance Reference ...
|
||||
* @param drawnObjects: CArrayObj instance for Holding Drawn Objects ...
|
||||
* @param ignoreSwingHighs: Boolean ...
|
||||
* @param ignoreSwingLows: Boolean ...
|
||||
* @param ignoreSupportZones: Boolean ...
|
||||
* @param ignoreResistanceZones: Boolean ...
|
||||
* @param ignoreSupplyZones: Boolean ...
|
||||
* @param ignoreDemandZones: Boolean ...
|
||||
* @param ignoreBullishOrderBlocks: Boolean ...
|
||||
* @param ignoreBearishOrderBlocks: Boolean ...
|
||||
* @param ignoreBullishFairValueGaps: Boolean ...
|
||||
* @param ignoreBearishFairValueGaps: Boolean ...
|
||||
* @param ignoreBullishRejectionBars: Boolean ...
|
||||
* @param ignoreBearishRejectionBars: Boolean ...
|
||||
* @param ignoreBullishMomentumBars: Boolean ...
|
||||
* @param ignoreBearishMomentumBars: Boolean ...
|
||||
*/
|
||||
int DrawState(
|
||||
XPOIState &state,
|
||||
XCBaseObject *&drawnObjects[],
|
||||
bool ignoreSwingHighs = false,
|
||||
bool ignoreSwingLows = false,
|
||||
bool ignoreSupportZones = false,
|
||||
bool ignoreResistanceZones = false,
|
||||
bool ignoreSupplyZones = false,
|
||||
bool ignoreDemandZones = false,
|
||||
bool ignoreBullishOrderBlocks = false,
|
||||
bool ignoreBearishOrderBlocks = false,
|
||||
bool ignoreBullishFairValueGaps = false,
|
||||
bool ignoreBearishFairValueGaps = false,
|
||||
bool ignoreBullishRejectionBars = false,
|
||||
bool ignoreBearishRejectionBars = false,
|
||||
bool ignoreBullishMomentumBars = false,
|
||||
bool ignoreBearishMomentumBars = false //
|
||||
)
|
||||
{
|
||||
//
|
||||
int result = 0;
|
||||
|
||||
//
|
||||
if (!state.IsValid() ||
|
||||
!state.HasChild())
|
||||
{
|
||||
return result;
|
||||
}
|
||||
|
||||
//
|
||||
Clean(drawnObjects);
|
||||
|
||||
//
|
||||
// SwingHighs ...
|
||||
if (!ignoreSwingHighs)
|
||||
{
|
||||
//
|
||||
int count = state.CountSwingHighs();
|
||||
if (IsValidSize(count))
|
||||
{
|
||||
//
|
||||
for (int i = 0; i < count; i++)
|
||||
{
|
||||
//
|
||||
XCSwing *iSwing = state.swingHighs[i];
|
||||
XCSwingHighObject *iObj;
|
||||
|
||||
//
|
||||
bool isCreated = CreateSwingHigh(
|
||||
iSwing,
|
||||
iObj //
|
||||
);
|
||||
if (isCreated)
|
||||
{
|
||||
//
|
||||
Add(
|
||||
(XCBaseObject *)iObj,
|
||||
drawnObjects //
|
||||
);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
//
|
||||
// SwingLows ...
|
||||
if (!ignoreSwingLows)
|
||||
{
|
||||
//
|
||||
int count = state.CountSwingLows();
|
||||
if (IsValidSize(count))
|
||||
{
|
||||
//
|
||||
for (int i = 0; i < count; i++)
|
||||
{
|
||||
//
|
||||
XCSwing *iSwing = state.swingLows[i];
|
||||
XCSwingLowObject *iObj;
|
||||
|
||||
//
|
||||
bool isCreated = CreateSwingLow(
|
||||
iSwing,
|
||||
iObj //
|
||||
);
|
||||
if (isCreated)
|
||||
{
|
||||
//
|
||||
Add(
|
||||
(XCBaseObject *)iObj,
|
||||
drawnObjects //
|
||||
);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
//
|
||||
// SupportZones ...
|
||||
if (!ignoreSupportZones)
|
||||
{
|
||||
//
|
||||
int count = state.CountSupportZones();
|
||||
if (IsValidSize(count))
|
||||
{
|
||||
//
|
||||
for (int i = 0; i < count; i++)
|
||||
{
|
||||
//
|
||||
XCSupportZone *iZone = state.supportZones[i];
|
||||
XCSupportZoneObject *iObj;
|
||||
|
||||
//
|
||||
bool isCreated = CreateSupportZone(
|
||||
iZone,
|
||||
iObj //
|
||||
);
|
||||
if (isCreated)
|
||||
{
|
||||
//
|
||||
Add(
|
||||
(XCBaseObject *)iObj,
|
||||
drawnObjects //
|
||||
);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
//
|
||||
// ResistanceZones ...
|
||||
if (!ignoreResistanceZones)
|
||||
{
|
||||
//
|
||||
int count = state.CountResistanceZones();
|
||||
if (IsValidSize(count))
|
||||
{
|
||||
//
|
||||
for (int i = 0; i < count; i++)
|
||||
{
|
||||
//
|
||||
XCResistanceZone *iZone = state.resistanceZones[i];
|
||||
XCResistanceZoneObject *iObj;
|
||||
|
||||
//
|
||||
bool isCreated = CreateResistanceZone(
|
||||
iZone,
|
||||
iObj //
|
||||
);
|
||||
if (isCreated)
|
||||
{
|
||||
//
|
||||
Add(
|
||||
(XCBaseObject *)iObj,
|
||||
drawnObjects //
|
||||
);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
//
|
||||
// SupplyZones ...
|
||||
if (!ignoreSupplyZones)
|
||||
{
|
||||
//
|
||||
int count = state.CountSupplyZones();
|
||||
if (IsValidSize(count))
|
||||
{
|
||||
//
|
||||
for (int i = 0; i < count; i++)
|
||||
{
|
||||
//
|
||||
XCSupplyZone *iZone = state.supplyZones[i];
|
||||
XCSupplyZoneObject *iObj;
|
||||
|
||||
//
|
||||
bool isCreated = CreateSupplyZone(
|
||||
iZone,
|
||||
iObj //
|
||||
);
|
||||
if (isCreated)
|
||||
{
|
||||
//
|
||||
Add(
|
||||
(XCBaseObject *)iObj,
|
||||
drawnObjects //
|
||||
);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
//
|
||||
// DemandZones ...
|
||||
if (!ignoreDemandZones)
|
||||
{
|
||||
//
|
||||
int count = state.CountDemandZones();
|
||||
if (IsValidSize(count))
|
||||
{
|
||||
//
|
||||
for (int i = 0; i < count; i++)
|
||||
{
|
||||
//
|
||||
XCDemandZone *iZone = state.demandZones[i];
|
||||
XCDemandZoneObject *iObj;
|
||||
|
||||
//
|
||||
bool isCreated = CreateDemandZone(
|
||||
iZone,
|
||||
iObj //
|
||||
);
|
||||
if (isCreated)
|
||||
{
|
||||
//
|
||||
Add(
|
||||
(XCBaseObject *)iObj,
|
||||
drawnObjects //
|
||||
);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
//
|
||||
// BullishOrderBlocks ...
|
||||
if (!ignoreBullishOrderBlocks)
|
||||
{
|
||||
//
|
||||
int count = state.CountBullishOrderBlocks();
|
||||
if (IsValidSize(count))
|
||||
{
|
||||
//
|
||||
for (int i = 0; i < count; i++)
|
||||
{
|
||||
//
|
||||
XCOrderBlock *iZone = state.bullishOrderBlocks[i];
|
||||
XCBullishOrderBlockObject *iObj;
|
||||
|
||||
//
|
||||
bool isCreated = CreateBullishOrderBlock(
|
||||
iZone,
|
||||
iObj //
|
||||
);
|
||||
if (isCreated)
|
||||
{
|
||||
//
|
||||
Add(
|
||||
(XCBaseObject *)iObj,
|
||||
drawnObjects //
|
||||
);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
//
|
||||
// BearishOrderBlocks ...
|
||||
if (!ignoreBearishOrderBlocks)
|
||||
{
|
||||
//
|
||||
int count = state.CountBearishOrderBlocks();
|
||||
if (IsValidSize(count))
|
||||
{
|
||||
//
|
||||
for (int i = 0; i < count; i++)
|
||||
{
|
||||
//
|
||||
XCOrderBlock *iZone = state.bearishOrderBlocks[i];
|
||||
XCBearishOrderBlockObject *iObj;
|
||||
|
||||
//
|
||||
bool isCreated = CreateBearishOrderBlock(
|
||||
iZone,
|
||||
iObj //
|
||||
);
|
||||
if (isCreated)
|
||||
{
|
||||
//
|
||||
Add(
|
||||
(XCBaseObject *)iObj,
|
||||
drawnObjects //
|
||||
);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
//
|
||||
// BullishFairValueGaps ...
|
||||
if (!ignoreBullishFairValueGaps)
|
||||
{
|
||||
//
|
||||
int count = state.CountBullishFairValueGaps();
|
||||
if (IsValidSize(count))
|
||||
{
|
||||
//
|
||||
for (int i = 0; i < count; i++)
|
||||
{
|
||||
//
|
||||
XCFVG *iZone = state.bullishFairValueGaps[i];
|
||||
XCBullishFairValueGapObject *iObj;
|
||||
|
||||
//
|
||||
bool isCreated = CreateBullishFairValueGap(
|
||||
iZone,
|
||||
iObj //
|
||||
);
|
||||
if (isCreated)
|
||||
{
|
||||
//
|
||||
Add(
|
||||
(XCBaseObject *)iObj,
|
||||
drawnObjects //
|
||||
);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
//
|
||||
// BearishFairValueGaps ...
|
||||
if (!ignoreBearishFairValueGaps)
|
||||
{
|
||||
//
|
||||
int count = state.CountBearishFairValueGaps();
|
||||
if (IsValidSize(count))
|
||||
{
|
||||
//
|
||||
for (int i = 0; i < count; i++)
|
||||
{
|
||||
//
|
||||
XCFVG *iZone = state.bearishFairValueGaps[i];
|
||||
XCBearishFairValueGapObject *iObj;
|
||||
|
||||
//
|
||||
bool isCreated = CreateBearishFairValueGap(
|
||||
iZone,
|
||||
iObj //
|
||||
);
|
||||
if (isCreated)
|
||||
{
|
||||
//
|
||||
Add(
|
||||
(XCBaseObject *)iObj,
|
||||
drawnObjects //
|
||||
);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
//
|
||||
// BullishRejectionBars ...
|
||||
if (!ignoreBullishRejectionBars)
|
||||
{
|
||||
//
|
||||
int count = state.CountBullishRejectionBars();
|
||||
if (IsValidSize(count))
|
||||
{
|
||||
//
|
||||
for (int i = 0; i < count; i++)
|
||||
{
|
||||
//
|
||||
XCRejectionBar *iBar = state.bullishRejectionBars[i];
|
||||
XCBullishRejectionBarObject *iObj;
|
||||
|
||||
//
|
||||
bool isCreated = CreateBullishRejectionBar(
|
||||
iBar,
|
||||
iObj //
|
||||
);
|
||||
if (isCreated)
|
||||
{
|
||||
//
|
||||
Add(
|
||||
(XCBaseObject *)iObj,
|
||||
drawnObjects //
|
||||
);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
//
|
||||
// BearishRejectionBars ...
|
||||
if (!ignoreBearishRejectionBars)
|
||||
{
|
||||
//
|
||||
int count = state.CountBearishRejectionBars();
|
||||
if (IsValidSize(count))
|
||||
{
|
||||
//
|
||||
for (int i = 0; i < count; i++)
|
||||
{
|
||||
//
|
||||
XCRejectionBar *iBar = state.bearishRejectionBars[i];
|
||||
XCBearishRejectionBarObject *iObj;
|
||||
|
||||
//
|
||||
bool isCreated = CreateBearishRejectionBar(
|
||||
iBar,
|
||||
iObj //
|
||||
);
|
||||
if (isCreated)
|
||||
{
|
||||
//
|
||||
Add(
|
||||
(XCBaseObject *)iObj,
|
||||
drawnObjects //
|
||||
);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
//
|
||||
// BullishMomentumBars ...
|
||||
if (!ignoreBullishMomentumBars)
|
||||
{
|
||||
//
|
||||
int count = state.CountBullishMomentumBars();
|
||||
if (IsValidSize(count))
|
||||
{
|
||||
//
|
||||
for (int i = 0; i < count; i++)
|
||||
{
|
||||
//
|
||||
XCMomentumBar *iBar = state.bullishMomentumBars[i];
|
||||
XCBullishMomentumBarObject *iObj;
|
||||
|
||||
//
|
||||
bool isCreated = CreateBullishMomentumBar(
|
||||
iBar,
|
||||
iObj //
|
||||
);
|
||||
if (isCreated)
|
||||
{
|
||||
//
|
||||
Add(
|
||||
(XCBaseObject *)iObj,
|
||||
drawnObjects //
|
||||
);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
//
|
||||
// BearishMomentumBars ...
|
||||
if (!ignoreBearishMomentumBars)
|
||||
{
|
||||
//
|
||||
int count = state.CountBearishMomentumBars();
|
||||
if (IsValidSize(count))
|
||||
{
|
||||
//
|
||||
for (int i = 0; i < count; i++)
|
||||
{
|
||||
//
|
||||
XCMomentumBar *iBar = state.bearishMomentumBars[i];
|
||||
XCBearishMomentumBarObject *iObj;
|
||||
|
||||
//
|
||||
bool isCreated = CreateBearishMomentumBar(
|
||||
iBar,
|
||||
iObj //
|
||||
);
|
||||
if (isCreated)
|
||||
{
|
||||
//
|
||||
Add(
|
||||
(XCBaseObject *)iObj,
|
||||
drawnObjects //
|
||||
);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
//
|
||||
result = ArraySize(drawnObjects);
|
||||
|
||||
//
|
||||
return result;
|
||||
}
|
||||
|
||||
/**
|
||||
* Draw Specific Pivot ...
|
||||
*
|
||||
* @param pivot: XPVPivot instance Reference ...
|
||||
* @param drawState: Boolean ...
|
||||
* @param filterByPrice: Boolean ...
|
||||
* @param ignoreSwingHighs: Boolean ...
|
||||
* @param ignoreSwingLows: Boolean ...
|
||||
* @param ignoreSupportZones: Boolean ...
|
||||
* @param ignoreResistanceZones: Boolean ...
|
||||
* @param ignoreSupplyZones: Boolean ...
|
||||
* @param ignoreDemandZones: Boolean ...
|
||||
* @param ignoreBullishOrderBlocks: Boolean ...
|
||||
* @param ignoreBearishOrderBlocks: Boolean ...
|
||||
* @param ignoreBullishFairValueGaps: Boolean ...
|
||||
* @param ignoreBearishFairValueGaps: Boolean ...
|
||||
* @param ignoreBullishRejectionBars: Boolean ...
|
||||
* @param ignoreBearishRejectionBars: Boolean ...
|
||||
* @param ignoreBullishMomentumBars: Boolean ...
|
||||
* @param ignoreBearishMomentumBars: Boolean ...
|
||||
*/
|
||||
int DrawPivot(
|
||||
XPVPivot &pivot,
|
||||
XCBaseObject *&drawnObjects[],
|
||||
bool drawState = true,
|
||||
bool ignoreSwingHighs = false,
|
||||
bool ignoreSwingLows = false,
|
||||
bool ignoreSupportZones = false,
|
||||
bool ignoreResistanceZones = false,
|
||||
bool ignoreSupplyZones = false,
|
||||
bool ignoreDemandZones = false,
|
||||
bool ignoreBullishOrderBlocks = false,
|
||||
bool ignoreBearishOrderBlocks = false,
|
||||
bool ignoreBullishFairValueGaps = false,
|
||||
bool ignoreBearishFairValueGaps = false,
|
||||
bool ignoreBullishRejectionBars = false,
|
||||
bool ignoreBearishRejectionBars = false,
|
||||
bool ignoreBullishMomentumBars = false,
|
||||
bool ignoreBearishMomentumBars = false //
|
||||
)
|
||||
{
|
||||
//
|
||||
int result = 0;
|
||||
|
||||
//
|
||||
Clean(drawnObjects);
|
||||
|
||||
//
|
||||
if (!pivot.IsValid())
|
||||
{
|
||||
return result;
|
||||
}
|
||||
|
||||
//
|
||||
// Draw Pivot it self ...
|
||||
XCXPVPivotObject *iPivotObj;
|
||||
iPivotObj = new XCXPVPivotObject();
|
||||
bool isCreated = iPivotObj.Create(
|
||||
ChartIdentification(),
|
||||
SubWindowIdentification(),
|
||||
pivot //
|
||||
);
|
||||
if (!isCreated)
|
||||
{
|
||||
return result;
|
||||
}
|
||||
|
||||
//
|
||||
color clrPivotColor = pivot.IsPeak()
|
||||
? clrAqua
|
||||
: clrMagenta;
|
||||
iPivotObj.PivotColor(clrPivotColor);
|
||||
iPivotObj.PivotWidth(2);
|
||||
|
||||
//
|
||||
Add(
|
||||
(XCBaseObject *)iPivotObj,
|
||||
drawnObjects //
|
||||
);
|
||||
|
||||
//
|
||||
result = ArraySize(drawnObjects);
|
||||
|
||||
//
|
||||
if (!drawState)
|
||||
{
|
||||
return result;
|
||||
}
|
||||
|
||||
//
|
||||
if (!pivot.state.IsValid())
|
||||
{
|
||||
return result;
|
||||
}
|
||||
|
||||
//
|
||||
XCBaseObject *stateObjects[];
|
||||
int stateCount = DrawState(
|
||||
pivot.state,
|
||||
stateObjects,
|
||||
ignoreSwingHighs,
|
||||
ignoreSwingLows,
|
||||
ignoreSupportZones,
|
||||
ignoreResistanceZones,
|
||||
ignoreSupplyZones,
|
||||
ignoreDemandZones,
|
||||
ignoreBullishOrderBlocks,
|
||||
ignoreBearishOrderBlocks,
|
||||
ignoreBullishFairValueGaps,
|
||||
ignoreBearishFairValueGaps,
|
||||
ignoreBullishRejectionBars,
|
||||
ignoreBearishRejectionBars,
|
||||
ignoreBullishMomentumBars,
|
||||
ignoreBearishMomentumBars //
|
||||
);
|
||||
|
||||
//
|
||||
if (IsValidSize(stateCount))
|
||||
{
|
||||
//
|
||||
Copy(
|
||||
stateObjects,
|
||||
drawnObjects,
|
||||
false // Doesn't Clean ...
|
||||
);
|
||||
}
|
||||
|
||||
//
|
||||
result = ArraySize(drawnObjects);
|
||||
|
||||
//
|
||||
return result;
|
||||
}
|
||||
|
||||
//
|
||||
protected:
|
||||
//
|
||||
|
||||
Reference in New Issue
Block a user