The stock market operates in a stochastic environment, making accurate price forecasting challenging. To address this issue, a stochastic multilayer perceptron (S-MLP) model has been developed to simulate the stock market's stochastic nature. By incorporating a Gaussian process into the sigmoid activation function, this model incorporates stochasticity into the traditional multilayer perceptron (MLP). As the perturbation factor, a stochastic sigmoid activation function (SAF) with a volatility estimator is used. Although S-MLP has demonstrated superiority over MLP, there is still room for improvement in terms of forecasting precision. In this study, we propose S-MLP with a trainable perturbation factor (S-MLPT), an improved variant of SMLP. SAF employs the Yang-Zhang volatility estimator as the perturbation factor. The proposed model first employed MLP, and all the parameters were trained. After freezing the parameters, SMLP is used to train the perturbation factor in the SAF. To evaluate the predictive performance of the models, MLP, S-MLP, and S-MLPT are used to predict the one day ahead highest stock price of four counters listed in Bursa Malaysia. As an evaluation metric, the coefficient of determination is utilised, and the relative percentage improvement of the models is calculated to determine their superiority. The results demonstrated that S-MLP outperforms MLP by effectively minimizing the loss function and converging towards a better local or global minimum during training. In conclusion, S-MLPT exhibits even better performance than S-MLP, with relative percentage improvements of 0.14%, 15.45%, and 0.48% for counters 0166.KL, 2445.KL, and 4707.KL, respectively.