Click here to Login





                                                   Export database by industry list

  0

0
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



No more messages
0




Reply:

No html code. URLs turn into links automatically.

Type in the trading objects you want to include: - Add Objects
To add a trading object in your message, type in the object name, select it and then click on "Add Objects"










QuantShare

Trading Items
Stock Industry Position
Industry Fundamental Data
Export Indicators Data with Filtering and Column Labels Support
Export Indicators Data
Earnings database

How-to Lessons
How to export trading data to a CSV file
How to quickly select stocks based on the last value of a databas...
How to associate an index with a list of stocks
How to import your own list of stocks/symbols
How to import trades into a portfolio

Related Forum Threads
Export to CSV the whole database including symbols
Export Custom Database data - all symbols - including text fields
Can I update the sector and industry information in the stock dat...
Create and Export each database for each market
How to export historical data for a list of symbols

Blog Posts
How to Backtest Your Trading System for Each Industry
Export Trading Orders from a Portfolio to a File
Let QuantShare Manage your List of Securities
How to Create a List of Ticker Symbols
Industry Analysis - How to Compare Stocks with their Industries









QuantShare
Product
QuantShare
Features
Create an account
Affiliate Program
Support
Contact Us
Trading Forum
How-to Lessons
Manual
Company
About Us
Privacy
Terms of Use

Copyright © 2024 QuantShare.com
Social Media
Follow us on Facebook
Twitter Follow us on Twitter
Google+
Follow us on Google+
RSS Trading Items



Trading financial instruments, including foreign exchange on margin, carries a high level of risk and is not suitable for all investors. The high degree of leverage can work against you as well as for you. Before deciding to invest in financial instruments or foreign exchange you should carefully consider your investment objectives, level of experience, and risk appetite. The possibility exists that you could sustain a loss of some or all of your initial investment and therefore you should not invest money that you cannot afford to lose. You should be aware of all the risks associated with trading and seek advice from an independent financial advisor if you have any doubts.