I know this may sound stupid. But I had this idea and wanted to try it out for a college project. Has this been done before? If and what's wrong with this idea?
Let's begin from the start.
At its core, market efficiency is a statement about the compensation for risk embedded in asset prices. So, you can think of this issue as involving 3 quantities: (1) the price that you observe, (2) the price that you should observe and (3) the distance between them. The fundamental problem with trying to test for market efficiency is that you only have (1), so you need to build (2) to check if (3) is zero as the theory predicts. That point was made by Eugene Fama back in 1965. He said that a test of market efficiency always is a joint test of an asset pricing model (what gives you (2)) and of market efficiency (the fact that (3) should be zero).
You're sort of a facing a Duhem-Quine type of problem here. If you run your tests and reject the hypothesis of efficiency, is it because markets are inefficient, because your asset pricing model is wrong or a little bit of both? In essence, when you say that a market is inefficient, what you're saying is that there doesn't exist any model, current or future, that could possibly rationalize the data while respecting the hypothesis of market efficiency... That's hell of a strong statement to make given how little of the possible space of models we have explored so far. The reason I bring this up is that no matter how you approach this issue, you will run into that problem. The best response I have seen thus far comes from Giglio and Kelly (2018): they show how a large class of models for a wide range of derivative instruments is strongly rejected by the data, that a relatively wide array of potential "excuses" we could make to rescue the absence of arbitrage fail while a behavioral model does match observed statistical patterns. It's not a perfect way around it, but going beyond just noting that an asset pricing model is rejected by the data is a good step in the right direction.
Now, let's turn to your idea.
Yes, this has been done in one way or another by many people, although the point isn't to prove or disprove the efficient market hypothesis. There is an entire literature in financial economics on agent based simulations where traders, market makers and other players are assumed to follow simple rules, as opposed to responding optimally. It can create extremely intricate dynamics. In those types of simulations, we generally have no idea if arbitrage opportunities exist.
One thing you could do for a quick project is to find the simulation codes of someone else that would allow you to simulate the price of a stock. Any code will do. Now, you go find stock market data: pick, say, 10 stocks and the S&P500 at daily or monthly frequency. Then, what you want to do is to run a test of the CAPM and collect diagnostics of how well or poorly it fits the data. Then, you will do the same, but using simulations. You run the simulations to create 10 artificial stock price series and you can naively assume that your artificial S&P500 is a simple average of them. On those 11 simulated time series, you run exactly the same tests and model diagnostics. You repeat that say, 10 000 times. Once you've done this, you can check how well your artificial market mimmicks the real market. This is a very naive way to do something like you want to do, but it's not bad to start simple. Unless you're writting a PhD thesis or are looking to publish a paper on this, you don't necessarily want to spend the time it would take to make all of this as kosher as possible.
Yes. It's possible to simulate markets. It's called Agent based model and you can read more about it on wikipedia:
Basically you assign simple rules to the agents (in our case market participants) and simulate to try to re-create and predict how the markets behave.
An example: By modeling a complex system of analysts based on three distinct behavioral profiles – imitating, anti-imitating, and indifferent – financial markets were simulated to high accuracy. Results showed a correlation between network morphology and the stock market index.
Stefan, F., & Atman, A. (2015). Is there any connection between the network morphology and the fluctuations of the stock market index? Physica A: Statistical Mechanics and Its Applications, (419), 630-641.