KLSE Screener

Installation and Usage

  1. go get github.com/kokweikhong/goklse

  2. Create a config file in root folder with name “config.yaml”

  3. In config.yaml

	mongodb:
		uri: <your mongodb uri>

Get Data and Store to Database

// need to place -write to overwrite to database

// KLSE latest data
go run main.go data klse -write // without -write will not overwrite to database

// company summary details data
// summary arguement is comapny code
// with single result, -summary=0001
// with mutilple results, -summary=0001,0002,1245
// with all results, -summary=all
go run main.go data -summary=0001,0002

// stock historical data
// stock arguement is company code
// with single result, -historical=0001
// with mutilple results, -historical=0001,0002,1245
go run main.go data -write -historical=0001,5641,4223

// market historical data
// arguement is market symbol
// if want to check which market is available
go run main.go market -options
// get data by market symbol
go run main.go data -write -market=KLSE

Get KLSE Latest Data

// Get all data
go run main.go klse

// with filter name contains.
go run main.go klse -name=sunway

// with filter code contains.
go run main.go klse -code=00

// with filter market or category
go run main.go klse -market=main
go run main.go klse -category=energy

// with filter price is lower than nta values.
go run main.go klse -ntaf

// options to filter with stastic data.
// arguement is contains min/max
// capital, dps, dy, eps,, nta, pe, price, ptbv,roe
// e.g. -pe=0,100 = pe >=0 & <=100
go run main.go klse -pe=0,100

// combination flag
go run main.go klse -name=sunway -code=00 -market=main -pe=0,100 -dy=0,10 -capital=10000,50000

Get Company Details with Filter

// with filter name contains.
go run main.go company -name=sunway

// with filter code contains.
// below example is retrieve those code which contains "00".
go run main.go company -code=00

// with filter market or category
go run main.go company -market=main
go run main.go company -category=energy

// with filter description contains.
// description filter can be multiple string contains.
go run main.go company -desc=online // single string contains
go run main.go company -desc=online,payment // multiple string contains

// combine filter
// below example is retrieve data which contains sunway/00/main/construction in name/code/market/desc
go run main.go company -name=sunway -code=00 -market=main -desc=construction

Get Stock Historical Data

// get stock historical data by company code.
go run main.go stock -code=0001

Get Market Historical Data

// check market available.
go run main.go market -options

// get market historical data.
go run main.go market -name=KLSE

// get market historical data for 10 year, default 1 year.
go run main.go market -name=KLSE -year=10

GitHub

View Github