diff --git a/R/primary_api.R b/R/primary_api.R index f1d74b5..4f3f8f2 100644 --- a/R/primary_api.R +++ b/R/primary_api.R @@ -80,7 +80,7 @@ trading_login <- function(username, password, env="reMarkets") { #'@examples #'\dontrun{trading_instruments()} trading_instruments <- function(request, sec_detailed = FALSE) { - if (!exists(".x_auth_token")) stop("You should first log in using primary_login()") + if (!exists(".x_auth_token")) stop("You should first log in using trading_login()") if (!request %in% c("segments", "securities")) stop("Invalid 'request' parameter.") # Segments @@ -142,7 +142,7 @@ trading_instruments <- function(request, sec_detailed = FALSE) { #'@examples #'\dontrun{trading_md(symbol='I.RFX20')} trading_md <- function(market_id='ROFX', symbol, entries=c('BI', 'OF', 'LA', 'OP', 'CL', 'SE', 'OI'), depth=1L) { - if (!exists(".x_auth_token")) stop("You should first log in using primary_login()") + if (!exists(".x_auth_token")) stop("You should first log in using trading_login()") if (!market_id %in% c("ROFX")) stop("Invalid 'market_id' parameter.") if (missing(symbol)) stop("You should pick a 'symbol' to move forward.") @@ -193,7 +193,7 @@ trading_md <- function(market_id='ROFX', symbol, entries=c('BI', 'OF', 'LA', 'OP #'@examples #'\dontrun{trading_mdh(symbol='I.RFX20')} trading_mdh <- function(market_id='ROFX', symbol, date, date_from, date_to) { - if (!exists(".x_auth_token")) stop("You should first log in using primary_login()") + if (!exists(".x_auth_token")) stop("You should first log in using trading_login()") if (!market_id %in% c("ROFX")) stop("Invalid 'market_id' parameter") if (missing(symbol)) stop("You should pick a 'symbol' to move forward.") if (missing(date) & (missing(date_from) | missing(date_to))) stop("Invalid date parameters") @@ -266,7 +266,7 @@ trading_mdh <- function(market_id='ROFX', symbol, date, date_from, date_to) { #' #'@return List with outputs like state of the order. trading_new_order <- function(symbol, side, quantity, price, order_type='Limit', time_in_force='Day', account) { - if (!exists(".x_auth_token")) stop("You should first log in using primary_login()") + if (!exists(".x_auth_token")) stop("You should first log in using trading_login()") market_id <- "ROFX" if (!market_id %in% c("ROFX")) stop("Invalid 'market_id' parameter") @@ -330,7 +330,7 @@ trading_new_order <- function(symbol, side, quantity, price, order_type='Limit', #' #'@return List with outputs like state of the order. trading_cancel_order <- function(order_id, proprietary) { - if (!exists(".x_auth_token")) stop("You should first log in using primary_login()") + if (!exists(".x_auth_token")) stop("You should first log in using trading_login()") if (missing(order_id)) stop("You should pick a 'order_id' to move forward.") if (missing(proprietary)) stop("You should pick a 'proprietary' to move forward.") @@ -368,7 +368,7 @@ trading_cancel_order <- function(order_id, proprietary) { #' #'@return A data frame. trading_lookup <- function(lookup_type, order_id, proprietary) { - if (!exists(".x_auth_token")) stop("You should first log in using primary_login()") + if (!exists(".x_auth_token")) stop("You should first log in using trading_login()") if (missing(lookup_type)) stop("You should pick a 'lookup_type' to move forward.") if (!lookup_type %in% c("COID", "OID")) stop("Invalid 'lookup_type' parameter") @@ -407,7 +407,7 @@ trading_lookup <- function(lookup_type, order_id, proprietary) { #' #'@return A data frame. trading_orders <- function(account) { - if (!exists(".x_auth_token")) stop("You should first log in using primary_login()") + if (!exists(".x_auth_token")) stop("You should first log in using trading_login()") if (missing(account)) stop("You should pick an 'account' to move forward.") diff --git a/README.Rmd b/README.Rmd index 9f740c4..6f57993 100644 --- a/README.Rmd +++ b/README.Rmd @@ -58,7 +58,7 @@ These are the currently available methods: - Historical Market Data - Send Orders -Available envirnorments: +Available environments: - *Demo environrment*: go to [reMarkets](https://remarkets.primary.ventures/) to get credentials. - *Production*: it needs credetentials. Please contact: for more information. @@ -69,7 +69,7 @@ Available envirnorments: library(rRofex) # Once you have cretencials, you'll be able to get a token when you login -rRofex::trading_login(username=XXX, password=XXX, environment='reMarkets') +rRofex::trading_login(username = XXX, password = XXX, env ='reMarkets') # You can get a complete Reference Data list with details rRofex::trading_instruments(request = "securities", sec_detailed = T) diff --git a/README.md b/README.md index 0b76b67..68b0ee6 100644 --- a/README.md +++ b/README.md @@ -50,7 +50,7 @@ These are the currently available methods: - Historical Market Data - Send Orders -Available envirnorments: +Available environments: - *Demo environrment*: go to [reMarkets](https://remarkets.primary.ventures/) to get credentials. @@ -63,7 +63,7 @@ Available envirnorments: library(rRofex) # Once you have cretencials, you'll be able to get a token when you login -rRofex::trading_login(username=XXX, password=XXX, environment='reMarkets') +rRofex::trading_login(username = XXX, password = XXX, env = 'reMarkets') # You can get a complete Reference Data list with details rRofex::trading_instruments(request = "securities", sec_detailed = T)