place_order: Function to place a trade.

View source: R/api_calls.R

place_orderR Documentation

Function to place a trade.

Description

Function to place a trade with specified details.

Usage

place_order(object, param)

Arguments

object

An object of type smart connect.

variety

Order variety, e.g. regular, bo, co or amo.

tradingsymbol

Trading Symbol of the instrument.

symboltoken

Symbol token

transactiontype

BUY or SELL.

exchange

Exchange for the order, e.g. NSE, NFO, CDS etc.

ordertype

Order type, e.g. MARKET, LIMIT, SL or SL-M.

producttype

Product type, e.g. MIS, NRML, CNC, BO or CO.

duration

Duration

price

Price if required (e.g. for limit orders).

squareoff

Price difference for profit booking (bracker orders).

stoploss

Price difference for loss booking (bracket orders).

quantity

Quantity of the order.

Details

This function sends an order with input details for execution. Please note not all parameters are relevant for all types of orders. This function (as with rest of the package) does no error checks and post the trade request as is. It is left to the function calling this method to carry out necessary error checks. If the order is successfully posted, an order ID will be returned. A successfully posted order does not mean it is a valid order, and orders with erroneous user input can be immediately cancelled. Therefore it is good practice to check the order details once an order ID is received from this call.

Value

Returns an order ID (string), if successful.


angelbroking-github/smartapi-r documentation built on March 30, 2022, 8:04 a.m.