Bars.Count between Weekly and Daily
Author: tradercn
Creation Date: 2/17/2012 7:19 PM
profile picture

tradercn

#1
To tell market conditions, after I get some statistical numbers from weekly data, Scale is set to be daily. However, the last part of my following codes generates a mistake, said "Index was out of range, Must be non-negative and less than the size of the collection." Bars.Count shows the right daily bar count 2593. If I changed the last cycle as: for(int bar=201; bar<535; bar++), it works perfect then. As far as I know, 535 is the weekly bar number.
Interesting thing is, after RestoreScale(), two cycles go through the daily bars have no problem. But in the last cycle, index was out of range error shows up. Could you please help?
Please go to the code segment which is after the "SetScaleDaily()". You can see the definition of MarketStatus there from 1-9. Thanks in advance.

CODE:
Please log in to see this code.

profile picture

tradercn

#2
Eventually got the reason. VS needs to be VolitalityStatus which is daily.
This website uses cookies to improve your experience. We'll assume you're ok with that, but you can opt-out if you wish (Read more).