Free Trial

Safari Books Online is a digital library providing on-demand subscription access to thousands of learning resources.


  • Create BookmarkCreate Bookmark
  • Create Note or TagCreate Note or Tag
  • DownloadDownload
  • PrintPrint
Share this Page URL
Help

Chapter 3. Get into Terms with Commonly ... > Time for action calculating volume w...

Time for action calculating volume weighted average price

These are the actions that we will take:

  1. Read the data into arrays.

  2. Calculate VWAP:

    import numpy
    c,v=numpy.loadtxt('data.csv', delimiter=',', usecols=(6,7), unpack=True)
    vwap = numpy.average(c, weights=v)
    print "VWAP =", vwap
    The output is
    VWAP = 350.589549353
    

  

You are currently reading a PREVIEW of this book.

                                                                                        

Get instant access to over
$1 million worth of books and videos.

  

Start a Free Trial