Code Monkey home page Code Monkey logo

stockgpt's Introduction

StockGPT

Predict Stock movements with GPT-4 or GPT-3.5 inspired by this paper: https://papers.ssrn.com/sol3/papers.cfm?abstract_id=4412788

Currently Untested!

DISCLAIMER

Please only use this to see how it correlates to stock movements rather than use it to invest. it's probably not very good at it anyways.

How it works

For every company you put in company.txt, it'll search the internet for news articles in from last day about your company. It will evaluate each headline as a number between -1 and 1, signifying if it will impact the stock price negatively, postively or not at all. It generates the reports for you on each company's healdines, in the form of a .csv file. And a final report which includes the api costs.

How to use it

  1. If you haven't installed the dependencies already, run, pip install -r requirements.txt
  2. If you haven't already, put your OpenAI api token in the file called auth.txt
  3. Put a list of companies you want to track in companies.txt
  4. Run python sgpt.py -h to see your options, then run the command as you want.

Examples

python sgpt.py -t -c gpt-3.5-turbo, sending the headlines in a batch (for minimum cost)

Screen Shot 2023-04-22 at 4 07 07 AM

Screen Shot 2023-04-22 at 4 11 01 AM

Stock movements the next day:

Screen Shot 2023-04-22 at 8 11 42 PM

Full options

  -h, --help            show this help message and exit
  -t, --turbo           use gpt-3.5-turbo instead of gpt-4
  -c, --combined        send and receive all the headlines in bulk (cheaper but probabaly less good)
  -T TEMP, --temp TEMP  temperature (variability) of the model. a value between 0.0 and 1.0 (default: 0.3)```

stockgpt's People

Contributors

d3n7 avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar

stockgpt's Issues

Traceback Error

Traceback (most recent call last):
File "C:\Users\XXX\OneDrive\Desktop\StockGPT\sgpt.py", line 59, in
for i in r:
TypeError: 'NoneType' object is not iterable

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.