last ...
This commit is contained in:
@@ -123,6 +123,196 @@ class XCPOIDrawer : public XCBase
|
||||
mSubWindowIdentification = value;
|
||||
}
|
||||
|
||||
//
|
||||
// XOHCL ...
|
||||
|
||||
/**
|
||||
* Get Bar Width ...
|
||||
*
|
||||
* @return ( int )
|
||||
*/
|
||||
int BarWidth()
|
||||
{
|
||||
return mBarWidth;
|
||||
}
|
||||
|
||||
/**
|
||||
* Set Bar Width ...
|
||||
*
|
||||
* @param value: Integer ...
|
||||
*/
|
||||
void BarWidth(int value)
|
||||
{
|
||||
//
|
||||
if (value < 0)
|
||||
{
|
||||
value = 0;
|
||||
}
|
||||
|
||||
//
|
||||
mBarWidth = value;
|
||||
}
|
||||
|
||||
/**
|
||||
* Get Bar Bullish Color ...
|
||||
*
|
||||
* @return ( color )
|
||||
*/
|
||||
color BarBullishColor()
|
||||
{
|
||||
return mBarBullishColor;
|
||||
}
|
||||
|
||||
/**
|
||||
* Set Bar Bullish Color ...
|
||||
*
|
||||
* @param value: Color ...
|
||||
*/
|
||||
void BarBullishColor(color value)
|
||||
{
|
||||
mBarBullishColor = value;
|
||||
}
|
||||
|
||||
/**
|
||||
* Get Bar Bearish Color ...
|
||||
*
|
||||
* @return ( color )
|
||||
*/
|
||||
color BarBearishColor()
|
||||
{
|
||||
return mBarBearishColor;
|
||||
}
|
||||
|
||||
/**
|
||||
* Set Bar Bearish Color ...
|
||||
*
|
||||
* @param value: Color ...
|
||||
*/
|
||||
void BarBearishColor(color value)
|
||||
{
|
||||
mBarBearishColor = value;
|
||||
}
|
||||
|
||||
/**
|
||||
* Get Fill Bar High Shadow State ...
|
||||
*
|
||||
* @return ( bool )
|
||||
*/
|
||||
bool BarFillHighShadow()
|
||||
{
|
||||
return mBarFillHighShadow;
|
||||
}
|
||||
|
||||
/**
|
||||
* Set Fill Bar High Shadow State ...
|
||||
*
|
||||
* @param value: Boolean ...
|
||||
*/
|
||||
void BarFillHighShadow(bool value)
|
||||
{
|
||||
mBarFillHighShadow = value;
|
||||
}
|
||||
|
||||
/**
|
||||
* Get Bar High Shadow Style ...
|
||||
*
|
||||
* @return ( ENUM_LINE_STYLE )
|
||||
*/
|
||||
ENUM_LINE_STYLE BarHighShadowStyle()
|
||||
{
|
||||
return mBarHighShadowStyle;
|
||||
}
|
||||
|
||||
/**
|
||||
* Set Bar High Shadow Style ...
|
||||
*
|
||||
* @param value: ENUM_LINE_STYLE member ...
|
||||
*/
|
||||
void BarHighShadowStyle(ENUM_LINE_STYLE value)
|
||||
{
|
||||
mBarHighShadowStyle = value;
|
||||
}
|
||||
|
||||
/**
|
||||
* Get Fill Bar Body State ...
|
||||
*
|
||||
* @return ( bool )
|
||||
*/
|
||||
bool BarFillBody()
|
||||
{
|
||||
return mBarFillBody;
|
||||
}
|
||||
|
||||
/**
|
||||
* Set Fill Bar Body State ...
|
||||
*
|
||||
* @param value: Boolean ...
|
||||
*/
|
||||
void BarFillBody(bool value)
|
||||
{
|
||||
mBarFillBody = value;
|
||||
}
|
||||
|
||||
/**
|
||||
* Get Bar Body Style ...
|
||||
*
|
||||
* @return ( ENUM_LINE_STYLE )
|
||||
*/
|
||||
ENUM_LINE_STYLE BarBodyStyle()
|
||||
{
|
||||
return mBarBodyStyle;
|
||||
}
|
||||
|
||||
/**
|
||||
* Set Bar Body Style ...
|
||||
*
|
||||
* @param value: ENUM_LINE_STYLE member ...
|
||||
*/
|
||||
void BarBodyStyle(ENUM_LINE_STYLE value)
|
||||
{
|
||||
mBarBodyStyle = value;
|
||||
}
|
||||
|
||||
/**
|
||||
* Get Fill Bar Low Show State ...
|
||||
*
|
||||
* @return ( bool )
|
||||
*/
|
||||
bool BarFillLowShadow()
|
||||
{
|
||||
return mBarFillLowShadow;
|
||||
}
|
||||
|
||||
/**
|
||||
* Set Fill Bar Low Show State ...
|
||||
*
|
||||
* @param value: Boolean ...
|
||||
*/
|
||||
void BarFillLowShadow(bool value)
|
||||
{
|
||||
mBarFillLowShadow = value;
|
||||
}
|
||||
|
||||
/**
|
||||
* Get Bar Low Shadow Style ...
|
||||
*
|
||||
* @return ( ENUM_LINE_STYLE )
|
||||
*/
|
||||
ENUM_LINE_STYLE BarLowShadowStyle()
|
||||
{
|
||||
return mBarLowShadowStyle;
|
||||
}
|
||||
|
||||
/**
|
||||
* Set Bar Low Shadow Style ...
|
||||
*
|
||||
* @param value: ENUM_LINE_STYLE member ...
|
||||
*/
|
||||
void BarLowShadowStyle(ENUM_LINE_STYLE value)
|
||||
{
|
||||
mBarLowShadowStyle = value;
|
||||
}
|
||||
|
||||
//
|
||||
// Swing Low ...
|
||||
|
||||
@@ -1285,6 +1475,17 @@ class XCPOIDrawer : public XCBase
|
||||
ChartIdentification(0);
|
||||
SubWindowIdentification(0);
|
||||
|
||||
//
|
||||
BarWidth(1);
|
||||
BarBearishColor(clrRed);
|
||||
BarBullishColor(clrLime);
|
||||
BarFillBody(false);
|
||||
BarFillHighShadow(false);
|
||||
BarFillLowShadow(false);
|
||||
BarBodyStyle(STYLE_DOT);
|
||||
BarLowShadowStyle(STYLE_DOT);
|
||||
BarHighShadowStyle(STYLE_DOT);
|
||||
|
||||
//
|
||||
int arrowWidth = 1;
|
||||
|
||||
@@ -2550,6 +2751,113 @@ class XCPOIDrawer : public XCBase
|
||||
return result;
|
||||
}
|
||||
|
||||
/**
|
||||
* Create Bar Object ...
|
||||
*
|
||||
* @param bar: XOHCL instance Reference ..
|
||||
* @param object: XCOHCLObject pointer Reference ..
|
||||
* @param to: Datetime ...
|
||||
*
|
||||
* @return ( bool )
|
||||
*/
|
||||
bool CreateBar(
|
||||
XOHCL &bar,
|
||||
XCOHCLObject *&object,
|
||||
datetime to = NULL //
|
||||
)
|
||||
{
|
||||
//
|
||||
bool result = false;
|
||||
|
||||
//
|
||||
object = NULL;
|
||||
|
||||
//
|
||||
result = bar.IsValid();
|
||||
if (!result)
|
||||
{
|
||||
return result;
|
||||
}
|
||||
|
||||
//
|
||||
if (!IsValid(to))
|
||||
{
|
||||
to = bar.time + PeriodSeconds(bar.period);
|
||||
}
|
||||
|
||||
//
|
||||
string prefix = Prefix();
|
||||
long chartID = ChartIdentification();
|
||||
int window = SubWindowIdentification();
|
||||
|
||||
//
|
||||
int width = BarWidth();
|
||||
|
||||
//
|
||||
color bullishColor = BarBullishColor();
|
||||
color bearishColor = BarBearishColor();
|
||||
|
||||
//
|
||||
bool fillBody = BarFillBody();
|
||||
bool fillHighShadow = BarFillHighShadow();
|
||||
bool fillLowShadow = BarFillLowShadow();
|
||||
|
||||
//
|
||||
ENUM_LINE_STYLE bodyStyle = BarBodyStyle();
|
||||
ENUM_LINE_STYLE highShadowStyle = BarHighShadowStyle();
|
||||
ENUM_LINE_STYLE lowShadowStyle = BarLowShadowStyle();
|
||||
|
||||
//
|
||||
object = new XCOHCLObject();
|
||||
result = object.Create(
|
||||
chartID,
|
||||
window,
|
||||
bar,
|
||||
to,
|
||||
prefix //
|
||||
);
|
||||
if (result)
|
||||
{
|
||||
//
|
||||
// Apply Styling ...
|
||||
|
||||
//
|
||||
object.BodyWidth(width);
|
||||
object.LowShadowWidth(width);
|
||||
object.HighShadowWidth(width);
|
||||
|
||||
//
|
||||
object.BodyStyle(bodyStyle);
|
||||
object.LowShadowStyle(lowShadowStyle);
|
||||
object.HighShadowStyle(highShadowStyle);
|
||||
|
||||
//
|
||||
bool isBullish = bar.IsBullish();
|
||||
if (isBullish)
|
||||
{
|
||||
//
|
||||
object.BodyColor(bullishColor);
|
||||
object.LowShadowColor(bullishColor);
|
||||
object.HighShadowColor(bullishColor);
|
||||
}
|
||||
else
|
||||
{
|
||||
//
|
||||
object.BodyColor(bearishColor);
|
||||
object.LowShadowColor(bearishColor);
|
||||
object.HighShadowColor(bearishColor);
|
||||
}
|
||||
|
||||
//
|
||||
object.BodyFill(fillBody);
|
||||
object.HighShadowFill(fillHighShadow);
|
||||
object.LowShadowFill(fillLowShadow);
|
||||
}
|
||||
|
||||
//
|
||||
return result;
|
||||
}
|
||||
|
||||
/**
|
||||
* Draw Specified Signal ...
|
||||
*
|
||||
@@ -3300,6 +3608,18 @@ class XCPOIDrawer : public XCBase
|
||||
long mChartIdentification; // Chart Id ...
|
||||
int mSubWindowIdentification; // Sub Window ...
|
||||
|
||||
//
|
||||
// XOHCL ...
|
||||
int mBarWidth; // Bar Width ...
|
||||
color mBarBullishColor; // Bar Bullish Color ...
|
||||
color mBarBearishColor; // Bar Bearish Color ...
|
||||
bool mBarFillHighShadow; // Fill Bar High Shadow ...
|
||||
ENUM_LINE_STYLE mBarHighShadowStyle; // Bar High Shadow Style ...
|
||||
bool mBarFillBody; // Fill Bar Body ...
|
||||
ENUM_LINE_STYLE mBarBodyStyle; // Bar Body Style ...
|
||||
bool mBarFillLowShadow; // Fill Bar Low Show ...
|
||||
ENUM_LINE_STYLE mBarLowShadowStyle; // Bar Low Shadow Style ...
|
||||
|
||||
//
|
||||
// Swing Low ...
|
||||
int mSwingLowWidth; // Swing Low Width ...
|
||||
|
||||
Reference in New Issue
Block a user