title: Why won't this code run in Pine Script 4? "Undeclared identifier"
body: <p>Resources are still Pine Script 3 heavy, so I think I'm mixing something up:</p>
  
  <p>I tried to create an Average Daily Range indicator, which is basically the ATR that takes a "D" input no matter what the time frame of the current chart is. My code works perfectly fine on Pine Script 3, but Pine Script 4 throws out the following errors:</p>
  
  <pre><code>line 4: Undeclared identifier `resolution`;
  line 6: Undeclared identifier `tickerid`;
  line 6: Undeclared identifier `dRange`;
  line 8: Undeclared identifier `adRange`
  </code></pre>
  
  <p>The docs indicate <code>resolution</code> is still an <code>input()</code> argument, and I'm not sure why anything else is called "undeclared".</p>
  
  <p>My full code is:</p>
  
  <pre><code>//@version=4
  study(title="Average Daily Range", shorttitle="ADR", overlay=false)
  
  dRange = input(defval="D", title="Daily Range", type=resolution)
  
  adRange = security(tickerid, dRange, rma(tr, 5))
  
  plot(adRange, title = "ADR", color=#000000, transp=0)
  </code></pre>
  
  <p>What are these "Undeclared identifiers"? And what must I do differently in Pine Script 4 so that I'm getting the same result?</p>
  
  <p>Thank you.</p>