G
gojakie
Dear friends,
I would like to have a html page which updates/auto-refreshes realtime
quotes of stock exchanges in India which is Nifty NSE. I have seen few
programs in Excel VBA, .net and other languages which serves the
purpose. I would like to know if this can be done in javascript. i
would like to have a table consisting of 7 rows and 10 columns (row
one for heading) Once the quotes are updated, I would like to sort it
using few javascripts like tablesorter.js that I have seen. Can
somebody help me with this?
I want to add the following scrips in the html page in column 2 of the
table.
^NSEI.NS UNITECH.NS, SUZLON.NS, RPL.NS RNRL.NS HINDALDO.NS and there
might be few more that I may want to add in the future.
---------------------------------
I would like to share an Excel VBA module that I saw in trajerji.com.
This example will show exactly what kind of output I am looking for.
Following is the code. It takes the name of the company, the symbol,
the current share value, date, time, change %, open, high, low and
volume. It takes if from the url
http://in.finance.yahoo.com/d/quotes.csv?s=UNITECH.NS,SUZLON.NS,&f=nsl1d1t1c1ohgv&e=.csv
Open Excel, press ALT+F11, click on Insert->Module and paste the code.
Go back to excel and press ALT+F8 and run the code to see the result.
Sub getDataFromYahooCSV()
strURL = "http://in.finance.yahoo.com/d/quotes.csv?
s=UNITECH.NS,SUZLON.NS,&f=nsl1d1t1c1ohgv&e=.csv"
With ActiveWorkbook.ActiveSheet.QueryTables.Add(Connection:="URL;"
& strURL, Destination:=ActiveSheet.Cells(3, 255))
.BackgroundQuery = True
.TablesOnlyFromHTML = False
.Refresh BackgroundQuery:=False
.SaveData = True
End With
'replace the ""
Range("IV1").Select
ActiveCell.FormulaR1C1 = "=SUBSTITUTE(RC[-1],"""""""","""")"
Selection.AutoFill Destination:=Range("IV1:IV10")
'break it to different column
csv 3
'auto fit them
Columns("A:K").Select
Columns("A:K").EntireColumn.AutoFit
Range("A1").Select
End Sub
Sub csv(j As Integer)
k = 3
row_no = j
While Len(Trim(Cells(k, 256).Value)) > 0
TempString = Trim(Cells(k, 256).Value) & ","
col_no = 1
While (InStr(1, TempString, ","))
Cells(row_no, col_no).Value = Mid(TempString, 1, InStr(1,
TempString, ",") - 1)
TempString = Mid(TempString, InStr(1, TempString, ",") + 1, Len
(TempString) - InStr(1, TempString, ","))
col_no = col_no + 1
Wend
k = k + 1
row_no = row_no + 1
Wend
'this will be deleting the data got once it serves its purpose
Columns("IU:IV").Select
Selection.QueryTable.Delete
Columns("IU:IV").Delete Shift:=xlToLeft
End Sub
-------------
Another one I saw which I believe is made in .Net
http://www.codeproject.com/KB/gadgets/StockBag.aspx?display=PrintAll
The significant difference in this one is that besides the things
which excel vba downloads, it also downloads some more information
like market capital, previous close, earnings, PE ratio etc.
-------------
I would like to have a html page which updates/auto-refreshes realtime
quotes of stock exchanges in India which is Nifty NSE. I have seen few
programs in Excel VBA, .net and other languages which serves the
purpose. I would like to know if this can be done in javascript. i
would like to have a table consisting of 7 rows and 10 columns (row
one for heading) Once the quotes are updated, I would like to sort it
using few javascripts like tablesorter.js that I have seen. Can
somebody help me with this?
I want to add the following scrips in the html page in column 2 of the
table.
^NSEI.NS UNITECH.NS, SUZLON.NS, RPL.NS RNRL.NS HINDALDO.NS and there
might be few more that I may want to add in the future.
---------------------------------
I would like to share an Excel VBA module that I saw in trajerji.com.
This example will show exactly what kind of output I am looking for.
Following is the code. It takes the name of the company, the symbol,
the current share value, date, time, change %, open, high, low and
volume. It takes if from the url
http://in.finance.yahoo.com/d/quotes.csv?s=UNITECH.NS,SUZLON.NS,&f=nsl1d1t1c1ohgv&e=.csv
Open Excel, press ALT+F11, click on Insert->Module and paste the code.
Go back to excel and press ALT+F8 and run the code to see the result.
Sub getDataFromYahooCSV()
strURL = "http://in.finance.yahoo.com/d/quotes.csv?
s=UNITECH.NS,SUZLON.NS,&f=nsl1d1t1c1ohgv&e=.csv"
With ActiveWorkbook.ActiveSheet.QueryTables.Add(Connection:="URL;"
& strURL, Destination:=ActiveSheet.Cells(3, 255))
.BackgroundQuery = True
.TablesOnlyFromHTML = False
.Refresh BackgroundQuery:=False
.SaveData = True
End With
'replace the ""
Range("IV1").Select
ActiveCell.FormulaR1C1 = "=SUBSTITUTE(RC[-1],"""""""","""")"
Selection.AutoFill Destination:=Range("IV1:IV10")
'break it to different column
csv 3
'auto fit them
Columns("A:K").Select
Columns("A:K").EntireColumn.AutoFit
Range("A1").Select
End Sub
Sub csv(j As Integer)
k = 3
row_no = j
While Len(Trim(Cells(k, 256).Value)) > 0
TempString = Trim(Cells(k, 256).Value) & ","
col_no = 1
While (InStr(1, TempString, ","))
Cells(row_no, col_no).Value = Mid(TempString, 1, InStr(1,
TempString, ",") - 1)
TempString = Mid(TempString, InStr(1, TempString, ",") + 1, Len
(TempString) - InStr(1, TempString, ","))
col_no = col_no + 1
Wend
k = k + 1
row_no = row_no + 1
Wend
'this will be deleting the data got once it serves its purpose
Columns("IU:IV").Select
Selection.QueryTable.Delete
Columns("IU:IV").Delete Shift:=xlToLeft
End Sub
-------------
Another one I saw which I believe is made in .Net
http://www.codeproject.com/KB/gadgets/StockBag.aspx?display=PrintAll
The significant difference in this one is that besides the things
which excel vba downloads, it also downloads some more information
like market capital, previous close, earnings, PE ratio etc.
-------------