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.
Size:
Color:
Eventually got the reason. VS needs to be VolitalityStatus which is daily.
Size:
Color: