Hi, I am getting following error:
NIFTY23SEP19750PE {'code': '500', 'data': TypeError('Object of type int64 is not JSON serializable')}
I am getting above error randomly sometimes. Please help me.
Here's my order placement code:
def placeOrderFyers(inst ,t_type,qty,order_type,price,variety):
exch = inst[:3]
symb = inst[4:]
papertrading = 1
print(" => ",t_type," ",symb," ",qty," ",order_type," @ price = ",price)
if(order_type=="MARKET"):
type1 = 2
elif(order_type=="LIMIT"):
type1 = 1
if(t_type=="BUY"):
side1=1
elif(t_type=="SELL"):
side1=-1
data = {
"symbol":inst,
"qty":qty,
"type":type1,
"side":side1,
"productType":"INTRADAY",
"limitPrice":0,
"stopPrice":0,
"validity":"DAY",
"disclosedQty":0,
"offlineOrder":"False",
"stopLoss":0,
"takeProfit":0
}
try:
if (papertrading == 1):
orderid = fyers.place_order(data)
print(" => ", symb , orderid)
return orderid
else:
return 0
except Exception as e:
print(" => ", symb , "Failed : {} ".format(e))