Rinku
Rinku

Reputation: 133

Pinescript: expression argument of security has no side effects error

I am calling a function using the following:

[v01, c01, d01] = security("NSE:NIFTY", timeframe.period, funct())

I am getting an error " Expression argument of security function should have no side effects"

However it works with [v01, c01, d01] = funct()

What is my mistake?

Upvotes: 1

Views: 739

Answers (1)

Rinku
Rinku

Reputation: 133

Debugged it with the help of another coder friend. Was trying to plot inside a function. Once removed, it works fine. –

Upvotes: 2

Related Questions