Req: How to count how many bars in displaying chart

asnavale

Well-Known Member
#4
not only 159 bars.

you can set @ menu: File/Database settings ---> Number of bars.


-------------

my question is: how to count no of bar displaying on pane when you zoom the chart.


Hi Baby,

Try the following AFL:

_SECTION_BEGIN("VisibleBars");

SetChartOptions(0, chartShowDates | chartWrapTitle);

last = Status("lastvisiblebar");
first = Status("firstvisiblebar");

VisibleBars = Min( last - first, BarCount - first );

_N(Title = StrFormat("{{NAME}} ({{INTERVAL}}) {{DATE}}; {{OHLCX}}, Vol=%1.0f\n{{VALUES}}\nVisible Bars=%1.0f", V, VisibleBars));

Plot(C, "", colorLightGrey, styleBar);

_SECTION_END();


-Anant