Please help how to go about and prevent this error.
Before placing a sell order i am trying to make sure buy orderstatus is traded
and then place sell order. Please help.
Ideally before placing the sell order we would like to make sure the buy order is executed/traded. For this we would ideally like to poll and get the status. Is there any alternative for this. Please help.
Thanks
Sai
But ideally we would like to check the status of the order every second for our target and place a sell order immediately as the price can go down or otherwise . How do you suggest we handle this. Please help.
Sai
if you are checking every second, you are making 3600 calls per hour.
The actual rate limit by dhan is 1000 (Non trading apis)
So as I see there is no other option, you can add 4 sec sleep time before making next call. this will result in 900 calls per hour.
Also, assuming you have multiple orders pending, you cannot check for each order every second to get the update. That would be an unwanted exploitation, hence the rate limits.
We are going to introduce an alternate to this very soon, which will solve for this. For now, you can keep a buffer between each subsequent API poll.
Kedar
In the 4 secs gap you are proposing if the target is reached in the first second and changed immediately to below target in the next second then we are at a loss right. Any suggestions please.
Sai
Hardik
Desperately waiting for this solution. By when you are expecting this to be released.
Any additional suggestions in the meantime would be of great help.
Sai