Still the same bugs, the "Script" lines, wrong defined variables and training trade results with no trading. It seems your algos do not trade at all because the if condition is never true.

If you want to train on trade returns then you must really enter trades, both long and short, and for both algos. Or you use another training target.

This has nothing to do with keras, it is the same with any machine learning method.