last ...
This commit is contained in:
@@ -4330,6 +4330,339 @@ class XCPOIDrawer : public XCBase
|
||||
return result;
|
||||
}
|
||||
|
||||
//
|
||||
int DrawOBFVG(
|
||||
XOBFVG &item,
|
||||
XCBaseObject *&objects[],
|
||||
//
|
||||
bool drawOrderBlock = true,
|
||||
bool drawFairValueGap = true,
|
||||
bool drawSupplyZones = true,
|
||||
bool drawDemandZones = true,
|
||||
bool drawSupportZones = true,
|
||||
bool drawResistanceZones = true,
|
||||
//
|
||||
bool drawOBStartedBar = true,
|
||||
bool drawOBActivatedBar = true,
|
||||
bool drawOBBreakedBar = true,
|
||||
bool drawOBWorkedBar = true,
|
||||
//
|
||||
bool drawFVGStartedBar = true,
|
||||
bool drawFVGActivatedBar = true,
|
||||
bool drawFVGBreakedBar = true,
|
||||
bool drawFVGWorkedBar = true,
|
||||
//
|
||||
// Order Block Specs ...
|
||||
//
|
||||
int widthOBStartedBar = 1,
|
||||
color clrOBStartedBar = clrYellow,
|
||||
ENUM_LINE_STYLE styleOBStartedBar = STYLE_SOLID,
|
||||
//
|
||||
int widthOBActivatedBar = 1,
|
||||
color clrOBActivatedBar = clrLime,
|
||||
ENUM_LINE_STYLE styleOBActivatedBar = STYLE_SOLID,
|
||||
//
|
||||
int widthOBBreakedBar = 1,
|
||||
color clrOBBreakedBar = clrRed,
|
||||
ENUM_LINE_STYLE styleOBBreakedBar = STYLE_SOLID,
|
||||
//
|
||||
int widthOBWorkedBar = 1,
|
||||
color clrOBWorkedBar = clrAqua,
|
||||
ENUM_LINE_STYLE styleOBWorkedBar = STYLE_SOLID,
|
||||
//
|
||||
// Fair Value Gap Specs ...
|
||||
//
|
||||
int widthFVGStartedBar = 1,
|
||||
color clrFVGStartedBar = clrYellow,
|
||||
ENUM_LINE_STYLE styleFVGStartedBar = STYLE_SOLID,
|
||||
//
|
||||
int widthFVGActivatedBar = 1,
|
||||
color clrFVGActivatedBar = clrLime,
|
||||
ENUM_LINE_STYLE styleFVGActivatedBar = STYLE_SOLID,
|
||||
//
|
||||
int widthFVGBreakedBar = 1,
|
||||
color clrFVGBreakedBar = clrRed,
|
||||
ENUM_LINE_STYLE styleFVGBreakedBar = STYLE_SOLID,
|
||||
//
|
||||
int widthFVGWorkedBar = 1,
|
||||
color clrFVGWorkedBar = clrAqua,
|
||||
ENUM_LINE_STYLE styleFVGWorkedBar = STYLE_SOLID
|
||||
//
|
||||
)
|
||||
{
|
||||
//
|
||||
int result = 0;
|
||||
|
||||
//
|
||||
Clean(objects);
|
||||
|
||||
//
|
||||
bool isValid = item.IsValid();
|
||||
if (!isValid)
|
||||
{
|
||||
return result;
|
||||
}
|
||||
|
||||
//
|
||||
int count = 0;
|
||||
bool has = false;
|
||||
bool isCreated = false;
|
||||
XCBaseObject *tmpObjects[];
|
||||
|
||||
//
|
||||
// Order Block ...
|
||||
has = item.HasOB();
|
||||
if (has &&
|
||||
drawOrderBlock)
|
||||
{
|
||||
//
|
||||
Clean(tmpObjects);
|
||||
count = DrawOrderBlock(
|
||||
item.ob,
|
||||
tmpObjects,
|
||||
drawOBStartedBar,
|
||||
drawOBActivatedBar,
|
||||
drawOBBreakedBar,
|
||||
drawOBWorkedBar,
|
||||
widthOBStartedBar,
|
||||
clrOBStartedBar,
|
||||
styleOBStartedBar,
|
||||
widthOBActivatedBar,
|
||||
clrOBActivatedBar,
|
||||
styleOBActivatedBar,
|
||||
widthOBBreakedBar,
|
||||
clrOBBreakedBar,
|
||||
styleOBBreakedBar,
|
||||
widthOBWorkedBar,
|
||||
clrOBWorkedBar,
|
||||
styleOBWorkedBar //
|
||||
);
|
||||
has = IsValidSize(count);
|
||||
if (has)
|
||||
{
|
||||
//
|
||||
Copy(
|
||||
tmpObjects,
|
||||
objects,
|
||||
false //
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
//
|
||||
// Fair Value Gap ...
|
||||
has = item.HasFVG();
|
||||
if (has &&
|
||||
drawFairValueGap)
|
||||
{
|
||||
//
|
||||
Clean(tmpObjects);
|
||||
count = DrawFairValueGap(
|
||||
item.fvg,
|
||||
tmpObjects,
|
||||
drawFVGStartedBar,
|
||||
drawFVGActivatedBar,
|
||||
drawFVGBreakedBar,
|
||||
drawFVGWorkedBar,
|
||||
widthFVGStartedBar,
|
||||
clrFVGStartedBar,
|
||||
styleFVGStartedBar,
|
||||
widthFVGActivatedBar,
|
||||
clrFVGActivatedBar,
|
||||
styleFVGActivatedBar,
|
||||
widthFVGBreakedBar,
|
||||
clrFVGBreakedBar,
|
||||
styleFVGBreakedBar,
|
||||
widthFVGWorkedBar,
|
||||
clrFVGWorkedBar,
|
||||
styleFVGWorkedBar //
|
||||
);
|
||||
has = IsValidSize(count);
|
||||
if (has)
|
||||
{
|
||||
//
|
||||
Copy(
|
||||
tmpObjects,
|
||||
objects,
|
||||
false //
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
//
|
||||
// Supply Zones ...
|
||||
has = item.HasSupplyZones();
|
||||
if (has &&
|
||||
drawSupplyZones)
|
||||
{
|
||||
//
|
||||
Clean(tmpObjects);
|
||||
count = item.CountSupplyZones();
|
||||
for (int i = 0; i < count; i++)
|
||||
{
|
||||
//
|
||||
XCSupplyZoneObject *iZoneObj;
|
||||
has = CreateSupplyZone(
|
||||
item.supplyZones[i],
|
||||
iZoneObj //
|
||||
);
|
||||
if (has)
|
||||
{
|
||||
//
|
||||
Add(
|
||||
(XCBaseObject *)iZoneObj,
|
||||
tmpObjects //
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
//
|
||||
count = ArraySize(tmpObjects);
|
||||
has = IsValidSize(count);
|
||||
if (has)
|
||||
{
|
||||
//
|
||||
Copy(
|
||||
tmpObjects,
|
||||
objects,
|
||||
false //
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
//
|
||||
// Demand Zones ...
|
||||
has = item.HasDemandZones();
|
||||
if (has &&
|
||||
drawDemandZones)
|
||||
{
|
||||
//
|
||||
Clean(tmpObjects);
|
||||
count = item.CountDemandZones();
|
||||
for (int i = 0; i < count; i++)
|
||||
{
|
||||
//
|
||||
XCDemandZoneObject *iZoneObj;
|
||||
has = CreateDemandZone(
|
||||
item.demandZones[i],
|
||||
iZoneObj //
|
||||
);
|
||||
if (has)
|
||||
{
|
||||
//
|
||||
Add(
|
||||
(XCBaseObject *)iZoneObj,
|
||||
tmpObjects //
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
//
|
||||
count = ArraySize(tmpObjects);
|
||||
has = IsValidSize(count);
|
||||
if (has)
|
||||
{
|
||||
//
|
||||
Copy(
|
||||
tmpObjects,
|
||||
objects,
|
||||
false //
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
//
|
||||
// Support Zones ...
|
||||
has = item.HasSupportZones();
|
||||
if (has &&
|
||||
drawSupportZones)
|
||||
{
|
||||
//
|
||||
Clean(tmpObjects);
|
||||
count = item.CountSupportZones();
|
||||
for (int i = 0; i < count; i++)
|
||||
{
|
||||
//
|
||||
XCSupportZoneObject *iZoneObj;
|
||||
has = CreateSupportZone(
|
||||
item.supportZones[i],
|
||||
iZoneObj //
|
||||
);
|
||||
if (has)
|
||||
{
|
||||
//
|
||||
Add(
|
||||
(XCBaseObject *)iZoneObj,
|
||||
tmpObjects //
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
//
|
||||
count = ArraySize(tmpObjects);
|
||||
has = IsValidSize(count);
|
||||
if (has)
|
||||
{
|
||||
//
|
||||
Copy(
|
||||
tmpObjects,
|
||||
objects,
|
||||
false //
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
//
|
||||
// Resistance Zones ...
|
||||
has = item.HasResistanceZones();
|
||||
if (has &&
|
||||
drawResistanceZones)
|
||||
{
|
||||
//
|
||||
Clean(tmpObjects);
|
||||
count = item.CountResistanceZones();
|
||||
for (int i = 0; i < count; i++)
|
||||
{
|
||||
//
|
||||
XCResistanceZoneObject *iZoneObj;
|
||||
has = CreateResistanceZone(
|
||||
item.resistanceZones[i],
|
||||
iZoneObj //
|
||||
);
|
||||
if (has)
|
||||
{
|
||||
//
|
||||
Add(
|
||||
(XCBaseObject *)iZoneObj,
|
||||
tmpObjects //
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
//
|
||||
count = ArraySize(tmpObjects);
|
||||
has = IsValidSize(count);
|
||||
if (has)
|
||||
{
|
||||
//
|
||||
Copy(
|
||||
tmpObjects,
|
||||
objects,
|
||||
false //
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
//
|
||||
Clean(tmpObjects);
|
||||
|
||||
//
|
||||
result = ArraySize(objects);
|
||||
|
||||
//
|
||||
return result;
|
||||
}
|
||||
|
||||
//
|
||||
protected:
|
||||
//
|
||||
|
||||
Reference in New Issue
Block a user