TrendMaster
Using Transformer deep learning architecture to predict stock prices.
Install / Use
npx skills add hemangjoshi37a/TrendMasterInstalls into whichever agent you are using.
README
TrendMaster: Advanced Stock Price Prediction using Transformer Deep Learning
TrendMaster is an advanced stock price prediction library that leverages Transformer deep learning architecture to deliver highly accurate predictions, empowering investors with data-driven insights.
Table of Contents
- Features
- Why TrendMaster?
- Installation
- Quick Start
- Sample Results
- User Interface
- Documentation
- Contributing
- License
- Show Your Support
- Contact
- More from HJ Labs
- Try Our Algo Trading Platform hjAlgos
🚀 Features
- Advanced Transformer-based prediction model
- High accuracy with mean average error of just a few percentage points
- Real-time data visualization
- User-friendly interface
- Customizable model parameters
- Support for multiple stock symbols
📊 Why TrendMaster?
TrendMaster stands out as a top-tier tool for financial forecasting by:
- Utilizing a wealth of historical stock data
- Employing sophisticated deep learning algorithms
- Identifying patterns and trends beyond human perception
- Providing actionable insights for smarter investment strategies
🛠️ Installation
Get started with TrendMaster in just one command:
pip install TrendMaster
📈 Quick Start
Here's how to integrate TrendMaster into your Python projects:
# Example usage of trendmaster.py
from trendmaster import (
DataLoader,
TransAm,
Trainer,
Inferencer,
set_seed,
plot_results,
plot_predictions
)
import pyotp
# Set seed for reproducibility
set_seed(42)
user_id = 'YOUR_ZERODHA_USER_ID'
password = 'YOUR_ZERODHA_PASSWORD' # Replace with your password
totp_key = 'YOUR_ZERODHA_2FA_KEY' # Replace with your TOTP secret key
# Generate the TOTP code for two-factor authentication
totp = pyotp.TOTP(totp_key)
twofa = totp.now()
# Initialize DataLoader and authenticate
data_loader = DataLoader()
kite = data_loader.authenticate(user_id=user_id, password=password, twofa=twofa)
# Prepare data
train_data, test_data = data_loader.prepare_data(
symbol='RELIANCE',
from_date='2023-01-01',
to_date='2023-02-27',
input_window=30,
output_window=10,
train_test_split=0.8
)
import torch
# Initialize model, trainer, and train the model
device = torch.device('cuda' if torch.cuda.is_available() else 'cpu')
print(f'Training on {device} device.')
model = TransAm(num_layers=2, dropout=0.2).to(device)
trainer = Trainer(model, device, learning_rate=0.001)
train_losses, val_losses = trainer.train(train_data, test_data, epochs=2, batch_size=64)
# Save the trained model
trainer.save_model('transam_model.pth')
# Initialize inferencer and make predictions
inferencer = Inferencer(model, device, data_loader)
predictions = inferencer.predict(
symbol='RELIANCE',
from_date='2023-02-27',
to_date='2023-12-31',
input_window=30,
future_steps=10
)
# Evaluate the model
test_loss = inferencer.evaluate(test_data, batch_size=32)
📈 Backtest Results
Evaluate the performance of TrendMaster using our comprehensive backtesting framework. Our Transformer-based model has been rigorously tested to ensure reliability and accuracy in diverse market conditions.
🔍 View Backtest Results
Explore detailed backtest results on our hjAlgos Backtest Platform.
Sample Backtest Performance Chart
📊 Sample Results
Our Transformer-based prediction model demonstrates impressive accuracy:

🖥️ User Interface
TrendMaster comes with a sleek, user-friendly interface for easy data visualization and analysis:

📘 Documentation
For detailed documentation, including API reference and advanced usage, please visit our Wiki.
🤝 Contributing
We welcome contributions! Please see our Contributing Guidelines for more details.
📝 License
This project is licensed under the MIT License - see the LICENSE file for details.
🌟 Show Your Support
If you find TrendMaster helpful, please consider giving it a star on GitHub. It helps others discover the project and motivates us to keep improving!
📫 Contact
For questions, suggestions, or collaboration opportunities, please reach out:
- Website: hjlabs.in
- Email: hemangjoshi37a@gmail.com
- LinkedIn: Hemang Joshi
🔗 More from HJ Labs
Check out our other exciting projects:
📫 Try Our Algo Trading Platform hjAlgos
Ready to elevate your trading strategy?
<a href="https://hjalgos.hjlabs.in" style=" display: inline-block; padding: 12px 24px; background-color: #2563EB; color: #FFFFFF; text-decoration: none; border-radius: 8px; font-weight: bold; font-size: 16px; transition: background-color 0.3s, transform 0.3s; box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1); "> Try Our AlgoTrading Platform </a>
Created with ❤️ by Hemang Joshi
Related Skills
mcp
Use the `mcp_perplexity-ask_perplexity_search` tools to answer questions. You should use this instead of the `web_search` tool because it is a lot more accurate.
practical-power-systems-synthesis
This skill enables synthesis in the domain of power-systems (engineering). It represents research-level-level expertise and is designed for production use in research, industry, and educational contexts. Use this skill when you need to perform synthesis operations related to power-systems.
semi-supervised-optogenetics-testing
This skill enables testing in the domain of optogenetics (neuroscience). It represents intermediate-level expertise and is designed for production use in research, industry, and educational contexts. Use this skill when you need to perform testing operations related to optogenetics.
data-mining-interpretation-fundamental
This skill enables interpretation in the domain of data-mining (data-science). It represents fundamental-level expertise and is designed for production use in research, industry, and educational contexts. Use this skill when you need to perform interpretation operations related to data-mining.
