Analysis and ML components for the Crypto Trader platform (news sentiment, training, utilities).
Project description
Crypto Trader — Analysis Module
Machine learning and market analytics engine
The Analysis module powers Crypto Trader’s price prediction and model training. It ingests market data from PostgreSQL, engineers features, trains LSTM‑based models (including multi‑layer variants), generates predictions, and reports results back to the platform.
Important: Past results and backtests do not guarantee future performance. Always start in paper mode. Liability is your own.
⭐️ What this module is
- A Python analytics service used by Crypto Trader’s core platform.
- Strategic ML engine: LSTM, complex LSTM, and multi‑layer LSTM variants.
- Feature engineering pipeline with robust scaling and time‑windowed sequences.
- Training, prediction, and reporting utilities that integrate with the Django API.
🧭 Key capabilities
- Data access
- Pulls market snapshots from PostgreSQL via SQLAlchemy; bulk
COPYfor speed. - Supports multiple query modes:
current_price,historical,historical_spaced.
- Pulls market snapshots from PostgreSQL via SQLAlchemy; bulk
- Feature engineering
- Sliding time windows (configurable
sequence_length). - Engineered channels: past trends, key timestamps, correlation with target returns.
- Multi‑scale preprocessing for multi‑layer models (short/medium/long horizons).
- Sliding time windows (configurable
- Models and training
- LSTM models with Keras/TensorFlow; early stopping, LR scheduling, checkpoints.
- Multi‑layer models combine short, medium, and long sequences.
- GPU execution when available; CPU fallback supported.
- Predictions and reporting
- Generates next‑step price predictions for a target currency.
- Posts predictions and training session summaries to the platform API.
- TensorBoard logs for model inspection.
🔗 How it fits into Crypto Trader
- Input: Market snapshot data from the platform database (PostgreSQL).
- Output: Trained model artifacts under
models/..., predicted prices, metrics. - Integration: Sends structured payloads to the Django API.
🧰 Operation
This module is operated by project owners alongside the Django API and two GPUs for training.
- Environment and data
- Database: PostgreSQL
- Market snapshots table must be populated;
currencies.jsonis used for price column discovery.
- GPU setup
- Two‑GPU operation is supported. Utilities in the codebase and the scripts
under
gpu/demonstrate splitting currency workloads across devices. - Example GPU launcher scripts live under
gpu/(e.g.,gpu/run_gpu_zero.py).
- Two‑GPU operation is supported. Utilities in the codebase and the scripts
under
- Common operator actions
- Train a single‑currency LSTM model
- Entry:
src/apps/learning/models/training/training_session.py
- Entry:
- Train a multi‑layer model (short/medium/long sequences)
- Entry:
src/apps/learning/models/training/training_session.py
- Entry:
- Make a one‑off prediction for a currency
- Entry:
src/apps/learning/models/training/training_session.py
- Entry:
- Prediction and reporting lifecycle
- Entry:
src/apps/learning/models/training/training_session.py - Note:
TrainingSession.train()will compute a prediction after training and report it via the platform integration. - Standalone utilities for sending predictions also exist under
apps/learning/models/prediction/predictions.pyif needed.
- Entry:
- Run a GPU‑oriented launcher
- Scripts under
gpu/(e.g.,gpu/run_gpu_zero.py,gpu/run_gpu_one.py).
- Scripts under
- Train a single‑currency LSTM model
Notes:
- Training hyperparameters can be chosen via
TrainingType(src/apps/learning/models/training/training_type.py) or by building aTrainingModel. - Multi‑layer models live under
src/apps/learning/models/ai/lstm/layered/....
🔒 Safety, privacy, and control
- This module does not manage exchange API keys directly; it trains/predicts from database data.
- Start with small datasets and paper trading.
- Guardrails (e.g., position sizing, stop loss) are enforced by the trading engine, not this module.
🛠️ Technology in this module
- Python 3
- TensorFlow + Keras
- NumPy, Pandas, scikit‑learn
- SQLAlchemy (COPY to CSV optimization)
- Requests (HTTP)
attrs/typing_extensions
❓ Questions or help
Email Oliver Lear Sigwarth (@theoliverlear): sigwarthsoftware@gmail.com
📄 License
See LICENSE.md in the repository root.
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
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file crypto_trader_analysis-0.1.3.tar.gz.
File metadata
- Download URL: crypto_trader_analysis-0.1.3.tar.gz
- Upload date:
- Size: 43.7 kB
- Tags: Source
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.7
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
4041c09abc494dbf0c7c4a7677edabcd944dd2c9647812e6d9e1b3d6f3cdbe03
|
|
| MD5 |
01a73a16b5de28a6392f1bb750ffc3ea
|
|
| BLAKE2b-256 |
4a8d0eb8b74911d2c5519bef5bf4356cfdab322ff5d52d552d5f10298b0f44ea
|
Provenance
The following attestation bundles were made for crypto_trader_analysis-0.1.3.tar.gz:
Publisher:
python-publish.yml on theoliverlear/Crypto-Trader
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
crypto_trader_analysis-0.1.3.tar.gz -
Subject digest:
4041c09abc494dbf0c7c4a7677edabcd944dd2c9647812e6d9e1b3d6f3cdbe03 - Sigstore transparency entry: 512413303
- Sigstore integration time:
-
Permalink:
theoliverlear/Crypto-Trader@fde9d343af0572f0b7149832e0d066ded7cd2ed8 -
Branch / Tag:
refs/tags/v0.2.2 - Owner: https://github.com/theoliverlear
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
python-publish.yml@fde9d343af0572f0b7149832e0d066ded7cd2ed8 -
Trigger Event:
push
-
Statement type:
File details
Details for the file crypto_trader_analysis-0.1.3-py3-none-any.whl.
File metadata
- Download URL: crypto_trader_analysis-0.1.3-py3-none-any.whl
- Upload date:
- Size: 69.3 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.7
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
50ea694cfd1850515366d1fd85537d0f4fa303295bb56108556d65f966ff507f
|
|
| MD5 |
58aa95c12b1084f09c1e3d1772d7dff7
|
|
| BLAKE2b-256 |
d43a7c4e70b6f0c2d045cf7cf735ea62b08a32eaef8d8e69edf251ee425d282b
|
Provenance
The following attestation bundles were made for crypto_trader_analysis-0.1.3-py3-none-any.whl:
Publisher:
python-publish.yml on theoliverlear/Crypto-Trader
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
crypto_trader_analysis-0.1.3-py3-none-any.whl -
Subject digest:
50ea694cfd1850515366d1fd85537d0f4fa303295bb56108556d65f966ff507f - Sigstore transparency entry: 512413322
- Sigstore integration time:
-
Permalink:
theoliverlear/Crypto-Trader@fde9d343af0572f0b7149832e0d066ded7cd2ed8 -
Branch / Tag:
refs/tags/v0.2.2 - Owner: https://github.com/theoliverlear
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
python-publish.yml@fde9d343af0572f0b7149832e0d066ded7cd2ed8 -
Trigger Event:
push
-
Statement type: