Documentation
¶
Index ¶
- Constants
- type CSE
- func (c *CSE) GetAllListedCompanies() ([]*Company, error)
- func (c *CSE) GetAllListedCompaniesByCategory() ([]*CompanyListingByCategory, error)
- func (c *CSE) GetAllListedCompaniesByIndustry() ([]*CompanyListingByIndustry, error)
- func (c *CSE) GetAllWeeklyReports(year int) (*WeeklyReports, error)
- func (c *CSE) GetLatestPrices(by sortBy, order sortOrder) ([]*CSEShare, error)
- func (c *CSE) GetMarketStatus() (*CseMarketStatus, error)
- func (c *CSE) GetMarketSummary() (*Summary, error)
- func (c *CSE) GetPriceEarningRatio(day, month, year string) (*PriceEarningRatios, error)
- type CSEShare
- type Company
- type CompanyListingByCategory
- type CompanyListingByIndustry
- type CseMarketStatus
- type DSE
- func (d *DSE) GetLatestPrices(by sortBy, order sortOrder) ([]*DSEShare, error)
- func (d *DSE) GetLatestPricesByCategory(categoryName string, by sortBy, order sortOrder) ([]*DSEShare, error)
- func (d *DSE) GetLatestPricesSortedByPercentageChange() ([]*LatestPricesWithPercentage, error)
- func (d *DSE) GetMarketStatus() (*DseMarketStatus, error)
- func (d *DSE) GetMarketSummary() (*MarketSummary, error)
- type DSEShare
- type DseMarketStatus
- type LatestPricesWithPercentage
- type MarketSummary
- type PriceEarningRatio
- type PriceEarningRatios
- type Summary
- type WeeklyReports
Constants ¶
const ( // ASC constant to sort result array in ascending order ASC sortOrder = iota // DESC constant to sort result array in descending order DESC )
const ( // SortByTradingCode to sort the result by Company's Trade code SortByTradingCode sortBy = iota // SortByLTP to sort the result by the Last Trade Price SortByLTP // SortByOpeningPrice to sort the result by the Opening Price of that day SortByOpeningPrice // SortByHighPrice to sort the result by the Highest Price of the day SortByHighPrice // SortByLowPrice to sort the result by Lowest price of the day SortByLowPrice // SortByYCP to sort the result by Yesterday's Closing Price SortByYCP // SortByNumberOfTrades to sort the result by The Number of shares are traded on that day SortByNumberOfTrades // SortByValue to sort the result by the Value of the Company. The Value is in Million BDT. SortByValue SortByVolumeOfShare // SortByPercentageChange ... SortByPercentageChange // SortByPriceChange to sort the result by the Change of Price of the Share SortByPriceChange )
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type CSE ¶
type CSE struct {
}
CSE is a struct to access cse related methods
func (*CSE) GetAllListedCompanies ¶
GetAllListedCompanies returns all the companies listed in cse or error in case of any error
func (*CSE) GetAllListedCompaniesByCategory ¶
func (c *CSE) GetAllListedCompaniesByCategory() ([]*CompanyListingByCategory, error)
GetAllListedCompaniesByCategory returns the listing of the companies by their category or an error in case of any error
func (*CSE) GetAllListedCompaniesByIndustry ¶
func (c *CSE) GetAllListedCompaniesByIndustry() ([]*CompanyListingByIndustry, error)
GetAllListedCompaniesByIndustry returns list of companies with their industry type or error in case of any error
func (*CSE) GetAllWeeklyReports ¶
func (c *CSE) GetAllWeeklyReports(year int) (*WeeklyReports, error)
GetAllWeeklyReports returns weekly reports pdf link for the input Year. the Year should be between current Year and 2018
func (*CSE) GetLatestPrices ¶
GetLatestPrices returns the array of latest share prices or error in case of any error It takes by which field the array should be sorted ex: SortByTradingCode and sort order ex: ASC It will return an error for if user tries to sort with a non existing file in the CSEShare model or invalid category name or invalid sort order
func (*CSE) GetMarketStatus ¶
func (c *CSE) GetMarketStatus() (*CseMarketStatus, error)
GetMarketStatus returns the CseMarketStatus with is open/close
func (*CSE) GetMarketSummary ¶
GetMarketSummary returns the summary with highest records till now and the historical market summary data
func (*CSE) GetPriceEarningRatio ¶
func (c *CSE) GetPriceEarningRatio(day, month, year string) (*PriceEarningRatios, error)
GetPriceEarningRatio returns the price earning ratio data for listed companies as per input date. It takes day, month and Year as input ex : (03, 07, 2020) where 03 is the day and 07 is the month and 2020 is the Year. Don't forget to include 0 before single digit day or month
type CSEShare ¶
type CSEShare struct {
}
CSEShare is a model for a single company's latest price data provided by the cse website
type CompanyListingByCategory ¶
CompanyListingByCategory ...
type CompanyListingByIndustry ¶
CompanyListingByIndustry ...
type CseMarketStatus ¶
type CseMarketStatus struct {
IsOpen bool
}
CseMarketStatus holds the data for if market is open/close
type DSE ¶
type DSE struct {
}
DSE is a struct to access dse related methods
func (*DSE) GetLatestPrices ¶
GetLatestPrices returns the array of latest share prices or error in case of any error It takes by which field the array should be sorted ex: SortByTradingCode and sort order ex: ASC It will return an error for if user tries to sort with a non existing file in the DSEShare model or invalid category name or invalid sort order
func (*DSE) GetLatestPricesByCategory ¶
func (d *DSE) GetLatestPricesByCategory(categoryName string, by sortBy, order sortOrder) ([]*DSEShare, error)
GetLatestPricesByCategory returns the array of latest share prices of the input category or error in case of any error It takes a category name, by which field the array should be sorted ex: SortByTradingCode and sort order ex: ASC It will return an error for if user tries to sort with a non existing file in the DSEShare model or invalid category name or invalid sort order
func (*DSE) GetLatestPricesSortedByPercentageChange ¶
func (d *DSE) GetLatestPricesSortedByPercentageChange() ([]*LatestPricesWithPercentage, error)
GetLatestPricesSortedByPercentageChange ...
func (*DSE) GetMarketStatus ¶
func (d *DSE) GetMarketStatus() (*DseMarketStatus, error)
GetMarketStatus returns the DseMarketStatus with is open/close and last market update date time
func (*DSE) GetMarketSummary ¶
func (d *DSE) GetMarketSummary() (*MarketSummary, error)
GetMarketSummary returns the last updated market summary data
type DSEShare ¶
type DSEShare struct {
}
DSEShare is a model for a single company's latest price data provided by the dse website
type DseMarketStatus ¶
DseMarketStatus holds the data for if market is open/close and when was last updated
type LatestPricesWithPercentage ¶
type LatestPricesWithPercentage struct {
ID int `json:"id"`
TradingCode string `json:"trading_code"`
LTP float64 `json:"ltp"`
High float64 `json:"high"`
Low float64 `json:"low"`
CloseP float64 `json:"close_p"`
YCP float64 `json:"ycp"`
PercentageChange float64 `json:"percentage_change"`
Trade int64 `json:"trade"`
ValueInMN float64 `json:"value"`
Volume int64 `json:"volume"`
}
LatestPricesWithPercentage ...
type MarketSummary ¶
type MarketSummary struct {
LastUpdatedOn struct {
Date string `json:"date"`
Time string `json:"time"`
} `json:"last_updated_on"`
DseX struct {
DSEXIndex float64 `json:"dsex_index"`
DSEXIndexChange float64 `json:"dsex_index_change"`
DSEXIndexChangePercentage float64 `json:"dsex_index_change_percentage"`
} `json:"dsex"`
Ds30 struct {
DS30Index float64 `json:"ds30_index"`
DS30IndexChange float64 `json:"ds30_index_change"`
DS30IndexChangePercentage float64 `json:"ds30_index_change_percentage"`
} `json:"ds30"`
DseS struct {
DSESIndex float64 `json:"dses_index"`
DSESIndexChange float64 `json:"dses_index_change"`
DSESIndexChangePercentage float64 `json:"dses_index_change_percentage"`
} `json:"dses"`
TotalTrade int64 `json:""`
TotalValueInMN float64 `json:""`
TotalVolume int64 `json:""`
IssuesAdvanced int32 `json:""`
IssuesDeclined int32 `json:""`
IssuesUnchanged int32 `json:""`
}
MarketSummary holds the data for market summary like DSEX index details and total trades and so on
type PriceEarningRatio ¶
type PriceEarningRatio struct {
SL string
TradingCode string
FinancialYear struct {
From string
To string
}
EPSAsPerUpdatedUnAuditedAccounts struct {
Quarter1 float64
HalfYear float64
Quarter3 float64
}
AnnualizedEPS float64
EPSBasedOnLastAuditedAccounts float64
ClosePrice float64
PERatioBasedOnAnnualizedEPS float64
PERatioBasedOnLastAuditedAccounts float64
}
PriceEarningRatio holds the data for a price earning ratio in selected date
type PriceEarningRatios ¶
type PriceEarningRatios struct {
Date string
PriceEarningRatioArray []*PriceEarningRatio
}
PriceEarningRatios ...
type Summary ¶
type Summary struct {
HighestRecords []*record
HistoricalSummaries []*market
}
Summary holds the historical market summaries array and the record trading or highest records data
type WeeklyReports ¶
type WeeklyReports struct {
Year int
Reports []*report
}
WeeklyReports holds the weekly reports for a Year