Saturday, March 31, 2018
Saturday, January 27, 2018
Brokerage fee comparison at a glance - Hong Kong
| Trading Value and brokage fee in HKD | |||||
| Broker | Minimum | Rate | 5,000 | 10,000 | 100,000 |
| Bank of China (Gold
Star) | 100 | 0.200% | 100.00 | 100.00 | 200.00 |
| Bank of East Asia Supreme Gold | 80 | 0.250% | 80.00 | 80.00 | 250.00 |
| Bright Smart | 50 | 0.067% | 50.00 | 50.00 | 66.80 |
| China Construction Bank | 0 | 0.180% | 9.00 | 18.00 | 180.00 |
| Citigold | 100 | 0.200% | 100.00 | 100.00 | 200.00 |
| DBS Treasures | 0 | 0.250% | 12.50 | 25.00 | 250.00 |
| Fubon Bank | 80 | 0.250% | 80.00 | 80.00 | 250.00 |
| Hang Seng Bank | 100 | 0.250% | 100.00 | 100.00 | 250.00 |
| HSBC | 100 | 0.250% | 100.00 | 100.00 | 250.00 |
| Interactive Brokers | 18 | 0.080% | 18.00 | 18.00 | 80.00 |
| SHK direct | 88 | 0.138% | 88.00 | 88.00 | 138.00 |
| Standard Chartered Bank | 0 | 0.200% | 10.00 | 20.00 | 200.00 |
| Winner | China Construction Bank | China Construction Bank & Interactive Brokers | Bright Smart | ||
| Fee | 9.00 | 18.00 | 66.80 |
Additional cost
– SFC Transaction Levy 0.0027% of the transaction amount
– Stock Exchange Trading Fee 0.005% of the transaction amount
- Stamp Duty 0.1% of the transaction amount
Date: 1/27/2018
Wednesday, January 24, 2018
Listing all tables in a database and their row counts and sizes
CREATE TABLE #RowCountsAndSizes (TableName NVARCHAR(128),rows CHAR(11),
reserved VARCHAR(18),data VARCHAR(18),index_size VARCHAR(18),
unused VARCHAR(18))
EXEC sp_MSForEachTable 'INSERT INTO #RowCountsAndSizes EXEC sp_spaceused ''?'' '
SELECT TableName,CONVERT(bigint,rows) AS NumberOfRows,
CONVERT(bigint,left(reserved,len(reserved)-3)) AS SizeinKB
FROM #RowCountsAndSizes
ORDER BY NumberOfRows DESC,SizeinKB DESC,TableName
DROP TABLE #RowCountsAndSizes
Source: https://www.sqlmatters.com/Articles/Listing%20all%20tables%20in%20a%20database%20and%20their%20row%20counts%20and%20sizes.aspx
Wednesday, August 23, 2017
Monday, May 22, 2017
How to find text in entire workbook
Your eyes are not built for searching text in a boring excel file.
To protect your eyes, you have to know what the computer can do for you.
Make good use of the "find and replace" can save your eyes from bleeding.
Sunday, May 7, 2017
Stock price predication using Weka
Background
As a seasonal stock trader, it has been a dream for me to have a stock info system suggesting order price.
Traditional technical indicators do help me a lot for giving buy / sell signal most of the time, but would big data with applying machine learning techniques help me to capture every trading opportunities?
During the Easter holiday, I spent a few days for trying out using WEKA for stock price prediction.
Objective
To predicate day low and day high of the next trading day.
Choosing stock - 0002 CLP Power Hong Kong
Stock market: Hong Kong
Stock code: 0002
Stock name: CLP Power Hong Kong Limited
The CLP Group (Chinese: 中電集團) and its holding company, CLP Holdings Ltd (SEHK: 0002) (Chinese: 中電控股有限公司), is a Hong Kong electric company that has businesses in a number of Asian markets and Australia. It is one of the two main electric power generation companies in Hong Kong.
There are couple of reasons to pick CLP Power
- Sizable market cap
- Sizable trade volume per trading day
- Stable income
- Stable customer base (monopoly, the only electric power company in Kowloon and New Terror ties, covering over 85% of total Hong Kong population)
- Stable dividend scheme
- Stable government policy, less sensitive to political and financial issues
Feeding Weka- Preparing data files
I used Yahoo Finance as the data source for 4/Jan/2000 - 4/May/2017 (4504 records), and later normalize the data and adding technical indicators.
Be aware, Weka works with file in ARFF only. Read http://www.cs.waikato.ac.nz/ml/weka/arff.html for more.
WEKA comes with a ARFFViewer to read ARFF.
Data files:
Engine On
![]() |
| Open the "Explorer" |
![]() |
| Press "Open File" |
![]() |
| I pick 0002-COMPLETE.arff to predict change% of high on 5 May 2017. |
- The change percentage of lowest price;
- The change percentage of the highest price.
Either one has to be removed for processing.
i.e. If you wanted to predict the change of the highest price, remove the change of lowest price.
![]() |
| Go to "Classify" and choose "AutoWEKAClassifier" as classifier |
![]() |
| I gave 15 minutes to Weka to predict the change of highest price. |
Results
![]() |
| I got the result after the coffee break. Weka found the best classifier. |

And I scrolled down, there were the summary and the prediction result. The accuracy
seemed to be very disappointing. But when I looked deeper into the results, it might not be that bad as it seems.
Result files
I decided to put the prediction results into a trading simulation to see how it looks. It is the end of part 1.
Subscribe to:
Posts (Atom)
Applying SMA10/20, SMA20/50 as trading signals
This is the comparison for results before and after applying SMA10/20 and SMA20/50 in the stock trader. Background Trading 3 stock ma...
-
Snes9X is one of the best Android SNES emulators ever made. It is free, no ads, highly customisable. It helps bringing back tons of go...
-
I struggled with the error "The mobile device interface cannot be opened because either the display settings are not configured or the...
-
Background As a seasonal stock trader, it has been a dream for me to have a stock info system suggesting order price. Traditional tec...











