项目作者: cstox

项目描述 :
A Python Module That Uses ANN To Predict A Stocks Price And Also Provides Accurate Technical Analysis With Many High Potential Implementations!
高级语言: Python
项目地址: git://github.com/cstox/stox.git
创建时间: 2021-05-22T14:40:32Z
项目社区:https://github.com/cstox/stox

开源协议:MIT License

下载




Stox





⚡ A Python Module For The Stock Market ⚡


A Module to predict the “close price” for the next day and give “technical analysis”. It
uses a Neural Network and the LSTM algorithm to predict the price. It uses a technical
indicator algorithm developed by the Stox team for technical analysis.

Installation

Get it from PyPi:

  1. pip3 install stox

Clone it from github:

  1. git clone https://github.com/dopevog/stox.git
  2. cd stox
  3. python3 setup.py install

Usage

Arguments:

  1. stock (str): stock ticker symbol
  2. output (str): 'list' or 'message' (Format Of Output)
  3. years (int or float): years of data to be considered
  4. chart (bool): generate performance plot

Returns:

List:

  1. [company name, current price, predicted price, technical analysis, date (For)]

Message:

  1. company name
  2. current price
  3. predicted price
  4. technical analysis
  5. data (for)

Examples:

Basic

  1. import stox
  2. script = input("Stock Ticker Symbol: ")
  3. data = stox.stox.exec(script,'list')
  4. print(data)
  1. $ stox> python3 main.py
  2. $ Stock Ticker Symbol: AAPL
  3. $ ['Apple Inc.', 125.43000030517578, 124.91, 'Bearish (Already)', '2021-05-24']

Intermediate

  1. import stox
  2. import pandas as pd
  3. stock_list = pd.read_csv("SPX500.csv")
  4. df = stock_list
  5. number_of_stocks = 505
  6. x = 0
  7. while x < number_of_stocks:
  8. ticker = stock_list.iloc[x]["Symbols"]
  9. data = stox.stox.exec(ticker,'list')
  10. df['Price'] = data[1]
  11. df['Prediction'] = data[2]
  12. df['Analysis'] = data[3]
  13. df['DateFor'] = data[4]
  14. if data[2] - data[1] >= data[1] * 0.02:
  15. if data[3] == "Bullish (Starting)":
  16. df['Signal'] = "Buy"
  17. elif data[3] == "Bullish (Already)":
  18. df['Signal'] = "Up"
  19. elif data[2] - data[1] <= data[1] * -0.02:
  20. if data[3] == "Bearish (Starting)":
  21. df['Signal'] = "Sell"
  22. elif data[3] == "Bearish (Already)":
  23. df['Signal'] = "Down"
  24. else:
  25. df['Signal'] = "None"
  26. x = x+1
  27. df.to_csv("output.csv")
  28. print("Done")
  1. $ stox> python3 main.py
  2. $ Done

More Examples Including These Ones Can Be Found Here

Possible Implentations

  • Algorithmic Trading
  • Single Stock Analysis
  • Multistock Analysis
  • And Much More!

Credits

License

This Project Has Been MIT Licensed