Coder Social home page Coder Social logo

yujunkuo / stock-overflow Goto Github PK

View Code? Open in Web Editor NEW
5.0 3.0 3.0 445 KB

Stock-Overflow is a stock recommendation system tailored for the Taiwanese stock market.

License: GNU Affero General Public License v3.0

Python 100.00%
line-messaging-api python stock-recommend

stock-overflow's Introduction

๐Ÿ’ต Stock-Overflow ๐Ÿ’ถ

๐Ÿ”Ž Overview

Stock-Overflow is a stock recommendation system tailored for the Taiwanese stock market. It leverages various strategies and indicators to identify potentially lucrative stock investment opportunities. The system provides recommendations based on fundamental analysis, technical analysis, and chip analysis. Additionally, it utilizes web scraping to fetch real-time stock market data and sends recommendations to users via the LINE messaging platform.

๐Ÿ“Œ Features

  • Highly Customizable Filtering Criteria: Tailor screening conditions to match specific investment preferences, allowing users to define criteria that align with their unique strategies.

  • Convenient Daily Push Notifications via LINE: Enjoy the convenience of receiving daily stock recommendations directly through LINE messaging, ensuring users stay informed without the need for manual checks.

๐Ÿช„ Deployment Tools

๐Ÿ”– How to Deploy the Service

  1. Modify the render.yaml file in your repository. (You can also find the template here.)

    • Modify the value of name, repo, and maybe some values of envVars.
  2. Go to Render's blueprint, create a new instance with the target repository and the render.yaml file.

    • The environment variables CHANNEL_ACCESS_TOKEN and CHANNEL_SECRET can be found from LINE Developers.
    • The environment variable API_ACCESS_TOKEN should be a random value to enhance the security.
  3. Upon creating and running the instance, you will receive a service URL for this web service from the dashboard (e.g., https://stock-overflow-api.onrender.com).

  4. Append /callback to the service URL to construct the webhook URL. Paste this webhook URL into the LINE Webhook URL section on LINE Developers.

  5. Configure the scheduler (e.g., Cron-job) to invoke the API endpoints using the following settings:

    • Invoke the /wakeup API endpoint every day at 9:00 and 18:00 to retrieve the recommendation list and ensure users receive notifications. For details regarding the configuration of the API access token, please refer to Issue #1.
    • Invoke the / API endpoint every 5 minutes to prevent the free instance from spinning down due to inactivity, and simultaneously release unreferenced memory usage.

๐Ÿ’ฌ LINE Notification Message

Below is an example of what the LINE notification message looks like:

LINE Notification Screenshot

โš ๏ธ Disclaimer and Customization

Please note that Stock-Overflow is a stock recommendation system offering investment advice for informational purposes only. We do not assume any responsibility for financial decisions made based on our recommendations. Investing in the stock market involves risks, and users are advised to exercise caution and conduct their own research before making any investment decisions.

Moreover, it's also important to note that the system's default investment strategy is geared towards "short-term trading." Nevertheless, users have the flexibility to adjust filtering criteria based on their individual investment preferences. They can modify the source code's stock screening conditions to better align with their unique strategies. Feel free to explore and adapt the criteria to match your preferences and risk tolerance.

๐Ÿงท Reference

๐Ÿงธ Contribution

Contributions are greatly welcome and appreciated! If you have any idea for enhancements, please don't hesitate to create a pull request. Thank you for being a crucial part of this project and for bringing your unique brilliance to the table! Let's create something extraordinary together!

๐Ÿ“… Update Info

If you need to automate restarting the service, Render now supports this via an API call. Just make a POST request to https://api.render.com/v1/services/{service-id}/restart. You can find the service-id by looking at the URL after entering the project (format: srv-xxxxx).

You should also include your api-key in the request via the Authorization HTTP header. You can create API keys from your Account Settings page in the Render Dashboard.

Here is an example:

curl --request POST \
     --url https://api.render.com/v1/services/{service-id}/restart \
     --header 'accept: application/json' \
     --header 'authorization: Bearer {api-key}'

stock-overflow's People

Contributors

dependabot[bot] avatar yujunkuo avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar

stock-overflow's Issues

401 Unauthorized Error when Configuring Scheduler for /wakeup API Endpoint

Description

I am encountering a 401 Unauthorized error when trying to configure the scheduler (Cron-job) to invoke the /wakeup API endpoint, as per the last instruction in the deployment guide.

Steps to Reproduce

  1. Modified the render.yaml file as per the deployment instructions.
  2. Successfully created a new instance on Render's blueprint using the modified render.yaml.
  3. Received the service URL and appended /callback to construct the webhook URL.
  4. Pasted the webhook URL into the LINE Webhook URL section on LINE Developers.
  5. Attempted to configure the scheduler to invoke the /wakeup API endpoint.

Expected Behavior

The scheduler should successfully invoke the /wakeup API endpoint without authorization issues.

Actual Behavior

Received a 401 Unauthorized error when the scheduler tried to access the /wakeup API endpoint.

Possible Causes/Suggestions

  • Is there a specific format or additional requirements for the API_ACCESS_TOKEN?

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.