Getting the error " GTT order failed. Invalid `order_type`. " when GTT is fired , which is placed by kite connect api . this is the function i used to place it Please note level is a price
From your code snippet let url="/api/PlaceGTT"; this API root is not part of Kite Connect. If there is an interface between above code and Kite Connect, check what is actually being sent to Kite Connect APIs.
{"tradingsymbol":"AARTIIND","exchange":"NSE","trigger_values":[482.4],"last_price":511.75} AND params.trigger_type=kc.GTT_TYPE_SINGLE; where kc is the object
let url="/api/PlaceGTT";
this API root is not part of Kite Connect. If there is an interface between above code and Kite Connect, check what is actually being sent to Kite Connect APIs.This is the node js code of the api you are referring to . Kindly help
app.post('/api/PlaceGTT', async (req,res) => {
let params=req.body.params;
let accessToken=req.body.accessToken;
try {
var kc = new KiteConnect({
api_key: api_key,
access_token: accessToken
});
params.trigger_type=kc.GTT_TYPE_SINGLE;
let out=await kc.placeGTT(params);
res.send(out);
return;
} catch (error) {
console.log(error,'this error')
}
{"tradingsymbol":"AARTIIND","exchange":"NSE","trigger_values":[482.4],"last_price":511.75}
then from back end i
set
params.trigger_type=kc.GTT_TYPE_SINGLE;
Kindly help in solving this
We can't help you with the details about what you are sending. Can you please give us the request logs?
debug=True
in the kiteConnect object initialization, and paste those logs here.