Thursday, February 27, 2025

Ichimoku AI Trading System -- Part I

What's going to say below all started because of the $500 SkillsFuture credit will expire Dec 2025 (according to latest, for my age group, it will not be expired but any unused will be channeled to the Mid-Career top up).  Well last year, the news of lifting the expiry date for my age group wasn't announced and for goodness shake since it was credited in 2020 I have yet to use a single cent of it.  Don't know what to use on to be exact.  So sensing not to waste that credit before expire, searched through all the courses see any possibility I could use it.  Chanced upon an Ichimoku Technical Analysis course conducted by SMU.  Well not that I'm totally new of using Ichimoku, I did know some knowledge of it and how to utilize it too.  Just that of all those courses, this look interesting that I could just spend the SkillsFuture credit so that it won't expire for nothing.  However, to my shocking, SMU didn't allow me to take the course with reason being I must complete the Basic Technical Analysis course before I could sign up for this.  Can't believe that and I sent email trying to reason with them since I'm not totally novice to technical analysis, I have some decent knowledge of Ichimoku and I can even use Elliott Wave as technical analysis.  Too bad, the reasoning didn't work and I was totally snub off from signing up for the Ichimoku course.  What's the heck !!!!

Then last month when news of Deepseek AI emerged that rocked the world in particular those existing AI developed by US, an idea struck me, inspired by Deepseek AI and still pissed off with SMU snub on the Ichimoku course, I have an idea of developing an AI system that utilize Ichimoku as a trading strategy.  Firstly, I know python programing but not to the mastery stage and I know nothing about developing something relating to AI.  OK you can laugh on me, fine with it !  So searching through the internet and keep on seeking answers from Deepseek, all this is possible and I am able to do it.  

Well, before I get to the point, side track a bit to talk about Deepseek.  As we know Deepseek is developed by China and obviously expecting some bias opinion against it especially from the West.  Not only that, even in Singapore some Chinese Singaporean already hold bias opinion against China in general.  Prior to Deepseek, I use none of AI like ChatGPT.  However, after using Deepseek and made an effort to compare to ChatGPT, I never regret not using ChatGPT.  For the same question that posed to Deepseek and ChatGPT, both give different responses.  Deepseek provides a very detail debating and reasoning type of answer (none of the answer is short and all throw back an essay length) and it just works like how a person is critical thinking of solutions to a problem.  On the other hand, ChatGPT answer is short, no detail debating and reasoning type of explanation like Deepseek.  In short, ChatGPT just spoon feed you with the solution (what's the heck !!!!).  Well maybe the paid version can do what Deepseek is doing but hey Deepseek is free and why should I pay ChatGPT when I can get the same from Deepseek for free ???    

OK, back to the point.  I can't immediately jump in to develop a system that could do all of what I wanted so I have to carry out stage by stage.  First was getting a simple Ichimoku trading system working.  This is not new, can easily find the source code from internet.  So after looking at those source codes, I managed to come out a version 1 of the program.  The method to trigger buy signal is pretty the same from what can be found on the internet, just that I added a possibility of doing a short trade and not to mention a GUI.  After backtesting, the followings are the result.





Above show the backtest result of doing a Long and Short trade on SGDJPY from period 1st Jan 2025 till 27 Feb 2025 using 1 hour interval.  Historical price is downloaded from Yahoo Finance and the trade metrics and detail of each trades are all displayed in the app.






Above are the long and short trades for SIA and STI for the period 1st Jan 2020 till 27 Feb 2025.  Given that involved the Covid-19 pandemic period whereby SIA and STI like other global markets were hit by it.  So testing how the system works from a cash to rebound make sense.




Next, I ran the backtest on BTC for the period from 1st Jan 2020 till 27 Feb 2025 for both the long and short trades given that BTC has broke the US100K mark recently and also to see whether the Ichimoku signals are able to handle the more volatile entity.

Well, I wouldn't say from the backtest result was excellent by looking at the metrics and the generated buy and sell signals from the program.  Nevertheless, this is an important first step that I can develop the system.

Knowing the limitation and problem of the first version that made the result so-so, I further enhanced the program to version 2, which has been completed and the results I can tell you is a big big contrast from version 1 and easily beat market return flat down.  That will be revealed in the next post !!!!

So, I must be very grateful for SMU doing the snobbish act of snubbing me from the Ichimoku course now.  If not, I would not have done what I have done.  Not to mention I saved up the SkillsFuture credit for any future use.