I'm building quite a lot of pretty complicated indicators/strategies in Pine Script. Quite often they don't work from the 1 try so I have to debug them heavily.
In Pine Script there are no fancy debuggers so you have to be creative. You can plot values on your screens, check them in the data window, etc.
If you want to display some textual information, you can...
Simple method I used to debug problem in my script.
For loop generates 5 numbers from the given depth. At present, depth is 9
Rules for generating the combinations are as follows:
First number is always 1
Two even numbers should not be adjacent to each other and two odd numbers should not be adjacent to each other
Numbers should be ordered in...