matplotlib / matplotlib/mplfinance
More easily Plot Trades or Trade Signals
- Dominant language
- Python
- Stars
- 4.4k
- Forks
- 678
- PR merge metrics
- No merged PRs in 30d
Description
**Is your feature request related to a problem? Please describe.**
Your addplot.ipynb page is phenomenal and I was able to figure out that I can add scatter points by;
1) Making a numpy array empty/zero
trs = np.zeros((length_to_add, 1))
2) Filling it with Nans
trs.fill(np.nan)
3) Setting my 2 scatter points as I know the index (x) and y values
trs[x] = y
4) Adding this to a dataframe
toplot.insert(6, "trades", trs, True)
5) Then using your well documented addplot:
apdict = mpf.make_addplot(toplot['trades'],scatter=True,secondary_y=False)
mpf.plot(toplot,type='candle',volume=True,addplot=apdict)
**Describe the solution you'd like**
While this is great it took a lot of energy - I'm moving from the plotpy (for the candles!) and there I simply wrote:
plt.scatter(trade_list_idx,trade_list_price,c='b')
Which was simpler than messing around with a dataframe and so on.
Contributor guide
Research direction
Start with addplot.ipynb and the documented make_addplot call shown in the issue, then review the existing plotting entry point for how addplot data is accepted. Done would provide a simpler way to plot trade or signal coordinates directly, without requiring the described NumPy array and dataframe preparation.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- matplotlib, numpy, pandas, python
- Domain
- data-visualization
- Issue type
- Feature
- Difficulty
- 5/5
- Estimated time
- Over a week
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 25/100