Welcome Guest ( Log In | Register )

5 Pages < 1 2 3 4 > » Bottom

Outline · [ Standard ] · Linear+

 Stock Spreadsheet

views
     
Intimidated
post Mar 4 2020, 04:52 PM


***
Junior Member
499 posts

Joined: Dec 2007
QUOTE(hft @ Mar 4 2020, 02:38 PM)
Why need to use excel? Plenty of established free or by subscription tool available. You want to be successful or just having fancy excel sheet is the goal?
*
Some people just prefer a simple spreadsheet tracker that doesn’t require additional login/software biggrin.gif like me

I like to have one column for the actual amount paid (including fees) for the shares, one for how many shares I have, and one for the latest price (which I have now automated with the importxml formula!). Then some other fancy formatting like scale weightage conditional color formatting, blabla.

So it gives me a quick glance how much the real gain/loss is without me logging into another website or software. I already use Google Drive extensively for work biggrin.gif

EDITED: just realised I can scrape fund prices from Bloomberg for my FSM/other unit trust portfolios as well biggrin.gif now I can have a one-sheet tracker to tell me how are the investments doing, don’t have to login here there anymore

This post has been edited by Intimidated: Mar 4 2020, 04:55 PM
TS97fangkhai97
post Mar 5 2020, 03:37 AM

Getting Started
**
Junior Member
64 posts

Joined: Apr 2011
QUOTE(hft @ Mar 4 2020, 02:38 PM)
Why need to use excel? Plenty of established free or by subscription tool available. You want to be successful or just having fancy excel sheet is the goal?
*
Hi ! I actually am more comfy using Google Sheets/ Excel tbh. What other free or subscription tool do you know? I quite cheap skate cause I am still a student not willing to pay subscription smile.gif



TS97fangkhai97
post Mar 5 2020, 03:39 AM

Getting Started
**
Junior Member
64 posts

Joined: Apr 2011
QUOTE(Intimidated @ Mar 3 2020, 10:43 PM)
Oh I just tried on a stock that gained instead of loss

The class will be ‘up big16’ instead

So maybe can do like

IFERROR(importxml_with_up big16, importxml_with_down big16)
*
Can you explain the IFERROR part?

Thanks!
cucubud
post Mar 5 2020, 10:51 AM

Super Moderator
*******
Senior Member
3,076 posts

Joined: Jan 2008


QUOTE(Yggdrasil @ Mar 4 2020, 03:04 PM)
bmwcaddy

Rough guide how to get the data. Clean up later if you want.

Excel
1. Copy URL.
user posted image

2. In Excel, go to Data.
user posted image

3. Paste link.

user posted image

4. Navigate to the info you want. Easy way is to just import the whole table and hide the sheet we don't want. Click load.

user posted image

5. It will appear like this.

user posted image

6. Clean up if you want. My putting a master sheet with what you want to see and the other data in another sheet like this.

user posted image

7. Click refresh all when you want to get latest data.

user posted image
*
Thank you very much for the tutorial.
It works!!! thumbup.gif
Yggdrasil
post Mar 5 2020, 10:54 AM

Look at all my stars!!
*******
Senior Member
2,210 posts

Joined: Jan 2018
QUOTE(97fangkhai97 @ Mar 5 2020, 03:39 AM)
Can you explain the IFERROR part?

Thanks!
*
The formula will be long and complicated. Just use Bloomberg for Sheets. Solve the problem.
babychai
post Mar 5 2020, 02:00 PM

I go to work because my name is not in Forbes list
*****
Senior Member
779 posts

Joined: Apr 2008
From: Petaling Jaya



QUOTE(97fangkhai97 @ Mar 5 2020, 03:39 AM)
Can you explain the IFERROR part?

Thanks!
*
it's just a normal Excel formula. you can understand from this link https://www.excel-easy.com/examples/iferror.html
once understand then you can apply in google sheets as well
DexterLim93
post Apr 3 2020, 08:34 PM

Getting Started
**
Junior Member
100 posts

Joined: Aug 2018
QUOTE(hft @ Mar 4 2020, 02:38 PM)
Why need to use excel? Plenty of established free or by subscription tool available. You want to be successful or just having fancy excel sheet is the goal?
*
What tool would you suggest?
Nyckl3z
post Apr 13 2020, 02:44 AM

Getting Started
**
Junior Member
84 posts

Joined: Apr 2007


QUOTE(Yggdrasil @ Mar 3 2020, 10:39 PM)
I think I found it. For example, klse.i3investor.com

user posted image

1. Input the formula like usual: =importxml("https://klse.i3investor.com/servlets/stk/annrep/6084.jsp",
2. Use inspect element to highlight the data.

As you can see, the code starts with "td". So,
CODE
//td[@


3. 0.38 which is the data we need is next to "class", so
CODE
//td[@class='


4. Fill in with the remaining code. So,
CODE
//td[@class='down big16']


5. Final code:

CODE
=importxml("https://klse.i3investor.com/servlets/stk/annrep/6084.jsp","//td[@class='down big16']")


6. Results

user posted image
*
This is quite useful. And I realize the naming convention of KLSE URL is the stock code, so can use the concatenate(or &) formula and only need to amend the stock code.
i.e. ="https://klse.i3investor.com/servlets/stk/"&"Stock Code&".jsp"
y@nggene
post Apr 20 2020, 11:45 AM

Casual
***
Junior Member
372 posts

Joined: Feb 2009
QUOTE(Yggdrasil @ Mar 4 2020, 02:35 PM)
Hmm. klse.i3investor.com code is unstable as it changes everytime.

Use Bloomberg instead. E.g. for Sunreit:

CODE
=importxml("https://www.bloomberg.com/quote/SREIT:MK","//span[@class='priceText__1853e8a5']")

*
Hi,
how to get the price for day high only?

Thanks
Yggdrasil
post Apr 20 2020, 11:52 AM

Look at all my stars!!
*******
Senior Member
2,210 posts

Joined: Jan 2018
QUOTE(y@nggene @ Apr 20 2020, 11:45 AM)
Hi,
how to get the price for day high only?

Thanks
*
Try this

CODE
=importxml("https://www.bloomberg.com/quote/SREIT:MK","//span[@class='textRight__9a2b77e6']")

y@nggene
post Apr 20 2020, 12:23 PM

Casual
***
Junior Member
372 posts

Joined: Feb 2009
QUOTE(Yggdrasil @ Apr 20 2020, 11:52 AM)
Try this

CODE
=importxml("https://www.bloomberg.com/quote/SREIT:MK","//span[@class='textRight__9a2b77e6']")

*
I tried this
But it will fetch 52 weeks price also. The code is identical. But i dont know how to limit to day range high price only.
Yggdrasil
post Apr 20 2020, 12:24 PM

Look at all my stars!!
*******
Senior Member
2,210 posts

Joined: Jan 2018
QUOTE(y@nggene @ Apr 20 2020, 12:23 PM)
I tried this
But it will fetch 52 weeks price also. The code is identical. But i dont know how to limit to day range high price only.
*
It fetched the day high for me. Not sure why it doesn't work for you.
y@nggene
post Apr 20 2020, 12:26 PM

Casual
***
Junior Member
372 posts

Joined: Feb 2009
QUOTE(Yggdrasil @ Apr 20 2020, 12:24 PM)
It fetched the day high for me. Not sure why it doesn't work for you.
*
52 weeks 1.98 will come up at bottom....


Attached thumbnail(s)
Attached Image
Yggdrasil
post Apr 20 2020, 12:28 PM

Look at all my stars!!
*******
Senior Member
2,210 posts

Joined: Jan 2018
QUOTE(y@nggene @ Apr 20 2020, 12:26 PM)
52 weeks 1.98 will come up at bottom....
*
Just hide the cell. Can't help it I think because both share the same code.
y@nggene
post Apr 20 2020, 12:29 PM

Casual
***
Junior Member
372 posts

Joined: Feb 2009
QUOTE(Yggdrasil @ Apr 20 2020, 12:28 PM)
Just hide the cell. Can't help it I think because both share the same code.
*
Noted. Thanks alot
y@nggene
post Apr 20 2020, 05:31 PM

Casual
***
Junior Member
372 posts

Joined: Feb 2009
QUOTE(Yggdrasil @ Apr 20 2020, 12:28 PM)
Just hide the cell. Can't help it I think because both share the same code.
*
The stock price from xml will not update automatically?
Yggdrasil
post Apr 20 2020, 05:38 PM

Look at all my stars!!
*******
Senior Member
2,210 posts

Joined: Jan 2018
QUOTE(y@nggene @ Apr 20 2020, 05:31 PM)
The stock price from xml will not update automatically?
*
Should auto update but you may need to refresh the page.
steyip531 P
post Apr 30 2020, 01:22 AM

New Member
*
Probation
1 posts

Joined: Apr 2020
QUOTE(Yggdrasil @ Mar 3 2020, 10:39 PM)

I think I found it. For example, klse.i3investor.com

https://i.imgur.com/vuALlpW.png 

1. Input the formula like usual: =importxml("https://klse.i3investor.com/servlets/stk/annrep/6084.jsp",
2. Use inspect element to highlight the data.

As you can see, the code starts with "td". So,
CODE
//td[@


3. 0.38 which is the data we need is next to "class", so
CODE
//td[@class='


4. Fill in with the remaining code. So,
CODE
//td[@class='down big16']


5. Final code:

CODE
=importxml("https://klse.i3investor.com/servlets/stk/annrep/6084.jsp","//td[@class='down big16']")


6. Results

https://i.imgur.com/kGqiqEZ.png 
*



Hey bro, I trying to follow what you guys done here with KLSE Screener. I use IMPORTHTML to get the table I want but again, it is abit tricky to import the price

This is the code : =IMPORTXML("https://www.klsescreener.com/v2/stocks/view/"A2,"//spanid='price'")

A2 is the cell/stock code, and the remaining is modified according to what you guys done, it is originally from KLSE Screener element for price display.
But at the end it does not show anything, just blanked. Could you please lookup for me, please sweat.gif I feeling like just one small step away from success



Yggdrasil
post Apr 30 2020, 09:18 AM

Look at all my stars!!
*******
Senior Member
2,210 posts

Joined: Jan 2018
QUOTE(steyip531 @ Apr 30 2020, 01:22 AM)
Hey bro, I trying to follow what you guys done here with KLSE Screener. I use IMPORTHTML to get the table I want but again, it is abit tricky to import the price
This is the code : =IMPORTXML("https://www.klsescreener.com/v2/stocks/view/"A2,"//spanid='price'")
A2 is the cell/stock code, and the remaining is modified according to what you guys done, it is originally from KLSE Screener element for price display.
But at the end it does not show anything, just blanked. Could you please lookup for me, please sweat.gif  I feeling like just one small step away from success
*
A2 cell:
CODE
http://www.klsescreener.com/v2/stocks/view/0656HK


CODE:
CODE
=importxml(A2,"//span[@id='price']")


P.S.: To others, stop asking me anymore dry.gif Tired of this. Just trial and error please.

This post has been edited by Yggdrasil: Apr 30 2020, 09:19 AM
plumberly
post May 4 2020, 09:44 AM

Look at all my stars!!
*******
Senior Member
4,761 posts

Joined: Jun 2007
From: My house


QUOTE(Intimidated @ Mar 4 2020, 04:52 PM)
Some people just prefer a simple spreadsheet tracker that doesn’t require additional login/software biggrin.gif like me

I like to have one column for the actual amount paid (including fees) for the shares, one for how many shares I have, and one for the latest price (which I have now automated with the importxml formula!). Then some other fancy formatting like scale weightage conditional color formatting, blabla.

So it gives me a quick glance how much the real gain/loss is without me logging into another website or software. I already use Google Drive extensively for work biggrin.gif

EDITED: just realised I can scrape fund prices from Bloomberg for my FSM/other unit trust portfolios as well biggrin.gif now I can have a one-sheet tracker to tell me how are the investments doing, don’t have to login here there anymore
*
Excellent! I have the same desire to have all my data on a page and with my own analysis calculations.

Currently, I am importing historical data from different web sites, cut and paste the data into a spreadsheet for my calculations and graphing. Find that tedious. So an auto data gathering spreadsheet will be my dream.

I hope that you can help when I go back to work on this spreadsheet.

Thanks.

P/S Get the latest data or also historical data from your method?

5 Pages < 1 2 3 4 > » Top
 

Change to:
| Lo-Fi Version
0.0256sec    0.51    6 queries    GZIP Disabled
Time is now: 21st December 2025 - 06:34 AM