Everything should work, candle 0 close is current price, strip this back to a single condition and test. you can then work out wat isn't working