>
        <span class="c"># make call to yahoo finance api to get historical stock data</span>
        <span class="n">api_url</span> <span class="o">=</span> <span class="s">&#39;https://chartapi.finance.yahoo.com/instrument/1.0/{}/chartdata;type=quote;range=3m/json&#39;</span><span class="o">.</span><span class="n">format</span><span class="p">(</span><span class="n">ticker</span><span class="p">)</span>
        <span class="n">result</span> <span class="o">=</span> <span class="n">urllib2</span><span cla