Data Importing from trading view. (format and reliability)

I am able to upload the data and see an accurate chart but when it comes to analysis(backtest) even a simple sma condition is not giving me triggers (it is giving me 1-2 triggers so thats completely inaccurate.). we've ruled out the possibility of the error being in the code and now we cant seem to figure out why this is happening. it could be the format of csv file.
to clarify, what format do we want the time to be? are there any steps to keep in mind when data is being imported from trading view?
has anyone else also encountered this problem before?

does anyone know where i can find minute historical data for NSE(INDIA) for free, even American exchanges will do?

TradingView is not data source. You should use supported data sources instead:

https://www.amibroker.com/guide/h_quotes.html