Place Order
- The order placement API call, allows to place order across all the accounts that are activated and linked to the strategy.
- If strategy link is deactivated or if the account is deactivated, orders will not be placed in any account.
- Details regarding Order placement with Rest API can be found here.
- Supported Order Types :
- Market
- Limit
- SL-Limit
- Supported Product Types : (Product types are automatically adjusted on the basis of Cash and FnO type of instruments)
- Intraday
- Delivery
- Tokens for order placement can be fetched from here.
- Splitby (default value : 0), this allows to split quality of the order into small batches and place them with same
strefid
strefid
: ST Reference id is a unique number generated for an order placed under a strategy. It contains all the orders placed in all the accounts linked with the strategy (This id can be used to modify/cancel orders across all the accounts with single api call).refid
: Reference id is a unique number generated for an order placed under a strategy in a specific account.orderid
: Order id is a unique number generated by the broker.operations
: While placing order operations feature can be used to smartly execute the order, more details here
Market Order Example :
from maticalgos.sparkLib import SparkLib
spk = SparkLib(apikeys="apikeys")
spk.generate_token()
spk.placeorder(
strategyName='test1',
orderType='Market',
productType='Intraday',
token = 'NSE:212', #ASHOKLEY token
qty = 1,
transType = 'Buy',
limitPrice=0,
splitby = 0
)
Response :
Response contains the strefid
of the order and account names with UCC
i.e UCC:AccountName
.
{
"status": true,
"error": false,
"data": [{
"strefID": "123456",
"placedIn": ["F000000:account1","F000000:account2"]
}],
"message": "Order placed in F000000:account1, F000000:account2"
}
What is UCC?
UCC
or Unique User Code, is a unique value assigned to all the clients. It can be found using /profile/
Api Call or can be found in Settings.
Limit Order Example :
from maticalgos.sparkLib import SparkLib
spk = SparkLib(apikeys="apikeys")
spk.generate_token()
spk.placeorder(
strategyName='test1',
orderType='Limit',
productType='Intraday',
token = 'NSE:212', #ASHOKLEY token
qty = 1,
transType = 'Buy',
limitPrice=201.1,
splitby = 0
)
SL-Limit Order Example :
from maticalgos.sparkLib import SparkLib
spk = SparkLib(apikeys="apikeys")
spk.generate_token()
spk.placeorder(
strategyName='test1',
orderType='SL-Limit',
productType='Intraday',
token = 'NSE:212', #ASHOKLEY token
qty = 1,
transType = 'Buy',
limitPrice=201.1,
splitby = 0
triggerPrice=202.2
)