Not Getting active, orders place in delta indian prod server

I have place live trade in delta exchange (India) server, trade is visible but while fetching trade from api am getting empty response, code shared below.

One Catch
If order are place with stoploss and targetprice we get 2 orders, but active trade is not capture in api request.

    method = 'GET'
    timestamp = str(int(time.time()))
    path = '/v2/orders'
    url = f'{base_url}{path}'
    query_string = '?states=open'
    payload = ''
    signature_data = method + timestamp + path + query_string + payload
    signature = generate_signature(api_secret, signature_data)
    req_headers = {
        'api-key': api_key,
        'timestamp': timestamp,
        'signature': signature,
        'User-Agent': 'python-rest-client',
        'Content-Type': 'application/json'
    }
    query = { "states": 'open'}

    response = requests.request(method, url, data=payload,params=query, timeout=(3, 27), headers=req_headers)
    return response.json()

Getting Below Response

{'meta': {'after': None, 'before': None, 'limit': 10, 'total_count': 0},
 'result': [],
 'success': True}

Hi @arbaz00789

with the above call you might be seeing your SL and TP as they are yet to be executed and are in an open state. but not your executed order as it is now considered as an active position.

  • If your trade is executed (i.e., order is filled), it moves from “open orders” to positions.

  • The endpoint /v2/orders?states=open only fetches open orders, not active positions.

  • to capture active trade call the endpoint /v2/positions,