Originally Posted by bondo1
About that last part, do you know where I could find more information on when to use series or not? I checked the manual for examples, and sometimes I found scripts that had series in them (see here: http://manual.zorro-project.com/tutorial_var.htm)
and also on forum posts that had code (for example here: https://opserver.de/ubb7/ubbthreads.php?ubb=showflat&Number=443791#Post443791) and (here: https://opserver.de/ubb7/ubbthreads.php?ubb=showflat&Number=476248#Post476248).
It's simple:
  • If you only need the value in this bar, do not use series.
  • If you will need to retrieve an older value (i.e. a value from bar 4 while in bar 0), use series.
  • For example, a SMA Period = 5 calculation calculates an average of bars 0 thru 4, so it requires a price series as an input, but its output is a var. But if that needs to be a series for yet another calculation, you can plug it into a series.