Realtime data NOW,ODIN,TradeTiger,Google,Yahoo > AmiBroker, Fcharts, Qtstalker

Status
Not open for further replies.

mrkanitkar

Well-Known Member
How to Backfill - Video

Set date and Time in Windows. Click Here- http://youtu.be/zinC8GDSt5U

Backfil from NSENOW/Nest Trader with NowBackfil.xlsm. Click Here - http://youtu.be/nSBlXglc4uM

Backfill with DataDownloader from Yahoo/Google - http://youtu.be/A65Si2KpK_s
I think you should edit first post of thread and add these links with latest version download link.
It will be helpful for people to findout links for latest download and video tutorials.
BTW: I done changes as you suggested for MS. Date format is still issue. Now output is
--------
NIFTY12JULFUT,I,05-07-12,15:30:00,5320.4,5320.4,5320.4,5320.4,0,23643150,
---------------------

MS can not handle such fast data like 3 sec. MS crashes after some time. I am changing time frame. I am not expert in VBA. How do you change dateformat? And how to add following line every time in header.
<TICKER>,<PER>,<DTYYYYMMDD>,<TIME>,<OPEN>,<HIGH>,<LOW>,<CLOSE>,<VOL>,<OPENINT>
 
Last edited:

josh1

Well-Known Member
I think you should edit first post of thread and add these links with latest version download link.
It will be helpful for people to findout links for latest download and video tutorials.
BTW: I done changes as you suggested for MS. Date format is still issue. Now output is
--------
NIFTY12JULFUT,I,05-07-12,15:30:00,5320.4,5320.4,5320.4,5320.4,0,23643150,
---------------------

MS can not handle such fast data like 3 sec. MS crashes after some time. I am changing time frame. I am not expert in VBA. How do you change dateformat? And how to add following line every time in header.
<TICKER>,<PER>,<DTYYYYMMDD>,<TIME>,<OPEN>,<HIGH>,<LOW>,<CLOSE>,<VOL>,<OPENINT>
1. This forum does not allow editing post after about two days.

2. did you try this for date formatting? -
CellValue = Cells(r, C).Value & ",I" & text(Date,"yyyy/mm/dd") ' (Insert comma and I and today's date formatted after ticker name)

3.after this line -
If NSENOW = "Yes" Then
Insert this line
a.writeline "<TICKER>,<PER>,<DTYYYYMMDD>,<TIME>,<OPEN>,<HIGH>,<LOW>,<CLOSE>,<VOL>,<OPENINT>"

Change this line to increase time frame
Application.OnTime NOW() + TimeValue("00:00:03"), "Timer" 'This code runs the Timer subroutine every 3 seconds
try 5 or 10 seconds
I feel MS should handle 3 seconds. All paid vendors are doing that. If you can create mycsv.csv in RAM Disk, it may work smoother. Basically there is hard disk activity twice here. First for creating csv file and then pushing it to Metastock data.
 
Last edited:

mrkanitkar

Well-Known Member
You can either request mods or I think second way is you can add it to your signature in forum.
It will be better.
yes, I tried changing
CellValue = Cells(r, C).Value & ",I" & text(Date,"yyyy/mm/dd") ' (Insert comma and I and today's date formatted after ticker name)

it gives compilation error Text not defined.
Here is some link about how to do it but I am not able to make it.
http://www.mrexcel.com/forum/showthread.php?322502-VBA-Converting-date-from-dd-mm-yyyy-to-yyyymmdd

we are almost there but still one last stone needs to turn.
 
Last edited:

josh1

Well-Known Member
yes, I tried changing
CellValue = Cells(r, C).Value & ",I" & text(Date,"yyyy/mm/dd") ' (Insert comma and I and today's date formatted after ticker name)

it gives compilation error Text not defined.
Try this- CellValue = Cells(r, C).Value & ",I" & "," & Format$(Date,"yyyy/mm/dd") ' (Insert comma and I and today's date formatted after ticker name)

Damn it. !@#!@$#@@$#@$ They have different syntax in excel and VBA
 

mrkanitkar

Well-Known Member
Wonderful, it returns data as 2012-07-05 but we need 20120705.
We have to remove -
???
Here is code for easy ref.
------------
Sub MakeCSV()

Dim fs As Object, a As Object, y As Object, C As Integer, i As Integer, r As Integer, S As String, t As Variant, CellValue As String
'Create a file object for writing
Set fs = CreateObject("Scripting.FileSystemObject")
On Error Resume Next
MkDir ("C:\RT") 'This will create a folder RT in C Drive.
FileName = "C:\RT\MyCSV.txt" 'This file is used to write quotes
Set a = fs.CreateTextFile(FileName, True) 'Here we create the file MyCSV.csv

If NSENOW = "Yes" Then
a.writeline "<TICKER>,<PER>,<DTYYYYMMDD>,<TIME>,<OPEN>,<HIGH>, <LOW>,<CLOSE>,<VOL>,<OPENINT>"
MyBook.Sheets("Now").Select 'Selects sheet containing quotations

For r = 7 To Range("A65536").End(xlUp).Row
C = 1
While Not IsEmpty(Cells(r, C))
If C = 1 Then
CellValue = Cells(r, C).Value & ",I," & Format$(Date, "yyyy/mm/dd") ' ' (Insert comma and I after ticker name)
ElseIf C = 3 Then 'Insert Last Traded Price 4 times for O,H,L,C
CellValue = Cells(r, C).Value & "," & Cells(r, C).Value & "," & Cells(r, C).Value & "," & Cells(r, C).Value
ElseIf C = 4 Then
CellValue = Cells(r, C).Value - Vol(r, 1)
Vol(r, 1) = Cells(r, C).Value

' Debug.Print Cells(r, 1).Value & " - " & CellValue & " - " & Vol(r, 1)
Else
CellValue = Cells(r, C).Value '
End If

' CellValue = Cells(r, C).Value '
S = S & CellValue & "," 'Add contents of current cell to string 's' and a comma
C = C + 1
Wend
a.writeline S 'write line
Next r
End If
-------------
 
Last edited:
Thanks Josh1, I finally managed to get the live data into the RTG3 file from Nest Plus. Your post no. 8 was amazing and very simple which enabled me to do the things in the right way. I will try to import the data into Ami tomorrow. I clicked on Start RT Data today but it is not ...may be something is wrong from my end..will watch the video again. Thanks a Ton for helping me out.:thumb::)
 
Status
Not open for further replies.

Similar threads