Hi Team,
I wrote a naive code to place order using V3 Python package of Fyers as below:
for index, row in new_orders.iterrows():
qty = int(approx_margin_per_order/float(row['Entry-Price']))
if row['Decision'] == "Buy":
side = 1
else:
side = -1
order = {
"symbol": "NSE:"+row['Symbol']+"-EQ",
"qty": qty,
"type":1,
"side":side,
"productType": "BO",
"limitPrice": row['Entry-Price'],
"stopPrice": row['Trigger-Price'],
"validity": "DAY",
"disclosedQty": qty,
"offlineOrder": False,
"stopLoss": row['Stoploss'],
"takeProfit": row['Target']
}
print(order)
try:
order_response = fyers.place_order(order)
print(order_response)
except:
logger.error("Error in placing order")
However, I am getting below error in my logs, can anyone diagnose?
{'symbol': 'NSE:IRCON-EQ', 'qty': 6, 'type': 1, 'side': 1, 'productType': 'BO', 'limitPrice': '155.35', 'stopPrice': '155.3', 'validity': 'DAY', 'disclosedQty': 6, 'offlineOrder': False, 'stopLoss': '137.45', 'takeProfit': '185.5'}
{'code': -50, 'message': 'Invalid input', 's': 'error'}
{'symbol': 'NSE:ITI-EQ', 'qty': 3, 'type': 1, 'side': 1, 'productType': 'BO', 'limitPrice': '272.45', 'stopPrice': '272.4', 'validity': 'DAY', 'disclosedQty': 3, 'offlineOrder': False, 'stopLoss': '223.75', 'takeProfit': '325.3'}
{'code': -50, 'message': 'Invalid input', 's': 'error'}
For all orders in my pandas dataframe, I am getting same error.