Candlestick Charting 

Charting Stocks/Forex for Technical Analysis Part 14 – Dynamic candlestick shadow color matplotlib

Advertisements

This is the fourteenth video in the collection for supply rate evaluation, teaching you just how to dynamically color the candlestick darkness in matplotlib. The function of the videos in this series is to show you how to configure your own charting and evaluation of supplies or Foreign exchange.

This is useful for you if you intend to do any type of sort of algorithmic, high-frequency, or any type of sort of automated trading.

Sentdex.com
Facebook.com/ sentdex.
Twitter.com/ sentdex.

I show You how I made $1,006 from $100, then $257,000 from $1,006 with Bitcoin and cryptocurrencies!

Related posts

14 Thoughts to “Charting Stocks/Forex for Technical Analysis Part 14 – Dynamic candlestick shadow color matplotlib”

  1. drunkzenith

    Could there be a difference between Windows, Linux and Mac OSX in this?
    I’m on a Mac and I’ve found the ‘finance.py’ file in :
    ./System/Library/Frameworks/Python.framework/Versions/2.7/Extras/lib/python/matplotlib/finance.py
    After I’ve edited it and restarted my Python and Editor (LiClipse) I still get the dark line.

    And you’re right. It looks awful 😉

    1. sentdex

      Yeah the location could vary, but editing the file will be the same with the same result. Not sure what you’d be doing wrong.

    2. lespaulandtheboys

      I have this same problem…

    3. lespaulandtheboys

      I fixed mine by accessing: /Library/Frameworks/Python.framework/Versions/7.3/lib/python2.7/site-packages/matplotlib/finance.py
      When I edited the file it asked for the admin password, once saved I reopened iPython and the candlestick shadows were white.

    4. sentdex

      @lespaulandtheboys
      You should be able to just do a search for “finance.py” to find the proper file.

    5. esostoic

      Great vids. I’m using Python 2.7(xy) on windows 7. I’ve made the changes exactly as you demonstrate but for some reason my shadow lines are still black. Any tips on what could be happening?

  2. rabitale

    im on osx 10.9 and making the changes the ‘finance.py’ file is not having any impact. I also tried deleting the entire candlestick function but it still gives the black candlestick chart. I have looked for another finance.py file but cant find any. I am also using canopy. Any ideas on where the file would be?

    1. sentdex

      Sounds like you’ve got two versions of matplotlib. If you’re deleting entire functions and it is still running, then it is using a file elsewhere. I believe canopy uses its own version of matplotlib entirely. Are you editing the file in canopy, or in the python directory?

    2. Fred Baker

      +rabitale file:///System/Library/Frameworks/Python.framework/Versions/2.7/Extras/lib/python/matplotlib/finance.py

      this is where I found it. But I cannot make changes to the permissions for the file so I can write over it. MAC 10.9

      Some help anyone?

    3. Fred Baker

      +sentdex See my reply to this comment. Maybe some advice?

    4. Fred Baker

      +Fred Baker 
      so I found this…. what do I do? :c

      https://support.apple.com/en-us/HT204899

  3. Phillip Kim

    Hey sentdex, I tried to do the same thing as you did with putting color = colorup and colordown for if/else cases, but my version of matplotlib had the candlestick function updated the following way:
    def candlestick(ax, quotes, width=0.2, colorup=’k’, colordown=’r’, alpha=1.0):
        warnings.warn(_warn_str.format(fun=’candlestick’), mplDeprecation)
        return _candlestick(ax, quotes, width=width, colorup=colorup, colordown=colordown, alpha=alpha, ochl=True)

    def _candlestick(ax, quotes, width=0.2, colorup=’k’, colordown=’r’, alpha=1.0, ochl=True):

        OFFSET = width / 2.0
        lines = []
        patches = []
       ( same code here)
     
        return lines, patches

    I tried things such as importing _candlestick instead of candlestick and updating a little of coding within the (same code here) line but they were all futile attempts.  Can you help me out?

  4. sean sjahrial

    I wouldn’t mind editing the original file, but if I wanted to run this on another computer, it wouldn’t work right… is there a better way?

Leave a Comment