Set properties to retrieve Stock tickers.
Obj.dbStockTicker = Symbol | TagIndex | Format | Caption"
| Keyword | Description |
|---|---|
| Symbol | Stock Symbols delimitedr by '+' e.g. GM+AAPL+CSCO or AAPL+QAAJN.X (QAAJO.X is the AAPL Oct06 75 Call Option). Get the Option symbols from the Yahoo Options Quote Page. |
| Format | Return format of stock tickers. 0=Default csv string delimited by /r/n. 1=csv string delimited by <br> 99=Use template defined by dbStockTickerTemplate to format the returned csv string. All the EOL markers and double quote wrappers will be ignored and ticker values will replace the macros [[S]] in a row manner. |
| Caption | User defined header text of ticker table delimited by ',' - SYM,LAST,CHANGE,VOL. This text will be inserted at the beginning of the returned csv text. |
| TagIndex | Index number delimited by ',' to specify the ticker fields to retrieve. See the TagIndex list below. Default value is - 68,42,16,70 which is (Symbol)(Last Trade)(Change)(Volume) |
TagIndex and Ticker Description
Both Stock and Option are supported. Get Option symbols (ends with .X) from YAHOO stock option pages.
This example displays all the tickers.
Obj.dbStockTicker = Symbol=GM+AAPL+CSCO | Tag = 68,42,16,70| format=1 |cap=SYM,LAST,CHANGE,VOL"
Dim Rm As New Tornado.z Rm.dbUnit = 8 Rm.dbStockTicker = "Symbol=GM | format=1 |Tag=1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37,38,39,40,41,42,43,44,45,46,47,48,49,50,51,52,53,54,55,56,57,58,59,60,61,62,63,64,65,66,67,68,69,70" Response.Write(Rm.ASPdbGetStockTicker())This example shows how to embed the function in your web page.
<script language="vb" runat="server">
Public Price, Vol as string
Sub Page_Load(Source as Object, E as EventArgs)
Dim Rm As New Tornado.z
Rm.dbQP = "U=8| Nh=t"
Rm.dbStockTicker = "Symbol=GM | Tag=42,70| cap=none| Format=99"
Rm.dbStockTickerTemplate = "[[S:##0.000]] [[S]]" '...you can format here - space is the delimiter
Dim ret2() As String = Split(Rm.ASPdbGetStockTicker())
price = ret2(0)
If IsNumeric(ret2(1)) Then
Vol = Format(CInt(ret2(1)), "###,###") '...or format here YAHOO returns N/A or 0.00
Else
Vol = ret2(1)
End if
End Sub
</script>
<html>
<body>
My Web Page ubder My control with My CSS and My settings<P>
GM Stock Price = <%= Price %> <br>
GM Stock Volume = <%= Vol %>
</body>
</html>
z Class | Tornado Namespace | ASPdbGetStockTicker | dbStockTickerTemplate