I am trying to do some very simple stuff with displaying moving averages of a single stock. I am attempting to backtest the 15 minute and 30 minute moving averages for IBM stock for the period of 10/26/2015 to 10/27/2015 using mavg. From what I understand, in order to do this I need to enter the time period in minutes inside the mavg function. However, mavg, to the best of my knowledge, only takes days as input. Is it possible to input the time period in minutes? I have been struggling with this.
I have attached my code and the backtest. It doesn't look right at all.'
Someone please help. Thanks.