Indodax: API for Trading at Indodax

Description Usage Details Methods Author(s) See Also

Description

Connect to Indodax API endpoints

Usage

1
2
indodax$new()
indodax$new(url, key, secret)

Details

Help you connect to Indodax API endpoints and execute your trading function.

Note: this is not a robot trading. This only helps you connect and execute your trading command.

Methods

Public methods


Method new()

Initializing new object

Usage
indodax$new(url = NULL, secret = NULL, key = NULL)
Arguments
url

indodax api endpoint

secret

indodax secret API

key

indodax key API

Details

To initialize this object, you need to call 'new()' method that will span this initialize function. All the arguments are optional.

When not supplied, you need to store them in you .Renviron as: api_key_indodax for key secret_key_indodax for secret url_api_indodax for url


Method print()

Usage
indodax$print()
Details

Representation to print the object


Method posting()

Usage
indodax$posting(payload, params)
Arguments
payload

The post data that will be sent

params

The post data in url-encoded form

Details

Posting the data to the endpoint to get a response

Returns

Fetched object of the Indodax API


Method assetInfo()

Usage
indodax$assetInfo(timestamp = 1578304294000, recvWindow = 1578303937000)
Arguments
timestamp

the millisecond timestamp of when the request was created and sent

recvWindow

the number of millisecond after timestamp where your request is valid

Details

Gives us information about our current assets. It will give us the information about the current balance and current held balance

Returns

dataframe of balance and held balance


Method transHistory()

Usage
indodax$transHistory(
  timestamp = 1578304294000,
  recvWindow = 1578303937000,
  since = "2021-03-28 00:00:00"
)
Arguments
timestamp

the millisecond timestamp of when the request was created and sent

recvWindow

the number of millisecond after timestamp where your request is valid

Details

Fetch transaction history from Indodax server

Returns

list of transaction history


Method withdrawHistory()

Usage
indodax$withdrawHistory()
Details

Gives us the withdrawal history

Returns

Data frame of withdrawal history


Method depositHistory()

Usage
indodax$depositHistory()
Details

Gives us the deposit history

Returns

Data frame of deposit history


Method tradeHistory()

Usage
indodax$tradeHistory(
  pairs = "eth_idr",
  count = 1000,
  from_id = 0,
  end_id = 0,
  order = "desc",
  since = "2021-03-28 00:00:00",
  timestamp = 1578304294000,
  recvWindow = 1578303937000
)
Arguments
pairs

define specific pairs we want to watch. It supports the vector of pairs

count

number of trading history of each interested coin

from_id

trading id we want to watch from

end_id

the last trading id we want to watch

order

the order of the record

since

specifies the interested time frame of the history

timestamp

the millisecond timestamp of when the request was created and sent

recvWindow

the number of millisecond after timestamp where your request is valid

Details

Gives us the trading history of corresponding coin. We can grab as many as coins we are interested in by passing them as vector.

Returns

Raw content of the fetched API object


Method buyHistory()

Usage
indodax$buyHistory(
  pairs = "eth_idr",
  count = 1000,
  from_id = 0,
  end_id = 0,
  order = "desc",
  since = "2021-03-28 00:00:00",
  timestamp = 1578304294000,
  recvWindow = 1578303937000
)
Arguments
pairs

define specific pairs we want to watch. It supports the vector of pairs

count

number of trading history of each interested coin

from_id

trading id we want to watch from

end_id

the last trading id we want to watch

order

the order of the record

since

specifies the interested time frame of the history

timestamp

the millisecond timestamp of when the request was created and sent

recvWindow

the number of millisecond after timestamp where your request is valid

Details

Gives us the buy history of corresponding coin. We can grab as many as coins we are interested in by passing them as vector.

Returns

data.frame


Method sellHistory()

Usage
indodax$sellHistory(
  pairs = "eth_idr",
  count = 1000,
  from_id = 0,
  end_id = 0,
  order = "desc",
  since = "2021-03-28 00:00:00",
  timestamp = 1578304294000,
  recvWindow = 1578303937000
)
Arguments
pairs

define specific pairs we want to watch. It supports the vector of pairs

count

number of trading history of each interested coin

from_id

trading id we want to watch from

end_id

the last trading id we want to watch

order

the order of the record

since

specifies the interested time frame of the history

timestamp

the millisecond timestamp of when the request was created and sent

recvWindow

the number of millisecond after timestamp where your request is valid

Details

Gives us the buy history of corresponding coin. We can grab as many as coins we are interested in by passing them as vector.

Returns

data.frame


Method trade()

Usage
indodax$trade(
  pair,
  type,
  price,
  timestamp = 1578304294000,
  recvWindow = 1578303937000,
  idr = NULL,
  val = NULL
)
Arguments
pair

define specific pairs we want to watch. It supports the vector of pairs

type

type of command to execute (sell or buy)

price

at price should the command will be executed

timestamp

the millisecond timestamp of when the request was created and sent

recvWindow

the number of millisecond after timestamp where your request is valid

idr

amount of rupiah(s) that we want to spend to buy the coin(s)

val

amount of coin(s) that we want to sell

Details

Function to execute buy and sell. Do not directly execute the function. Use 'sell()' or 'buy()'.

Returns

raw data from server


Method sell()

Usage
indodax$sell(pair, val, ...)
Arguments
pair

define specific pairs we want to watch. It supports the vector of pairs

val

amount of coin(s) that we want to sell

Details

Execute sell command.

Returns

data_frame


Method buy()

Usage
indodax$buy(pair, idr, ...)
Arguments
pair

define specific pairs we want to watch. It supports the vector of pairs

idr

amount of rupiah(s) that we want to spend to buy the coin(s)

Details

Execute buy command.

Returns

data_frame


Method openOrders()

Usage
indodax$openOrders(
  pair = NULL,
  timestamp = 1578304294000,
  recvWindow = 1578303937000
)
Arguments
pair

define specific pairs we want to watch. It supports the vector of pairs

timestamp

the millisecond timestamp of when the request was created and sent

recvWindow

the number of millisecond after timestamp where your request is valid

Details

Execute command to open order position

Returns

raw content of the function


Method orderHistory()

Usage
indodax$orderHistory(
  pairs,
  count = 1000,
  from = 0,
  timestamp = 1578304294000,
  recvWindow = 1578303937000
)
Arguments
pairs

define specific pairs we want to watch. It supports the vector of pairs

count

number of trading history of each interested coin

from

order id we want to watch from

timestamp

the millisecond timestamp of when the request was created and sent

recvWindow

the number of millisecond after timestamp where your request is valid

Details

Get the details order history opened

Returns

raw content of the function


Method getOrder()

Usage
indodax$getOrder(
  pair,
  order_id,
  timestamp = 1578304294000,
  recvWindow = 1578303937000
)
Arguments
pair

define specific pair we want to watch. It does not support the vector of pair.

order_id

order_id that we want to check the detail of

timestamp

the millisecond timestamp of when the request was created and sent

recvWindow

the number of millisecond after timestamp where your request is valid

Details

Get the details of a specific order

Returns

data.frame


Method cancelOrder()

Usage
indodax$cancelOrder(
  pair,
  order_id,
  type,
  timestamp = 1578304294000,
  recvWindow = 1578303937000
)
Arguments
pair

define specific pair we want to watch. It does not support the vector of pair.

order_id

order_id that we want to check the detail of

type

order type that we want to cancel (buy or sell)

timestamp

the millisecond timestamp of when the request was created and sent

recvWindow

the number of millisecond after timestamp where your request is valid

Details

Cancel specific order id

Returns

data.frame


Method clone()

The objects of this class are cloneable with this method.

Usage
indodax$clone(deep = FALSE)
Arguments
deep

Whether to make a deep clone.

Author(s)

Suberlin Sinaga (2021)

See Also

httr for API management in R


blakcjack/coinTrader documentation built on Dec. 19, 2021, 9:51 a.m.