Sunday, July 2, 2017

How to find Uptrend Stocks in KLSE?

Trend following is one of the simplest way to make money in stock market. You identify shares which are in good trend, buy and follow it until the trend change and exit the position. The assumption is: if a share is in good trend now and in the past, it is possible that the trend will continue in future. The entry point is usually not very important and the holding period is from medium to long term. Therefore, trend trading is suitable for beginner and part-time traders.

The winning rate usually is not high but if you manage to catch some of the shares which the trends extended for long time,  the profit will be more than enough to cover your loss in other trades. 

Let's implement a Amibroker trend scanner in this post, yes it should be up-trend to be exact because we can only trade long in KLSE. 

The code is as below:

uptrend = C > EMA(C, 30) AND EMA(C, 30) > MA(C, 50) AND MA(C, 50) > MA(C, 200);
decentVolume = (MA(V, 20) * C) > 3500;
priceRange = C >= 0.5 AND C <= 1.5;
Filter = uptrend AND decentVolume AND priceRange;   

The scanner consists of only 4 lines of code. As I explained in other post before, C represents close price and V represents volume in Amibroker. First line of code filters the stocks which are in short, medium and long term up trend. We do this by mainly using moving average with different periods. The code should be self explanatory. Of cause moving average is only one of the simplest way to identify trends, you can using any other indicator or technique which is suitable. 

Second line of code is just an extra filter to make sure the shares we filtered are trading with good volume so that they are liquid enough to trade. Third line of code filters the price range of the share, in this example, we are only interested in share between RM 0.5 to RM 1.5.   

Last line of code combines all of the conditions together and assigns it to Filter variable which will be used by Amibroker exploration feature to filter the stocks. 

No comments:

Post a Comment