[amibroker] Amibroker.Import OLE ASCII import call

 

This may seem rudimentary, but what is the proper call to import an ASCII file using Amibroker 5.5 OLE?

ab.Import(1,importFile,formatFile)  does not do anything.



1) Here's my ruby code:

db = 'Data'  

dirAB = 'C:\\Program Files\\AmiBroker\\'

ab = WIN32OLE.new("Broker.Application") # C:\Program Files (x86)\AmiBroker\Broker.exe

puts "Opening #{db} database"

ab.LoadDatabase( dirAB + db )

  

importFile = 'C:\\Program Files\\AmiBroker\\AmiQuote\\Download\\CN10.aqd'

formatFile = "aqd.format" #'C:\\Program Files\\AmiBroker\\Formats\\aqd.format'

puts "Performing ASCII import"

ab.Log(1) # nothing goes into C:\Program Files\AmiBroker\import.log

ab.Import(1,importFile,formatFile)


2) Documentation

 http://www.amibroker.com/guide/objects.html

Application

Methods:

  • Function Import(ByVal Type As Integer, ByVal FileName As String, [ByVal DefFileName As Variant]) As Long

 3) I can manually open up AB GUI, do File, Import, point to the right format and daily quote file, and it works.  I even get C:\Program Files\AmiBroker\import.log and everything is fine.


4) I also coded up other functions (Analysis, Quotations) in ruby using AmiBroker and AmiQuote OLE that do work, so my environment, db, etc are fine.


__._,_.___

Posted by: mdwin01@yahoo.com
Reply via web post Reply to sender Reply to group Start a New Topic Messages in this topic (1)
**** IMPORTANT PLEASE READ ****
This group is for the discussion between users only.
This is *NOT* technical support channel.

TO GET TECHNICAL SUPPORT send an e-mail directly to
SUPPORT {at} amibroker.com

TO SUBMIT SUGGESTIONS please use FEEDBACK CENTER at
http://www.amibroker.com/feedback/
(submissions sent via other channels won't be considered)

For NEW RELEASE ANNOUNCEMENTS and other news always check DEVLOG:
http://www.amibroker.com/devlog/


.

__,_._,___


EmoticonEmoticon