title: Undeclared Identifier error in Pinescript while updating to version=4
body: <p>I am trying to convert Ehlers Instantaneous Trend study script to v=4 but getting Undeclared Identifier error in version=4</p>
  <p>The original script can be found here -</p>
  <p><a href="https://www.tradingview.com/script/DaHLcICg-Ehlers-Instantaneous-Trend-LazyBear/" rel="nofollow noreferrer">https://www.tradingview.com/script/DaHLcICg-Ehlers-Instantaneous-Trend-LazyBear/</a></p>
  <pre><code>study(title=&quot;Ehlers Instantaneous Trend [LazyBear]&quot;, shorttitle=&quot;EIT_LB&quot;, overlay=true, precision=3)
  src=input(hl2, title=&quot;Source&quot;)
  a= input(0.07, title=&quot;Alpha&quot;, step=0.01) 
  fr=input(false, title=&quot;Fill Trend Region&quot;)
  ebc=input(false, title=&quot;Enable barcolors&quot;)
  hr=input(false, title=&quot;Hide Ribbon&quot;)
  it=(a-((a*a)/4.0))*src+0.5*a*a*src[1]-(a-0.75*a*a)*src[2]+2*(1-a )*nz(it[1], ((src+2*src[1]+src[2])/4.0))-(1-a )*(1-a )*nz(it[2], ((src+2*src[1]+src[2])/4.0))
  lag=2.0*it-nz(it[2])
  dl=plot(fr and (not hr)?(it&gt;lag?lag:it):na, color=gray, style=circles, linewidth=0, title=&quot;Dummy&quot;)
  itl=plot(hr?na:it, color=fr?gray:red, linewidth=1, title=&quot;Trend&quot;)
  ll=plot(hr?na:lag, color=fr?gray:blue, linewidth=1, title=&quot;Trigger&quot;)
  fill(dl, ll, green, title=&quot;UpTrend&quot;, transp=70)
  fill(dl, itl, red, title=&quot;DownTrend&quot;, transp=70)
  bc=not ebc?na:(it&gt;lag?red:lime)
  barcolor(bc)
  
  </code></pre>
  <p>errors</p>
  <pre><code>Processing script...
  line 9: Undeclared identifier `it`;
  line 10: Undeclared identifier `it`;
  line 11: Undeclared identifier `it`;
  line 11: Undeclared identifier `lag`;
  line 12: Undeclared identifier `it`;
  line 13: Undeclared identifier `lag`;
  line 16: Undeclared identifier `it`;
  line 16: Undeclared identifier `lag`;
  line 17: Undeclared identifier `bc`
  
  </code></pre>
  <p>Any help would be greatly appreciated.
  Trying to base a strategy on the script.</p>
  <p>Have a nice day</p>
  <p>J</p>