Comment on Managing your Script
There is nothing as such like one best timeframe for intraday trading, it depends on individual, scrip, overall volatility, risk reward ratio and various other factors. Best way to find it out is via experience. Also can check this http://tradingqna.com/ for more answers from experts on coding and market related stuff.