Skip to main content

Make your stock investment smarter, join StockAit!

Project description


stockait: python machine learning framework for stock prediction

stockait is an integrated machine learning package for technical research of stock price big data. From data collection to machine learning-specific stock price time series dataset generation, AI model learning and model evaluation, and backtesting, the goal of this package is to provide a one-time Python library to enhance the utilization and convenience of stock price big data technical research.




Why stockait?

  • Stock Price Big Data Collection

'stockait' stores big data in github and provides it to users. Because 'stockAit' is a research package, the data provided here focused on collecting data, storing it reliably, and storing it in a high-quality way, rather than collecting it in real time with unstable crawling methods.

  • An integrated package that enables the entire process of machine learning

In the past, we had to use distributed libraries to study stock price big data. Stockait is very useful because it is an integrated package that can collect data, preprocess data, learn artificial intelligence models, evaluate models, and backtest (yield calculation) at once.

  • Support the convenience of stock price big data research

The stockait package can also be used by experts with domain knowledge of stocks. When these experts are unfamiliar with programming and want to perform artificial intelligence technological analysis with stock price data, it helps them conveniently conduct research on stock price data without a large amount of programming.




Datasets provided

The following is a description of the dataset provided by stockait, the dependent variable that are set by default.

▪️ Dataset

  • Dataset is a daily stock price dataset that provides open, high, low, close, and volume columns by default.

▪️ Dependent variable

  • Dependent variable: The add_index function creates a dependent variable next_change column, which stockait recognizes as a dependent variable by default. next_change means the rate of change in the closing price of the next day.



Installation

pip install stockait
import stockait as sai 



How to use stockait?

You can find more information about using stockait in the tutorials folder.

▪️ method

The following image summarizes the methods of stockait.

img

Specific methods are as follows.

1. Data Acquisition

1.1 Bringing up the market

sai.get_markets(country:list)

1.2 Bringing up tickers

sai.get_tickers(markets:list, date:string)

1.3 Bring up stock price data

sai.load_data(date:list, tickers:list=None)

2. Data Preprocessing

2.1 Add Secondary Indicators

sai.add_index(data:pd.DataFrame(), index_list:list)

2.2 Scaling

sai.scaling(data:pd.DataFrame(), scaler_type:String, window_size:Int=None)

2.3 Convert to time series data

sai.time_series(data:pd.DataFrame(), day:Int=10)

3. Trader Definition

3.1 trader definitions img For trader definitions, it is recommended to refer to the tutorials folder.


4. Trader(Model) Fitting & Evaluation

3.2 Store required data sets inside the trader

sai.save_dataset(lst_trader:list, train_data:pd.DataFrame(), test_data:pd.DataFrame(), train_data_scaled:pd.DataFrame()=None, test_data_scaled:pd.DataFrame()=None)

3.3 Model fitting

sai.trader_train(lst_trader:list)

3.4 Model evaluation

sai.get_eval_by_threshold(lst_trader)

img

3.5 Setting Thresholds

sai.set_threshold(lst_trader, lst_threshold:list, hisogram:bool=True)

img


4. Back Testing

4.1 Making a sales log

sai.decision(lst_trader:list, dtype='test', data=None, data_scaled=None)

4.2 Calculate the yield

sai.simulation(df_signal_all, init_budget, init_stock)

4.3 Leader Board

sai.leaderboard(df)

4.4 Visualize yield

sai.yield_plot(df)

img

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

stockait-1.0.0.tar.gz (17.2 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

stockait-1.0.0-py3-none-any.whl (17.4 kB view details)

Uploaded Python 3

File details

Details for the file stockait-1.0.0.tar.gz.

File metadata

  • Download URL: stockait-1.0.0.tar.gz
  • Upload date:
  • Size: 17.2 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/4.0.2 CPython/3.9.12

File hashes

Hashes for stockait-1.0.0.tar.gz
Algorithm Hash digest
SHA256 cbadfc040762e7fd916b2a8ca791d6ddbbb671cb5340ea62b4765034bbe813f0
MD5 d006710d0cdf4e704effbbef5654d2a4
BLAKE2b-256 ea3448d085449c194be4e1a3483277f0db369d67510eee85da77b72c70ff787e

See more details on using hashes here.

File details

Details for the file stockait-1.0.0-py3-none-any.whl.

File metadata

  • Download URL: stockait-1.0.0-py3-none-any.whl
  • Upload date:
  • Size: 17.4 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/4.0.2 CPython/3.9.12

File hashes

Hashes for stockait-1.0.0-py3-none-any.whl
Algorithm Hash digest
SHA256 b9818391b3edcd954f31f13df778f6309b4c9d82d35e7e23a5ebca77456669cc
MD5 135ab02850e66163be54c519ceb9e320
BLAKE2b-256 1fcd0843685a13ec611be1b6ef079b42c84cbf7fb2848380c3dab745b965583a

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page