Re: [amibroker] Export Quotes enclosed in Quotation Marks

 

Thanks for that idea.


Jim

On Jul 26, 2016, at 2:23AM, alan.clement@gmail.com [amibroker] <amibroker@yahoogroups.com> wrote:


You're not going to be able to do it using the Explore function. 

For example, in an ideal world it would be as simple as this:
AddTextColumn("\"" + Numtostr(O, 1.2, False) + "\"","Open");  // THIS WON'T WORK

However, the above won't work because of the limitation of AddTextColumn, which can only handle a fixed value string, so it won't vary the numeric value for each bar.

You're only recourse is to write the values out to a file using a loop. There's a good example of how to do that here: http://www.amibroker.com/kb/2014/11/14/how-to-export-quotes-to-separate-text-files-per-symbol/

To include the quotes with the numeric values, include them when building the string to output.

In the above example it uses:
qs StrFormat"%g,%g,%g,%g,%g\n"O], H], L], C], V] );
To include quotes change that line to:
qs StrFormat"\"%g\",\"%g\",\"%g\",\"%g\",\"%g\"\n"O], H], L], C], V] );
The backslash (\) is an escape character that tells the interpreter to treat the double quote following immediately after as part of the string rather than as a terminator.

The output will then look something like this:

Ticker,Date/Time,Open,High,Low,Close,Volume
CBA.asx,2/01/1992,"7.80761","7.90707","7.80761","7.85734","140760"
CBA.asx,3/01/1992,"7.83745","7.87723","7.81756","7.85734","127723"
CBA.asx,6/01/1992,"7.96774","8.03637","7.87723","7.87723","231953"

If you want quotes around the other fields as well, you can use th e same technique, eg:

 "\"" + Name() + "\""

Cheers
Alan


__._,_.___

Posted by: James Rea <jarea@teleweb-pub.com>
Reply via web post Reply to sender Reply to group Start a New Topic Messages in this topic (4)

Save time and get your email on the go with the Yahoo Mail app
Get the beautifully designed, lighting fast, and easy-to-use Yahoo Mail today. Now you can access all your inboxes (Gmail, Outlook, AOL and more) in one place. Never delete an email again with 1000GB of free cloud storage.

**** 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