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.
BarNumber and CurrentBar question
BarNumber and CurrentBar question
- Attachments
-
- 2013-02-11 22.00.27.jpg
- (1.81 MiB) Downloaded 863 times
Re: BarNumber and CurrentBar question
BarNumber is 1000 on the chart for your reference. Thanks!
- Attachments
-
- barnumber1000.jpg
- (718.88 KiB) Downloaded 853 times
- Andrew MultiCharts
- Posts: 1587
- Joined: 11 Oct 2011
- Has thanked: 931 times
- Been thanked: 559 times
Re: BarNumber and CurrentBar question
Hello
Here is what you need to plot:
Here is what you need to plot:
Code: Select all
NumberOfBar = maxbarsback+currentbar-1;
Plot1 (NumberOfBar);
Re: BarNumber and CurrentBar question
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
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
- Andrew MultiCharts
- Posts: 1587
- Joined: 11 Oct 2011
- Has thanked: 931 times
- Been thanked: 559 times
Re: BarNumber and CurrentBar question
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.