Also to
ensure a consistent image size, dimensions of 800 x 400 are specified for the image. As
expected, another helper method is needed to programmatically do just that; we can call
this one GetAnalytics and have the same signature as the previous helper methods used
here. Here??™s the code for that method:
private void GetAnalytics(string strTicker)
{
imgPriceHistory.ImageUrl = "PH.aspx?ticker=" + strTicker + "&days=100";
}
Once again, this just sets the source of the Image control here to the image generated
from PH.aspx. This includes the ticker that had been entered in the text box, and the
CHAPTER 10 ?– BUILDING A SAMPLE APPLICATION USING ASP.NET AJAX 248
???days=100??? are also passed onto the PH.aspx page, which results in the price history chart
you saw earlier in Figure 10-11 and Figure 10-12.
Generating an Analytics Graph
A methodology for determining good buy and sell prices for a stock comes from a technical
analysis of the stock??™s trading envelope through the use of Bollinger bands. These
bands are based on a calculation of the moving average of the stock??”the moving average
being the average price of the stock over a number of periods preceding the current one.
Pages:
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347