%
'--- Forces us to declare all your variables.
option explicit
'--------------------------------------------------------
' YOU NEED TO CUSTOMIZE THIS
'--------------------------------------------------------
Dim devToken ' The token you received
devToken = "6T2nL7NAdMF6cBTR" ' Your Dev Token
'--------------------------------------------------------
'--- Get the symbol and encode the URL
Dim symbol
symbol = Server.URLEncode(request("symbol"))
'--- Get the record size
dim recNumb
recNumb = Server.URLEncode(request("recNumb"))
'--- Dim all Count for each side
Dim bcount, scount, x, side
dim bgcolorup
'--------------------------------------------------------
' Dim the returned values as arrays
'--------------------------------------------------------
Dim BOpenShares(50), BOrderPrice(50)
Dim SOpenShares(50), SOrderPrice(50)
Dim BOpenOrders, SOpenOrders, asof
dim BmatchedShares(150),BmatchPrice(150),bmatchTime(150),bmatchType(150)
'--------------------------------------------------------
' GRAB ISLAND WS XML
'--------------------------------------------------------
Function getBook(symbol)
Dim xmlDoc, nodeName, XMLURL
'--- Create the DOM object
Set xmlDoc = CreateObject("Msxml2.DOMDocument")
xmlDoc.async = False
'--- This will validate the XML.
'--- If you're having problems, set this to False
xmlDoc.validateOnParse=True
'--- Now we can create the URL to call
'LES open order
XMLURL = "http://xml.island.com/ws/xml/timeandsales.xml?token=" & devToken &_
"&symbol=" & symbol &_
"&recNumb=" & recNumb
dim xmlhttp
Set xmlhttp = Server.CreateObject("Microsoft.XMLHTTP")
xmlhttp.Open "GET",XMLURL,False
xmlhttp.send
'--- OK, Load the URL
xmlDoc.loadXML(xmlhttp.responsetext)
'--- If Errors found - spit them out.
if xmlDoc.parseError.errorcode <> 0 Then
response.write "Error Code : " & xmlDoc.parseError.errorcode & "
"
response.write "Error Reason : " & xmlDoc.parseError.reason & "
"
response.write "Error Line : " & xmlDoc.parseError.line & "
"
'--- Otherwise begin walking the nodes
else
tree_walk(xmlDoc)
end if
End Function
'--------------------------------------------------------
' Recursive Node Walk function
'--------------------------------------------------------
Function tree_walk(node)
dim child
For Each child In node.childNodes
'--- This means we want this node:
if child.nodeType = 1 then
'--- Search for things that we want.
Select Case child.nodeName
Case "asof" '--- Found as of date and time
asof = child.text
Case "match"
scount=scount+1
Case "matchedShares"
BmatchedShares(scount) = child.text
Case "matchPrice"
BmatchPrice(scount) = child.text
Case "matchTime"
bmatchTime(scount) = child.text
Case "matchType"
bmatchType(scount) = child.text
'Case "matchType" '--- Found Order Price Data
' if side = "B" then bmatchType(bcount) = child.text else SOrderPrice(scount) = child.text
End Select
'--- More nodes? Keep on walkin'
If (child.hasChildNodes) then tree_walk(child)
end if
next
End Function
'--- This calls the actual Function and populates our Arrays.
getBook(symbol)
%>
Real time level I stock quote online, times and sales online stock market trading quotes
|
|
| More on <%=symbol%> Stats I Level II (html) I Level II (java) I Chart I News |
|
|
| Real time ECN - <%=symbol%> - Times & Sales (Refresh) |
| TIMES |
BUY/SELL |
SHARES |
PRICES |
<% for x = 1 to scount %>
<%=bmatchTime(x)%> |
<%=bmatchType(x)%> |
<%=BmatchedShares(x)%> |
<%
bgcolorup = "#ffffff"
if BmatchPrice(x) > BmatchPrice(x+1) then bgcolorup="#00FF00"%>
<%if BmatchPrice(x) < BmatchPrice(x+1) then bgcolorup="#FD8099"%>
<%=BmatchPrice(x)%> |
<% next %>
|
|
|