|
Sie Ching Han
2015-01-20 06:44:44
0
|
|
I found it, here it is "
string path = "c:\\database";
Symbol[] symbols = Symbols.GetSymbols();
for(int i=0;i < symbols.Length;i++)
{
Symbol sym = symbols[i];
HistoricalQuotes quotes = Quotes.GetHistoricalQuotes(sym.Name);
System.Text.StringBuilder builder = new System.Text.StringBuilder("");
for(int j=0;j < quotes.Close.Length;j++)
{
string line = quotes.Date[j].ToString("MM/dd/yyyy") + "," + quotes.Open[j] + "," + quotes.High[j] + "," + quotes.Low[j] + "," + quotes.Close[j] + "," + quotes.Volume[j] + "," + quotes.OpenInterest[j];;
builder.AppendLine(line);
}
System.IO.File.WriteAllText(path + "\\" + sym.Name + ".txt", builder.ToString());
}
|
|