Search code examples
pine-scriptpine-script-v5pine-script-v4

How to continue coding one line deeper in PineScript without violating the syntax?


How to continue coding one line deeper in PineScript without violating the syntax?

I am writing a quite complex program where I need to calculate many values. I want to avoid that I do a very long calculation only in one line, because then you have to go back and forth to the side all the time and have no overview.

So how can I spread a calculation over several lines without violating the syntax?


Solution

  • Your next line should start with one or several spaces (different from multiples of 4). You can read more information from here.

    a = open + high + low + close
    
    a = open +
          high +
              low +
                 close