)
Excelente día amigos amantes de la tecnología y la programación, hoy en mi avance de lo aprendido en Python, quiero mostrarles el ejercicio que he realizado para generar una velas, si de esas muy usadas en finanzas, creo que aunque no seamos o no tengamos que ser grandes conocedores de finanzas, economía y/o negocios, algo de lo que si debemos tener mas o menos una idea es interpretar graficas y para mi las velas son una de las mas claras.
Excellent day friends who love technology and programming, today in my advance of what I learned in Python, I want to show you the exercise that I have done to generate a candle, if one of those widely used in finance, I think that even if we are not or do not have to being great connoisseurs of finance, economics and/or business, something that we should have more or less an idea about is interpreting graphs and for me candles are one of the clearest.

Las velas japonesas, a diferencia de los gráficos en forma de línea, nos informan, en general, de cuatro parámetros, nos informan del precio de apertura, (open) de cierre (closed), el máximo (High) y el mínimo (Minimun), además, para distinguir entre periodos alcistas y bajistas, se suelen rellenar los cuerpos de cada vela con distintos colores, conforme el color del cuerpo es la tendencia que marca el mercado, tenemos entonces que si son verdes estamos en un cuadro alcista y si es rojo tiende a la baja.
Japanese candlesticks, unlike line charts, generally inform us of four parameters, they inform us of the opening price, (open) closing (closed), the maximum (High) and the minimum (Minimum). ), in addition, to distinguish between bullish and bearish periods, the bodies of each candle are usually filled with different colors, as the color of the body is the trend that marks the market, then we have that if they are green we are in a bullish picture and if is red trending downward.
En la web tenemos mucha información respecto a las velas japonesas de hecho existen ejercicios y técnicas para medir soportes, o bien tener idea de cuando el mercado saldrá de un bache bajista y cuando alcanzara su máximo, pero esto bien podría ser tema de una publicación aparte, el día de hoy quiero mostrarles mi pequeño ejercicio y cual fue el resultado.
On the web we have a lot of information regarding Japanese candles, in fact there are exercises and techniques to measure supports, or to have an idea of when the market will come out of a bearish bump and when it will reach its maximum, but this could well be the subject of a separate publication. , today I want to show you my little exercise and what the result was.
Quiero pensar que ya tenemos Python instalado y también contamos con nuestra IDE desde donde trabajamos nuestro código, lo siguiente a necesitar son estas librerías “mplfinance” y “pandas_datareader” su instalacion es algo tan sencillo como desde nuestra consola escribir, (pip install pandas_datareader) y (pip install mplfinance).
I want to think that we already have Python installed and we also have our IDE from where we work our code, the next thing we need are these libraries "mplfinance" and "pandas_datareader" their installation is something as simple as writing from our console, (pip install pandas_datareader) and (pip install mplfinance).
El módulo pandas-datareader está específicamente diseñado para interactuar con algunas de las APIs de datos financieros más populares del mundo, e importar sus datos en un DataFrame de pandas fácilmente digerible. Se accede a cada API financiera mediante una función diferente expuesta por pandas-datareader. Generalmente, el acceso a cada API requiere un conjunto diferente de argumentos e información que debe proporcionar el programador.
The pandas-datareader module is specifically designed to interface with some of the world's most popular financial data APIs, and import their data into an easily digestible pandas DataFrame. Each financial API is accessed through a different function exposed by pandas-datareader. Generally, access to each API requires a different set of arguments and information to be provided by the programmer.

Aquí el código para este ejercicio, en la linea 1, importamos pandas_datareader como web, en la linea 2 importamos datetime como dt, en la linea 3 importamos mplfinance como mpf.
Here the code for this exercise, on line 1, we import pandas_datareader as web, on line 2 we import datetime as dt, on line 3 we import mplfinance as mpf.
La linea 6 y 7 son el indicativo del periodo a consultar o representar en la grafica con velas, la linea 8 corresponde a la función de donde se originan los datos en este caso de Yahoo finanzas
Line 6 and 7 are indicative of the period to consult or represent in the candlestick chart, line 8 corresponds to the function from which the data originates, in this case from Yahoo Finance
Finalmente en la linea 10 tenemos las características de nuestra interfaz, el tipo, el estilo y los títulos en ella, obteniendo como resultado la siguiente gráfica, dejare el archivo.py por si quisieran añadir mas lineas al código o bien modificarlo con otros datos.
Finally in line 10 we have the characteristics of our interface, the type, the style and the titles in it, obtaining as a result the following graph, I will leave the .py file in case you want to add more lines to the code or modify it with other data.

Sin mas que añadir me despido amigos Hivers, espero seguir encontrando ejercicios prácticos y poder así ir conociendo mas de librerías y formas de trabajar con Python, ademas que sean utiles o con alguna funcionalidad para nosotros que monitoreamos criptomonedas.
Without further ado, I say goodbye Hivers friends, I hope to continue finding practical exercises and thus be able to learn more about libraries and ways of working with Python, in addition to being useful or with some functionality for us who monitor cryptocurrencies.
Curioso lo que has hecho, me gusta como python tiene un sin fin de herramientas para multiples objetivos que podamos llegar a tener
Y creo aún es nada a lo que me tiene por delante Python.
Yay! 🤗
Your content has been boosted with Ecency Points, by @tex73110.
Use Ecency daily to boost your growth on platform!
Support Ecency
Vote for new Proposal
Delegate HP and earn more