If I'm aiming to buy a stock at close and sell it at close tomorrow, speculating that the price will increase by then, how many shares can be purchased without affecting the price of the stock such that the increase in the price that I speculated is disrupted? For example, a stock with an avg volume of 20,000 and price of 2$.
There's no way to definitively answer the question other than to say that less liquid stocks are more apt to move in price than more liquid stocks. Each day, it depends on the buy/sell dispersion in the order book. Given that, let's go with your numbers and make up some more.
If there are 20,000 shares offered for sale from $2.00 to $2.05 (ask price) and no further sellers appear, it will take the buying of 20,000 shares to move price up 5 cents.
OTOH, suppose that there are 20,100 shares offered for sale at $2.00 and buyers take out 20,000 shares at $2.00 then price will remain at $2.00
The first metric I would look at would be the average daily volume. I would only look to trade stocks with an average daily volume of at least 10x the volume I was looking to trade.
For example, if you were looking to trade 10,000 shares, you would only look for shares with an average daily volume of at least 100,000.
As a second metric I would also only trade stocks with a tight spread. Using these 2 metrics you shouldn't move the market more than a couple of cents with your trades.
You are effectively asking how many shares can be traded at or near the close of market without affecting price dramatically. The answer is on average about 3-4% of the volume near close. This varies greatly. It will be much less than 0.5% of the daily volume.
Another factor is the volatility (vol) of the instrument for the day compared to its average vol. The more abnormal the volatility, the larger volumes the close will do.
You can't easily say for sure, because it depends on many hidden variables like market sentiment. Long term, if the asset has been trading flat, and you slowly buy a bunch at market price, you might not affect it at all. If you buy during an upswing, you might cause a bubble. But it all depends on how other traders watching it will "read" your buy and that may vary quite a lot.
For market orders in the short term, you can get a rough estimate from the order book. This will list price P and amount V for every ask. Add up P1*V1+P2*V2+...+Pi*Vi until V1+V2+...+Vi is the amount you're trying to buy. The moment after you execute an instantaneous market buy, the new market price will be Pi, by definition.
Why the italics? Market buys take nonzero time to process. (In fact, your broker will have to split your market buy into multiple orders, unless there's a single ask big enough to satisfy it.) As soon as one ask is filled the other asks may react. You may trigger stop loss orders which will then place a new ask, potentially changing the set of asks that will be taken. Some asks may be conditional or algorithmic, and when they see you take the first ask, they may immediately shift their price down. Manual reactions will happen soon after your trade completes, and while technically the market price is whatever the asset traded at last, traders have no obligation to follow the last price. Even after you come out of your deep market buy at Pi, they may decide to ignore you and keep trading at P1 anyway. Also, there might be market sells that coincide with your market buy.
Looking at my stock screener, I found that XELB averages about 20k volume and traded last at 2.15. Keep in mind that this is a microcap (only 40M) and it's not very liquid. But here's a 1Y Yahoo chart:
Is there's a relation? I don't see it.
There doesn't seem to be a publicly available order book, but we can look at how volume and price affected each other in the past. Using daily data from the last year, we can try plotting volume vs. difference from previous days OHLC:
Is there a relation? I don't see it.
Well, maybe depending on trade volume during the day, the price was momentarily pushed to very low or very high levels vs. the open of that day? We can plot HLC vs Open of that day, getting a new value of "relative" HLC:
Is there a relation? I don't see it.
Now we can keep looking for more complex relations with more advanced filtering... But I think at this point I've sufficiently demonstrated my point, which is: "There's no easy way to tell."
The technically correct answer is zero: Every share bought or sold will affect the price.
But if you're the average small investor, talking about buying perhaps a few thousand dollars worth of stock in a billion dollar company, your purchase is a drop in the ocean and your affect on the price will be lost in the statistical noise of all the other things happening out there.
Unless you're talking about buying a measurable percentage of the stock, you're just not going to make any noticeable difference. If you buy $10,000 of a $1 billion company, you're buying 1/1,000th of 1%. You might shift the price by a fraction of a penny.
And if you're planning to buy millions or billions of dollars worth of stock, you should be getting advice from professionals and not some random people on the Internet. :-)