百科.dev
全部条目在线工具AI 编程趋势榜开源项目技术资讯提交条目
登录
< 返回工具列表
A

AssetNewsSentimentAnalyzer

> DevOps
开源

一个利用 GPT 模型的金融资产和证券情感分析包。

197 stars0 点赞5 次浏览
访问官网GitHub

工具介绍

一个利用 GPT 模型的金融资产和证券情感分析包。

Looking for stabilized versions of my own live trading strategies/bots?

Check out SkyBlue HorizonEdge series (HE Alex and HE Realm): skybluefin.tech/HorizonEdge

Setup instructions: skybluefin.tech/HE-Setup

After setup, message me so I can guide you on configuring the stop-loss killswitch.

Asset News Sentiment Analyzer

This application provides two sophisticated tools catering to sentiment analysis of financial assets and securities by using ChatGPT on Google search results and online news articles. You will just need an OpenAI API Key to get started and utilize the power of all the functionalities provided by this package, namely to fetch news articles, analyze their content, and produce insightful reports for investment and trading decisions.

A simple trading strategy involving daily sentiment analysis signals from this package may provide basic market traction of the target asset (We did a sample backtest on commodities over the past 100 market days):

  Crude Oil 100 Days

  


  Gold 100 Days

Disclaimer: All investments and trading involve risk. This package is intended for research/academic purposes, and coding projects. It aids algorithmic/quantitative traders and researchers in their work. The reports and signals generated by this package does not constitute financial advice, and users should perform their own due diligence before making any trading decisions.

Contents

  • Two Main Classes
    • SentimentAnalyzer Tool
    • WebInteractor Tool
  • Installation
  • Contributing
  • License

Two Main Classes

1. SentimentAnalyzer Tool

The SentimentAnalyzer class allows users to perform sentiment analysis on news articles related to a specific financial asset for any given date. It fetches news links, retrieves the content, and if desired, uses GPT models to generate reports and assess market sentiment.

Usage

…

API Reference

  • SentimentAnalyzer(): Initializes the SentimentAnalyzer object with specified asset and optional OpenAI key (openai_key parameter) and model selection (model parameter).

Available Methods:

  • .fetch_news_links(): Fetches news links from Google Search News tab for the specified asset on the given date. If news_date parameter is not assigned, it will retrieve the current day's latests news links. nlinks parameter denotes the number of news links to retrieve, default is 4.
  • .show_news_content(): Parses and returns main content as string for a given news URL.
  • .get_sentiment(): Analyzes online results automatically and returns the news sentiment for asset/security on any given date. If date parameter is not assigned, it will return the current day's latest sentiment verdict.
  • .produce_daily_report(): Generates a daily report returned as string with insights based on the online Google Search content for any given date. If date parameter is not assigned, it will generate report for the current day. The default max_words is 100, but this can be adjusted as preferred.

Note: All dates must be in MM-dd-YYYY format or must be passed as a datetime.datetime object into the methods.

2. WebInteractor Tool

The WebInteractor class provides functionalities to interact with web content, perform Google searches, and retrieve content, which can then be fed into a GPT client for further interaction.

Usage

…

API Reference

  • WebInteractor(): Initializes a WebInteractor object which provides functionalities for interacting with web content and performing web searches.

Available Methods:

  • .search_google(): Searches Google for the specified query and retrieves a list of unique links. Parameters:
    • query (str): The search query.
    • tld (str, optional): The top-level domain for Google (eg. 'com' for Google.com).
    • lang (str, optional): The language setting for the Google search.
    • date (str, optional): The date to refine search results. (MM-dd-YYYY format)
    • country (str, optional): The country setting for Google search results.
    • tab (str, optional): Specifies the tab under which the search is performed, allowing for specific types of search results.
    • Possible values include:
      • 'app' for Applications
      • 'blg' for Blogs
      • 'bks' for Books
      • 'dsc' for Discussions
      • 'isch' for Images
      • 'nws' for News
      • 'pts' for Patents
      • 'plcs' for Places
      • 'rcp' for Recipes
      • 'shop' for Shopping
      • 'vid' for Video
    • nlinks (int, optional): The number of links to retrieve.
  • .get_webpage_main_content(): Fetches the main content of a webpage.
  • .get_llm_response(, ): A method to interact with a GPT language model based on a specified prompt and retrieve its response.

Installation

Project has been published on pip

bash
pip install asset-sentiment-analyzer

Contributing

If you would like to contribute to this project, please follow the guidelines below:

  • Fork the repository.
  • Create a new branch (git checkout -b feature-branch).
  • Make your changes.
  • Commit your changes (git commit -m 'Add new feature').
  • Push to the branch (git push origin feature-branch).
  • Open a pull request.

License

This project is pioneered by SkyBlue Capital (Singapore), and is licensed under the Apache-2.0 License. See the LICENSE file for details.

Issues· 0 开放

查看全部 Issues在 GitHub 打开

暂无开放 Issues,或尚未同步最近议题。

> 标签

Pythoncommodity-tradingfinancial-analysisforex-tradinggoogle-search-api

暂无评论,来聊聊你的看法吧

> 工具信息

发布日期2026年8月1日
最后更新2026年9月18日
分类DevOps
定价开源

> 相关工具

D
Docker
容器化平台,标准化应用交付
G
GitHub Actions
GitHub 原生 CI/CD 工作流
N
Nginx
高性能 Web 服务器与反向代理