Showing posts with label Strategy. Show all posts
Showing posts with label Strategy. Show all posts

Tuesday, November 4, 2025

Major Update on AI Trading System App

Since the release of the limited features for public testing in September, works have be done in further enhancement and fine tuning of the app.


In fine tuning, efforts were made in improving the accuracy of the AI model prediction through continuous testing on different trained models and this will still be ongoing going forwards.


1. Enhancement -- BackTest 

The BackTest section in the previous version was totally revamp to make it more useful and purposeful and practically essential to the app.  It is being replaced with a Prediction History and BackTest sections.  

Prediction History is a list of all the AI predictions, the time, the price, the type and it correspond profit and stoploss level.  To further make it meaningful, it will also measure the success rate of the prediction, that is whether the prediction going forward will hit the profit or the stoploss or trigger by signal.  If prediction is closed by either profit or stoploss level hit, the corresponding exit time and price will also displayed.

BackTest is an emulation of real life trading scenario.  With brokerage fees included, what predefined Trading Strategy to be used, the trading period of interest, the app will be able to compute based the return of the trades for the predictions made by AI.  This will be benchmarked against a Projected and Equity return.  Projected return is simply what is the expected return (with and without brokerage fees) if all the predictions are correct.  Equity return (with and without brokerage fees) basically just the return due to change of price for the period of interest.  

Presently, the brokerage fees are for SG Local brokers Cash Collateral, SG Local brokers CFD, Tiger Brokers (SG and US stocks), Webull (SG and US stocks), Oanda (forex and indices CFD) and Coinhako (cryptocurrency).  To match real life situation, only SG Local brokers CFD and Oanda are allowed for long and short trade while the rest are restricted to long position only.

There are 4 predefined Trading Strategy that can be chosen to determine which can get better return.  The 4 strategies are : Single Trade (Profit - Stoploss), Single Trade (Profit - Stoploss/Signal), Multi-trades (max 3) (Profit - Stoploss) and Multi-trades (max 3) (Profit - Stoploss/Signal).

In Single Trade (Profit - Stoploss), for the period of interest, the first valid prediction will be logged.  The position will remain open until either profit or stoploss level has been hit and the respective return will be calculated.  Then the next valid prediction will be logged and so on.

In Single Trade (Profit - Stoploss/Signal), the only different is open position will be closed apart from profit or stoploss level is when encounter an opposite prediction going forward.

In Multi-trades (max 3) (Profit - Stoploss) or (Profit - Stoploss/Signal), 3 successive positions can be opened going forward.  The 4th is only allowed when either one or all of the 3 has closed due to profit or stoploss or signal trigger.  In signal trigger, all 3 positions will be closed.  This is something like trying to average down or average up a trade.


2. Enhancement -- Day Prediction

Previously, the app is developed solely for intraday trading meaning the AI prediction is done on intraday data.  However, consider the case when stocks are moving sideway, price in rangebound and with brokerage fees eating in chunk of profit, intraday trading totally make no sense.  Thus, prediction make from daily data to cater for longer trade duration of weeks, months or years in order to get better return


3. Enhancement -- Oanda Integration

Present data feed is from Yahoo Finance and those are typically on average 15 min delayed price data even if data interval is 1min.  Now, with the ability to integrate Oanda data feed for its instruments, situation is much better.  Firstly, data delayed is only 1 min for 1 min interval data.  Secondly, this make it better to trade on its instrument.  The Forex-pair and Indices CFD have much longer operating hours unlike typical stock market.  In fact, while US stock market is now closed, Oanda's Index CFD on DJ, SP500 and Nasdaq are currently live and can be traded.


While there are several major enhancement in the latest version of the AI app, there are some redundant and less useful features that are removed too.  Let look at those major enhancements below.



Above is the AI prediction of SIA at the point of writing.  A short signal was predicted at 11:30am at 6.65 and it has since hit the 1x profit level at 6.61 and going down to hit the 1.5x profit level at 6.60.



Above is the enhaced Prediction History log that display all the prediction signals, the time and price being triggered, the type of position, the respective profit and stoploss level.  The status of the prediction, correct or wrong or still ongoing, if completed, the exit reason, exit price and exit time.  Lastly, the accumulated success rate of the prediction.




Above 2 showed the BackTest section.  SG Tiger Brokers is the one, trade quantity is 100 share, the min board lot, trade period is 15 Oct till 31 Oct.  This period is chosen as only this period the AI predicted long signal while the rest are short signal.  We can't short a share so no point looking at those short positions.  The top is Single Trade (Profit - Stoploss) strategy and the bottom is Multi-trades (max 3) (Profit - Stoploss) strategy.  The Equity return for this period, gross is $8 for 100 share and including brokerage fee is only $3.09.  For 1st strategy, gross profit is $11 and nett become -$3.73 mainly due to the chunk of brokerage fee incurred.  2nd strategy, the multi-trade, gross profit is $32 but nett still come in at -$2.37, again due to the chunk of brokerage fees.  Take note, that during this period, SIA share price pretty much is rangebound and with the brokerage fees incurred, ended making a loss.  Tiger Brokers is already having one of the cheapest brokerage fees in SG now (along WEbull), if this still can't get the trading profit, you can forget about those SG local broker houses.  Now, you know why SG stock market has been dead for so long, the old cog, SG local broker houses with their sky high brokerage fees just drive away traders.



Above is the Day prediction on daily data.  As seen, the last prediction was a short signal on 21st July.  This means after 21st July, the AI didn't predict any meaningful signal.  This further affirmed the rangebound condition in October.  Unless scalping else those intraday predictions in Oct made no sense given the brokerage fee incurred.  



Above is Nvidia share.  The period of interest is week of 6th Oct to 10th Oct.  The brokerage fees is based on Webull and trade quantity is 1 share, the mini board lot size.  Since short position is not along, the only long signal predicted that week only 1.  It happened to be a correct prediction and even minus off the brokerage fee, we still earn US$3 for that 1 share.  

While some might be thinking the contrast between SIA and Nvidia trading could be due to the performance of the AI prediction, the accuracy BUT think again, in stock, you are not allow to short so can only do long position and further more, brokerage fees were incurred and that can easily eat into whatever profit you can get.  How about if able to do both long and short position and practically no brokerage fees incurred ?  This is where Oanda comes in.  Oanda is a margined leverage trading.  One need to put in a sum of capital to provide that margin and using the leverage to trade instrument that cost more than whatever capital incur.  It doesn't have any brokerage fee on any position but could incur overnight financial cost if position is carried over the night.  the financial cost could be a plus or minus to you depend on the position type.  Should one trade indices CFD, one can get the dividend on any long position if any of the component stocks go XD and minus off if in short position.



Above is the S&P500 CFD AI prediction at the point of writing from Oanda.  A short signal was predicted at 7:55am and now it has gone past 2x profit level.



This is the S&P500 CFD trade from Oanda for today 4th Nov.  Oanda is able to do long or short so 2 short signals were detected.  Though only 1 ended with correct prediction, the nett return still positive given there isn't any brokerage fees incurred and the AI app is designed such that profit is default 1.5x that of stoploss.  so with 1 trade in stoploss, the other in profit hit, nett off still positive.



Above is the same S&P500 CFD trade from Oanda, the different is using Multi-trades strategy and you can see it has more trades than before and the return is very much different.

A 0.1 share is used, that is the minimum quantity on Indices CFD from Oanda.  The capital for that 0.1 share due to leverage is very small amount, around S$45.  The amount of money you put in to buy 100 share of SIA (S$600+) or 1 share of Nvidia (US$100+) is more than enough the maintain a healthy margin for 0.1 share of S&P 500 CFD and yet the return is very much more attractive.



This is the AI prediction result for SGD/JPY forex pair from Oanda at the point of writing.  Again, profit target already hit for that short prediction.




Above is the Single Trade and Multi-Trade strategy for the AI prediction on SGD/JPY forex pair on Oanda for today, 4th Nov.  The trade quantity is 100 unit (minimum is 1 unit).  Due to the leverage, the cost of 100 unit is S$2+ only or $8+ for the multi-trade.  Again, the cost of 100 share of SIA or 1 share of Nvidia is more than enough to have a healthy margin for those positions and the return you get from it is even more attractive.  Correction, the currency of the return should be JPY and not SGD


This is pretty much what the AI Trading System app can do.  While most of the examples shown above are positive, do remember that AI prediction is all about probability and it is not fortune teller as prediction is not 100%.  However, with the enhanced BackTest emulation, if prediction result goes against, do not proceed to follow the prediction to trade, that is best risk management.  This AI prediction might not be 100% accurate or spot on, at least this is based on science unlike some dude citing STI hitting 10,000 by 2030, 不懂装懂,懵懵懂懂.

Note, I have no affiliation with Tiger Brokers, Webull and Oanda so the above is not a sponsorship to promote their products.

Lastly, this is the question probably in most people mind now, will there be an AI bubble going to burst ?  Well unlike Nvidia in which its biggest revenue is from AI related products, it will say no since which idiot wants to burst its own revenue, from someone who develop AI app, yes, there will be an AI bubble coming !!!


When you have an AI that helps you learn what is AI, this is a double-edged sword.  Eventually, the AI bubble will burst !!!


Background and Historical Facts

1. Around 2H2024, in an attempt to use the SkillsFuture credit before it expires in Dec 2025, I was snubbed by the snobbish SMU from attending the Ichimoku Technical Analysis course as I didn't attend the Basic Technical Analysis course conducted by them.  Despite reasoning that I'm not novice to technical analysis and am able to even use Elliott Wave to analyze stock market, they still continue the snub.

2. Around end Jan 2025 when China's Deepseek AI shocked the world with its performance, I was inspired with it and couple with feeling unjustified and anger from the snobbish SMU's snub, decided to embark on a journey to develop an Ichimoku AI System to predict when to buy or sell in stock market.

3. Around mid Feb 2025, with the assist from Deepseek given the fact programming is not my major but I do possess the basic essential knowledge of programming (well few years ago, I did develop an app to calculate Elliott Wave), I have completed the automation version of the Ichimoku system.  This has provided me the platform to develop the AI version.

4. By mid Mar 2025, the first version of the Ichimoku AI System has completed and was able to predict buy and sell signals with average or slightly above average accuracy.  That was used in the post dated 27th Mar 2025 to predict STI direction.

5. In order to increase the accuracy and performance of the AI prediction, additional features and enhancements were made that led to v2.3 of the app being completed in first week of Apr 2025 to carry out the 2nd analysis on STI (this post)

6. Pass the first real test in predicting STI crash in the 1st week of Apr 2025.  Prediction of selling signals started at least 5 months prior to the crash.

7. App upgraded to v2.4 after modifications made to be able to fine tune AI model's parameters to provide better prediction in Apr 2025

8. Started to develop the AI UpDown to make prediction of direction, up or down for the next time instance in May 2025

9. 2 weeks after the AI UpDown, started developing the AI Intraday app to make prediction for long or short position coupled with profit and stop-loss level for almost real time intraday trading

10. After weeks or debugging, testing and enhancement, the AI Intraday together with AI UpDown and AI Ichimoku were integrated together to form the AI Trading System in June 2025

11. In Aug 2025 wanted to test the accuracy on using generic trained data instead of specific data so did some modification and enhancement to the system thereby elevate it to the next version.

12. Modification work and preliminary testing was carried out in early Sep 2025.  Decided to spin off a Lite version of the AI Intraday app to the public to assist in testing on the using of generic trained data 

13. Fine tuning for accuracy and major enhancement were carried out from Sep 2025 to early Nov 2025.  Major enhancement includes revamp the BackTest section to make it more useful, include a daily prediction capability on top of the existing intraday and integrate Oanda data feed to be used for Oanda trading.


Sunday, September 7, 2025

AI Trading app open for public testing, free download

As the title said it all, am opening the AI Trading app open for public testing and anyone can download it to test and provide feedback.


Refer here for the link to download the app.  Both a Windows and Mac OS version are provided.  Just a little note, the GUI of the Mac OS version is slightly different from the Window version but basic functionality still the same.  You will download the zip file for both versions.  It will unzip into a folder inside is the executable file AI Trading System and a sub-folder model which house the model file for the AI to use for prediction.  Once clicked on the executable file, a command window will first pop up, do not close it as it will close the program, just minimize it.  Thereafter, the GUI will launch and can use it.  Also note that, the data feed is NOT REAL TIME, average 15 minutes delay



The GUI will look like the above (for the Window version).  For the testing, 3 categories of entities are provided and each category has 3 entities.  Category Index (DJI, HSI, STI), category Stock (Alibaba, Procter & Gamble and SIA and category Forex (EUR/USD, SGD/JPY and USD/SGD).  

On the central panel at the top is the setting.  

Mode (0 or 1) allows users to choose different trained dataset for the AI model to use.  These trained dataset are generic and not specific to the entity.  This is to allow the AI model to learn as much of the patterns as possible compared to the specific dataset.  One minus is the AI model might miss out of the specific behavior and thus lower its accuracy.  

The PnL Factors allows users to choose from 1x, 1.5x and 2x.  The AI model makes the precision based on dynamic volatility and the above factor will adjust the threshold for such volatility.  Simply put it, PnL Factors 1x will allow the AI model to make more prediction but in the expense of more noise (more false prediction) and 2x will make less prediction but with less false prediction.

The 2 sliders Weak and Strong Probability is to control the probability threshold for the AI model to make the decision.  Again, lowering the Weak Probability will produce more prediction in the expense of perhaps false prediction.

In the bottom display section, the left side will display the detail information of the prediction, entry price, entry type (Long/Short), profit level (1x, 1.5x, 2x) and stoploss level.  The last row will indicate when the next update.  Present setting is updating every 15 minutes and the candlestick period is 30 minutes interval.  The right side is the chart and pretty much self explainable with the help of the legend.  There is an option to save the trade, reload it or delete it when it no longer required (just scroll to the saved trade then select load or delete).  Once the trade is saved or loaded, it will display as follow



The additional column under Saved will display all the information for the save trade while the Latest column will continue to display the latest update information.  A pop up will appear once the stoploss level or profit level or an opposite entry signal from the latest update to indicate such target has been achieved.



The Prediction tab will display all the past prediction signals from the AI model to allow users have a greater view of the predictions.  The other 2 tab BackTest and Long/Short Detail are self explainable.


In the app, 3 tabs were provided so users can run 3 entities at the same time to help accelerating the test.

As this is for public testing, I do look forward to the feedback, be it bug, accuracy or whatsoever.  Please email the feedback to patiencemarketz@gmail.com providing screenshot of the setting and description of the issue.  The main objective of the testing is to evaluate the accuracy of the generic dataset (both mode 0 and 1) to each of the entities in the 3 categories.

Last but not least, should any users use the above app for real trading, any financial loss, I'm will not be responsible for it, please be aware of it. 


Background and Historical Facts

1. Around 2H2024, in an attempt to use the SkillsFuture credit before it expires in Dec 2025, I was snubbed by the snobbish SMU from attending the Ichimoku Technical Analysis course as I didn't attend the Basic Technical Analysis course conducted by them.  Despite reasoning that I'm not novice to technical analysis and am able to even use Elliott Wave to analyze stock market, they still continue the snub.

2. Around end Jan 2025 when China's Deepseek AI shocked the world with its performance, I was inspired with it and couple with feeling unjustified and anger from the snobbish SMU's snub, decided to embark on a journey to develop an Ichimoku AI System to predict when to buy or sell in stock market.

3. Around mid Feb 2025, with the assist from Deepseek given the fact programming is not my major but I do possess the basic essential knowledge of programming (well few years ago, I did develop an app to calculate Elliott Wave), I have completed the automation version of the Ichimoku system.  This has provided me the platform to develop the AI version.

4. By mid Mar 2025, the first version of the Ichimoku AI System has completed and was able to predict buy and sell signals with average or slightly above average accuracy.  That was used in the post dated 27th Mar 2025 to predict STI direction.

5. In order to increase the accuracy and performance of the AI prediction, additional features and enhancements were made that led to v2.3 of the app being completed in first week of Apr 2025 to carry out the 2nd analysis on STI (this post)

6. Pass the first real test in predicting STI crash in the 1st week of Apr 2025.  Prediction of selling signals started at least 5 months prior to the crash.

7. App upgraded to v2.4 after modifications made to be able to fine tune AI model's parameters to provide better prediction in Apr 2025

8. Started to develop the AI UpDown to make prediction of direction, up or down for the next time instance in May 2025

9. 2 weeks after the AI UpDown, started developing the AI Intraday app to make prediction for long or short position coupled with profit and stop-loss level for almost real time intraday trading

10. After weeks or debugging, testing and enhancement, the AI Intraday together with AI UpDown and AI Ichimoku were integrated together to form the AI Trading System in June 2025

11. In Aug 2025 wanted to test the accuracy on using generic trained data instead of specific data so did some modification and enhancement to the system thereby elevate it to the next version.

12. Modification work and preliminary testing was carried out in early Sep 2025.  Decided to spin off a Lite version of the AI Intraday app to the public to assist in testing on the using of generic trained data 



Saturday, June 28, 2025

I developed an AI Trading app, am using it everyday


This is the app that I developed and use it everyday for trading !


Since developing the AI Ichimoku app that used to analyze stock market (refer here), was curious is it possible to use AI to predict the direction of stock price for the next time instance, up or down.  Guessing up or down is practically a 50% probability well sometime 1/3 probability since price can remain the same at the next time instance.  So, I went ahead to develop an app, AI UpDown to try to predict the outcome with the help of technical indicators.  Pure guessing is 50% chance, with the help of TA unfortunately won't get you 100% accuracy, a 60% - 70% is considered very good performance already.



Above is the AI UpDown app that used to predict direction of STI at an interval of 15min.  As seen, after 2 hours of prediction, accuracy is 75% and that pretty good performance as a whole.  Then there are instances, the prediction accuracy is low like 50%+.  This applies to stock like most of SGX listed stocks that even after hours, price still remain unchanged.  Well, that pretty much within my expectation though.  With this and the foundation of AI Ichimoku (used for EOD analysis), was thinking to develop an AI app that use for intraday trading shouldn't be a problem.  The AI should be able to predict a long or short position almost real time.  So after weeks of writing the codes, testing and debugging, the AI Intraday app finally done.  Next incorporate together with AI Ichimoku and AI UpDown to form the AI Trading System.  Now, let see the performance of the AI Intraday app.







Above showed all the successful trades from the AI prediction.  It can handle Forex, SG stocks, US stocks and Cryptocurrency effectively.  For every AI prediction of a position, long or short, it will also accompany with a profit and stop loss level.  The P&L levels are dynamic unlike the norm of a fixed percentage.  This is to cater and reflect the volatility of the entity.  The AI with the help of technical indicators as feature engineering is being trained to learn of the dynamically computed profit and loss level to make the prediction for either a long or short position.  While, the prediction is updated every 15min, it is just almost real time.  It is not real time as the data feed is not real time and on average a 15min delay.  Then, it doesn't matter as just strictly stick to the P&L levels that was computed at the instance at which the prediction was made.





Above showed failed prediction by the AI.  This is expected as even AI can't achieve 100% accuracy.  AI basically used trained data and make prediction of what's next.  The prediction is a probability of occurring and not a simply True/False or Yes/No.  So next time when you use AI, don't take it for granted.  What commercial AI will not reflect to users is the actual probability of the prediction.  A 60% chance of accuracy is a big difference than a 80% of accuracy.  Nevertheless, that is commercial AI issue.  In the AI Trading System, the probability of the trade is shown so user can decide whether or not to follow it.  Should it follow, it should strictly adhere to the P&L level to take profit and stop-loss.  This is proper risk management.

A little note is the probability of the long or short position prediction is mostly in the range of 50% to 60%+.  Firstly, the app only allow probability of at least 50% to filter through.  There is reason as why it is capped at 60%+ too.  In predicting a position, it is not just long or short but long, short and hold.  As in stock market, 70%-80% of the time is hold with merely 10% - 15% of the time is buy or sell.  Thus, in a relatively biased system, a 60% probability to predict the minority class (buy or sell) is considered very good performance already.


Background and Historical Facts

1. Around 2H2024, in an attempt to use the SkillsFuture credit before it expires in Dec 2025, I was snubbed by the snobbish SMU from attending the Ichimoku Technical Analysis course as I didn't attend the Basic Technical Analysis course conducted by them.  Despite reasoning that I'm not novice to technical analysis and am able to even use Elliott Wave to analyze stock market, they still continue the snub.

2. Around end Jan 2025 when China's Deepseek AI shocked the world with its performance, I was inspired with it and couple with feeling unjustified and anger from the snobbish SMU's snub, decided to embark on a journey to develop an Ichimoku AI System to predict when to buy or sell in stock market.

3. Around mid Feb 2025, with the assist from Deepseek given the fact programming is not my major but I do possess the basic essential knowledge of programming (well few years ago, I did develop an app to calculate Elliott Wave), I have completed the automation version of the Ichimoku system.  This has provided me the platform to develop the AI version.

4. By mid Mar 2025, the first version of the Ichimoku AI System has completed and was able to predict buy and sell signals with average or slightly above average accuracy.  That was used in the post dated 27th Mar 2025 to predict STI direction.

5. In order to increase the accuracy and performance of the AI prediction, additional features and enhancements were made that led to v2.3 of the app being completed in first week of Apr 2025 to carry out the 2nd analysis on STI (this post)

6. Pass the first real test in predicting STI crash in the 1st week of Apr 2025.  Prediction of selling signals started at least 5 months prior to the crash.

7. App upgraded to v2.4 after modifications made to be able to fine tune AI model's parameters to provide better prediction in Apr 2025

8. Started to develop the AI UpDown to make prediction of direction, up or down for the next time instance in May 2025

9. 2 weeks after the AI UpDown, started developing the AI Intraday app to make prediction for long or short position coupled with profit and stop-loss level for almost real time intraday trading

10. After weeks or debugging, testing and enhancement, the AI Intraday together with AI UpDown and AI Ichimoku were integrated together to form the AI Trading System in June 2025




Saturday, April 26, 2025

STI Analysis with Ichimoku AI System -- Part 4

Continue from STI Analysis with Ichimoku AI System -- Part 3


Before the analysis, let it known that the app has been upgraded to v2.4 since the last analysis.  Features were added to be able to fine tune the AI model's parameters to improve the prediction capability.  Another is ability to switch between various final prediction strength.

After hitting an all time high of 4,005.18 on 28th Mar 2025, STI fell to an intra-day low of 3,372.38 on 9th Apr 2025 and rebound from there to close 3,823.78 on 25th Apr 2025.  That is a recovery of 451.4 points or 13.38%.  Naturally, people would suggest a buy.  Is that really so ?




Above is the AI model prediction for any buy signals since the sell off.  Like seen from the snapshot, not a single buy signal being predicted despite the 13.38% rebound.  The last buy signal predicted was Aug 2024. The predicted probability for the buy signal still largely stay below that of sell and hold signals.  Why ?




Above is the re-prediction by adding in other technical indicators (RSI, ADX, MACD, BollingerBand, EMA and OBV) along Ichimoku signals.  It is very common people use several technical indicators together to provide better confirmation of signals as different technical indicator focuses on different aspect of technical analysis, some on trending and some on momentum and so on.  Unfortunately, there is still not a single buy signal predicted despite the 13.38% rebound.  We can see more buy signals generated (both strong and weak) compared with just Ichimoku signals only but still not a single buy signals since the rebound.  The only bright side is the probability of sell signal has lowered than in previous case but the probability of buy signal still lying below that of the sell and hold signals.  Why ?





Above is the prediction from the AI model after making several tweaks to it.  Model's parameters were tune to focus solely on precision and recall in making prediction.  The buy threshold was lowed to the minimum to relax the condition for the model to predict buy signal and the prediction strength is set to weakest so that any slight buy predicted can be caught.  Still, from the snapshot, not a single buy signal despite the 13.84% rebound despite the model now is capturing more buy signals than the previous 2 cases.  This is a way to force the model to predict a buy signal which should not be encouraged as this will introduce unwanted noise to the model to train and highly predict the incorrect outcome.  The buy signal probability is increasing compared to the previous 2 predictions but still below that of the sell and hold signals.

From human eye the strong rebound clearly entice into thinking of buy signal but this is the opposite from the AI prediction.  Why ?

Singapore GE2025 will be held on 3rd May 2025.  Wait, don't get me wrong, am not going to talk about politics in this STI analysis.  Just that in the politics world, I have the perfect classic example to illustrate my point.  Since not having any political propaganda, will go direct and straight to the point.  Go to the Straits Times Facebook page, look at the comments of any of the political reporting, be it on the PAP or any opposition parties.  You can easily find a dozen of comments that have the following nature.  "This MP has been working very hard for the past 5 years, vote him/her", "This MP is very friendly and helpful, vote for him/her", etc.  Firstly, let be known that it is the primary responsibility of the elected MP to work hard and help the residents in the ward, they are being paid to do so.  Do you not work hard in your company when the company pay you the salary ?  Friendly is a subjective thing, so not going deep into it.  Next, how to you know if an opposition candidate is voted in to be the MP of the ward, he/she will not be as hardworking, friendly and helpful (or better) than the existing one ?  Do you dare to put your neck on the chopping board to affirm your stance ?  This is weakness in a human being psychology, a psychological pitfall to be exact.  One will only make conclusion on what they have seen or experienced (the result) and not think of the possible outcome (or result) that they have not seen or experienced.  As such, they only make biased conclusion.  To make a even more powerful example, Singapore since PAP took to power in the 50s has been government of the day uninterrupted till now.  When asked stance of opposition parties forming the government of the day or a coalition government, you will likely get the response of "Do not think opposition parties are good", "PAP has records" and so on.  Again, not a single day since 50s Singapore has been under the government of another political party other than PAP, how to you know opposition parties can't do the same or even better job than PAP ?  You have not seen the result doesn't mean it is a negative.  This is the typical psychological pitfall that majority will fall into.  Even the more acute to psychology like people who majored in psychology or the professor who teach psychology in university cannot avoid falling into this pitfall.

So back to the main focus.  It is this psychology pitfall that when you see STI rebound strongly from sell off and entice you to the buy signal.  You cannot see the outcome of what you've not seen, that is not a buy signal.  In AI, AI model was fed to historical data to train them to recognize pattern and sequence by computing on all the perspectives and eventually make the final prediction based on possibility of the possible outcome.  It is the possibility of the possible outcome and not the simply True or False of the outcome.  The AI model has already shown prior to the sell off that sell signals has been predicted since Sept 2024 without a single buy signal being predicted in between.  With the psychological pitfall, one would not believe as STI kept scaling higher and higher despite all those sell signals and guess what next ?  In fact, here, the AI model is being fed with 20 years of historical data (yes, typical Singapore KS style) meaning starting from year 2002 (since the start of the test data above is 2022) till 2021.  During these periods, STI encountered the peak and trough of 2003 SARS, 2007-2009 US subprime crisis, the uncertainty from the Euro debts crisis from 2009 - 2014, the peak and trough in 2015-2016 due to concern of China economy and the latest 2020 Covid-19 pandemic.  There are more than enough samples for the model to be trained and learned of the market peak and trough to make a reasonable prediction as of now.

In the politics world, you don't have the luxury of the AI to assist you in analyze comprehensively all the possible outcomes (what you can see and experience and what you cannot see and experience) and hence you are being dictated by the psychological pitfall of the majority for the future, it is quite a sad thing unfortunately.  However, in the financial world, you have a tool in AI that can compensate that and why you choose to ignore it and instead continue to believe in your own eye ?

STI has rebounded strongly but there is no predicted buy signals, don't rush into it, wait in patience for one !!!


Background and Historical Facts

1. Around 2H2024, in an attempt to use the SkillsFuture credit before it expires in Dec 2025, I was snubbed by the snobbish SMU from attending the Ichimoku Technical Analysis course as I didn't attend the Basic Technical Analysis course conducted by them.  Despite reasoning that I'm not novice to technical analysis and am able to even use Elliott Wave to analyze stock market, they still continue the snub.

2. Around end Jan 2025 when China's Deepseek AI shocked the world with its performance, I was inspired with it and couple with feeling unjustified and anger from the snobbish SMU's snub, decided to embark on a journey to develop an Ichimoku AI System to predict when to buy or sell in stock market.

3. Around mid Feb 2025, with the assist from Deepseek given the fact programming is not my major but I do possess the basic essential knowledge of programming (well few years ago, I did develop an app to calculate Elliott Wave), I have completed the automation version of the Ichimoku system.  This has provided me the platform to develop the AI version.

4. By mid Mar 2025, the first version of the Ichimoku AI System has completed and was able to predict buy and sell signals with average or slightly above average accuracy.  That was used in the post dated 27th Mar 2025 to predict STI direction.

5. In order to increase the accuracy and performance of the AI prediction, additional features and enhancements were made that led to v2.3 of the app being completed in first week of Apr 2025 to carry out the 2nd analysis on STI (this post)

6. Pass the first real test in predicting STI crash in the 1st week of Apr 2025.  Prediction of selling signals started at least 5 months prior to the crash.

7. App upgraded to v2.4 after modifications made to be able to fine tune AI model's parameters to provide better prediction in Apr 2025


Tuesday, April 8, 2025

STI Analysis with Ichimoku AI System -- Part III

Continued from STI Analysis with Ichimoku AI System -- Part II


STI closed 3,540.50 on 7th Apr 2025 and as of now 8th Apr, STI still below 3,540.50.  With reference to the first AI prediction posted on 27th Mar 2025 (refer here) and part II on 6th Apr 2025 (refer here), it was stated the AI system has been predicting Sell signals for STI since Sept 2024, be it Strong or Weak signals, without a single Buy signals in between despite STI climbing higher and higher.




The above snapshots were what happened as of 7th Apr 2025 close.  With not much difference from those AI predicted Sell signals, the only difference was STI has dropped sharply since 4th Apr 2025.  The above was the AI model used to predict Buy and Sell signals for STI.  There wasn't any Buy signals since Sep 2024 with Buy probability stayed at rock bottom during these period while the Sell probability was at elevated level throughout.




The above snapshots were obtained with the AI system working on another model and only predict Sell signals.  Nothing much has changed from the 6th Apr 2025 post.  It was mentioned in the 6th Apr 2025 post that the first Strong sell signals started on 14th Nov 2024 at STI 3,738.16 and given STI at 3,540.50 at 7th Apr 2025, this has obviously dropped below the level the first Strong signal was being predicted by the AI system.  


As mentioned in previous post, should there isn't any Buy signals predicted during these periods and with STI fell below the 3,738.16 level, this is a proof that the AI system has been making the correct prediction since Sep 2024 (or Nov 2024) with the Sell signals despite STI scaling higher and higher.  This concludes the Ichimoku AI System has passed its first real test in predicting buy and sell signals and it has giving warning signs at least 5 months before the actual crash now !!!


The next test for the Ichimoku AI System shall be to predict Buy signals in which STI recover from the ongoing crash.  The same criteria will be applied, that is, continuous Buy signals without a single Sell signal in between even if STI further decline and the confirmation shall be STI recover to break above the level of the first Buy signal being predicted.


Background and Historical Facts

1. Around 2H2024, in an attempt to use the SkillsFuture credit before it expires in Dec 2025, I was snubbed by the snobbish SMU from attending the Ichimoku Technical Analysis course as I didn't attend the Basic Technical Analysis course conducted by them.  Despite reasoning that I'm not novice to technical analysis and am able to even use Elliott Wave to analyze stock market, they still continue the snub.

2. Around end Jan 2025 when China's Deepseek AI shocked the world with its performance, I was inspired with it and couple with feeling unjustified and anger from the snobbish SMU's snub, decided to embark on a journey to develop an Ichimoku AI System to predict when to buy or sell in stock market.

3. Around mid Feb 2025, with the assist from Deepseek given the fact programming is not my major but I do possess the basic essential knowledge of programming (well few years ago, I did develop an app to calculate Elliott Wave), I have completed the automation version of the Ichimoku system.  This has provided me the platform to develop the AI version.

4. By mid Mar 2025, the first version of the Ichimoku AI System has completed and was able to predict buy and sell signals with average or slightly above average accuracy.  That was used in the post dated 27th Mar 2025 to predict STI direction.

5. In order to increase the accuracy and performance of the AI prediction, additional features and enhancements were made that led to v2.3 of the app being completed in first week of Apr 2025 to carry out the 2nd analysis on STI (this post)

6. Pass the first real test in predicting STI crash in the 1st week of Apr 2025.  Prediction of selling signals started at least 5 months prior to the crash.


Sunday, April 6, 2025

STI Analysis with Ichimoku AI System -- Part II

Continued from STI Analysis with Ichimoku AI System -- Part I


Since the last analysis on 27th Mar 2025, additional features and couple of enhancements were made to the app to improve its prediction accuracy.  As such, the app has upgraded to v2.3 (previous was v4 and renamed to v2.2).

Noticeable features are the inclusion of 2 AI Prediction mode.  In the previous version, the AI could only predict Hold, Buy and Sell together.  In this new version, 2 additional prediction modes were added -- predict only Buy signals and predict only Sell signals, to provide additional accuracy in predicting buy or sell signals.  Another feature is the inclusion of other Technical Indicators such as ADX, Bollinger Bands, EMA, MACD, OBV and RSI to provide additional confirmation to the Ichimoku signals on trend and momentum.  This can improve the accuracy of the AI prediction.

As for enhancement, Threshold, Buy Accuracy and Sell Accuracy were added to fine tune the AI model in its training and testing on historical data to make better prediction on the real dataset.




Above is the app doing the 3 classes AI prediction on STI.  As can seen from the 2nd screenshot and quite similar to the analysis done on previous version on 27th Mar 2025, Sell signals have been flashing since Sep 2024 despite STI climbing higher and higher.  




Above is switching the AI Prediction mode to Sell only meaning the AI model only predict Sell or no Sell signals using the same threshold, TA signals and AI model.  For the same period from Sep 2024 till now, more Strong Sell signals appeared than previously.




Next, the AI model was switched to one that is much better in doing binary prediction and maintaining the same threshold, this time with no additional Technical Indicators needed (just pure Ichimoku signals), the Strong Sell signals appears around the same period as previous analysis




Now, looking at another perspective, this time look at the AI model predict Buy only signals.  Using the same AI model and threshold setting, the above shows the Buy signals from the AI.  Looking at around end Aug 2024 to mid Sep 2024, there were Strong Buy signals predicted during the time STI hit a trough and rebound.  Thereafter, practically no Buy signals, not even a Weak Buy signals were predicted till now when STI was climbing higher and higher.  That pretty much matches the Sell signals prediction.  What's worrying is looking at the Buy signal prediction probability, it just sink lower and lower as STI climb higher and higher and hit rock bottom.



The above displayed the detail date at which Strong Buy, Weak Buy, Strong Sell and Weak Sell are being predicted and their respective STI closing value for that day.  The snapshot indicates that the Strong Sell signal on 14th Nov 2024 at STI 3,738.16 is the series of Strong Sell signals that lasted till today.  Now if STI going forward fell below 3,738.16 without a single Strong Buy signal being predicted in between, this will further strengthen the proof that the accuracy of the AI prediction.  The AI prediction has given warning at least 5 months earlier for the selling off we are seeing today !!!


Background and Historical Facts

1. Around 2H2024, in an attempt to use the SkillsFuture credit before it expires in Dec 2025, I was snubbed by the snobbish SMU from attending the Ichimoku Technical Analysis course as I didn't attend the Basic Technical Analysis course conducted by them.  Despite reasoning that I'm not novice to technical analysis and am able to even use Elliott Wave to analyze stock market, they still continue the snub.

2. Around end Jan 2025 when China's Deepseek AI shocked the world with its performance, I was inspired with it and couple with feeling unjustified and anger from the snobbish SMU's snub, decided to embark on a journey to develop an Ichimoku AI System to predict when to buy or sell in stock market.

3. Around mid Feb 2025, with the assist from Deepseek given the fact programming is not my major but I do possess the basic essential knowledge of programming (well few years ago, I did develop an app to calculate Elliott Wave), I have completed the automation version of the Ichimoku system.  This has provided me the platform to develop the AI version.

4. By mid Mar 2025, the first version of the Ichimoku AI System has completed and was able to predict buy and sell signals with average or slightly above average accuracy.  That was used in the post dated 27th Mar 2025 to predict STI direction.

5. In order to increase the accuracy and performance of the AI prediction, additional features and enhancements were made that led to v2.3 of the app being completed in first week of Apr 2025 to carry out the 2nd analysis on STI (this post)




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 ?






Thursday, March 20, 2025

Ichimoku AI Trading System -- Part III

 Continued from Ichimoku AI Trading System -- Part I and Ichimoku AI Trading System -- Part II


Finally, completed a working version of the Ichimoku AI System !!!

Before proceed, let do some clarification, in the previous 2 edition, version 1 and version of the app, that should not be considered anything as AI.  Those should be classified as automation instead.  So, this version 3, IS REALLY AI !!!

What's the difference ?  In automation, we just make use of computation power to fasten the process and in the case of Ichimoku signal detection, it just simply marks out the buy and sell signals based on the rules that we input, the very typical Ichimoku buy and sell signals.  It WILL NOT PREDICT the nature of the signals.  In AI, the story is different.  historical data were fed to the AI model for machine learning, to train it to recognize the pattern as to when and how the buy and sell signals should be generated.  Features, in particular Ichimoku's features (characteristics) were injected along with target (buy and sell conditions) for it to train on the historical data.  Once the model is trained, the real data will feed in for it to predict the buy and sell signals based on what it has learned so far.  The output is probability of buy and sell (and do nothing) signals and based on the probability, we could classify them into Strong Buy, Weak Buy, Strong Sell and Weak Sell signals to further aids our decision of entry and exit.  AI is not supposed to take over the control to make decision for us but assist us only.  This is the correct way to use AI !!!


Now, let see some example what this AI system can do.  We'll looking at STI in the period 1st Jan 2007 to 20th Oct 2007.  This is the period STI on a bull run and finally peak on 12th Oct 2007 then crash all the way down till Mar 2009 due to the US subprime crisis.  We all knew what happened (where the peak and trough is) since it is already an happened event.  However, the data being fed into the AI system is as if it is looking at on 20th Oct 2007.  What the AI model did was being trained on historical data prior to 1st Jan 2007 and do the prediction for 1st Jan 2007 till 20th Oct 2007 based on what it has learnt.



We can see the AI model is able to predict a weak sell signal around the 12th Oct 2007 peak.  Also note the gray shaded region.  This is the region whereby there is no Chikou span signal for the AI model to use on its prediction.  This is mainly Chikou span is a laggard signal, shift backward 26 period.  So the question is did the AI model's decision making being affected given Chikou span is one of the component that indicate bullish (Chikou span above price) or bearish (Chikou span below price).  



The above is the same period as the first figure, the only different is the Risk Level was adjusted (look at the red circle in the top left region).  This is a feature that I put in to the AI system.  Stock market volatility is always changing and it will play a part in the decision on whether one should enter or exit the stock market.  As shown from the above screenshot, there are more weak sell signals leading up the the peak and quite a prominent strong buy signal at the trough before the peak.  These made the AI model prediction looks right on the track.



The above screenshot moved the ending period to 20th Nov 2007 so that the peak on 12th Oct 2007 has moved out of the no Chikou span zone.  This is the see whether now with Chikou span signal being available for the AI mode, will the final decision anything different.  Again, the weak sell signal near the peak remain, so as the strong buy signal at the trough prior to the peak.  Probably, this is just a special case whereby the prediction the AI model made is independent of Chikou span.



We now move to 9 Mar 2009 when STI hit rock bottom and recover from the crisis.  Again, we are trying to see the AI model can predict any buy signal at or near this bottom.  The testing period is from 1st Jan 2008 to 15th Mar 2009.  9th Mar 2009 is now inside the no Chikou span zone.  As we knew whole of 2008 STI was down, down, down all the way and the AI model didn't fail to predict that as all the strong sell signals were flashing along the way.  Now, the AI model didn't manage to predict any buy signal around 9th Mar 2009 maybe due to lack of Chikou span signal.



We now move the period till 31st Mar 2009 so that 9th Mar 2009 is near to come out of the no Chikou span zone.  Walah !!! a strong buy signal pop out.



Above is the period extends till 20th Apr 2009 so that 9th Mar 2009 is totally out of the no Chikou span zone.  This time even better 2 strong buy signals pop out.  While still couldn't be very conclusive did the Chikou span play some parts in the AI model prediction, the assure is the AI model is pretty well able to predict correctly near the trough.


To be able to making good prediction is not good enough if you don't make use of it.  Next, we will be carrying out a little simulation to emulate trading based on the AI predicted buy and sell signals.  This is the part that I've integrated into the app apart from just pure looking at metrics and backtesting results.  



This time we'll looking at 1st Jan 2019 till 31st Dec 2020, the period stock market hit by the unexpected Covid-19 pandemic.  Well, maybe we can predict when financial crisis can happen next but definitely not a natural disaster like pandemic.  This is real test for the capability of the AI prediction.  Looking at the above AI prediction, while the AI didn't predict a buy signal (weak or strong) at the trough, it did manage to predict 2 strong buy signal near the next trough.  Strong sell signals also appear near most of the peak and especially the one just before STI crash to the trough.  This means should anyone follow the AI prediction, should be able to avoid the crash to the bottom.



This is the simulation to simulate buy strategy (only on strong buy signal to enter and strong sell signal to exit) using the above AI prediction.  Can see only 3 trades were performed and all turn out to be winning trade and a realized profit of 15.51% were achieved, annualized to 7.50% return for this period.  This is definitely outperformed than you simply buy on 1st Jan 2019 and hold till 31st Dec 2020 when you only suffered negative return.



The same simulation but this time we changed the buy and sell signal from only strong to both (either strong or weak and we'll enter and exit).  The return is even better with 19.19% profit and annualized return of 9.20% but the win rate dip to 75% only meaning 2 out of 8 trades were cut loss.



Normally, investors don't short the market when it was on a downtrend but traders are different.  The next simulation as above is to simulate how a trader will react to the AI predicted signals, long and short.  Here, we only focus on the strong signal to long or short.  6 trades were done with 3 long and 3 short and all came out winning.  This net a profit of 54.52% or annualized gain of 24.38%.  So this AI system is able to cater for trader as well.



Now, we turn to a more volatile entity, BTC and see how the AI's prediction can benefit our investment or trading.  Above is the AI prediction for BTC from 1st Jan 2024 till 20th Mar 2025 (yes, today !!!!).  Look at the 3 red circles, a very prominent entry and exit point.  For those interested, look at the region near today, no buy signal was predicted so far.



The above is the long only simulation with strong signals for these periods.  Only 3 trades were done and all came out winning.  That gives a realized profit of 124.65%, annualized to 94.81% return.


While this is not the final working version as there are definitely bugs that yet to discover, features need enhancement and fine tuning especially to be more precise how the AI model going to make prediction at the no Chikou span zone, this working version nevertheless is quite impressive to certain aspect.

Perhaps, somewhere at other parts of the earth already have such an AI system, this is definitely something fully developed by me (ccloh) in 2025, fully AI Ichimoku system.  

This I will dedicate (or put it bluntly a pot shot) to SMU for being snobbish to snub me from attending the Ichimoku TA class with my SkillsFuture credit.  Not to mention to Singapore Government of the day -- PAP, another those high nose stance that everything also talk about foreign talent.  Hey, this AI system is fully developed by a local born citizen that serve that bloody 2.5 yrs of NS and went through hell from that pressure cooking education system who is not specialize in programming and only know about AI when I started developing on this.  Whatever certifications that this pseudo elite government that always pride themselves from wearing white cited as requirement,  all I don't have and yet based on my solo effort I develop this AI system !!!