Progress Update 1
As the first post of this blog, I would like to say that the reason behind creating this blog and publicly sharing my learning process in attempting to create a trading bot is strictly for educational uses only. If I create a successful automated trading strategy devoid of emotions, then I can try to use my own capital to deploy and test out the strategy. If I fail in creating a successful automated trading strategy, I will still pick up useful insights and skills that other people my age will not have. It is a win-win-win scenario. I win whether I fail or not, and you the reader win through learning along with me.
Today I continued working on the SPY strategy that is based on using moving averages and volatility-based indicators. When I finished coding and planning out the strategy that I wanted to do, I had a hard time figuring out why the strategy wasn't placing any buy or sell orders. I eventually found out that my "genius" idea to have a bunch of conditions for a buy or sell order was too much. Financial markets never perform perfectly to expectations so that is probably why having too many constraints was too much. I was trying to have my "aggressive" orders defined as an RSI indicator with a simple moving average on it to use RSI/MA crosses combined with measured volatility to determine if a potential trade was "worth it" and also coded for the crosses to only be listened to if they occurred near or in overbought/oversold RSI levels.
I guess I need to simplify everything and stop going the path of ultra-technical thinking that there is an indicator for everything that will solve every problem.
Anyways, I eased up the order conditions for "aggressive" orders and just put the standard orders as a simple bull/bear cross between two moving averages: one fast exponential moving average and one slow simple moving average. I eventually optimized this strategy on a 4 hour chart to a 0.331 Sharpe Ratio and 465.15% net profit over a 10.5 year span. When I was further messing with values, I stumbled across a possibility where the algo listened to all RSI/MA crosses instead of listening to only the ones in extreme overbought/oversold levels. When it did this, it was over trading around 2600+ orders in a 10.5 year span compared to the normal optimized 70-100. Normally I would ignore that if I was making this for Bitcoin markets (where there are trading fees), but since there are no trading fees for stocks and ETFs, I looked further into that scenario to optimize it further.
I eventually got the algo optimized with my starting $1k hypothetical balance so that it would make +100x returns leading up to the COVID stock market crash and +200x returns up to now (during COVID). It also had a Sharpe Ratio of 0.861 which is the highest I have got so far in my learning process. It made me really think hard about if this would be viable as a strategy long term. I will look more into it tomorrow.
-Jamie

Comments
Post a Comment