I am not a code guru, but you code looks correct, but in order to test a 1 Min strategy I would use ticks data and set the ticks flag.

Ciao