R Package for Casablanca Stock Exchange (Morocco) Data.
# RCSE: Load and Manage Data from Casablanca Stock Exchange (Morocco)
The goal of RCSE is to provide an easy way to load and manage data from
Casablanca Stock Exchange (Morocco). The package is still under
development and will be updated regularly.
## Installation
You can install the development version of RCSE from
GitHub with:
``` r
# install.packages("devtools")
devtools::install_github("bilnash/RCSE")
```
## Example
### `get_symbols`
The function `get_symbols` allows you to get the list of symbols
available in the Casablanca Stock Exchange:
``` r
listed_symbols # A tibble: 6 × 2
#> title symbol
#>
#> 1 AFMA AFM
#> 2 AFRIC INDUSTRIES SA AFI
#> 3 AFRIQUIA GAZ GAZ
#> 4 AGMA AGM
#> 5 AKDITAL AKT
#> 6 ALLIANCES ADI
```
### `get_historical_data`
The function `get_historical_data` allows you to get the historical data
of a given symbol. This function takes in three arguments: `symbol`,
`start_date`, and `end_date`.
If `start_date` and `end_date` are not provided, the function will
return the historical data of the last 3 years (Casablanca Stock
Exchange API limit is 3 years).
Use the function `get_symbols` to get the list of symbols available in
the Casablanca Stock Exchange.
``` r
atw_data [1] 750 10
```
``` r
head(atw_data)
#> # A tibble: 6 × 10
#> date open high low close adjusted quantity_exchanged volume
#>
#> 1 2024-09-27 546 555 545. 555 555 154888 85483912.
#> 2 2024-09-26 548 550 546 550 550 25732 14129613.
#> 3 2024-09-25 547 559. 547 550 550 218367 120119821.
#> 4 2024-09-24 555 565. 546 547. 547. 181993 100631932.
#> 5 2024-09-23 546. 550 546. 550. 550. 19806 10875601.
#> 6 2024-09-20 553 555. 547 550. 550. 51560 28356446.
#> # ℹ 2 more variables: total_trades , capitalisation
```
Here is an exampl …