Skip to content

Features

ari99 edited this page Sep 4, 2023 · 8 revisions

Download Historical Data

Create Features

Create Model

Check Model Performance

Randomized Significance Checks

Machine Learning Model Performance Statistics

Backtest Performance Statistics

Features

Download Historical Data

Download historical data from Polygon

https://github.com/ari99/algorithmic_trading/tree/main/1_download_data

Create features

Uses a series of historical data and over 100 technical indicators as features.

https://github.com/ari99/algorithmic_trading/tree/main/2_data_prepare https://github.com/ari99/algorithmic_trading/tree/main/3_make_model/rnn/1_prepare_returns

Feature Correlation

Check Spearman correlation of features:

https://github.com/ari99/algorithmic_trading/blob/main/2_data_prepare/services/correlationMaker.py

Flipped Features

Also create flipped data and features to compare performance of algo with normal data: https://github.com/ari99/algorithmic_trading/blob/main/2_data_prepare/flipped_test_data.ipynb

flipped

Create Model

Create RNN model from features:

https://github.com/ari99/algorithmic_trading/tree/main/3_make_model

AWS Sagemaker

Creating the model on AWS Sagemaker:

https://github.com/ari99/algorithmic_trading/tree/main/3_make_model/rnn/3_create_models/sagemaker

Check Model Performance

Uses backtest verification techniques such as Whites Reality Check and Monte Carlo to test the statistical significance of the backtest result. Generates thousands of backtests using VectorBT.

https://github.com/ari99/algorithmic_trading/tree/main/4_test_model

See what prediction values from the model we should use to trigger a long or short order:

https://github.com/ari99/algorithmic_trading/blob/main/4_test_model/1_compare_long_short_mins.ipynb

Screen Shot 2023-09-04 at 4 31 37 PM

Randomized Significance Checks

https://github.com/ari99/algorithmic_trading/blob/main/4_test_model/3_random_checks.ipynb

Random Portfolios

Compare performance with random portfolios

random1

Monte Carlo Check

Monte Carlo check for statistical significance of backtest results

random2

Whites Reality Check

White's Reality check for statistical significance of backtest results

random3

Machine Learning Model Performance Statistics

Machine learning Statistics

https://github.com/ari99/algorithmic_trading/tree/main/5_model_ml_stats

modelstats1

Screen Shot 2023-09-04 at 4 44 07 PM

Visualize model

https://github.com/ari99/algorithmic_trading/blob/main/5_model_ml_stats/visualize_model.ipynb

model_plot copy

Backtest Performance Statistics

https://github.com/ari99/algorithmic_trading/tree/main/6_model_bt_stats

Screen Shot 2023-09-04 at 4 33 45 PM

Screen Shot 2023-09-04 at 4 33 54 PM

Screen Shot 2023-09-04 at 4 34 48 PM

Paper trade using Alpaca

https://github.com/ari99/algorithmic_trading/tree/main/4_test_model/paper