README.md

Instrument(s) Management System (ims)

INTRODUCTION

Instrument(s) Management System is an R library that help you manage your trading scenario even better. You don't need to worry about tracking your instrument, updating your portfolio, manage your account, or even help you manage your strategies better and faster. Many other functions will come.

INSTALL

In order to install the package, you can use devtools to do that. You can install it as follow.

devtools::install_github("blakcjack/ims")

Available Class

  1. Data Pooler

At the moment, this class is only meant to scrape/pool historical data from indodax regarding the coins. Many will come (soon).

To pool the historical data, you just need to follow the following simple step:

``` library(ims)

# initialize object dp <- data_pooler$new()

# pooling specific coin data dp$indodax_crypto_pooler(date_range = c('2021-01-01', '2021-02-01'), 'btc_idr', resolution = 1, type = 'initial')

# if found missing data where the interval is different, fix it by using indodax_data_fixer dp$indodax_data_fixer(asset_name = 'btc_idr', resolution = 1, interval = 60)

# if you have done with the data and want to store it to your data base, you can call the push_data method dp$push_data(db_name = 'trading_table', table_name = 'btc_1_minute', .fun = SQLite())

# in order to get help regarding the object ?data_pooler ```

Notes: - If not changed, you can leave the url blank - Interval is in second, while resolution is in 1 minute as min. - You may need add additional parameter when you use another db drive functions other than SQLite.

  1. Instrument

This object is the main object and the goals to create this package. Instrument(s) is as simple as portfolio that you bought (your asset(s)). Portfolio can be a bond, securities, or stocks. When buying those portfolio, of course you need an account. The combinations of those three are what this object simply provides to you.

When creating the instrument it will ask you to enter the instrument's owner. You can have multiple account from many platform. But you have to ensure that each object must represents only one owner. To work with this object you can do as follow.

library(ims)

# initialize object
assets <- instrument$new("Jhon Doe")

# To add instrument, you have to add account first. Call add_acount method
assets$add_account(platform = 'Binance', name = 'Jhon Doe', username = 'jhon_so_cute', totDep = 0, totWithd = 0)

# To add an instrument, you can call add_instrument method. But, before that you have to know your account id first
assets$add_instrument(account_id = 1, portfolio_symbol = 'btc', open_price = 5000, value = 5, order_id = 1237745, user_name = 'jhon_so_cute', platform = 'Binance')

# to list all your account_id, you can call as follow
assets$list_all_account

# adding indikator into your portfolio. Let's say we want to add SMA using n = 3
assets$add_inidcator(TTR::SMA, SMA_3, n = 3)


blakcjack/ims documentation built on Dec. 19, 2021, 9:52 a.m.