Your analysis is correct if we optimize our algorithm to maximize the profit from its most recent trade.
But, as with the iterated prisoner's dilemma, what makes a successful strategy can change when a game is played repeatedly. Imagine a genetic algorithm that comes up with a tit-for-tat strategy when playing the iterated prisoner's dilemma. Now imagine a similar genetic algorithm applied to automated trading. Imagine a market in which a large fraction of the trading is done by such algorithms.
I think it is quite plausible that a cartel could form more or less spontaneously, without any conscious encouragement in that direction from human programmers. (But hey, maybe you have a good argument that I'm wrong.)
But, as with the iterated prisoner's dilemma, what makes a successful strategy can change when a game is played repeatedly. Imagine a genetic algorithm that comes up with a tit-for-tat strategy when playing the iterated prisoner's dilemma. Now imagine a similar genetic algorithm applied to automated trading. Imagine a market in which a large fraction of the trading is done by such algorithms.
I think it is quite plausible that a cartel could form more or less spontaneously, without any conscious encouragement in that direction from human programmers. (But hey, maybe you have a good argument that I'm wrong.)