Closed MatteoSid closed 4 years ago
@MatteoSid
Matteo,
Try setting alpha=1.0
in mpf.make_market_colors()
That might work.
Also, please clarify what you mean by "Then I delete all the edges with PIL and this is the result:" Do you mean the axes edges (that's what it looks like in your picture; i just want to be sure I am understanding correctly).
Thanks. --Daniel
Btw, just because I am always trying to better understand the full breadth of mplfinance users and their use-cases ... and you posted a similar issue where you alos wanted to plot only the candles with no numbers axis edges, etc. ... can you help me understand your need/desire for such a plot?
What are you ultimately trying to accomplish, and/or what is the big picture of what you are using it for? Much appreciated.
Try setting
alpha=1.0
inmpf.make_market_colors()
That might work.
Omg yeah, it's perfect!! Thank you so much for your help!!
Also, please clarify what you mean by "Then I delete all the edges with PIL and this is the result:" Do you mean the axes edges (that's what it looks like in your picture; i just want to be sure I am understanding correctly).
I only need to have the candles without the axes so I cut the edges of the image using Pillow
Btw, just because I am always trying to better understand the full breadth of mplfinance users and their use-cases ... and you posted a similar issue where you alos wanted to plot only the candles with no numbers axis edges, etc. ... can you help me understand your need/desire for such a plot? What are you ultimately trying to accomplish, and/or what is the big picture of what you are using it for? Much appreciated.
I'm trying to create a Convolutional Neural Network to predict whether the next candle will be positive or negative. Convolutional Neural Networks extract features from images like edges or recurring patterns and since I just need to see the shapes that the graph assumes I don't need to have axes, I don't care about values. So, I decided to use grayscale images to get one channel images and then crop the image to remove the axes. This is the result:
I'm trying to create a Convolutional Neural Network to predict whether the next candle will be positive or negative. Convolutional Neural Networks extract features from images like edges or recurring patterns and since I just need to see the shapes that the graph assumes I don't need to have axes, I don't care about values. So, I decided to use grayscale images to get one channel images and then crop the image to remove the axes.
Nice! Sounds very cool. I'd love to hear about your results. Please keep me posted. You can reach me at dgoldfarb.github@gmail.com or post here on GitHub. All the best.
@MatteoSid Lol, I'm using it for the same application. CNN prediction with reinforcement learning.
To convert the image to grey-scale just save the image to a buffer such asbuf = io.BytesIO()
and use Pillow to convert to grey scale im = Image.open(buf).convert('LA')
@MatteoSid @bastulli
Matteo, Joseph -
Since both of you are doing similar work that requires a similar plot appearance, do either of you want to add it as an available style in the mplfinance package by adding a style file to the package, perhaps cneural.py
or convneural.py
?? --Daniel
@MatteoSid @bastulli
Matteo, Joseph -
Since both of you are doing similar work that requires a similar plot appearance, do either of you want to add it as an available style in the mplfinance package by adding a style file to the package, perhaps
cneural.py
orconvneural.py
?? --Daniel
That would be great, but I don't know if it works yet. As far as I'm concerned, when I'm done, if it works, it can be done.
@MatteoSid Lol, I'm using it for the same application. CNN prediction with reinforcement learning. To convert the image to grey-scale just save the image to a buffer such as
buf = io.BytesIO()
and use Pillow to convert to grey scaleim = Image.open(buf).convert('LA')
I'm just getting started. I have completed the creation of the dataset and the network model but for now the accuracy remains at 50%. Now I have to fix the HPharams to make the network learn better. If you want we can help, I'll leave you my email: matteo0593@gmail.com
Good luck for your work! ;)
@DanielGoldfarb It does not work for me
I also set alpha=1.0 in mpf.make_market_colors()
@miladd72 please show your code, and your data.
Are you making sure candle edges are same color, and/or erased?
@miladd72 please show your code, and your data.
Are you making sure candle edges are same color, and/or erased? @DanielGoldfarb thanks for your attention
mc = mpf.make_marketcolors( up='white', down='grey', edge={'up':'white','down':'grey'}, wick={'up':'white','down':'grey'}, inherit=True, alpha=1.0, ) s = mpf.make_mpf_style(base_mpf_style='classic', facecolor='black',figcolor='black', marketcolors=mc)
mpf.plot(df2, type='candle', volume=True, style=s , tight_layout=True, axisoff=True, scale_padding=0, savefig=r'C:\Users\Milad\Desktop\test5')
df2 is OHLC with volume from yahoo finance
I'm trying to make greyscale plots from a csv file, I need to have only 3 color in my images so I plot my graph like this:
Then I delete all the edges with PIL and this is the result: Apparently that's exactly what I wanted to get but zooming in we can see that the colors aren't correct.
What would I have to do to get the uniform color in the candles? Thanks a lot.