Page 1 of 1

BarNumber and CurrentBar question

Posted: Feb 11 2013
by ctu1121
I insert 12 stock on Market Scanner, XLP, SPY, XLU, XLI, XLV, XLY, XLF, XLB, XLK, XLE, XRT, XHB. I wrote the following study and check close, currentbar and barnumber.

value1=close;
plot1(value1,"close");

value2=currentbar;
plot2(value2,"CurrentBar");

value3=BarNumber;
plot3(value3,"BarNumber");

Question1: I setup for 1000 Bars back on settings of Format Resolution(All Instruments), however, the CurrentBar and BarNumber for XL* is 994 and 767 for SPY. May I know why?
Question2: I could see the the barnumber is 1000 on the chart, why I see 994 and 767 on MarketScanner?

Thanks for your advice.

Re: BarNumber and CurrentBar question

Posted: Feb 11 2013
by ctu1121
BarNumber is 1000 on the chart for your reference. Thanks!

Re: BarNumber and CurrentBar question

Posted: Feb 11 2013
by Andrew MultiCharts
Hello

Here is what you need to plot:

Code: Select all

NumberOfBar = maxbarsback+currentbar-1;
Plot1 (NumberOfBar);

Re: BarNumber and CurrentBar question

Posted: Feb 12 2013
by ctu1121
Hi Andrew,
I follow your code as below:

value14 = maxbarsback+currentbar-1;
Plot14 (value14,"Barnumber");

and still see different barnumber for SPY. Please refer attached photo. My market data provider is IQFeed.

Charles

Re: BarNumber and CurrentBar question

Posted: Feb 12 2013
by Andrew MultiCharts
Please plot SPY on chart with the same data range and point your cursor on the last bar to see hint with the bar number. If it is still less than 999, press CTRL+R to reload data. If the issue persists, please make a screenshot of this and upload it here.