Pinescript has a console that tells you if the code is proper or not. Like any programming language, it tells you what is the error. I had to tell ChatGPT the error and it created a new code. Now whether it works for more complex cod