library(magrittr)
knitr::opts_chunk$set(
    collapse = TRUE,
    comment = "#>",
    fig.path = "README-"
)

Project Status: Moved to https://github.com/bilnash/RCSE – The project has been moved to a new location, and the version at that location is no longer working due to changes in Casablanca Stock Exchange API.

Warning: The project has been moved to a new location, and the version at that location is no longer working due to changes in Casablanca Stock Exchange API. New version is available at [https://github.com/bilnash/RCSE

CSE

The goal of CSE (Casablanca Stock Exchange) is to simplify financial programming workflow with Casablanca stock exchange data.

Currently, it implements 3 mains functions:

Installation

You can install CSE from github with:

# install.packages("devtools")
devtools::install_github("bilnash/CSE", build_vignettes = FALSE)
# install.packages("devtools")
devtools::install_github("bilnash/CSE", build_vignettes = TRUE)

Documentation

Please refer to the package vignette:

vignette("cse_vignette", package = "CSE")

Also available at: https://bilnash.github.io/CSE/vignettes/cse_vignette.html

Basic Example

This is a basic example which shows you how to use CSE:

listed_stocks <- CSE::listed_symbols(type = "stock")

available_indexes <- CSE::listed_symbols(type = "index")
sample(listed_stocks, size = 6L)
sample(listed_stocks, size = 6L) %>%
    dplyr::tibble(Stock = .) %>%
    knitr::kable()
head(available_indexes)
head(available_indexes) %>%
    knitr::kable()
cosumar_data <- CSE::get_symbol(symbol = "COSUMAR", from = "2015-01-01", to = "2021-09-29", 
                                type = "stock", format.as.xts = FALSE)

masi_data <- CSE::get_symbol(symbol = "MASI", from = "2015-01-01", to = "2021-09-29", 
                             type = "index", format.as.xts = FALSE)
head(cosumar_data)
head(cosumar_data) %>%
    knitr::kable()
tail(masi_data)
tail(masi_data) %>%
    knitr::kable()


bilnash/CSE documentation built on Oct. 1, 2024, 4:17 p.m.