title: MACD stock indicator function using ewm() from pandas library
body: <p>Here is the test code for my macd function, however, the values I am getting are incorrect. I don't know if it is because my span is in days and my data is in 2 minute increments, or if it is a seperate issue. Any help would be much appreciated :)</p>
  <pre><code>import yfinance as yf
  import pandas as pd
  import pandas_ta as ta
  import numpy as np
  import datetime as dt
  import time
  
  
  dataTSLA = yf.download(tickers='TSLA', period='1mo', interval='2m', auto_adjust=True)
  
  
  def indicatorMACD(data):
      exp1 = data['Close'].ewm(span=12, adjust=False).mean()
      exp2 = data['Close'].ewm(span=26, adjust=False).mean()
      macd = exp1 - exp2
      signalLine = macd.ewm(span=9, adjust=False).mean()
      return [macd, signalLine]
  
  print(indicatorMACD(dataTSLA))
  </code></pre>
  <p>Getting an output of around 0.66 for macd and 0.23 for signal when it should be -0.23 and -0.64 respectively.</p>