orderADD: Recorde an order's trade

View source: R/orderADD.R

orderADDR Documentation

Recorde an order's trade

Description

This function is used to submit buy and sell orders on the Nobitex website

Usage

orderADD(typ, src, dst, amnt, prc, stp = NULL, stpL = NULL, exe = "limit", token)

Arguments

typ

"buy" is used for placing buy orders, while "sell" is used for placing sell orders

src

Cryptocurrency sources are defined by lowercase names in the function (e.g., "btc", "eth", "bnb", "paxg").

dst

For the Rials or USD system, the destination currency must be set to either "rls" or "usdt".

amnt

Amount of cryptocurrency to trade

prc

Price of cryptocurrency to trade. The trade price ("prc") depends on the exe's option.

stp

If using stop-loss or OCO, define the stop price here. Default is NULL. When the market price reaches "stp", "prc" is activated and recorded in the order list. For a "buy" position, "stp" must be greater than "prc"; for a "sell"" position, "stp" must be less than prc.

stpL

If using "oco" then stop limit price must be defined. Defualt is NULL. While "stp" is active, "stpl" is recorded as the trade price; otherwise, "prc" is used.

exe

Three common ways to configure a trade: regular trading, stop-loss trading, or One-Cancels-the-Other (OCO) trading.
Regular trading: The limit will be recorded in prc as the trade price. The market will be recorded in prc as the nearest trade price to the latest bid or ask, depending on the buyer or seller.
Stop loss trading: stop_limit and stop_market are two trade types that depend on price of stp.
OCO: Using oco requires defining two price: stp and stpL.

token

The token is string value obtain from user ID settings in the NOBITEX. If you are not registered on the website, please use the provided link.

Value

Returns a list: "ok" if the order is recorded successfully on the website; otherwise, "failed".

Examples

## Not run: 
tkn <- "CONTACT WITH AUTHOR"
x <- orderADD(typ = "sell", src = "usdt", dst = "rls", amnt = 5, prc = 1600000,
              + exe = "limit", token = tkn)

x <- orderADD(typ = "sell", src = "usdt", dst = "rls", amnt = 5, prc = 1400000,
              + stp = 1300000, exe = "stop_limit", token = tkn)

x <- orderADD(typ = "sell", src = "usdt", dst = "rls", amnt = 5, prc = 1400000,
              + stp = 1300000, stpL = 1350000, exe = "oco", token = tkn)

## End(Not run)

TSEtools documentation built on Jan. 8, 2026, 5:07 p.m.