April 17, 2017

Kwargs syntax now covers all built-in functions

Pinescript had different calls for annotation functions (study, plot,…) and built-in functions (sma, security, …) up until now. Annotation functions used to accept keyword arguments while built-in functions didn’t.

You are now able to call all built-in functions using keyword arguments. This will be especially useful for the security function to specify the lookahead argument but skip the gaps argument:

security('TSLA', 'D', close, lookahead=barmerge.lookahead_off)