BarNumber and CurrentBar question

Questions about MultiCharts and user contributed studies.
ctu1121
Posts: 135
Joined: 05 Jul 2012
Has thanked: 10 times
Been thanked: 4 times

BarNumber and CurrentBar question

Postby ctu1121 » 11 Feb 2013

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.
Attachments
2013-02-11 22.00.27.jpg
(1.81 MiB) Downloaded 863 times

ctu1121
Posts: 135
Joined: 05 Jul 2012
Has thanked: 10 times
Been thanked: 4 times

Re: BarNumber and CurrentBar question

Postby ctu1121 » 11 Feb 2013

BarNumber is 1000 on the chart for your reference. Thanks!
Attachments
barnumber1000.jpg
(718.88 KiB) Downloaded 853 times

User avatar
Andrew MultiCharts
Posts: 1587
Joined: 11 Oct 2011
Has thanked: 931 times
Been thanked: 559 times

Re: BarNumber and CurrentBar question

Postby Andrew MultiCharts » 11 Feb 2013

Hello

Here is what you need to plot:

Code: Select all

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

ctu1121
Posts: 135
Joined: 05 Jul 2012
Has thanked: 10 times
Been thanked: 4 times

Re: BarNumber and CurrentBar question

Postby ctu1121 » 12 Feb 2013

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
Attachments
SPY diff barnumber.jpg
(530.99 KiB) Downloaded 873 times

User avatar
Andrew MultiCharts
Posts: 1587
Joined: 11 Oct 2011
Has thanked: 931 times
Been thanked: 559 times

Re: BarNumber and CurrentBar question

Postby Andrew MultiCharts » 12 Feb 2013

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.


Return to “MultiCharts”