arXivDaily arXiv每日学术速递 周一至周五更新
arXiv 2308.13414cs.CE
收藏

利用Python自动生成历史股价数据集

Automatic Historical Stock Price Dataset Generation Using Python

Arunima Mandal, Yuanhang Shao, Xiuwen Liu

AI总结:

针对股票研究中手动构建大规模指数成分股数据集耗时费力、现有工具功能有限的问题,本研究提出一套基于Python的统一代码资源,支持任意时间段、任意股指的最新数据集自动生成并开源代码。

摘要:

在动态的政治与经济环境下,瞬息万变的股票市场每天都会产生大量数据。在股价行为研究中,获取最新数据对提升预测精度至关重要。然而,手动准备数据集不仅难度大还十分耗时。股票市场分析通常围绕S&P500(标准普尔500指数)、Nasdaq(纳斯达克指数)、Dow Jones(道琼斯指数)、纽约证券交易所(NYSE)等特定指数展开,因此有必要对任一特定指数的所有成分股公司进行分析。虽然原始数据可从各类金融网站获取,但这些资源仅适配单家公司的数据检索,现有资源与生成大规模数据集所需的条件之间存在巨大差距。Python 成为了全面收集给定指数内所有成分股数据的得力工具。尽管部分线上资源提供了可生成有限数据集的代码片段,但目前仍缺乏一套完善、统一且公开可用的脚本。为此,我们提出了一套全面整合的代码资源,可支持提取任意特定时间段、任意特定股票市场指数的最新数据集,填补了上述空白。该代码可访问:https://github.com/amp1590/automatic_stock_data_collection。

英文摘要:

With the dynamic political and economic environments, the ever-changing stock markets generate large amounts of data daily. Acquiring up-to-date data is crucial to enhancing predictive precision in stock price behavior studies. However, preparing the dataset manually can be challenging and time-demanding. The stock market analysis usually revolves around specific indices such as S&P500, Nasdaq, Dow Jones, the New York Stock Exchange (NYSE), etc. It is necessary to analyze all the companies of any particular index. While raw data are accessible from diverse financial websites, these resources are tailored for individual company data retrieval and there is a big gap between what is available and what is needed to generate large datasets. Python emerges as a valuable tool for comprehensively collecting all constituent stocks within a given index. While certain online sources offer code snippets for limited dataset generation, a comprehensive and unified script is yet to be developed and publicly available. Therefore, we present a comprehensive and consolidated code resource that facilitates the extraction of updated datasets for any particular time period and for any specific stock market index and closes the gap. The code is available at https://github.com/amp1590/automatic_stock_data_collection.

机构、总结、中文摘要均由AI分析而来,可能存在错误,请以论文正文为准。

↑