We propose a model of a deterministic artificial stock market driven by a chromosome that encodes the different trading rules of its agents as individual genes. We first define a stylized version of a price-adjustment mechanism that is calibrated to real market data to interpret any random chromosome. Once the gene is activated, we use a steady-state genetic algorithm to invert the market, namely to infer which chromosome is activated in order to generate a given financial time-series without any a priori knowledge of its agent structure. This reconstructed active chromosome is then used to generate price forecasts. These forecasts are analyzed and compared to the standard ARIMA time-series forecasting method.