I am trying to plot BUY, SELL, BCLOSE and SCLOSE points only (i.e not SIT or SHRTCLS etc) from dataframe column C on the matplotlib chart that can be generated below
Eg. the at the 2nd price point in column B (5.53) as it is a BUY I am trying to plot this point on the line of the graph. The 4th price in col B is BCLOSE and this should also be added to the graph and so on.
thanks for your time.
import pandas as pd
import matplotlib.pyplot as plt
df = pd.DataFrame()
df['A'] = ('11/06/2019','10/06/2019','9/06/2019','8/06/2019','7/06/2019','6/06/2019','5/06/2019','4/06/2019','3/06/2019','2/06/2019','1/06/2019','31/05/2019','30/05/2019')
df['B'] = (5.97,5.53,5.13,4.85,4.87,4.92,4.9,5.66,5.66,5.72,5.72,5.68,6.05)
df['C'] = ('BHODL','BUY','SIT','BCLOSE','BUY','SIT','SELL','SIT','SIT','SIT','SHRTCLS','BCLSHRT','SELL')
print(df)
ax = df.plot(title='tesing123')
ax.set_xlabel('date')
ax.set_ylabel('price')
ax.grid()
plt.show()
