Still working on the code. It looks like there are still problems with returning inconsistent answers. Without consistent answers, there is no hope to optimize the algorithm for the best answer.
Anyway, I've narrowed it down to the issue of trying to use stochastic, analog problem solving method on a problem with a very digital output (buy, sell, wait).
In order to solve this problem, I have to rig the code by judiciously invoking some rounding and also by setting up a predetermined random seed for the algorithm. Otherwise, the computed solution will always be just slightly different, which it turns out is enough to give inconsistent answers, and impair the optimization runs, which require definite answers.
Alas.. The problem of using genetic algorithms. It gives "pretty good answers mos of the time", but not absoute answers all of the time!
More later.