MOEX scalping trade bot based on deep learning model.
Uses adopted variant of LSHASH to speed up similarity measurement of trading data samples.
- https://numpy.org/
- https://tinkoff.github.io/invest-python/
- https://pypi.org/project/dearpygui/
- https://pypi.org/project/joblib/
- https://pypi.org/project/win10toast/
- https://pytorch.org/get-started/locally/
- pip install numpy
- pip install tinkoff-investments
- pip install dearpygui
- pip install joblib
- pip install win10toast
- pip3 install torch torchvision torchaudio --index-url https://download.pytorch.org/whl/cu118
- The scripts requires T-Bank access token in order to integrate with its API.
- The token should be provided in environment variable TK_TOKEN on the local machine.
- To train the models you will need to gather enough of the trading data using TkDataGatherLoop.bat
- The script feeding from the live stock market exchange (MOEX) and outputs a set of files representing streams of trading orders and operations relevant to certain shares.
An example of the gathered tading data:
-
The forecasting model uses compressed representation of orderbooks and last trades distribution samples.
-
The aforementioned compressed representation is a learnable models based on autoencoders.
-
To train those autoencoders you need to preprocess the gathered trading data using TkPreprocessAutoencoderData.py
-
Upon completion of preprocessing data, you can launch TkTrainAutoencoders. It will display feedback regarding the training process, so you can decide for yourself when it should be stopped.
- With trained autoencoder models we can prepare training data for time series prediction model using TkPreprocessTimeSeriesData.py.
- Upon completion of preprocessing data, it is all ready for launching TkTrainTimeSeries.py and training of the forecasting model. The training script will display feedback regarding the training process as well, it is just take significantly more time than training of the autoencoders.
In trading mode it is required to run both:
- TkDataGatherLoop.bat - to gather realtime trading data
- and TkForecastingService.py - to predict the price movement based on the gathered realtime trading data
Depending on the model parameters TkForecastingService.py would need for the trading data to accumulate for some time before starting predicting price movement.



