Pages

Monday, 16 September 2013

Algorithmic Trading Resources


Books
Overviews
Strategies
Sites
  • Quantopian algorithmic trading platform: web app that allows you to create algorithms and back-test them using historical data.
  • Quantstart has a list of free resources here.
Open Source Projects
Technology
Courses

Tuesday, 10 September 2013

Learning Japanese

What can you do when you take the tube? Read the free version of the Evening Standard or learn Japanese with flashcards.

Same as for Chinese I use cram.com so store my vocab.

I started re-arranging the vocab list in 3 columns, separating Kanji from Romaji. like this:


You can import this format into cram.com which supports 3-sided cards.



Then you download those cards to Flashcards Deluxe where you can choose which side to use for the prompt: either English or Kanji.



Sunday, 8 September 2013

One backup is never enough...



I had trouble with my backup lately when switching to a new MacBook. I tried restoring the data to the new machine as a test.

The WD Passport software restore failed (it restored a 6-month old version of my files for some reason). Since the WD Passport software doesn't have a backup tool for Mac, I tried to configure it with Timemachine instead. The WD Passport USB drive died. I reformatted it from Windows: impossible to write to it any more. Surface tests with the WD diagnostic tools failed. It probably didn't like the whole traveling thing.

The Mozy restore worked fine.

So here is the new setup:

Off-site backup
  • Automatic backup to Mozy using local encryption with passphrase. 
On-site backup
  • Automatic backup to a USB drive with TimeMachine and Apple encryption.
  • Manual backup every now and then of sensitive files to a USB key protected with Truecrypt. It's good to have a simple copy of your important data. A simple, straight copy that doesn't require backup software. Because DVDs are out, a simple USB key should do.
The main disk is encrypted with FileVault. 

I'm still using Mozy but I'm considering moving to Backblaze that also offers local encryption with a passphrase that no one else knows and unlimited storage. Also Backblaze claims to be able to backup data from a USB drive as well without getting confused. I tried doing this with Mozy and it got mad, deleting all my files from the server as soon as I unplugged the drive.



Tuesday, 25 June 2013

Learning Chinese


I bought a couple of phrasebooks while traveling. Making out in Chinese is a fun one, the Rough Guide Phrasebook: Mandarin Chinese fits in your pocket.

I also used the flashcards by Brainscape. They contain some English > Chinese vocab (+audio), some Chinese > English, some grammar and even character radicals.


I maintain a vocabulary list in a spreadsheet which I export to flashcards using cram.com (used to be flashcardexchange) for long-term memorisation. When I'm in the tube I play the flashcards on the iPhone with Flashcards Deluxe, one of the many flashcards apps that support cram accounts. I haven't tried many flashcard apps actually. I like this one because it allows you to fine tune the spaced repetition algo. So you can set how long it takes before they prompt you with a word you got wrong. And when you get a word right you can set how long it takes before the app prompts you again to check you didn't forget.

Cram allows you to work with 3-sided cards. This is good for languages like Chinese or Japanese where you need to learn characters on top of the romanised version of the word.

For a while I listened to Serge Melnyk's free podcast as well as One Minute Mandarin from Radio Lingua network.

I gave a quick try to Rosetta Stone in a shop. It gave me the impression of being no more than a very polished overpriced phrasebook, I wasn't convinced.

So far the best tool I found is the course by chineseclass101. Courses are structured in a large number of short lessons, each lesson has a 15min podcast with pdf notes, online quizzes, vocabulary and grammar points. It's very progressive and they actually explain you the grammar from the ground up. The vocab always comes with the Simplified Chinese, Traditional Chinese and pinyin representations. The beginner lessons have 4 lines of dialog each. The advanced lessons have entire texts. You have to use at least the premium option for the material to be useful. The podcasts happen to be lively and not too scripted.

The same company that does chineseclass101 sells an iPhone app WordPower. This one is useful to learn vocab. The vocab is organised in 10 levels of flashcards of about 100 words each starting with the most basic. You can also tackle the flashcards by category.


Letting go of the pinyin

At the beginning I was learning the Roman representation of Chinese words while completly ignoring the actual Chinese characters. Then after using the line-by-line audio from chineseclass101, I realised recognising characters is not that difficult.

Pinyin exists only to give a phonetic representation of the sound for each Chinese character. However anything else than the International Phonetic Alphabet is actually misleading. It's just as lame as those English phonetic approximations you find in Lonely Planet phrasebooks. If you have access to an online resource / electronic dictionary that plays out a word out loud when you click it (such as Google Translate), then you don't need pinyin. All you have to do is read the characters at the same time as you listen to the way they're pronounced in order to associate each character with its sound and tone.

The objective is to learn to visually recognise the Chinese characters, pinyin is just a way to guess the sound associated with the character when the actual sound is not available. If you have access to the real sound, forget pinyin. By the way from my last trip to Asia I got the impression that most Chinese people don't know about pinyin anyway.

For pinyin to be useful you actually have to learn how to pronounce it with a chart like this one, that lists the 4 tones of each syllable combination.

To recognise characters it helps to know the radicals they're composed of. It helps memorisation as well. Sometimes they make sense... Here is a list of radicals together with their simplified version. Brainscape here is a good flashcard tool to learn them. You can find a fun visual way of associating radicals with characters on Chineasy.org.


Texting

I've also found out that a good exercise to train recognising the characters is to text on the iPhone using the Mandarin keyboard. The keyboard expects pinyin as input then suggests a list of matching homophone characters sorted by frequency. Choosing the right character from the list makes your brain work a little bit.







Thursday, 16 May 2013

Preparing for the FRM exam


The exam for the FRM certification (Financial Risk Manager) takes place twice a year in May and November. It has two parts and you can take the exam for each part either separately or both on the same day.

According to GARP it takes somewhere between 200 and 400 hours of reading to prepare each part. So obviously you have to spread it out over a few months to make it digestible.



Topics

This is Part 1 in a nutshell:
  • Foundations of risk management: some generalities about risk + CAPM in great detail
  • Quantitative Analysis: probabilities, distributions, statistics, lots of regression, Monte Carlo methods
  • Financial Markets and Products: futures, swaps, options, bonds... Lots of chapters from the Hull book.
  • Valuation and Risk Models: this is where it gets interesting. VAR calculation, binomial trees, Black Sholes, Greeks, hedging, risk metrics...
Material
  • The official material is an aggregation of chapters extracted from a variety of finance books. The FRM study doesn't rely on one single manual. This makes the reading more interesting because you navigate through publications written by different authors with different specialties. The FRM study guide gives the full list of books and chapters to read. Another guide called "AIM statements"gives the same list plus a highlight of what you're expected to take away from each chapter.
If you wanted you could absorb the whole FRM knowledge without spending a penny: just go through the reading plan available on the website and borrow the books from libraries. This is what I did while I was traveling since I didn't want to carry heavy books with me.
  • Obviously having all readings in one place is much more convenient so you can buy the 4 books from GARP for $250 + shipping. This is what I did when coming back to London to prepare for the last 2-week cram.
  • There is also a book called Financial Risk Manager Handbookwritten by Philippe Jorion and available in Kindle format. It's a complete textbook covering FRM Part 1 and Part 2 and broadly addressing the same topics as the 2013 GARP's study guide (but not exactly). That handbook is not mentioned on the GARP website so I guess it has been obsoleted. Anyway this is a very very convenient book because you find pretty much everything in one place and in electronic format. It is not as detailed as the readings themselves but it gives a very decent overview of what you're supposed to know. It also contains a good number of exam questions with answers. I had this book on my iPhone, iPad and MBP.
Hong Kong skyline seen from Cafe Habitu: study with free Wifi and a cool view
Doing FRM on the road

Apart from a few documents available online, 95% of the FRM reading are from books that are not available in electronic form (boooooh!). Because I was traveling and didn't walk around with a camel I relied on the following:
  • GARP's AIM statements for the reading plan. 
  • Libraries (in particular the Singapore national library which had most of the books I needed, the Hong Kong main library on the other hand was no help).
  • Jorion's FRM handbook in Kindle format. This is how I kept doing FRM reading on the boat in Thailand, on the resort's peer in Langkawi, in the studenty coffee shops of Taipei, in Hong Kong's Habitu cafes, in the Beijing hutong and during long ferry trips in the Philippines...

Boracay 

Time Allocation

According to my logs I spent about 230 hours on FRM study and I felt like I could have used 50 more hours to really complete the material.

Rather than going through the chapters sequentially I've iterated through the readings, jumping to the next chapter when one chapter was taking too long. Sometimes a chapter was building up on a concept introduced in a previous chapter I had not completed. In that case I had to move back to the previous chapter to understand what was going on... That made the reading more interesting I think. I did 4 iterations that were somewhere between 2 and 4 weeks in length.

I took the sample exam questions during the last week of revisions, which was a mistake. I should have taken them earlier because they're very useful.

The questions are multiple-choice questions with 4 possible answers every time. Some questions require calculations (nothing too complex and beyond add/multiply/divide/log), others just judgement. You would think that doing all the non calculation questions first would be easier, well it's not the case :) The qualitative questions can be quite tricky and require some thinking even if you're familiar with the material.


The Spider House in Boracay:
read about quantitative analysis with a cocktail





Tuesday, 30 April 2013

Too many SIM cards - Prepaid internet while traveling


Getting a mobile internet connection when you're traveling outside your own country is not always easy: it can be a hassle to find prepaid SIM cards. And the free wifi you get in some restaurants is not as convenient and secure as having your own portable always-on connection.

I’m still using a Huawei to share 3G internet between the iPhone/iPad/Macbook. The iPhone has my regular UK SIM, useful to be reached on my normal number.

I managed to find prepaid SIM cards for 3G in almost all countries I visited except Japan. Every time the SIM card I bought was compatible with my unlocked Huawey. Often I had to manually configure the APN to get internet working on the Huawey.

Here are the details, country by country.


  • Singapore, M1 broadband

Bought a SIM card at the airport immediately after arrival from an M1 stand. Unlimited data for a set number of days. When registering you need to show your passport and they keep a record of your passport number.

When the card expires, you need a separate connection to top it up, either with a credit card of with a voucher. You can buy the voucher in 7-11. You need to remember your broadband mobile number, you’ll need it to top-up.

5 days of unlimited data cost SGD18.

To top-up, go here.




  • Taiwan, Chungwa Telecom

Went to the store in the shopping area near Taipei 101, had to bring two photo IDs with me. The Chungwa store was crowded, I had to wait about half an hour. There is a number calling system so once you have your ticket you can walk around the other shops before coming back so it wasn't that bad.

The vendor spoke English, the price of the card was reasonable.

  • Hong Kong, one2free

Went to the one2free shop outside Fortress Hill MTR station. No ID required, no registration, the connection is entirely anonymous unlike in Beijing, Taiwan or Singapore. Unlimited data, you pay for a number of days. When your credit expires, your browser automatically prompts you to recharge. You don’t need a separate internet connection to recharge an expired card which is good.

If the one2free card was a beer...

To top-up
  • get $100 vouchers in 7-11 (it's just a receipt paper with a number on it)
  • top-up your balance online with the voucher number
  • Buy more days (7 days of unlimited data costs HKD78)


  • Beijing, China Unicom

Went to the China Unicom store located right outside the Dongdan subway station. Google map here. The passport is required. Only one employee spoke English in the store, which allowed me to skip the queue. The price for the card was reasonable.

This is not unlimited data, they charge you per KB so it's fine for Twitter/Email/FourSquare but no more. To buy recharges, go to any newsagent kiosk and buy a China Unicom recharge card. Topping up is a bit convoluted: you do it from a mobile phone. You call their phone number and type in the voucher number. You can call from a different SIM than the one you are recharging.

Important: you have to set the APN manually for the SIM to work correctly.

Warning! Not all China Unicom stores sell the SIM card. I also went to the main store in Wangfujing, which is the Beijing equivalent of London's Oxford Street. They sell much more expensive cards that do both voice and data, the price is ridiculous.

Twitter and Facebook are blocked in China (at least they were at the time I was there). US sites are a bit slow, Whatsapp and Wechat work fine. I haven't tried using VPNs there but here is a list of VPNs that are supposed to work in China.


  • USA, T-Mobile

In Los Angeles T-Mobile sells a data-only SIM that works just fine. I went to the Santa Monica store and paid $35.95 for a SIM that kept me running for the remaining 8 days of my US trip.

Warning: don't get the card sold at LAX airport, it's way too expensive.

  • Philippines, Global

I bought a Global data SIM card at a kiosk for PHP600 at MNL airport terminal 1 (Manila). This gives you 7 days of unlimited data. No document required, activation is anonymous. As the nice Filipino lady at the kiosk said "it's more fun in the Philippines".

You have to set up the APN manually.

To top up put the SIM in a mobile phone and dial a number to access a WAP menu. Then you have to:
  • recharge your account using a prepaid card (I bought one for PHP300).
  • create a 'promo' to choose the plan (I chose another 7 days).

  • Japan, no luck
I found nothing in Japan!

My plane landed too late for the airport kiosk. None of the phone shops I visited in Osaka had any prepaid 3G SIM card - they told me the only place to get it was the airport.

I found free wifi in some bars (not so much in coffee shops, tea rooms or restaurants).

Tuesday, 9 April 2013

How to travel and study at the same time


I left London 5 months ago, preparing for a financial exam I'll take in May. The exam requires on average somewhere between 200 and 300 hours of study time. It turns out you don't have to do it in front a white wall.

Equipment

  • Macbookpro 15’’
  • iPad mini
  • iPhone 4S with extra battery
  • Huawey E586 with extra battery.
I don’t always walk around with a Macbook pro of course. Whether I take it with me or not depends on several things including how safe it is to leave it in my hotel room. A 15’’ is not ideal for travel, it's clearly heavy. An Air would be easier on my shoulders but it’s ok. Sometimes hotel safes are big enough to accommodate an MBP, sometimes I take the risk of just leaving it in my locked suitcase. When I can leave the MBP behind, I carry only the iPad mini in a small satchel.
The smallest bag I could find to carry the MBP 15’’ is a Samsonite rucksack. The 15’’ retina fits in just right.




Study material

I read books using a combination of
  • Amazon Kindle
  • Apple iBooks
  • Dropbox (for PDF files)
  • Public libraries: for books that are not accessible in electronic form. The National Library in Singapore has plenty of reference books, is open to non students (as long as you don’t borrow the books) and is laptop-friendly.

Dedicating time to study

The technical bit is not really the problem. The hardest part is to put time aside and dedicate it to study. Traveling is full of distractions. One of them is doing tourism. When I’m in London I’m not stuffing my days with trips to Mme Tussaud or the British Museum so I don’t feel like doing this either while I’m in another country. Local attractions are not a must-do, they will still be there the next time you come back.

The biggest factor of wasted time while traveling is decision making and exploration - by wasted I mean in relation to the objective of studying, of course it's not wasted time if you actually enjoy exploring. Where should I go today? Where are the good places? Rather than doing extensive and time-consuming research or walking around at random, it’s quicker to rely on a few recommendations from friends/locals/hotel receptionists or even suggestions from FourSquare.

Here are the top 3 questions I ask FourSquare:
  • where can I have breakfast now?
  • where is a good coffee place to sit down and open my laptop?
  • where can I eat now?
Based on where you are FourSquare returns a single list of suggestions. This list includes places you stumbled upon at random before, places recommended by friends and places recommended by FourSquare users.


Dealing with travel overhead

Then another factor is the travel overhead: taking a plane, booking trips, booking hotels, checking in, checking out, washing clothes, etc… Now I do most of my bookings with the Expedia iPhone app. It has a very clean flow and allows quick sorting by deals first. When booking a flight or hotel, it doesn't ask you to type in your life story, just the 3 digits at the back of your credit card. Some airline web booking forms are just horrendous: they have too many pages, ask for way too much info sometimes redundant... It happened to me to spend up to an hour to complete a booking process because of slow websites that crash in the middle. None of this with Expedia for iPhone. Another nice thing: the search shows you the total price for stay as opposed to a misleading nightly rate that excludes taxes...


The drawback of Expedia: it shows only the hotels connected to Expedia. That excludes a lot of smaller more obscure hotels that can be perfectly OK and sometimes very cheap.
I wash my clothes in places that wash, dry and fold them for you, not in launderettes. I try and avoid moving around too much: I prefer staying in the same place for 1 or 2 weeks. After two weeks in the same city you’re pretty much a local: you have your favorite hangouts, you know the good places to eat or study, you have your data SIM card sorted out, you know the cheap local wash&fold laundry service, you can get around in the MTR/subway/metro/tube without a map and you can order a latte in the native language.

Although I spent most of my time in big cities (Taipei, Hong Kong, Singapore, Beijing, San Francisco, Los Angeles), I found that for studying sleepy resorts are the best because they remove all distractions. No invites from friends, no dating, no travel, no tourism, no time wasted in transport - it’s a quick walk from the bungalow to the pool. It also removes choice: there is only one restaurant, one cafe, one swimming pool and only 10 items on the menu. I clocked in at least 10 hours daily of intensive study while in Malaysia/Thailand, whereas I struggled to reach 5 hours when I was preparing for the Microsoft exam in Taipei.

See also:
Keep your data safe while traveling
Study plan for a 6-month break



Saturday, 26 January 2013

Keep your data safe while traveling


Photo 27-01-2013 11 02 21
Before leaving London for a 6 month break I sold my desktop and replaced it with a MacBookPro. The MBP has become my main computer and because I'm traveling, I had to review the whole backup routine… The likelihood of having it stolen or lost on the beach is quite high (compared to having my flat broken into for instance).

After trying a few things I came up with this: I sorted out my data into two groups, sensitive data and mobile data.

Sensitive data
Stuff you really don’t want someone to steal from you.
That includes budget spreadsheets, bank statements, receipts, health documents…
  • Store on local drive
  • Encrypt with TrueCrypt (Windows) or Filevault (MacOs). You can forget the Filevault password, the only purpose of encrypting the data on the local drive is to prevent it from being accessed by someone who steals the laptop. 
  • Back-up manually to external HD with hardware encryption (such as My Passport which comes with a built-in backup software WDSmartware).
    This external HD should always stay in the room, or in the hotel safe. If the main laptop gets stolen or crashes, this is the first line of defense. Of course the HD itself could be stolen that’s why data should be encrypted with a password that you remember.
  • Backup off-site automatically with a service that allows local encryption (such as Mozy)
    Local encryption technology exists so there is no point taking the risk of trusting the cloud storage provider to encrypt the really sensitive data for you. Just don’t forget the password.
Mobile data
Stuff you need with you all the time, files used often and on-the-go that are less sensitive: photos, travel itineraries, hotel bookings, flight tickets, travel insurance certificate, passport scans, ebooks.
  • Must be quickly synchronised across devices (iPhone, iPad, PC, MacBook, web). Dropbox is good for that. iCloud not so much...
  • Encrypt the offline cache with OS encryption. Encrypt the Dropbox folder with TrueCrypt/FileVault so that the files stored offline cannot be accessed if the laptop gets stolen.
Notes:

Why use TrueCrypt for sensitive data under Windows and not EFS?
The backup systems I tried (WDSmartware and Windows8 File History) don't know how to save EFS-encrypted files. Mozy knows how to save EFS-encrypted files. But when it restores them, they're still encrypted with EFS. So if you lose your laptop and don't have the EFS keyfiles, you lose your data. I find EFS a bit cumbersome because if you're serious about testing it, you have to do a restore to a totally different system to make sure that you're able to decrypt the EFS files, save the keyfiles to USB drives, blah blah blah. I know I’ll just get it wrong so I prefer using TrueCrypt.

Don't use Mozy to save data stored on the external HD
Mozy is really bad at saving data located on a removable drive (such as an external HD). Mozy starts automatically. If the drive is not connected at the time when Mozy starts, Mozy thinks the files were deleted from the machine and it marks them as deleted from the server, which is a bit rough.

Tuesday, 22 January 2013

HTML5/CSS3/Javascript Resources

 

It is sunny in Langkawi because we’re in the middle of the dry season on that side of Malaysia, unlike Singapore where it’s raining all day at the moment.
This is the perfect setting to gather some resources about HTML5 and in particular to prepare for Microsoft exam 70-480.
  • Exam registration
  • upcoming Microsoft exam book.
  • From Safari Online Books:
    • Head-first HTML5 programming dives directly into the things a client apps dev is actually interested in: how to do asynchronous programming with Javascript to avoid page reloads, how to change the DOM programmatically, how to call Web services, how to execute tasks in parallel, how to use local storage, how to use geolocation and Google maps.
    • Beginning iPhone and iPad web apps
  • Test Papers (exam Q&As)
  • Some study guides:
  • HTML5 Jumpstart (Microsoft Virtual Academy)
    • The videos spend a lot of time on CSS3 (as opposed to Head-First that goes into Javascript immediately).
    • The focus is to build apps for Windows 8 rather than web apps therefore some of the CSS properties and Javascript code is Microsoft-specific.
    • There is a good demo of WinJS’s Promises, which makes asynchronous programming under Javascript look more industrial.
  • HTML5 Spec