post_kucoin_market_order: Post a market order

Description Usage Arguments Value Examples

View source: R/market-order.R

Description

Post a market order

Usage

1
2
post_kucoin_market_order(symbol, side, base_size = NULL,
  quote_size = NULL)

Arguments

symbol

A character vector of one or more pair symbol.

side

A character vector of one which specify the order side: "buy" or "sell".

base_size, quote_size

A numeric vector which specify the base or quote currency size.

Value

If the transaction success, it will return a character vector which showing the order id

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
## Not run: 

# to run this example, make sure
# you already setup the API key
# in a proper .Renviron file

# import library
library(rucoin)

# post a market order: buy 1 KCS
order_id <- post_kucoin_market_order(
  symbol = "KCS/BTC",
  side = "buy",
  base_size = 1
)

# quick check
order_id

# post a market order: sell 1 KCS
order_id <- post_kucoin_market_order(
  symbol = "KCS/BTC",
  side = "sell",
  base_size = 1
)

# quick check
order_id

# post a market order: buy KCS worth 0.0001 BTC
order_id <- post_kucoin_market_order(
  symbol = "KCS/BTC",
  side = "buy",
  quote_size = 0.0001
)

# quick check
order_id

# post a market order: sell KCS worth 0.0001 BTC
order_id <- post_kucoin_market_order(
  symbol = "KCS/BTC",
  side = "sell",
  base_size = 0.0001
)

# quick check
order_id


## End(Not run)

bagasbgy/rucoin documentation built on Jan. 1, 2020, 8:34 p.m.