$$$ KPO and CZM $$$: Syfe Transactions Parser

Monday, May 18, 2020

Syfe Transactions Parser

I did a Syfe REIT+ (100%) Review and decided to open an account. As I was preparing to import the transactions into StocksCafe for tracking over the weekends, I realized an annoying thing when I copy and pasted them into an excel - it is not properly formatted to be displayed in tabular manner -.-

Copy the transactions out

Paste into excel

My thoughts - TMD and spent about 15 minutes to code out a Python (version 2) script to parse and output those transactions into a csv. Regardless if you are using StocksCafe or your own spreadsheet for tracking, you should find it useful.

Firstly, download this script (syfe_parser.py) and save it whenever you want.

Next, copy and paste the transactions and save it as 'transactions.txt' (I hardcoded it, you can modify it if you know how to) in the same place you kept the script.


Last but not least, just run/execute the script (python syfe_parser.py) and you will get a syfe_transactions.csv that looks like this. I even computed the average price per transaction which was missing in Syfe dashboard.


With this, I transform the data further and was able to import all the transactions into StocksCafe! I like to track all my investments with StocksCafe as I get a lot more data/visibility. We can see this portfolio has a projected yield of ~5% which is in line with our goals! Oddly, there are only 19 stocks instead of 20 (iEdge S-REIT 20 Index) in the portfolio and I can't find the components online too.

Updated as Eliezer from Syfe reached out - Came across your post today on the Syfe transactions parser and your question on why there are 19 REITs. Briefly, while the iEdge S-REIT 20 index has 20 REITs, our REIT+ portfolio has 19 REITs because one of the REITs in the index (Manulife US REIT) is USD-denominated. At this point, we are keeping all the REITs in the REIT+ portfolio as SGD-denominated REITs. Even with 19 REITs, you can be assured that our portfolio is still tracking the index very well. Our stated aim is after all to replicate the performance of the iEdge S-REIT 20 index as closely as we can!

Overview

Report

Honestly, I am quite annoyed at how all these robos are not providing an option to export/download these transactions. I have made multiple requests to StashAway (not to Syfe yet) and was always brushed aside that it is not in their list of priorities. How long is it going to take your developer to implement a simple feature like this? Max 1 hour? Oh well, not going to stop me :)

New Syfe customers will have their first $30,000 managed free for 6 months when they use our new referral code (KPOCZM). We will be receiving a $10 cash incentive for our portfolio if you invest $500 or more.

If you are interested in the smart portfolio tracker (StocksCafe) which I am using as shown above, sign up using my link for a longer trial period :) Refer to our Referrals page for more information.

Do like any of the following for the latest update/post!
1. FB Page - KPO and CZM
2. Twitter - KPO and CZM
3. Click here to subscribe using email :)
4. Instagram - KPO_and_CZM (Did you see those delicious food photos to the right --> Unfortunately, you can't see it on mobile.)

17 comments:

  1. Thank you! Considering that I just started with SYFE this is a time-saver! I think a bunch of you guys who are techie bloggers dabbling with Python and coding can team up and do lots of good haha!

    Kevin, Turtle Investor

    ReplyDelete
    Replies
    1. Haha. You are welcome! Evan is doing lots of good with StocksCafe already.

      Delete
  2. Thank you so much! This is what I have been looking for

    ReplyDelete
    Replies
    1. Haha. You are welcome! Glad that you found it useful!

      Delete
  3. Thks a lot! Newbie here. How do you run/execute the script (python syfe_parser.py) in the excel?

    ReplyDelete
    Replies
    1. Hi Cryptocoin8088,

      You have to download and install python on your machine:
      https://www.python.org/download/releases/2.7/

      After that can just open a command prompt at the location where you store the script and run "python syfe_parser.py".

      Delete
  4. hi, can you show a sample how you further "massaged" the data before importing? not sure which columns to add/move, and how to handle the dividends and mgmt feets. thanks in advance!

    ReplyDelete
    Replies
    1. Hi Wx,

      You only need to import Buy/Sell transactions. You can refer to this - https://stocks.cafe/personal/portfolio/transactions/tobulkupload:
      Column 1) (-1 or 1 or 0 to indicate sell for -1, buy for 1 and fees for 0) OR (Buy or Sell or Fees text are also acceptable)
      Column 2) Exchange Code (i.e. SGX or HKEX)
      Column 3) Symbol
      Column 4) Units Purchased or Sold
      Column 5) Currency
      Column 6) Price Paid or Received (based on the currency this stock trades in)
      Column 7) Date of transaction (YYYY-MM-DD or MM/DD/YYY)
      Column 8) Total after fees (Blank is allowed) (based on the currency this stock trades in)
      Column 9) Anything you would like to note about the transaction (Blank is allowed)

      Example: 1, SGX, ES3, 1000, SGD, 3, 2015-01-03, 3003, "First trade of the year"

      You can refer to this post too - https://kpo-and-czm.blogspot.com/2020/05/stashaway-transactions-parser.html

      Dividends are automatically tracked by StocksCafe. As for mgmt fees, I add them manually.

      Delete
  5. Hi!, I got some units with <0.01 but the command is not able to do anything with it. How can i change it to work? Thanks!

    ReplyDelete
    Replies
    1. Hi iJazzyman,

      Yes, when I coded the parser, "<0.01" was not an expected input. Technically, I can modify the code logic to handle that but the problem is it will not be accurate - what value should be assigned? 0.009 and 0.00001 are considered to be <0.01.

      Anyway, I blogged about this previously - https://kpo-and-czm.blogspot.com/2020/08/syfe-july-2020.html. I think if more people feedback to Syfe about this issue, they might fix the display/inaccuracy by increasing the decimal places.

      You can email them and ask them to provide an export of your transactions too which will be much more accurate - to 5 decimal places.

      Delete
  6. Enter formula below is the excel, and drag it to the right for a total of 5 columns and then drag down will do the trick as well, thanks kpo for sharing anyway
    =INDEX($A:$A,ROW(A1)*5-5+COLUMN(A1))

    ReplyDelete
  7. Hi I have a ValueError could not convert string to float: '18 Jan 2021'. How do I fix this?

    ReplyDelete
    Replies
    1. And I realised Syfe has changed the labelling format , could this be the reason?

      Delete
    2. Hi, I'm no longer using Syfe so I'm not sure what has it changed to.

      Generally, Python is quite easy to read and understand.

      Go take a look at the event for 18 Jan 2021 and see what's the description. You probably got to add the it to here:
      special = ['TRANSFER_IN', 'BONUS_IN', 'MANAGEMENT_FEE',
      'Funds added', 'Bonus', 'Management fee', 'Adjustment (in)',
      'Portfolio transfer (in)']

      If you still can't get it to work, manually remove that line or email Syfe and get them to export the transactions for you :)

      Delete
    3. ok I fixed it alr! I added in " Portfolio transfer (out) " & "Funds withdrawn" and removed "Funds added". Their updated labelling has made it more difficult to convert it to the format for stockscafe. Anyways thank you so much for this! I hope Syfe and other roboadvisors will eventually add an export function to make our lives easier hahah.

      Delete