print(f"Request to API: {gtt_order_params}") print(f"Response from API: {response.json()}")
data = response.json() if data['status'] == 'success': trigger_id = data['data']['trigger_id'] print(f"GTT order placed successfully for {symbol}. Trigger ID: {trigger_id}") else: print(f"Error placing GTT order for {symbol}: {data}") except Exception as e: print(f"Error placing GTT order for {symbol}: {e}")
========== RESTART: ==========
Request to API: {'type': 'SINGLE', 'condition': {'exchange': 'NSE', 'tradingsymbol': 'RELIANCE', 'trigger_values': [2581.7], 'last_price': 2590.25}, 'orders': [{'exchange': 'NSE', 'tradingsymbol': 'RELIANCE', 'transaction_type': 'BUY', 'quantity': 1, 'order_type': 'LIMIT', 'product': 'CNC', 'price': 2581.7}]} Response from API: {'status': 'error', 'message': 'Invalid order params.', 'data': None, 'error_type': 'InputException'} Error placing GTT order for RELIANCE: {'status': 'error', 'message': 'Invalid order params.', 'data': None, 'error_type': 'InputException'}
PS: Please don't post app or client specific tokens on public threads. You may private message, if you have to share any of the tokens.