我想使用Python读取Amibroker股票符号的价格和成交量数据。我在谷歌上找不到有用的信息来做这件事。有人能帮忙吗?
酷
:不要犹豫,完全打开美味糖果盒子AmiBroker和其他交易框架一样,可以提供数据,但它是一个紧凑的(~3.5 MB .EXE
+.DLL
),性能优化的可执行文件,不像Java或.NET程序那样需要任何内部VM来解释用户进程的字节码级别,而是在机器码级别上全速运行。
虽然AB为数据访问提供了几种集成选项,但是在量化R&D中花费了大约12年的时间后,我的建议是:采用分布式(忘记花费时间实现特定数据元素(Volume)的特定访问,并且不再依赖状态共享 - 而是开始使用智能进程间通信和智能代理信号python
-请求,AmiBroker
-即时回应等)。
localhost
上还是在另一个大陆上运行)VCInstallDir\SDK\v2.0\Bootstrapper\Packgages\vcredist_x86
或VCInstallDir\SDK\v2.0\Bootstrapper\Packgages\vcredist_x64
因此 -- 将您的 DLL
放入“插件”目录中,如果它没有显示在数据源列表中,则意味着其位数(32位/64位)与AmiBroker不匹配。
准备好使用 DLL
模式后,人们可以为几乎任何智能消息框架实现基于 DLL
的包装器,例如 ZeroMQ
、nanomsg
等等,然后,在进一步进行系统间通信时,只有您的想象力是限制。
python
-请求,AmiBroker
-回复AmiBroker
-请求,python
-回复AmiBroker
-请求,remote-GPU
-回复AmiBroker
-请求,remote-AI/ML
-预测并发布交易设置/交易管理的目标(适用于低延迟时间--数十毫秒--适合于低强度的高频交易策略)AmiBroker
-发布,remote-ComputingGrid
-处理并向其他人发送任何后处理的信号https://www.amibroker.com/guide/objects.html
以下链接是我在另一个关于AB COM互操作的答案中提出的想法。
Sethmo
function FormatFloat( number )
{
number = 0.001 * Math.round( number * 1000 );
str = number.toString();
return str.substring( 0, str.indexOf(".") + 4 );
}
var oAB = new ActiveXObject("Broker.Application");
var fso = new ActiveXObject("Scripting.FileSystemObject");
/* Indicate the location and file name for the database dump. */
file = fso.OpenTextFile( "C:\\Info.txt", 2, true );
/* Indicate the location and name of the database to dump. */
oAB.LoadDatabase("C:\\Program Files (x86)\\AmiBroker\\Data");
var oStocks = oAB.Stocks;
var Qty = oStocks.Count;
for( i = 0; i < Qty; i++ ) { /* Loop through all the stocks in the database. */
oStock = oStocks(i);
for (j = 0; j < oStocks(i).Quotations.Count; j++) { /* Loop through all the ohlcv in each stock. */
oQuote = oStock.Quotations( j );
var oDate = new Date( oQuote.Date );
file.WriteLine( oStocks(i).Ticker + "," +
(oDate.getMonth()+1) + "/" + oDate.getDate() + "/" + oDate.getFullYear() + "," +
FormatFloat( oQuote.Open ) + "," +
FormatFloat( oQuote.High ) + "," +
FormatFloat( oQuote.Low ) + "," +
FormatFloat( oQuote.Close ) + "," +
Math.round( oQuote.Volume ) );
}
}
file.Close();
WScript.Echo("Export finished" );
//Price Volume of the ticker (Formula: Close x Volume)
Price_Volume = C*V
//Price Volume of specific ticker (eg. SPY) (Formula: Close x Volume)
Price_Volume_SPY = foreign("SPY","C")*foreign("SPY","V")
//Yesterday Price Volume of specific ticker (eg. SPY) (Formula: Close x Volume)
Yesterday_Price_Volume_SPY = Ref(foreign("SPY","C"),-1)*Ref(foreign("SPY","V"),-1)