add support for hide and show bars in xczone indicator ...
This commit is contained in:
@@ -73,6 +73,7 @@ input bool filterBasedOnTrend = false; // Filter Pivots Based on Trend
|
||||
//
|
||||
// Presentation ...
|
||||
input group "Presentation";
|
||||
input bool showBars = true; // Show Bars
|
||||
input bool showSar = false; // Show Sar
|
||||
input bool showTrend = false; // Show Trend
|
||||
input bool rayLeft = false; // Ray to Left
|
||||
@@ -244,6 +245,14 @@ int maxLength;
|
||||
//
|
||||
int firstBarIndex;
|
||||
|
||||
//
|
||||
// Bars Color Variables ...
|
||||
static color _upColor;
|
||||
static color _downColor;
|
||||
static color _lineColor;
|
||||
static color _bullishColor;
|
||||
static color _bearishColor;
|
||||
|
||||
//
|
||||
XCAlert *alert;
|
||||
double mPoints = 0;
|
||||
@@ -389,6 +398,19 @@ int OnInit()
|
||||
// and then wait until pass it ...
|
||||
maxLength = ExtractMaxLengthOfInputs();
|
||||
|
||||
//
|
||||
ReadBarStyle();
|
||||
|
||||
//
|
||||
if (showBars)
|
||||
{
|
||||
ShowBars();
|
||||
}
|
||||
else
|
||||
{
|
||||
HideBars();
|
||||
}
|
||||
|
||||
//
|
||||
// Define Index Buffers ...
|
||||
DefineBuffers();
|
||||
@@ -433,6 +455,9 @@ void OnDeinit(const int reason)
|
||||
ZeroMemory(drawer);
|
||||
ZeroMemory(barAnalyser);
|
||||
|
||||
//
|
||||
ShowBars();
|
||||
|
||||
//
|
||||
IndicatorRelease(sarHandler);
|
||||
IndicatorRelease(rsiHandler);
|
||||
@@ -2449,4 +2474,47 @@ void ApplyStyle(
|
||||
//
|
||||
}
|
||||
|
||||
//
|
||||
void ReadBarStyle()
|
||||
{
|
||||
//
|
||||
long chartId = ChartID();
|
||||
|
||||
//
|
||||
_upColor = GetChartUpColor(chartId);
|
||||
_downColor = GetChartDownColor(chartId);
|
||||
_lineColor = GetChartLineColor(chartId);
|
||||
_bullishColor = GetChartBullishColor(chartId);
|
||||
_bearishColor = GetChartBearishColor(chartId);
|
||||
}
|
||||
|
||||
//
|
||||
void ShowBars()
|
||||
{
|
||||
//
|
||||
long chartId = ChartID();
|
||||
|
||||
//
|
||||
SetChartUpColor(_upColor, chartId);
|
||||
SetChartDownColor(_downColor, chartId);
|
||||
SetChartLineColor(_lineColor, chartId);
|
||||
SetChartBullishColor(_bullishColor, chartId);
|
||||
SetChartBearishColor(_bearishColor, chartId);
|
||||
}
|
||||
|
||||
//
|
||||
void HideBars()
|
||||
{
|
||||
//
|
||||
long chartId = ChartID();
|
||||
|
||||
//
|
||||
SetChartUpColor(CLR_NONE, chartId);
|
||||
SetChartDownColor(CLR_NONE, chartId);
|
||||
SetChartLineColor(CLR_NONE, chartId);
|
||||
SetChartBullishColor(CLR_NONE, chartId);
|
||||
SetChartBearishColor(CLR_NONE, chartId);
|
||||
}
|
||||
|
||||
|
||||
//
|
||||
Reference in New Issue
Block a user