title: Pinescript: Script could not be translated from:
body: <p>I am trying to create a multiple moving average script in TradingView Pinescript. Unfortunately, it keeps throwing the error:</p>
  <blockquote>
  <p>Script could not be translated from: [&quot;EMA&quot;,&quot;SMA&quot;,&quot;WMA&quot;,&quot;HMA&quot;,&quot;LIN&quot;]</p>
  </blockquote>
  <p>I can't seem to figure out if my syntax is incorrect or if there is something else that I'm missing.</p>
  <p>Any help anyone can provide would be greatly appreciated.</p>
  <pre><code>study(&quot;SPY Indicators&quot;, shorttitle=&quot;SPY Ind&quot;, overlay=true)
  //@version=1
  // Version 1.0
  // Author: Likwid
  
  
  // Definitions: Price and Timeframes
  src = input(close, title = &quot;Source&quot;)
  resolution = timeframe.period
  price = security(syminfo.tickerid, resolution, src)
  
  // Defintions: Moving Average periods and types
  ma1Period = input(defval=8, title=&quot;Period&quot;, inline=&quot;1&quot;, group=&quot;Moving Averages: Zone 1&quot;)
  ma1Type = input(defval=&quot;EMA&quot;, title=&quot;Type&quot;, type=input.string, options=[&quot;EMA&quot;,&quot;SMA&quot;,&quot;WMA&quot;,&quot;HMA&quot;,&quot;LIN&quot;], tooltip=&quot;MA Smoothing&quot;, inline=&quot;1&quot;, group=&quot;Moving Averages: Zone 1&quot;)
  
  ma2Period = input(defval=21, title=&quot;Period&quot;, inline=&quot;2&quot;, group=&quot;Moving Averages: Zone 1&quot;)
  ma2Type = input(defval=&quot;EMA&quot;, title=&quot;Type&quot;, type=input.string, options=[&quot;EMA&quot;,&quot;SMA&quot;,&quot;WMA&quot;,&quot;HMA&quot;,&quot;LIN&quot;], tooltip=&quot;MA Smoothing&quot;, inline=&quot;2&quot;, group=&quot;Moving Averages: Zone 1&quot;)
  
  ma3Period = input(defval=34, title=&quot;Period&quot;, inline=&quot;3&quot;, group=&quot;Moving Averages: Zone 2&quot;)
  ma3Type = input(defval=&quot;EMA&quot;, title=&quot;Type&quot;, type=input.string, options=[&quot;EMA&quot;,&quot;SMA&quot;,&quot;WMA&quot;,&quot;HMA&quot;,&quot;LIN&quot;], tooltip=&quot;MA Smoothing&quot;, inline=&quot;3&quot;, group=&quot;Moving Averages: Zone 2&quot;)
  
  ma4Period = input(defval=50, title=&quot;Period&quot;, inline=&quot;4&quot;, group=&quot;Moving Averages: Zone 2&quot;)
  ma4Type = input(defval=&quot;EMA&quot;, title=&quot;Type&quot;, type=input.string, options=[&quot;EMA&quot;,&quot;SMA&quot;,&quot;WMA&quot;,&quot;HMA&quot;,&quot;LIN&quot;], tooltip=&quot;MA Smoothing&quot;, inline=&quot;4&quot;, group=&quot;Moving Averages: Zone 2&quot;)
  
  ma5Period = input(defval=200, title=&quot;Period&quot;, inline=&quot;5&quot;, group=&quot;Moving Averages: Other&quot;)
  ma5Type = input(defval=&quot;EMA&quot;, title=&quot;Type&quot;, type=input.string, options=[&quot;EMA&quot;,&quot;SMA&quot;,&quot;WMA&quot;,&quot;HMA&quot;,&quot;LIN&quot;], tooltip=&quot;MA Smoothing&quot;, inline=&quot;5&quot;, group=&quot;Moving Averages: Other&quot;)
  
  vwSwitch = input(title=&quot;VWAP&quot;, type=input.bool, defval=true, inline=&quot;6&quot;, group=&quot;Moving Averages: Other&quot;)
  vwPeriod = input(defval=9, title=&quot;Period&quot;, inline=&quot;6&quot;, group=&quot;Moving Averages: Other&quot;)
  
  // Moving Average Calculation
  ma1 = ma1Type == &quot;EMA&quot; ? ema(price, ma1Period) :
       ma1Type == &quot;SMA&quot; ? sma(price, ma1Period) :
       ma1Type == &quot;WMA&quot; ? wma(price, ma1Period) :
       ma1Type == &quot;HMA&quot; ? hma(price, ma1Period) :
       ma1Type == &quot;LIN&quot; ? linreg(price, ma1Period, 0) : na
  
  ma2 = ma2Type == &quot;EMA&quot; ? ema(price, ma2Period) :
       ma2Type == &quot;SMA&quot; ? sma(price, ma2Period) :
       ma2Type == &quot;WMA&quot; ? wma(price, ma2Period) :
       ma2Type == &quot;HMA&quot; ? hma(price, ma2Period) :
       ma2Type == &quot;LIN&quot; ? linreg(price, ma2Period, 0) : na
  
  ma3 = ma3Type == &quot;EMA&quot; ? ema(price, ma3Period) :
       ma3Type == &quot;SMA&quot; ? sma(price, ma3Period) :
       ma3Type == &quot;WMA&quot; ? wma(price, ma3Period) :
       ma3Type == &quot;HMA&quot; ? hma(price, ma3Period) :
       ma3Type == &quot;LIN&quot; ? linreg(price, ma3Period, 0) : na
  
  ma4 = ma4Type == &quot;EMA&quot; ? ema(price, ma4Period) :
       ma4Type == &quot;SMA&quot; ? sma(price, ma4Period) :
       ma4Type == &quot;WMA&quot; ? wma(price, ma4Period) :
       ma4Type == &quot;HMA&quot; ? hma(price, ma4Period) :
       ma4Type == &quot;LIN&quot; ? linreg(price, ma4Period, 0) : na
      
  ma5 = ma5Type == &quot;EMA&quot; ? ema(price, ma5Period) :
       ma5Type == &quot;SMA&quot; ? sma(price, ma5Period) :
       ma5Type == &quot;WMA&quot; ? wma(price, ma5Period) :
       ma5Type == &quot;LIN&quot; ? linreg(price, ma5Period, 0) : na
  
  // Definitions: Trends
  TrendUp1() =&gt; ma1 &gt; ma2
  TrendDown1() =&gt; ma1 &lt; ma2
  TrendUp2() =&gt; ma3 &gt; ma4
  TrendDown2() =&gt; ma3 &lt; ma4
  
  trendColor1 = TrendUp1() ? color.green : TrendDown1() ? color.red : color.blue
  trendColor2 = TrendUp2() ? color.blue : TrendDown2() ? color.red : color.blue
  
  
  // Moving Average plots
  fill(ma1, ma2, color=trendColor1, transp=70)
  fill(ma3, ma4, color=trendColor2, transp=70)
  
  plot(ma5, color=color.red, linewidth=2, style=plot.style_line)
  plot(vwSwitch ? vwap(hlc3) : na, color=color.white, linewidth=1, style=plot.style_line)
  </code></pre>