Skip to content

Commit

Permalink
Merge branch 'kenarab-dev-kenarab'
Browse files Browse the repository at this point in the history
  • Loading branch information
augustohassel committed Jun 27, 2019
2 parents 48f24b1 + 4f89d68 commit 15a7996
Show file tree
Hide file tree
Showing 3 changed files with 11 additions and 11 deletions.
14 changes: 7 additions & 7 deletions R/primary_api.R
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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.")

Expand Down Expand Up @@ -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")
Expand Down Expand Up @@ -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")
Expand Down Expand Up @@ -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.")
Expand Down Expand Up @@ -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")
Expand Down Expand Up @@ -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.")

Expand Down
4 changes: 2 additions & 2 deletions README.Rmd
Original file line number Diff line number Diff line change
Expand Up @@ -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: <[email protected]> for more information.
Expand All @@ -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)
Expand Down
4 changes: 2 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -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.
Expand All @@ -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)
Expand Down

0 comments on commit 15a7996

Please sign in to comment.