Search for a command to run...
Stock market prediction has been one of the most difficult problems to solve as it is stochastic, nonlinear, and very volatile. Current deep learning architectures, such as LSTM and Transformer, have been demonstrated to be effective at learning sequential dependencies but not in incorporating domain-specific logic and symbolic reasoning, which people in the trading industry inherently apply. In this regard we introduce our proposal of a hybrid neural network, the LLSTMN (Logical Long Short-Term Memory Network) that integrates traditional LSTM with logic-based event indicators to improve the interpretability and accuracy of financial predictions. The LLSTMN architecture adds a logic embedding layer to include engineered Boolean signals (e.g., Price > MA50 AND RSI < 30) of technical trading heuristics. These logic indicators are combined with temporal features learned by the LSTM, and there is an attention mechanism which concentrates on both important time steps and logic activations. The model has been tested with a variety of real-life stock data such as AAPL, TSLA, GOOGL and others. Through our experiments, we were able to show that LLSTMN is better than current models with a prediction accuracy of up to 98.41, much higher than the 95.00 and 88.03 of standard LSTM and ARIMA respectively. The model has also strong levels of direction accuracy, low RMSE (0.91) and effective inference rate (163.97 samples/sec). LLSTMN does not only improve the effectiveness of prediction but also offers a way of reasoning that can be easily understood, using logic indicators. This renders it an efficient instrument in automated trading mechanisms and human in the loop analysis of funds. The introduction of symbolic reasoning into deep-temporal networks is a major milestone in explainable AI in finance.