For debugging of pinescript, coders have a console window just below pinescript editor window. If the console window is not visible. Right click on the menu bar of editor window and select console. All the script related errors are generated and shown in console window. Coders can then take overview of error from the error description generated and debug pinescript errors.
Taking Hints from Pinescript Console Window
The above shows console option when right clicked on the menu bar of editor window.When any error is found in script by the pinescript editor it highlights the error in console window with red colour. The line number of possible error is also generated. In the example below, line no 3 has generated error. The description of error is "Undeclared identifier close1" . This error means that you have used a variable without declaration, this normally happens when you have written the name of variable wrong or the variable name has typo error.
This is very common question asked by almost every new coder. When you are new, you often make mistake and for learning debugging is very important.