No support for countries other than USA

Bug #1040191 reported by Prasanna Kumar
20
This bug affects 3 people
Affects Status Importance Assigned to Milestone
protoborsa
Confirmed
Low
Andrea De Gaetano

Bug Description

Application does not load information of companies that are not in USA. This application is supposed to be generic and it will be great if it could support stock information of non-USA companies.

Revision history for this message
Andrea De Gaetano (dega1999) wrote :

Thanks you for your report..
I will check if it is possible to also add european markets..
I'm using yahoo finance data.. so if their api doesn't support it, it is a more complex problem.

Changed in protoborsa:
assignee: nobody → Andrea De Gaetano (dega1999)
importance: Undecided → Low
status: New → Confirmed
Revision history for this message
Prasanna Kumar (prasannatsmkumar) wrote :

Thanks for your attention. It would be great if you could add support for Indian market (BSE and NSE are the stock exchanges and in yahoo finance data the suffixes are .BS and .NS respectively). The quote can be obtained by using <company>.BS or <company>.NS. I am able to get the data using the ystockquote python library in this way. I guess it is possible to add this to your code.

I will try to look into your code and get a patch if possible but please keep up your good work.

Revision history for this message
Andrea De Gaetano (dega1999) wrote :

Hey Prasanna!
thanks you, I appreciate so much.

if it is just a matter of symbols...it is easy
The list of suffixes with description is taken from the sqlite database present in your home .protoborsa folder after installation.
So the first hack you can try is read the sqlite db content and try to add in the tables the new companies manually (with sql syntax).

I can make a UI patch.. in 1 or 2 weeks (I'm a little busy) with the possibility to add manually the stocks suffixes in the list...

Can you give me some example suffix for indian market?

Revision history for this message
Prasanna Kumar (prasannatsmkumar) wrote :

Yeah I found one sqlite database in the data directory but I was not able to open the database using Libre Office base. I did not give much try after that. Yes I understood that adding entries to the db will solve the issue. But I don't have a list of scrips to add and also I don't have tool to add (I was lazy to write sql code).

Thanks for your response. BHEL.BO (for Bombay Stock Exchange) and BHEL.NS (National Stock Exchange) are scrip code for BHEL company (India has 2 big stock exchanges). Feel free to ask if you need more info.

Changed in protoborsa:
status: Confirmed → New
Revision history for this message
Manfred Hampl (m-hampl) wrote :

In response to this Bug report and a question https://answers.launchpad.net/ubuntu/+question/207932 I have played around with protoborsa (12.07.17ubuntu1) and found out the following:

1. Ticker symbols can be added manually with limited effort:
You need the sqlite3 user interface installed (apt-get install sqlite3)
open a terminal and issue the command
sqlite3 ~/.protoborsa/stocksymbols.db
inside sqlite3 at the 'sqlite>' prompt enter this SQL command:
insert into "Symbols" values ('BHEL.BO','Bharat Heavy Electricals Ltd.','bharat heavy electricals ltd.');
close sqlite3 with the command
.exit
(The three Fields in the list are the ticker symbol, the company name, and the company name in lower case letters)
I have no clue how to receive a complete list of ticker symbols for the companies where finance.yahooo.com provides data. Such list could easily be uploaded into the stocksymbold.db database - either by creating SQL commands, or with a mass upload function of the sqlite3 program.

2. The currency displayed in protoborsa always is US Dollars ($), even if the data from Yahoo are in a different currency.
According to http://code.google.com/p/yahoo-finance-managed/wiki/enumQuoteProperty you can request the currency by the symbol c4. It should no be too complicated to request the currency symbol from yahoo and use that instead of the strings '$' resp. 'Dollars'

1. Yahoo finance does not have complete historical data for all companies they deliver quotes. I found a case where the data for the past month are missing.
http://ichart.finance.yahoo.com/table.csv?s=TKA.VI&a=09&b=21&c=2012&d=10&e=22&f=2012&g=d&ignore=.csv
In that case the download does not produce data, but a plain html page. Protoborsa in turn does not produce any error message, but just leaves the previous graphic displayed.
I guess some of the programs (maybe ystockquote.py) have to be extended to make provisions for such cases. (I am not experienced in python programming, so I do not know if it would be easy e.g. just to clear the stock graphics area whenever another ticker symbol is selected to make sure that no old data stay on screen.)

4. You can search only for company names, but not for ticker symbols.
Maybe a small change in personaldata.py - getAllStockSymbolsPattern(pattern) would solve that:
extend
 return selectAndFetchQuery("select Symbol, Naming from symbols where lnaming like '"+pattern+"%';" );
to
 return selectAndFetchQuery("select Symbol, Naming from symbols where (lnaming like '"+pattern+"%' or Symbol like '"+pattern.upper()+"%' );" );

5. When I click on About, and the close the About dialog, the whole program is closed.

Changed in protoborsa:
status: New → Confirmed
Revision history for this message
Prasanna Kumar (prasannatsmkumar) wrote :

1. To get list of symbols can be obtained as described in http://stackoverflow.com/questions/5246843/how-to-get-a-complete-list-of-ticker-symbols-from-yahoo-finance (not stragith forward though).

2. Adding a list of symbols is difficult if done manually - first list of symbols is needed to do that.

Sounds good regarding the currency.

The search is slow as I guess search is done using sql - the full list of stocks can be stored in a array or dictionary and can be searched for. I guess it will be easier.

Revision history for this message
Prasanna Kumar (prasannatsmkumar) wrote :

YSS Project seems to be a great place to get all the Yahoo Stock Symbols - http://sourceforge.net/projects/yss/.

1. Option to add symbols using the above project or some way has to be added.
2. Optimising search like searching from data in memory than using sql query to search - not tested this but this may be the reason for very slow search.
3. Removing crashes.

If these three thing gets implemented protoborsa will become great software :).

Revision history for this message
NonnoEmilio (lameo40) wrote :

Dear Andrea, would it be too difficult to solve the problem taking the data directly from the Bombay stock exchange or the Milan borsa or any other country's instead of yahoo finance? This could also solve the currency problem because if you take data from the local burse it would use the local currency.
Thank you and regards.
Best season greetings.

Emilio lambrini

Revision history for this message
Prasanna Kumar (prasannatsmkumar) wrote :

Hi Emilio,

The scrip list and code can be taken from Bombay Stock Exchange but Yahoo finanace's way of storing things seems to be different - I think it is based on the code of National Stock Exchange (another major stock exchange in India). Yahoo Finance suffixes .BO for BSE and .NS for NSE. Even though the company list is available in various websites there is no file to download. Every website that has the list shows the company list alphatically or in some other way. Only thing possible is minig the data from these websites.

Trying to find out some other way to do get the data.

Regards,
Prasanna Kumar

Revision history for this message
Andrea De Gaetano (dega1999) wrote :

Hello,
 I really appreciate your interests also the workaround explanations and advice.
It is easy to make some changes based on yahoo stock exchange.. but it is really not easy to catch the data from other site... it is just not a matter of changing an url, cause the format of the data from other website is different...

BTW, In these months since the release.. I was very busy and I didn't find the time to make the fixes...but xmas holidays are near!
I will make some change before the end of the year (2012).

anyone knows, Where can I find the list of other suffixes for the other Market?(like in the #2 comment)
Thanks you all

Revision history for this message
Prasanna Kumar (prasannatsmkumar) wrote :

If a plugin infrastructure is provided it will be great. Assume this application gets data from a python class (here ystockquotes library) which can be replaced by another class (some new library). Create interfaces the application needs - the class which implements reading from some site and providing values can confirm to the interface. Then it will be easy for others to get the information from any site and use it - anyone can write a similar class. In short what I mean to say is - instead of ystockquote anyone must be capable of writing a class (library) which can fetch the data and provide it. If little work is done it is possible to do this. Once this is done many problems can be solved I think.

To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Related questions

Remote bug watches

Bug watches keep track of this bug in other bug trackers.