Welcome Guest ( Log In | Register )

Bump Topic Topic Closed RSS Feed

Outline · [ Standard ] · Linear+

 Fundsupermart.com v11, Grexit or not, Europe will sail on...

views
     
idyllrain
post Jul 12 2015, 12:57 AM

Getting Started
**
Junior Member
78 posts

Joined: Apr 2008
If anyone's interested, I've added the following code in polarzbearz IRR Excel sheet to obtain the latest NAV prices from FSM with just one click (I attached the macro to a button).

CODE
Sub GetFundPrices()
   Set WS = Worksheets("Investment Details")
   Set htm = CreateObject("htmlFile")
   Set XML = CreateObject("msxml2.xmlhttp")
   
   Dim i As Long
   Dim lastRow As Long
   lastRow = WS.Range("C:C").Find(What:="*exit*", LookIn:=xlValues).Row

   'From first row all the way to the row containing the value *exit*'
   For i = 1 To lastRow
       'If this row is a group header row (Column A has a value of 1)'
       If WS.Cells(i, 1).Value = "1" Then
           Dim fundName As String

           'Get the fund code'
           fundName = WS.Cells(i, 3).Value
       
           'Download the correct price list'
           XML.Open "GET", "http://www.fundsupermart.com.my/main/fundinfo/dailyPricesHistory.tpl?id=" & fundName, False
           XML.send
           If XML.ReadyState = 4 And XML.Status = 200 Then
               htm.body.innerHTML = XML.responsetext

               On Error GoTo ErrHandler:
                   'Get all 4 cells in the first row of data'
                   Set FirstRow = htm.getElementsByTagName("tr")(2).Children
                   
                   'Update date value from 4th table cell of first row'
                   WS.Cells(i, 4).Value = FirstRow(3).innerText
                   
                   'Update NAV value from the DIV element in the 3rd table cell of first row'
                   WS.Cells(i, 9).Value = FirstRow(2).FirstChild().innerText
           End If
       End If
   Next i

   Exit Sub

ErrHandler:
   MsgBox ("Cannot load data. Either the FSM Code is incorrect or FundSuperMart is down.")
End Sub


As this code relies on FSM's price list pages, if there's any changes to that in the future, this code will break. The only modifications done on the table was changing Column C into the Fund Codes used at FundSuperMart (You can get these from the URL: http://www.fundsupermart.com.my/main/fundi...do?sedolnumber=MYKNGGF) and adding the value "*exit*" into the final row of Column C. Like this:
user posted image

Also, the formula for the Units calculation in Column M will sometimes result in an amount that doesn't reflect the value shown on FSM's website as the rounding order is different.
» Click to show Spoiler - click again to hide... «

QUOTE
Edit 12/7: Testing by polarzbearz reveals that my modification to the rounding formula is still not the formula that FSM uses [ Link to post ]


This post has been edited by idyllrain: Jul 12 2015, 05:45 PM
idyllrain
post Jul 12 2015, 03:19 PM

Getting Started
**
Junior Member
78 posts

Joined: Apr 2008
Here's my modified copy (with some slight differences): https://www.dropbox.com/s/r9vv8oib6blxia3/P...bearz.xlsm?dl=0

Modifications I've made:
Added macro to obtain fund prices (Options -> Customize Ribbon -> Developer tab)
If you are not comfortable with code, I highly suggest that you don't use this file and let polarzbearz look at the code, verify that it doesn't do anything malicious then include it into his version. As this file contains a macro, it will trigger security warnings and you will need to enable macros in order to use it. You have to do this only once.
user posted image

The macro code in this file is slightly different than the one I posted above. The differences in this file is just that I added a message indicator saying what is being updated so that if something fails you'll know which fund is causing the problem:
» Click to show Spoiler - click again to hide... «

Code here for auditing:
» Click to show Spoiler - click again to hide... «

Changed "Investment Details" table into range (Table Design tab -> Convert to Range)
Since I just want to insert rows by "Select rows -> right click -> insert copied cells" *and* I don't really want to have tons of placeholder rows, I converted it to a normal range. The only downside to this, is that Excel will not autofill the formulas for you. However, it is really really simple to do that manually:
- Shift + spacebar (This selects the row if its not already selected)
- Ctrl + D (This takes the formula from the row above and fills it into the current row)
» Click to show Spoiler - click again to hide... «

I removed the dummy values for the IRR calculations
Since I don't have any retired funds... I understand they're there to fix a summary bug

Changed unit amount rounding order
» Click to show Spoiler - click again to hide... «

QUOTE
Edit 12/7: Testing by polarzbearz reveals that my modification to the rounding formula is still not the formula that FSM uses [ Link to post ]


This post has been edited by idyllrain: Jul 12 2015, 05:46 PM
idyllrain
post Jul 12 2015, 03:33 PM

Getting Started
**
Junior Member
78 posts

Joined: Apr 2008
QUOTE(polarzbearz @ Jul 12 2015, 03:28 PM)
I'm currently modifying your original source (the first one which was provided), mainly on the ErrHandling part - so that the code continues to execute (for subsequent fund updates) even if there was error, and provides a summary at end of execution.

Awesome! Time for me to lurk again~
idyllrain
post Jul 12 2015, 05:27 PM

Getting Started
**
Junior Member
78 posts

Joined: Apr 2008
QUOTE(yklooi @ Jul 12 2015, 03:42 PM)
why is that when I tried to click on that link.....
it shows this....
(I just wanted to see what is the code for my funds...sort of a lists of them)
*
Thats because when I bolded the "code" part of the URL, the link got broken.

Broken: http://www.fundsupermart.com.my/main/fundi...do?sedolnumber=MYKNGGF (the bold part cannot be clicked)
Same Link without Bold: http://www.fundsupermart.com.my/main/fundi...lnumber=MYKNGGF
Price list that the excel macro gets: http://www.fundsupermart.com.my/main/fundi....tpl?id=MYKNGGF

This post has been edited by idyllrain: Jul 12 2015, 05:30 PM
idyllrain
post Jul 12 2015, 05:40 PM

Getting Started
**
Junior Member
78 posts

Joined: Apr 2008
QUOTE(polarzbearz @ Jul 12 2015, 05:35 PM)
Regarding the above formula, I have tested with my sample (which is relatively small also) and seems like it will still sometime returns wrong decimal calculation (which requires manual transaction adjustment). Need to test further on the rounding but guess I'll leave it untouched in coming version for now.

Surprisingly, some of the transaction which requires "Manual Adjustment" were fixed with your formula, but some of those transaction which was accurate (no issues) now requires manual adjustment laugh.gif
*
smile.gif In that case then yeah, I agree its best to use your version. I'll update my posts to reflect your findings.
idyllrain
post Jul 13 2015, 01:09 PM

Getting Started
**
Junior Member
78 posts

Joined: Apr 2008
QUOTE(polarzbearz @ Jul 12 2015, 06:57 PM)
Released v2.0 of the Portfolio Summary worksheet, with "Fund Update" features to fetch latest NAV price from FSM directly.
polarzbearz I just noticed that the msxml2.xmlhttp object we've used in our code appears to cache responses from the FSM server . If you have run the code once, and you don't exit Excel, and FundSuperMart updates their prices, and you run the code again, none of the prices in the Excel sheet will update to the latest (for non-techies, it means that Excel is storing old data and reusing it). (This caching is the reason why subsequent executions of the macro code are faster.)

To get past this, I've swapped to using the winhttp.winhttprequest.5.1 object that does not cache. These are the lines that need to be changed (I changed the variable name as well):
CODE
-- Set XML = CreateObject("msxml2.xmlhttp")
++ Set Conn = CreateObject("winhttp.winhttprequest.5.1")

-- If XML.ReadyState = 4 And XML.Status = 200 Then
++ If Conn.Status = 200 Then

p/s: While waiting for him to update his file, you can force an update by just saving, exiting Excel, open the file again, and run the code. This issue is just a minor annoyance. smile.gif

This post has been edited by idyllrain: Jul 13 2015, 02:04 PM
idyllrain
post Sep 25 2015, 11:26 PM

Getting Started
**
Junior Member
78 posts

Joined: Apr 2008
QUOTE(dexk @ Sep 25 2015, 11:03 PM)
Why you guys call it Ponzi but some recommend buy?
Just a nickname coz the short term historical returns have been very good.
idyllrain
post Sep 26 2015, 12:24 AM

Getting Started
**
Junior Member
78 posts

Joined: Apr 2008
QUOTE(larisSa @ Sep 25 2015, 11:35 PM)
Can't we just use the simple maths calculation of selling price of  NAV   minus   initial buying price of NAV?
That's basically ROI after averaging out the cost/unit. smile.gif

QUOTE(larisSa @ Sep 25 2015, 11:35 PM)
If I am not mistaken ,one post here says XIRR is actually IRR?sorry but I am really very confused and i have no financial background concerning all these excel formula(I think they are excel lah)
*
XIRR and IRR are both Excel functions that calculate IRR. The main difference is that XIRR can deal with random dates, while IRR assumes the values you give it to be periodic. The XIRR function gives you an annualized rate though, so if your data is less than year it'll give you big numbers:
user posted image

Here are some examples of the different return rate formulas used:
user posted image

Note that ROI and CAGR (a.k.a Annualized return) calculated the same values for all scenarios, these two measures are not time-sensitive: ROI measures the absolute return over cost of investment irrespective of how long it will take to get that rate, CAGR gives you the average return per year that your investment is compounding at.

IRR on the other hand takes into account the time-value of money, i.e. RM10 today is worth more than RM10 next year. To understand IRR more, you'll need to learn about NPV (Net Present Value, i.e what's the current value of a particular sum of money that you will get in the future).

This post has been edited by idyllrain: Sep 26 2015, 06:15 AM
idyllrain
post Oct 1 2015, 02:11 AM

Getting Started
**
Junior Member
78 posts

Joined: Apr 2008
QUOTE(larisSa @ Sep 30 2015, 11:47 PM)
1) Concerning IRR/XIRR, when I read articles online, they give me example of anticipated income/earnings. In real life, we only start calculating IRR/XIRR after we have invested, is it?
*
In our case (as in Polarzbearz's file), we are using the "lump sum returns" example but instead of the anticipated date being a time in the future, we just move it back to today. Like this:
user posted image

QUOTE(larisSa @ Sep 30 2015, 11:47 PM)
2) For investors who top up irregularly(regardless of the amount) should opt for XIRR whereas for investors who top up regularly(regardless of amount) should go for IRR in excel calculation?
*
Nah, both XIRR and IRR Excel functions will give you the same result if your top-ups/dividends are regular (see the second example "Periodic Returns"). They are just different "methods" of calculating the Internal Rate of Return (IRR). You can think the difference between the two methods like this: XIRR tries to be as accurate as possible by asking you when you received dividends and when you invested, IRR assumes you always get dividends/perform investments at the same day every week/month/year.

QUOTE(larisSa @ Sep 30 2015, 11:47 PM)
3) I have opened polarbearz excel file and seriously, it is really superb duper confusing rclxub.gif  rclxub.gif . I look at the instructions I also cannot make sense of it.Eg:"add new set of fund" vs "add new row of fund". Is it linked to fundsupermart directly because I see a tab "update current fund price"?
I just want to start investing and this file is  like killing me.or should I learn to make sense of it later?
*
You don't need to worry about the file, it is only used for tracking your investments in greater detail because FSM's website has the information scattered in different places after you've logged in. It is also not live linked to FSM; the "Update Current Fund Price" button is just a convenience feature that will go to FSM's website and get the latest NAVs of the funds you put in the Excel file.

Highlighted in yellow is "A Row of Fund", marked with blue is "A Group of Fund"
user posted image

QUOTE(larisSa @ Sep 30 2015, 11:47 PM)
4)As mentioned above, I just want to start investing. I know sifus here must be sick of hearing it" What funds should I invest in" but this is really my question. I look at the past performace of Ponzi 2.0,RHB Asia Total Return and GTF, the performance chart is a very good one(maybe too good in the current market?) and the NAV is very high also. If I invest in them now,advisable?
*
First, determine how much risk you're willing to take in the short term. Once you have this answered you can then either use FSM's recommended portfolios or build your own. An aggressive portfolio will consist mostly equity funds, balanced portfolios are less heavy on equity funds and have more fixed income funds, while conservative portfolios lean toward fixed income funds. Diversification (i.e. don't put all your eggs in one basket) is a key concept in when building a portfolio. We try to build a portfolio that satisfies our appetite for risk and is diversified across asset types and geographic regions.

An example balanced portfolio (starting with RM 10k) will be something like this:
RM1500 - 15% Equities Fund investing in Malaysia
RM1500 - 15% Equities Fund investing in Asia (excluding Japan)
RM1000 - 10% Equities Fund investing with a Global scope
RM1000 - 10% Balanced Fund investing in Emerging markets (Brazil, Russia, etc)
RM1000 - 10% Balanced Fund investing in Developed markets (US, UK, etc)
RM2000 - 20% Fixed Income Bond Fund investing in Malaysia
RM2000 - 20% Fixed Income Bond Fund investing in Asia (ex. Japan)

As to what specific funds you should invest in, you can start by looking at FSM's recommended funds. Remember though, doing great in the past doesn't mean it'll continue doing well in the future (because the people managing it may change, market conditions may change, the fund's investment aims may change, etc).

QUOTE(larisSa @ Sep 30 2015, 11:47 PM)
5)What are the things to look at when it comes to selecting funds? Some says past performance unequal to future potential.and some advises to look at the portfolio,so what part of the portfolio?
*
Other than the things I've mentioned (geographic region, equity/bond mix), you should be looking at the fund's expense ratio. If you are inclined, these are some of the things that you can use to select a fund:
- Fund manager (is the fund manager experienced? How long has she managed the fund? How strong is her team?)
- The fund's investment objectives (short term? Can they shift to different investment mix when the prospects are not good?)
- Parent fund details (if the fund is a feeder fund)
- The fund's holdings by sector/country/company (Is it heavy in China? India? Another country? Is it investing mainly in technology/etc companies?)

You don't have to know all these things in #5 to begin investing in UTs; selecting funds from FSM's recommended list is a pretty safe move. If you need more specific answers about XYZ fund, there are many members here with encyclopaedic knowledge of the funds offered by FSM, so just ask smile.gif

This post has been edited by idyllrain: Oct 1 2015, 08:57 AM

Topic ClosedOptions
 

Change to:
| Lo-Fi Version
0.0408sec    0.33    7 queries    GZIP Disabled
Time is now: 6th December 2025 - 10:28 PM