Quantopian's community platform is shutting down. Please read this post for more information and download your code.
Back to Community
Am I using history() incorrectly?

I'm trying to make an algorithm that is in and out of the market every couple of minutes. I've set it up to buy a share when the 2 minute price and volume moving averages are greater than the 10 minute averages.

The algorithm is only buying and selling at the start of the day, even though the backtest period and history() functions are set to minutes.
Sorry, this is definitely a noob question. Please help!