Hello sir,
What I am really looking for is RT data updating in text file in below format
Symbol, Date, Last Traded Time, Bidsize, Bid Price, Asksize, Ask Price, Last Price, Last Qty
As and when the data is updating in RT it appends below last updated price and not like data is changing in same cell in excel. So it write each new data in new line.
First you have to stop AmiBroker from opening.
1. Open Visual Basic code from Developer Tab. Go to StartTimer subroutine in Module1.
Comment out or remove this line- InitialiseAB 'Start AmiBroker
2. Go to Stop_Timer Subroutine . Comment out or remove this line- AB.SaveDatabase
3. Go to Subroutine Timer. Comment out or remove this line- CallAmiBroker 'Calls AmiBroker for importing file
After that- 4. Go to Subroutine MakeCSV() and find this line-
Set a = fs.CreateTextFile("C:\RT\MyCSV.csv", True) 'Here we create the file MyCSV.csv
The parameter "True" means file can be overwritten. Change it to "False" and see what happens. Microsoft does not say whether file will be appended if "False" is given. If it starts appending then you are set.
See this link for further help-
http://msdn.microsoft.com/en-us/library/aa265018(v=vs.60).aspx
If it does not append, you will have to find other ways of coding. Remove this part of code from Subroutine MakeCSV()
fs As Object, a As Object,
'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.
Set a = fs.CreateTextFile(C:\RT\MyCSV.csv, True) 'Here we create the file MyCSV.csv
Put Public fs As Object, Public a As Object, in global declarations.
Paste rest of the above code in Subroutine Start_Timer and check.
Note-I am not a professional programmer. You will have to do some R&D.