4

I am just trying out Pine Script for the first time, and can't make this work – which should be trivial according to other examples.

study("Price to Operating Income", overlay=true, scale=scale.left)
op_income = financial(syminfo.tickerid, "OPER_INCOME", "FQ")
price_op_income = close/op_income
plot(price_op_income)

Could not find function or function reference financial

Is this simply because Operating Income is not available for Pine Script in the free version of TradingView, or am I missing something?

P A N
  • 5,642
  • 15
  • 52
  • 103

1 Answers1

5

You forgot the //@version=4 tag in the beginning of your script.
financial() is a function that's available as of Pine script version 4.

//@version=4
study("Price to Operating Income", overlay=true, scale=scale.left)

op_income = financial(syminfo.tickerid, "OPER_INCOME", "FQ")
price_op_income = close/op_income

plot(price_op_income)
Bjorn Mistiaen
  • 6,459
  • 3
  • 18
  • 42