title: Add to Chart operation failed, reason: line 73: Mismatched input 'if' expecting 'end of line without line continuation'
body: <p>I'm using pine editor. The problem is at the bottom with the if/else statements. When I remove the second if/else it throws and error at line 0 mismatched input ' eof ' expecting 'block of statements'. What can I do?</p>
  <p>// This source code is subject to the terms of the Mozilla Public License 2.0 at <a href="https://mozilla.org/MPL/2.0/" rel="nofollow noreferrer">https://mozilla.org/MPL/2.0/</a>
  // © sixfour_tv
  //@version=5</p>
  <pre><code>
  //CHOP
  length = input.int(title = &quot;Chop&quot;, defval=13, minval=1)
  ci = 100 * math.log10(math.sum(ta.atr(1), length) / (ta.highest(length) - ta.lowest(length))) / math.log10(length)
  offset = input.int(0, &quot;Offset&quot;,  minval = -500, maxval = 500)
  
  //MACD
  fast_length = input(title=&quot;Fast Length&quot;, defval=6)
  slow_length = input(title=&quot;Slow Length&quot;, defval=13)
  macd_src = input(title=&quot;Source&quot;, defval=close)
  signal_length = input.int(title=&quot;Signal Smoothing&quot;,  minval = 1, maxval = 50, defval = 9)
  sma_source = input.string(title=&quot;Oscillator MA Type&quot;,  defval=&quot;EMA&quot;, options=[&quot;SMA&quot;, &quot;EMA&quot;])
  sma_signal = input.string(title=&quot;Signal Line MA Type&quot;, defval=&quot;EMA&quot;, options=[&quot;SMA&quot;, &quot;EMA&quot;])
  
  // Calculating
  fast_ma = sma_source == &quot;SMA&quot; ? ta.sma(macd_src, fast_length) : ta.ema(macd_src, fast_length)
  slow_ma = sma_source == &quot;SMA&quot; ? ta.sma(macd_src, slow_length) : ta.ema(macd_src, slow_length)
  macd = fast_ma - slow_ma
  signal = sma_signal == &quot;SMA&quot; ? ta.sma(macd, signal_length) : ta.ema(macd, signal_length)
  hist = macd - signal
  
  //EMAs
  len_ema_1 = input.int(title=&quot;First EMA&quot;, defval=13, minval=1)
  src_ema_1= input(close, title=&quot;Source&quot;)
  offset_ema_1 = input.int(title=&quot;Offset&quot;, defval=0, minval=-500, maxval=500)
  ema13 = ta.ema(src_ema_1, len_ema_1)
  
  len_ema_2 = input.int(title=&quot;Second EMA&quot;, defval = 169, minval=1)
  src_ema_2 = input(close, title=&quot;Source&quot;)
  offset_ema_2 = input.int(title=&quot;Offset&quot;, defval=0, minval=-500, maxval=500)
  ema169 = ta.ema(src_ema_2, len_ema_2)
  
  //Variables
  macdLongAlert = ta.crossover(macd,signal) and macd &lt; ema169 // MACD crossing up
  macdShortAlert = ta.crossunder(macd,signal) and macd &gt; ema169 // MACD crossing down
  emaCrossUp = ta.crossover(ta.ema(close, 13), ta.ema(close, 169))
  emaCrossDown = ta.crossunder(ta.ema(close, 13), ta.ema(close, 169))
  ciLow = ci &lt;= 50
  volCloseCheckOver = volume&gt; ta.ema(volume,13)
  volCloseCheckUnder = volume&lt; ta.ema(volume,13)
  longCloseCheck = close &gt; open
  shortCloseCheck = close &lt; open
  confirmLong = ciLow and longCloseCheck and volCloseCheckOver and close &gt; ema169
  confirmShort = ciLow and shortCloseCheck and volCloseCheckOver and close &lt; ema169
  exitLong = ta.crossunder(macd,signal)
  exitShort = ta.crossover(macd,signal)
  
  //specialLong = (close &gt; open) and (close &gt; ema13) and (close &gt; ema169) and (macd &gt; signal) and volCloseCheck and ciLow
  //specialShort = (close &lt; open) and (close &lt; ema13) and close &lt; ema169 and macd &lt; signal and volCloseCheck and ciLow
  
  
  //Plots
  plotshape(macdLongAlert, &quot;Long Alert&quot;, style = shape.flag, location = location.belowbar, color = color.green)
  plotshape(confirmLong, &quot;Long Confirmed&quot;, style = shape.triangleup, location = location.belowbar, color = color.green)
  
  plotshape(macdShortAlert, &quot;Short Alert&quot;, style = shape.flag, location = location.abovebar, color = color.red)
  plotshape(confirmShort, &quot;Short Confirmed&quot;, style = shape.triangledown, location = location.abovebar, color = color.red)
  
  //plotshape(specialLong, &quot;Special Alert Long&quot;, style = shape.triangleup, location = location.abovebar, color = color.green)
  //plotshape(specialShort, &quot;Special Alert Short&quot;, style = shape.triangledown, location = location.belowbar, color = color.red)
  
  if macdShortAlert
      while (confirmShort)
          strategy.entry(&quot;Short&quot;, strategy.short)
          strategy.close(&quot;Short&quot;, when = strategy.position_size &gt; 0)
  else
  
  if macdLongAlert
      while (confirmLong)
          strategy.entry(&quot;Long&quot;, strategy.long)
          strategy.close(&quot;Long&quot;, when = strategy.position_size &gt; 0)
  else```
  </code></pre>