|
Xavier Baez
2018-06-11 22:45:59
|
|
I am exporting my Quantshare database to my hard drive
It is divided in NASDAQ, AMEX, NYSE
HEre is the script
Symbol[] symbols = Symbols.GetSymbols();
System.Text.StringBuilder text = new System.Text.StringBuilder("");
text.AppendLine("SYMBOL,INTERVAL,DATA,OPEN,HIGH,LOW,CLOSE,VOLUME");
for(int i=0;i < symbols.Length;i++)
{
Symbol sym = symbols[i];
if (sym.Market == "NASD") {
HistoricalQuotes quotes = Quotes.GetHistoricalQuotes(sym.Name);
for(int j=0;j < quotes.Close.Length;j++)
{
double day = quotes.Date[j].Day;
double month = quotes.Date[j].Month;
double year = quotes.Date[j].Year;
if(month >= 1 && day >=1 && year >= 2013) // Specify Period of data exporting
{
text.AppendLine(sym.Name + "," + "D" + "," + quotes.Date[j].ToString("d/MM/yyyy") + " 12:00:00 AM" + "," + quotes.Open[j]+ "," + quotes.High[j] + "," + quotes.Low[j] + "," + quotes.Close[j] + "," + quotes.Volume[j]);
}
}
}
}
System.IO.File.WriteAllText(@"C:\quantshare.nasdaq.csv", text.ToString());
However, I would like to also export the database so I can have
C:\ALUMINUM\quantshare.aluminum.csv
C:\SOFTWARE\quantshare.software.csv
I would also like to know if it would be possible to have the S&P 500
C:\S&P500\quantshare.s&p500.csv
Thanks
|
|