What is the equivalent of plt.scatter in mplfinance???
I am graphing stock prices using mpl finance.
def graph():
file = 'prices1.xlsx'
data = pd.read_excel(file, sheet_name = stockQuote)
data.Date = pd.to_datetime(data.Date)
data = data.set_index('Date')
mpf.plot(data, type = 'candle', mav = (100), tight_layout = True)
This
graph('AAPL')
should get me the graph of AAPL prices in candlestick.
I have another excel sheet with buy and sell prices. it looks like this
myPrices = pd.read_excel('transactions.xlsx')
Date | Symbol | Action | Price |
---|---|---|---|
2020-03-20 | AAPL | Buy | 80 |
2021-03-05 | AAPL | Sell | 120 |
2020-03-20 | TSLA | Buy | 400 |
I know that matplotlib has this:
plt.scatter(myPrices.index, myPrices['Buy'], label = 'Buy', market = '^', color = 'green')
plt.scatter(myPrices.index, myPrices['Sell'], label = 'Sell', market = 'v', color = 'red')
Because I want to graph 'AAPL', I want to read the date in transaction.xlsx where Symbol = 'AAPL'. I want to indicate with a green arrow ^ in the MPLFINANCE GRAPH when I buy it, and red arrow v when I sell. However, I only know this method in matplotlib. is there an equivalent for mplfinance? PLEASE HELP T-T