title: Adding legend in ggplot2
body: <p>I have looked through similar questions and I have a feeling I have done everything. Still not getting the desire output. I am using <strong>ggplot2</strong> and <strong>tidyquant</strong> packages to visualize data with 2 financial trends I am trying to display a legend that contains trends line coloron plot</p>
  
  <pre><code>data %&gt;%
    ggplot(aes(date, price)) +
    geom_line() +
    geom_ma(ma_fun = SMA, n = 50, size = 1 , col = "red" , show.legend = TRUE)+
    geom_ma(ma_fun = SMA, n = 200, size = 1 , col = "blue", show.legend= TRUE)+
    theme_tq() 
  </code></pre>
  
  <p><a href="https://i.stack.imgur.com/Bu9vu.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/Bu9vu.png" alt="enter image description here"></a></p>