Actually the algo IS the hardest past in a bot. It took me three hours to code the bot and 2 months to create the algo.
I suggest that you are making this way more complicated than it needs to be. You've put 100 times as much effort into the algorithm as I did. No doubt your algorithm is better than mine, but I rather doubt it's 100 times better.