PART 1:
I wish to create a single sell Forever stoploss order like this one using API.
The order should sell at Market Price when stoploss is hit. Its only a sell order to sell from holdings.
I tried this, but it fails with DH-905. any help here?
curl --request POST
–url https____://api.dhan.co/v2/forever/orders
–header ‘Accept: application/json’
–header ‘Content-Type: application/json’
–header 'access-token: <SECRET_TOKEN>’
–data ‘{
“dhanClientId”: “<CLIENT_ID>”,
“orderFlag”: “SINGLE”,
“transactionType”: “SELL”,
“exchangeSegment”: “NSE_EQ”,
“productType”: “CNC”,
“orderType”: “MARKET”,
“securityId”: “11654”,
“quantity”: 15,
“price”: 3281,
“disclosedQuantity”: 0,
“triggerPrice”: 3282,
“validity”: "DAY”
}’
PART 2:
Once created I should be able to change the price / quantity. I tried the PUT call but similar error
curl --request PUT
–url https_____://api.dhan.co/v2/forever/orders/<ORDER_ID>
–header ‘Accept: application/json’
–header ‘Content-Type: application/json’
–header 'access-token: <TOKEN’>
–data ‘{
“dhanClientId”: “<CLIENT_ID>“,
“orderId”: “<ORDER_ID>”,
“orderFlag”: “SINGLE”,
“orderType”: “MARKET”,
“legName”: “ENTRY_LEG”,
“quantity”: 15,
“price”: 0,
“triggerPrice”: 3282.1,
“validity”: “DAY”
}’
Need some help here.