Thursday, March 27, 2025

STI Analysis with Ichimoku AI System -- Part 1

 After v3 of the Ichimoku AI System (refer here), I continued to enhance and improve the AI prediction and now the app has upgraded to v4.  In v4, other technical indicators like RSI, OBV and ADX are used together (or has the option to be used together) with the Ichimoku signals to improve the AI prediction.  There are also additional features added to fine tune the threshold to  improve the prediction too.  So now, am using this v4 to analysis STI.



This is how v4 looks like with those additional features.  STI was analyzed from 27th Mar 2022 till 27th Mar 2025, a 3 years period.  Well actually till 26th Mar 2025 as data only available till then.



This is the zoom version of the chart showing the predicted buy & sell signals.  The bottom plot is added in v4 shows the probability of the buy, sell and hold signals predicted by the AI model.  Why probability ?  Simple, as mentioned in previous post on the v3, AI is not to take over the control of human's decision making but assist them,  AI prediction is never just True or False as it relied on data being fed into for it to train to learn the pattern and then make the prediction based on what it has been trained.  It will output the prediction based on probability of will or will not happen.  Thus, able to look into the probability being predicted by AI is nevertheless a great way for us to eventually make the final decision.

A coin with 2 sides meaning each has 50% of 1/2 the probability of appearing when you toss.  In this Ichimoku AI system, we are dealing with not 2 but 3 classes, Hold, Buy and Sell.  This means each class has a probability of 1/3 to occur.  The AI prediction produces very interesting result for these past few weeks (up till 26th Mar 2025).  Sell signals (be it strong or weak) are flashing as early as September 2024 despite STI climbing higher and higher.  Well the most common first reaction upon seeing this definitely is the AI prediction is not working.  Sure ???  Now, look at the bottom probability chart, from Sept 2024 onwards, the probability for Sell signals is on the high side, easily surpass 0.5 while both the buy and hold signals are kept low below 0.35.  As mentioned before for a 3 classes system, each class has a probability of 1/3 to happen and now both the buy and hold are kept below the 1/3 probability during these periods.  Don't think this is something one can easily ignore.



For this analysis, I made use of RSI, OBV and ADX indicators together with Ichimoku and the above shows the respective chart for each of the indicator.  The RSI, ADX and OBV don't look like being oversold to the extend STI will drop next.  In fact, looking at them and with the knowledge of them, it does look like STI is biased towards the upside rather than the downside.  However, do remember that most technical indicators are laggard meaning it will not predict what will happen next and it only shows when it has already happened.



The above is the new features that were added to v4 of the app.  It is the Classification Report and Confusion Matrix of the AI model performance.  In another word, it is a metrics to determine how accurate the AI has made the prediction.  This is something I can tell you any commercial AI software will not show you and these are the most important metrics to determine how good the AI prediction is.  

First talk about the Confusion Matrix.  It basically a plot of True vs Predicted.  The diagonal line which was circled in the above represent the True Predicted probability.  For a very good performance, this diagonal line must have the highest number compared to the off diagonal rows and columns.  The off diagonal rows and columns represent the False Positive and the False Negative of the prediction.  The higher the number in these cell just tell you the prediction is pretty mess up.  Mentioned before, a 3 classes system the probability for each to occur is only 1/3.  In the above, the diagonal row are all having value more than 1/3 in particular the Buy-Buy sell is having a 0.58 value.  0.58 in a 3 classes system is like almost 88% probability in a 2 classes system.  Image the 2 sided coins with say Head is having a 88% chance of appearing, do you still bet on getting a Tail ?  Now, the Sell-Sell prediction is having a 0.44 probability and that translate to about 67% probability in a 2 classes system.  So, is the AI prediction of the sell signals since Sept 2024 till now incorrect ??  

Next look at the Classification Report, focus on the F1-score, F1-score is the combine of the Precision and Recall performance (for those wondering what are those for, please search and read up yourself).  The overall F1-score for accuracy of the prediction is 42% and that translates to 70% accuracy for a prediction of a 2 classes system (70% accuracy of predicting head or tail of a coin toss).  

Now, are those sell signals since Sept 2024 till now something that you can blush away because STI has been climbing higher and higher during these periods ?