I'd have a suggestion.
When I go to a shop and set it to buy x amount of that item, and the shop very quickly restores it's stock, it will eventually just keep on buying 1 at a time to reach that x amount (and since it restocks quicker than it can buy, it just keeps on buying 1).
e.g. The shop has a stock of 200, I want it to buy until it has 160 left. It reaches 164 and will now keep on buying 1 at a time to reach that 160 limit, but it restocks quicker so you're stuck at a slow buying, extremely click-intensive rate. (even if it reaches 165 and decides to buy 5, the restock went so quick so it already goes up again so it decides to buy 1 at a time again, resulting in staying at that world with a more depleted stock).
Hope this makes sense.
My suggestion would just be a buy until it's between x and x amount (in this case say between 160-170)
@Hashtag