Hello everyone! ๐
Guess what? Trade Maven just got a massive upgrade, and here's a journey into the nitty-gritty details! ๐๐ฅณ
After the massive loss we suffered due to [Cointelegraph's market manipulation](https://hackmd.io/@trademaven/HyLDH-o-6) ๐, we've been up all night for the past week (literally) reevaluating Trade Maven's algorithms โ๏ธ, and we stumbled upon some exciting discoveries! ๐ต๏ธโโ๏ธ
> **Disclaimer**: While we discussed various terms and techniques that may suggest Trade Maven employs Machine/Deep Learning or AI for market analysis, we don't currently utilize learning algorithms due to testing complexities. Trade Maven operates through our developed expertise in [Technical Analysis](https://www.investopedia.com/terms/t/technicalanalysis.asp), Mathematics, Statistics, and Cryptocurrency Trading.
## 1. We weren't testing the algorithm properly ๐ถ
We changed how we tested the algorithm's efficiency ๐ as we can access Bitcoin's price data from 2013 to 2023 ๐. In the past, we **trained** the algorithm with data from 2018 to 2022, **forward tested** using 2023 data, and **backward tested** using the entire dataset ๐ป
> **Training data** is what the algorithm uses to develop signal generation, filtering, and risk management strategies ๐
> **Forward testing data** is used to test if the algorithm trained in the present will still work in the future ๐ซ
> **Backward testing data** is used to test if the algorithm would work on data generated before the **testing data** ๐ฐ๏ธ
This worked perfectly, and that's how Trade Maven was born ๐ but you might wonder why we changed the testing process. We started **feeling** that the algorithm might be getting [overfitted](https://www.investopedia.com/terms/o/overfitting.asp) with the training data and wouldn't stand the test of time ๐คทโโ
> Overfitting is when an algorithm "memorizes" the given data instead of learning from it. When this happens, the algorithm will seamlessly pass tests but fail in the real world ๐
We realized the previous setup wasn't adequate for detecting overfitting since the algorithm aced tests from 2013 to 2017 and 2023 seamlessly ๐. So, we decided to get creative and split the data into three pieces ๐งฉ:
- **2013 to 2016**: This batch will be the backward test, like stepping into a time machine to ensure our algorithm could've held its own in the past ๐ฐ๏ธ
- **2017 to 2020**: These years are right after one [Bitcoin halving](https://www.investopedia.com/bitcoin-halving-4843769) and right before another โ๏ธ. Perfect for training, don't you think? It's like capturing a complete [crypto market cycle](https://learn.bybit.com/investing/crypto-market-cycles/) in action ๐
- **2021 to 2023**: This period was a wild ride for crypto, and the market flexed some serious muscle ๐ฆพ; it makes sense for forward testing the algorithm. Plus, by this time, the crypto market had matured quite a bit ๐ก
Next, we used the new data and repeated research and strategy development process ๐จโ๐ฌ. The goal? Make sure that both the forward and backward tests are successful, with a special focus on the forward test, because that's where the real magic happens! ๐ซ
Unfortunately, Trade Maven flopped the forward test ๐, meaning the entire project faces potential failure, and we had to **quickly** restrategize ๐โโ๏ธ
## 2. Bitcoin performed very well in the past ๐
With a dataset showing Bitcoin's ($BTC) journey from $12 in 2013 to $69,000 in 2021 and then a dip to $30,000 in 2023, it's possible to enter random trades and still make profits, particularly when the market experiences mind-boggling gains of 5,400% and 1,300% in a single year ๐ค๐ฅ
Trade Maven's mission ๐ฏ is to hedge against Bitcoin's movements. If $BTC decides to shoot up by 160% in a year, Trade Maven is ready to turn that into 600% profit for you ๐๐ฐ, and even when the tide turns and $BTC dips by 70%, Trade Maven should be in 300% profits ๐ฅ๐
The overfitted algorithm succeeded by using knowledge of the 2018 to 2022 market data during backtesting to trade from 2012 to 2017 when the market was volatile ๐๐. But the big question is, what about 2024 or 2027 when market dynamics change? Relying solely on past patterns spells uncertainty in a shifting cryptocurrency landscape ๐ก๐น
## 3. Managing bad trades is better than executing perfect good trades ๐คนโโ๏ธ
Overfitted algorithms often appear to make "perfect" predictions, yielding excellent evaluation results. However, the primary objective for any algorithm should be to discover meaningful patterns that inform decisions on unseen data ๐ซก๐ค. When we created Trade Maven, we made use of an excess of [Technical Indicators](https://www.investopedia.com/terms/t/technicalindicator.asp), which inadvertently led the algorithm to "memorize" the data instead of uncovering valuable patterns ๐๐ค
We streamlined Trade Maven's trading strategies to include only the essential indicators, skipped [hyperparameter tuning](https://www.anyscale.com/blog/what-is-hyperparameter-tuning) in favour of default values, added a small yet effective set of signal filters, and focused on managing both profitable and bad trades, all while keeping a keen eye on portfolio risk management ๐๐ผ
We kicked it up a notch when we witnessed substantial progress using this approach. We doubled our efforts until we had a rock-solid algorithm that excelled in training and aced the forward and backward testing phases. We even tested the new algorithm with Ethereum's ($ETH) data from 2018, and guess what? It sailed through like a pro, requiring **no modifications or tweaks** ๐ฆพ๐
## How well does the algorithm perform? ๐ค
**Data source**: [Bitstamp](https://www.bitstamp.net/) (cryptocurrency exchange founded in 2011)
**Time period**: December 1, 2012 (BTC = $12) to July 17, 2023 (BTC = $30,000)
| METRIC | VALUE |
| - | - |
| Number of trades | 433 |
| Accuracy | 66.05% |
| Cumulative profit | 8,208.55% |
| Average profitable trade | 32.38% |
| Average losing trade | 7.16% |
| [Risk to Reward Ratio (RRR)](https://www.investopedia.com/terms/r/riskrewardratio.asp) | 1 to 4.52 |
| [Maximum drawdown (MDD)](https://www.investopedia.com/terms/m/maximum-drawdown-mdd.asp) | 50.41% |
| Annual drawdown geometric mean | 27.75% |
| Annual profit geometric mean | 344.22% |
> For detailed definitions of the metrics, please refer to the Trade Maven Whitepaper ๐๐





| YEAR | ANNUAL PROFIT | MAXIMUM DRAWDOWN |
| - | - | - |
| 2013 | 4,140.48% | 26.05% |
| 2014 | 295.27% | 26.99% |
| 2015 | 118.8% | 48.63% |
| 2016 | 303.39% | 9.4% |
| 2017 | 1,183.71% | 27.48% |
| 2018 | 263.54% | 20.86% |
| 2019 | 441.97% | 19.39% |
| 2020 | 834.19% | 39.09% |
| 2021 | 355.52% | 50.41% |
| 2022 | 17.56% | 45.97% |
| 2023 | 254.12% | 23.21% |
## Are there any future plans? ๐ฎ
Our roadmap remains consistent with what we initially [unveiled on our launch day](https://hackmd.io/@trademaven/S1bBtoHlp). However, given the promising performance of the new algorithm in analyzing additional markets like $ETH, we're gearing up for further research to explore the potential expansion of Trade Maven beyond just trading $BTC ๐๐ฆ
## How would the new algorithm have handled October 16, 2023? ๐
The [event on October 16, 2023](https://hackmd.io/@trademaven/HyLDH-o-6) resulted from market manipulation, with limited room for algorithmic intervention. Nevertheless, with the new algorithm in action, it would have initiated just **two** SHORT trades instead of the previous **four**, ultimately reducing the extent of losses incurred by half ๐โ๏ธ
## Conclusion ๐
Trade Maven's journey has been a whirlwind of growth and learning. We've revamped our testing methods, honed our strategies focusing on essential indicators and risk management, and emerged with a robust algorithm adaptable to changing market dynamics. Thank you once again for being a part of this story ๐๐
> Originally published: 27/10/2023