Hi team,
I tried to change the DNS also and now i can confidently say that the issue is just random. Let me share some details for the order I placed today using api.
The most recent order, I placed kept on running for 6 mins and 34 seconds.
Please see the log below.
My order was supposed to be placed at 10:49:17 as usual. But it kept on running for 6 mins 34 second and finally my market order for filled. But one more weird this is that, from my order id it was supposed to fetch buy price to calculate the stop loss. But it is brining it as 0 so my stop loss order also throwing an error since It can not take 0 as price.
PLEAE NOTE that, I placed two orders using the same code before this order and they got filled successfully, stop loss was placed success fully.
AND before that, my first order at 9:24 also faced the same issue. Getting stuck.
so basically this is what happened:
1st order at 9:24 - Got stuck
2nd and 3rd order - Got placed using api-
4th order - the below log file. Got stuck.
2025-02-14 10:49:16,504 INFO Sys path: [‘my/local/path***/Build_NIFTY_FNO_BUY_ORDER__NP__2025-02-14T05-19-01.736/compute_NIFTY_FNO_BUY_ORDER_NP/python-recipe/pyout0qCvY0k2w0LT’, ‘DATA_DIR/lib/python’, ‘/my/local/path***/python’, ‘/usr/lib/python37.zip’, ‘/usr/lib/python3.7’, ‘/usr/lib/python3.7/lib-dynload’, ‘/home/DATA_DIR/code-envs/python/code_env_1/lib/python3.7/site-packages’, ‘my/local/path***/DATA_DIR/jobs/QUANT_PROD/Build_NIFTY_FNO_BUY_ORDER__NP__2025-02-14T05-19-01.736/compute_NIFTY_FNO_BUY_ORDER_NP/python-recipe/pyout0qCvY0k2w0LT/project-python-libs/QUANT_PROD/python’]
2025-02-14 10:49:16,505 INFO Script file: my/local/pathDATA_DIR/jobs/QUANT_PROD/Build_NIFTY_FNO_BUY_ORDER__NP__2025-02-14T05-19-01.736/compute_NIFTY_FNO_BUY_ORDER_NP/python-recipe/pyout0qCvY0k2w0LT/script.py
my/local/path/DATA_DIR/code-envs/python/code_env_1/lib/python3.7/site-packages/pkg_resources/init.py:121: DeprecationWarning: pkg_resources is deprecated as an API
warnings.warn(“pkg_resources is deprecated as an API”, DeprecationWarning)
my/local/path***/DATA_DIR/code-envs/python/code_env_1/lib/python3.7/site-packages/pkg_resources/init.py:2870: DeprecationWarning: Deprecated call to pkg_resources.declare_namespace('mpl_toolkits')
.
Implementing implicit namespace packages (as specified in PEP 420) is preferred to pkg_resources.declare_namespace
. See Keywords - setuptools 75.8.0.post20250203 documentation
declare_namespace(pkg)
close_price: 22887.6
22900
NSE_FO|63522 197.35
placing Market order
MKT ORDER
{‘data’: {‘order_id’: ‘250214010157651’}, ‘status’: ‘success’}
buy price : 0.0
0.0
0.0
placing SL-L order
/home/DATA_DIR/code-envs/python/code_env_1/lib/python3.7/site-packages/upstox_client/rest.py:45: DeprecationWarning: HTTPResponse.getheaders() is deprecated and will be removed in urllib3 v2.1.0. Instead access HTTPResponse.headers directly.
return self.urllib3_response.getheaders()
Exception when calling OrderApi->place_order: (400)
Reason: Bad Request
HTTP response headers: HTTPHeaderDict({‘Date’: ‘Fri, 14 Feb 2025 05:25:50 GMT’, ‘Content-Type’: ‘application/json’, ‘Transfer-Encoding’: ‘chunked’, ‘Connection’: ‘keep-alive’, ‘Vary’: ‘Origin, Access-Control-Request-Method, Access-Control-Request-Headers’, ‘message’: ‘request failed’, ‘requestId’: ‘ae47d80e-682d-4783-a9fa-6f3d8861b718’, ‘X-Content-Type-Options’: ‘nosniff’, ‘X-XSS-Protection’: ‘1; mode=block’, ‘Cache-Control’: ‘no-cache, no-store, max-age=0, must-revalidate’, ‘Pragma’: ‘no-cache’, ‘Expires’: ‘0’, ‘Strict-Transport-Security’: ‘max-age=31536000 ; includeSubDomains’, ‘X-Frame-Options’: ‘DENY’})
HTTP response body: b’{“status”:“error”,“errors”:[{“errorCode”:“UDAPI1052”,“message”:“The order ''quantity'' cannot be zero”,“propertyPath”:“quantity”,“invalidValue”:0,“error_code”:“UDAPI1052”,“property_path”:“quantity”,“invalid_value”:0},{“errorCode”:“UDAPI1041”,“message”:“The ''price'' and ''trigger_price'' both are required”,“propertyPath”:“price, trigger_price”,“invalidValue”:[0.0,0.0],“error_code”:“UDAPI1041”,“property_path”:“price, trigger_price”,“invalid_value”:[0.0,0.0]},{“errorCode”:“UDAPI1038”,“message”:“Trigger price should be greater than limit price”,“propertyPath”:“price, trigger_price”,“invalidValue”:[0.0,0.0],“error_code”:“UDAPI1038”,“property_path”:“price, trigger_price”,“invalid_value”:[0.0,0.0]}]}’
2025-02-14 10:55:50,445 INFO Initializing dataset writer for dataset QUANT_PROD.NIFTY_FNO_BUY_ORDER