Seems to be made mostly for tick data (< 1 min timeframe) and advanced scalpers
Always interesting to see that Pinescript is much easier than most of other trading programming languages out there :)
PS You might like checking the data window panel from TradingView and mouseover your cursor on the chart. It will update the debug/historical data in real-time