Data extraction #
The latest daily currency exchange rate tables, which include rates of various currencies paired with HKD, are scraped from the websites of some currency exchange retailers in Hong Kong for analysis.
Tables in HTML can be easily parsed. Tables in images are reconstructed by OCR with tesseract. Currency rows with data in the format of a 3-letter string followed by two decimal numbers are extracted from a list of words from the parsing result of using page segmentation methods 4, 6 and 11.
Note that the Buy rate is the amount in HKD at which a currency exchange retailer buys a unit of a particular currency from its customers. It is similar for the Sell rate.
A simple check on the ensemble of parsing results is performed by asserting that the Buy rate is less than the Sell rate for each currency row.
Limitation of analysis #
The daily reference rates are scraped for analysis with the following limitations.
The actual rates may fluctuate during the day.
Historical rates are yet to be scraped from the retailers for computation of average rate spread percentages over a certain period of time. This may provide better insight although similar results are expected.
Buy-sell spread percentages #
For each retailer, the relative buy-sell spread (or bid-ask spread) percentage for each currency is computed by taking the percentage change of the Buy rate from the Sell rate. The rate spread percentages are sorted and plotted.
An interesting discovery in such plots is that the results are very interpretable. For convenience of interpretation, major stable currencies are defined as follows.
USD, EUR, JPY, CHF, GBP, CAD, AUD
In general, the relative spreads of major stable currencies are lower than that of the non-major currencies. The relative spread for USD is reasonably the lowest as a result of the HKD-USD dollar peg.
For currency exchange retailer B, a relatively small number of currencies are listed aside from the major currencies. The relative spreads are consistently low, which imply good rates offered to customers.
For currency exchange retailer L, more South East Asian currencies (VND, BND) and some Middle Eastern currencies (AED, SAR) are listed in addition to the major currencies. The relative spreads are generally higher than that of retailer B.
For currency exchange retailer R, some less common currencies paired with HKD are listed (ZAR, TRY, RUB) although with much higher relative spreads (26% to 36%). The relative spreads of common currencies are generally slightly higher than or comparable to that of retailer B.
For currency exchange retailer K, all currencies paired with HKD except USD has relative spreads higher than 1%. Some Northern European currencies (DKK, SEK, NOK) are listed although with moderately higher relative spreads (5% to 8%).
Buy-sell spread index #
A spread index defined as the mean or median of the relative buy-sell spread for the seven major currencies is proposed. It can be used as a "rip-off index" because a lower spread index would mean a lower degree of rip-off for customers.
The spread index computed for the currency exchange retailers are as follows.
In comparison, the spread index for a retailer that offer bad rates to their customers would typically be in the range of 5 to 20.
Although a higher spread may not imply a higher profit margin due to a higher rate fluctuation risk for a particular currency for the retailer, consistently high spreads across all currencies listed can be observed in currency exchange retailers that potentially take high profit margins, such as those commonly found in airports.
Buy-sell asymmetry #
A currency exchange retailer with a lower spread index may or may not generally offer better rates for both buying and selling for the customer than a retailer with a higher spread index.
As an example, for currencies commonly listed by retailers B and R, plots for the percentage change of the rate at R from the rate at B are generated.
The Buy rates at retailer R are generally higher and hence better than that at retailer B for the customer. For most currencies, the customer would go to retailer R to sell the currency at a better Buy rate.
The Sell rates at retailer B are generally lower and hence better than that at retailer R for the customer. For most currencies, the customer would go to retailer B to buy the currency at a better Sell rate.
The scraping of exchange rates was motivated by an attempt to generate a table of values in HKD for a bunch of different currencies that I intended to sell for HKD.
- Feb 2021 Replaced plots with new versions generated with the latest data and re-exported in SVG format.
- Oct 2020 Added paragraphs on spread index.
- Oct 2020 Re-organized content in bullet points.