PureBytes Links
Trading Reference Links
|
Hello,
I am using Export script(attached) but it has a problem- It
exports prices above 1000 as 100.... for example I have 1635 it
exports as 163, or I have 9586 it exports as 958... Do u know why?
Thanks a lot
/*
** AmiBroker/Win32 scripting Example
**
** File: Export.js
** Created: Tomasz Janeczko, December 12th, 1999
** Purpose: Exports quotations to CSV file
** Language: JScript (Windows Scripting Host)
*/
function FormatFloat( number )
{
number = 0.001 * Math.round( number * 1000 );
str = number.toString();
return str.substring( 0, str.indexOf(".") + 4 );
}
var oAB = WScript.CreateObject("Broker.Application");
var fso = new ActiveXObject("Scripting.FileSystemObject");
var oStocks = oAB.Stocks;
Ticker = oAB.ActiveDocument.Name;
oStock = oStocks( Ticker );
var Qty = oStock.Quotations.Count;
WScript.Echo("Export of " + Ticker + " start" );
f = fso.OpenTextFile( Ticker + ".csv", 2, true );
f.WriteLine("$SEPARATOR ,");
f.WriteLine("$FORMAT Ticker,Date_YMD,Open,High,Low,Close,Volume")
for( i = 0; i < Qty; i++ )
{
oQuote = oStock.Quotations( i );
var oDate = new Date( oQuote.Date );
f.WriteLine( oStock.Ticker + "," +
oDate.getFullYear() + "-" + (oDate.getMonth()
+1) + "-" + oDate.getDate() + "," +
FormatFloat( oQuote.Open ) + "," +
FormatFloat( oQuote.High ) + "," +
FormatFloat( oQuote.Low ) + "," +
FormatFloat( oQuote.Close ) + "," +
Math.round( oQuote.Volume ) );
}
f.Close();
WScript.Echo("Export finished" );
Please note that this group is for discussion between users only.
To get support from AmiBroker please send an e-mail directly to
SUPPORT {at} amibroker.com
For NEW RELEASE ANNOUNCEMENTS and other news always check DEVLOG:
http://www.amibroker.com/devlog/
For other support material please check also:
http://www.amibroker.com/support.html
Yahoo! Groups Links
<*> To visit your group on the web, go to:
http://groups.yahoo.com/group/amibroker/
<*> Your email settings:
Individual Email | Traditional
<*> To change settings online go to:
http://groups.yahoo.com/group/amibroker/join
(Yahoo! ID required)
<*> To change settings via email:
mailto:amibroker-digest@xxxxxxxxxxxxxxx
mailto:amibroker-fullfeatured@xxxxxxxxxxxxxxx
<*> To unsubscribe from this group, send an email to:
amibroker-unsubscribe@xxxxxxxxxxxxxxx
<*> Your use of Yahoo! Groups is subject to:
http://docs.yahoo.com/info/terms/
|