Hmm I see nothing wrong in your code and dont see why you think you need to use [1], but maybe you wanted a crossOver() of the price instead of just comparing it? Your comparing will enter trades all the time on every bar, but crossover only enters it when the price crosses over the border.