Stock Price Prediction And Analysis
Project description
Stox
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. Check out how it works here.
Installation
Get it from PyPi:
pip3 install stox
Clone it from github:
git clone https://github.com/dopevog/stox.git
cd stox
python3 setup.py
Usage
Arguments:
stock (str): stock label
output (str): 'list' or 'message'
steps (int): previous days to consider for generating the model.
training (float): fraction assigned for training the model
years (int or float): years of data to be considered
plot (bool): generate performance plot
Returns:
List:
[company name, current price, predicted price, technical analysis, date (For)]
Message:
company name
current price
predicted price
technical analysis
data (for)
Examples:
Basic
import stox
script = input("Stock Ticker Symbol: ")
data = stox.stox.exec(script,'message')
print(data)
$ stox> python3 main.py
$ Stock Ticker Symbol: AAPL
$ ['Apple Inc.', 125.43000030517578, 124.91, 'Bearish (Already)', '2021-05-24']
Intermediate
import stox
import pandas as pd
stock_list = pd.read_csv("SPX500.csv")
df = stock_list
number_of_stocks = 100
x = 0
while x < number_of_stocks:
ticker = stock_list.iloc[x]["Symbols"]
data = stox.stox.exec(script,'list')
df['Price'] = data[1]
df['Prediction] = data[2]
df['Analysis] = data[3]
df['DateFor'] = data[4]
if df.Prediction - df.Price >= df.Price * 0.02:
if df.Analysis == "Bullish (Starting)":
df['Signal'] = "Buy"
elif df.Analysis == "Bullish (Already)":
df['Signal'] = "Up"
elif df.Prediction - df.Price <= df.Price * -0.02:
if df.Analysis == "Bearish (Starting)":
df['Signal'] = "Sell"
elif df.Analysis == "Bearish (Already)":
df['Signal'] = "Down"
else:
df['Signal'] = "None"
x = x+1
df.to_csv("output.csv")
print("Done")
$ stox> python3 main.py
$ Done
More Examples Including These Ones Can Be Found Here
Possible Implentations
- Algorithmic Trading
- Single Stock Analysis
- Multistock Analysis
- And Much More!
License
This Project Has Been MIT Licensed
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
stox-0.3.tar.gz
(5.1 kB
view details)
File details
Details for the file stox-0.3.tar.gz
.
File metadata
- Download URL: stox-0.3.tar.gz
- Upload date:
- Size: 5.1 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/3.4.1 importlib_metadata/4.0.1 pkginfo/1.7.0 requests/2.25.1 requests-toolbelt/0.9.1 tqdm/4.60.0 CPython/3.9.4
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | c6104d036f8e2bd3c545d3b08391c5a14d35826faa5e3f498c80ec3d8a4ba633 |
|
MD5 | 80665063f4231b57d374e063ea819517 |
|
BLAKE2b-256 | 9828056a66310e59b47341885e6bc52dd58ff857892364b3701398b3b1d06351 |