Trading, Python, Quantitative Finance, Finance, Investing.
label=f'Short {short_window} days Mavg') ax.plot(signals.index, signals['long_mavg'], label=f'Long {long_window} days Mavg') # Plotting buy signals ax.plot(signals.loc[signals.positions == 1.0].index, signals.short_mavg[signals.positions == 1.0], '^', markersize=10, color='g', label='Buy Signal') #