Skip to content

LSEG-API-Samples/Article.DataLibrary.Python.PriceForcastUsingFBProPhet

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

6 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Forecast Stock Price using Historical Pricing API with Facebook Prophet library

Introduction

First of all, let me introduce you to the Data Platform, which provides simple web-based API access to a broad range of content provided by LSEG. It can retrieve data such as News, ESG, Symbology, Streaming Price, and Historical Pricing. And more content and services will be added to the platform in the future. To access the content, developers can use any programming language that provides the REST client library to call the REST interfaces and get data from the Data Platform services. To help API users access the Data Platform content easier, we provide the LSEG Data Libraries that provide a set of uniform interfaces providing the developer access to the Data Platform. We are currently providing the LSEG Data Library for Python, .NET, and Typescript. Developers and data scientists can leverage the library's functionalities to retrieve data from the Data Platform services. Basically, the original response message from the Data Platform service will be in JSON tabular format. Still, the LSEG Data Library Library for Python will help you convert the JSON tabular format to the dataframe, so the user does not need to handle a JSON message and convert it manually. The data from the Data Platform cover a wide range of the universe. Using the Data Platform interfaces, developers can benefit from the services to retrieve only data for a specific period they want with Adjustments Behavior they need.

This article will show you the step to use the LSEG Data Library for Python to retrieve daily intraday pricing from the Historical Pricing service and then use the 3rd party library to forecast the data's stock price. To make it more simple to demonstrate the usage, in this article, I will apply the data with a Prophet library created by Facebook to forecast the price. Time-series forecasting is one of the hot topics with many possible applications, such as stock prices forecasting, weather forecasting, network resources allocation, and many others. LSEG provides the platform for users to automatically retrieving the dataset that contains a series of timestamps with the data, such as the stock price. You can then pass it to your own library or automatically use a 3rd party library to forecast and generate a chart in a few seconds.

The prophet is open-source software released by Facebook’s Core Data Science team based on decomposable (trend+seasonality+holidays) models. It provides us with the ability to make time-series predictions with good accuracy using simple, intuitive parameters and has support for including the impact of custom seasonality and holidays. You can get a reasonable forecast on messy data with no manual effort. The prophet is robust to outliers, missing data, and dramatic changes in your time series according to the information on the prophet page.

I will provide a Jupyter notebook with steps to call the LSEG Data Library for Python and prepare data for use with the Prophet library to forecast the price and then shows the forecasting Chart for a final result.

For the full article, please visit this link.

About

No description, website, or topics provided.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Contributors 2

  •  
  •