Linux - Software This forum is for Software issues.
Having a problem installing a new program? Want to know which application is best for the job? Post your question in this forum. |
Notices |
Welcome to LinuxQuestions.org, a friendly and active Linux Community.
You are currently viewing LQ as a guest. By joining our community you will have the ability to post topics, receive our newsletter, use the advanced search, subscribe to threads and access many other special features. Registration is quick, simple and absolutely free. Join our community today!
Note that registered members see fewer ads, and ContentLink is completely disabled once you log in.
Are you new to LinuxQuestions.org? Visit the following links:
Site Howto |
Site FAQ |
Sitemap |
Register Now
If you have any problems with the registration process or your account login, please contact us. If you need to reset your password, click here.
Having a problem logging in? Please visit this page to clear all LQ-related cookies.
Get a virtual cloud desktop with the Linux distro that you want in less than five minutes with Shells! With over 10 pre-installed distros to choose from, the worry-free installation life is here! Whether you are a digital nomad or just looking for flexibility, Shells can put your Linux machine on the device that you want to use.
Exclusive for LQ members, get up to 45% off per month. Click here for more info.
|
 |
|
03-16-2019, 10:49 AM
|
#1
|
Senior Member
Registered: Oct 2018
Location: Surrey UK
Distribution: Mint 20 xfce 64bit
Posts: 1,042
Rep: 
|
LibreOffice Calc -Stock market (equities) price updates
Hi,
I'm looking for a method to update a portfolio of stocks (equities) I track in a LibreOffice Calc spreadsheet automatically, somewhat like the Googlefinance functions you can use on a Google Docs spreadsheet in Chrome, e.g. =GoogleFinance("LON.BP.","price") would return the value of a share in BP on the London stock exchange.
|
|
|
03-16-2019, 06:50 PM
|
#2
|
Member
Registered: Apr 2013
Location: Massachusetts
Distribution: Debian
Posts: 529
|
I suppose you could use wget or curl to grab the data and your own script to put it into a csv file which can be opened in Calc. A nice little programming project.
|
|
|
03-16-2019, 07:11 PM
|
#3
|
LQ Veteran
Registered: Feb 2013
Location: Tucson, AZ, USA
Distribution: Rocky 9.6
Posts: 5,902
|
Excel has/had a "remote data" option which would pull data from a URL. Does Calc have the same ability?
Help menu can be your friend.
|
|
|
03-16-2019, 07:14 PM
|
#4
|
Member
Registered: Feb 2013
Location: Germany, EU
Distribution: Debian (stable release)
Posts: 67
Rep:
|
LibreOffice has =webservice (and =importxml) to call from JSON files. You will need links but I only know links to grab BTC exchange courses.
Another alternative is to "insert sheet" from online or from a file and then you can choose an online link. From that sheet you can export data to your original sheet.
Last edited by äxl; 03-16-2019 at 07:28 PM.
|
|
1 members found this post helpful.
|
03-17-2019, 10:37 AM
|
#5
|
Senior Member
Registered: Oct 2018
Location: Surrey UK
Distribution: Mint 20 xfce 64bit
Posts: 1,042
Original Poster
Rep: 
|
Quote:
Originally Posted by äxl
LibreOffice has =webservice (and =importxml) to call from JSON files. You will need links but I only know links to grab BTC exchange courses.
Another alternative is to "insert sheet" from online or from a file and then you can choose an online link. From that sheet you can export data to your original sheet.
|
I've seen this in my searches:
Code:
=NUMBERVALUE(WEBSERVICE("http://download.finance.yahoo.com/d/quotes?s="&U4&"&f=l1"),".")
where U4 cell contains LON:RDSB = i.e. Royal Dutch Sheel (B) shares on the London Stock exchange
But no luck getting it to work.
curl and wget look possible, need to see how they work first.
Cheers folks
|
|
|
03-17-2019, 11:21 AM
|
#6
|
Senior Member
Registered: Oct 2018
Location: Surrey UK
Distribution: Mint 20 xfce 64bit
Posts: 1,042
Original Poster
Rep: 
|
Okay folks I've found this:
This page:
https://www.bloomberg.com/markets/chart/data/1D/ulvr:ln
returns this:
Code:
precision 2
prev_close 4193
data_values
The data I want in a cell is on line 2 second item: 4193
I've tried webservice:
Code:
=webservice"https://www.bloomberg.com/markets/chart/data/1D/ulvr:ln"
and get an error This
Code:
=WEBSERVICE("https://www.bloomberg.com/markets/chart/data/1d/ulvr:ln")
doesn't error, but doesn't return anything.
It's getting close I think but I need help on the syntax, google hasn't found anything useful so far
Cheers
|
|
|
03-17-2019, 12:00 PM
|
#7
|
LQ Veteran
Registered: Feb 2013
Location: Tucson, AZ, USA
Distribution: Rocky 9.6
Posts: 5,902
|
|
|
|
03-17-2019, 12:26 PM
|
#8
|
Member
Registered: Feb 2013
Location: Germany, EU
Distribution: Debian (stable release)
Posts: 67
Rep:
|
Quote:
Originally Posted by GPGAgent
I've seen this in my searches:
Code:
=NUMBERVALUE(WEBSERVICE("http://download.finance.yahoo.com/d/quotes?s="&U4&"&f=l1"),".")
where U4 cell contains LON:RDSB = i.e. Royal Dutch Sheel (B) shares on the London Stock exchange
But no luck getting it to work.
curl and wget look possible, need to see how they work first.
Cheers folks
|
My search engine says that download.finance.yahoo.com is down since Jan. 2018.
Maybe use https://finance.yahoo.com/quote/RDS-B?p=RDS-B ?
My VPN is blocked from Bloomeberg so can't test right now.
If curl/wget don't work maybe also try this:
https://help.libreoffice.org/Calc/In...Table_WebQuery
|
|
|
03-17-2019, 12:35 PM
|
#9
|
Senior Member
Registered: Oct 2018
Location: Surrey UK
Distribution: Mint 20 xfce 64bit
Posts: 1,042
Original Poster
Rep: 
|
Quote:
Originally Posted by äxl
|
Yep that's right about Yahoo, I knew that.
Bloomberg works fine for me, I can see the share price, I just need to get it into a cell!
|
|
|
06-09-2019, 07:25 AM
|
#10
|
LQ Newbie
Registered: Jun 2019
Posts: 2
Rep: 
|
You could use Alpha Vantage API and PARSEJSON function from LibreOffice GetRest Plugin to get a stock quote.
|
|
|
11-24-2020, 11:36 AM
|
#12
|
LQ Newbie
Registered: Nov 2020
Posts: 2
Rep: 
|
Minor improvement
Just find a way to do the thing without pluging, besides the poor performance, it may be enough for an user use case.
Code:
=NUMBERVALUE(
REGEX(
REGEX(
SUBSTITUTE(
WEBSERVICE(
"https://www.alphavantage.co/query?function=GLOBAL_QUOTE&symbol="& <<YOUR TICKET>> &"&apikey="& << YOUR API KEY >>
),
$B$2,
"*"
),
".*price"": """,
"",
"g"
),
""",.*",
"",
"g"
),
"."
)
Ghe $B$2 is a cell with a new line "\n" I could not find how to represent that character inside a string.
|
|
|
12-30-2020, 11:38 AM
|
#14
|
Member
Registered: Jun 2009
Location: Cleveland, TN
Distribution: Mint 21.3
Posts: 527
Rep:
|
This may be a piece of useless information considering that Yahoo appears not to be available. I was unable to figure out how the code worked. The only real reason for posting the link below is that others may find elements of the code useful
Bash script for Yahoo Finance historical data.
I've been curious concerning how to download stock prices. Since I am able to download stock prices with KMyMoney, I have not put much effort into developing a bash script to download stock prices.
|
|
|
12-30-2020, 01:16 PM
|
#15
|
LQ Newbie
Registered: Dec 2020
Posts: 2
Rep: 
|
Quote:
Originally Posted by Steve R.
This may be a piece of useless information considering that Yahoo appears not to be available. I was unable to figure out how the code worked. The only real reason for posting the link below is that others may find elements of the code useful
Bash script for Yahoo Finance historical data.
I've been curious concerning how to download stock prices. Since I am able to download stock prices with KMyMoney, I have not put much effort into developing a bash script to download stock prices.
|
Not sure what your question is - do you have a specific question about the Python code or the accompanying README? Have you tried the extension from Calc?
|
|
|
All times are GMT -5. The time now is 11:07 PM.
|
LinuxQuestions.org is looking for people interested in writing
Editorials, Articles, Reviews, and more. If you'd like to contribute
content, let us know.
|
Latest Threads
LQ News
|
|