The air quality index (AQI) can be described using different pollutant indices. Many investigators study the effect of stock prices and air quality in the field to show if there is a relationship between changing the stock market and the concentration of various pollutants. This study aims to find a relationship between Saudi Tadawul All Share Index (TASI) and multiple pollutants, including particulate matter (PM10), ozone (O3), nitrogen dioxide (NO2), sulfur dioxide (SO2), carbon monoxide (CO), and AQI. Based on tree models, the relationship is created using linear regression and two prediction models, Chi-square Automatic Interaction Detection (CHAID), and CR-Tree. In order to achieve the target of this research, the TASI dataset relates to six pollutants using time; afterward, the new dataset is divided into three parts—test, validate, and train—after eliminating the outlier data. In order to test the performance of two prediction models, R2 and various error functions are used. The linear regression model results found that PM10, NO2, CO, month, day, and year are significant, whereas O3, SO2, and AQI indices are insignificant. The test dataset showed that R2 scores are 0.995 and 0.986 for CR-Tree and CHAID, respectively, with RMSE values of 387 and 227 for CR-Tree and CHAID, respectively. The prediction models showed that the CHAID model performed better than CR-Tree because it used only three indices, namely, PM10, AQI, and O3, with year and month. The results indicated an effect between changing TASI and the three pollutants, PM10, AQI, and O3.