matplotlib / matplotlib/mplfinance
add scatter points to renko plot
Nadie ha tomado este issue todavía.
- Lenguaje dominante
- Python
- Estrellas
- 4.4k
- Forks
- 678
- Métricas de merge de PR
- Sin PR fusionados en 30 d
Descripción
@DanielGoldfarb ... thank you for your wonderful work.
Hello can someone help me to add scatter points to my renko chart.
All i am trying to do is add scatter chart to existing chart(ie marker) "o" where volume is > 500 in my data.
sample Data structure - csv file:
time,Open,High,Low,Close,Volume,date
2020-06-16 09:33,2439.0,2439.0,2439.0,2439.0,340.0,2020-06-16 09:33:03.872999936-04:00
2020-06-16 10:25,2450.5,2450.5,2450.5,2450.5,521.0,2020-06-16 10:25:01.012000-04:00
2020-06-16 10:30,2440.0,2440.0,1440.0,2440.0,415.0,2020-06-16 10:30:13.260999936-04:00
2020-06-16 10:30,2429.5,2429.5,2429.5,2429.5,770.0,2020-06-16 10:30:20.295000064-04:00
Basic code:
df = []
df = pd.read_csv('test.csv',index_col=0,parse_dates=True)
df = df.iloc[:20000]
bucket_size = 0.00012 * max(df['Close'])
volprofile = df['Volume'].groupby(df['Close'].apply(lambda x: bucket_size*round(x/bucket_size,0))).sum()
mc = mpf.make_marketcolors(base_mpf_style='yahoo')
s = mpf.make_mpf_style(base_mpf_style='nightclouds',marketcolors=mc)
fig, axlist = mpf.plot(df,type='renko',renko_params=dict(brick_size=3),returnfig=True,style=s,tight_layout=True)
vpax = fig.add_axes(axlist[0].get_position())
vpax.set_axis_off()
vpax.set_xlim(right=1.2*max(volprofile.values))
mpf.show()
current sample image:

Guía de contribución
Primeros pasos
- Lee el issue completo y luego la guía de contribución del proyecto.
- Comenta en el issue que vas a ocuparte — evita que dos personas hagan lo mismo.
- Haz un fork del repositorio y trabaja en una rama.
- Abre un pull request que haga referencia al número del issue.
Línea de trabajo
Start with the mpf.plot(..., type='renko', returnfig=True) call and the returned axlist in the provided example. Read how Renko plots expose their axes and how the supplied Volume values relate to the plotted data. Done means documenting or implementing a way to show marker points for rows whose volume exceeds 500 on the Renko chart.
Escrito por el modelo de indexación a partir del texto del issue.
Evaluación
- Stack tecnológico
- matplotlib, python
- Área
- data-visualization
- Tipo de issue
- Nueva funcionalidad
- Dificultad
- 4/5
- Tiempo estimado
- 3-5 días
- Estado de actividad
- Estancado
- Claridad
- Necesita aclaración
- Aptitud para principiantes
- 25/100