This is a weird case. The logic is correct so the only reason I can imagine is some restriction coming from the broker. Have you tried using the bot on other brokers?