👬 Team: Hyun Kang
👨🏻💻 Role: Solo Project
📅 Date: Jan 2025 - Feb 2025
Automated crypto trading agent that uses technical analysis and sentiment analysis to make trading decisions. Currently running on Binance and a status can be viewed on this page.
In today’s fast-paced cryptocurrency markets, traders are constantly seeking an edge through better analysis, automation, and decision-making tools. TradInsight is an open-source framework that combines technical analysis, sentiment analysis, and AI-powered portfolio management to provide comprehensive cryptocurrency trading insights and automation.
This article explores the architecture and capabilities of TradInsight, demonstrating how it can help traders make more informed decisions in the volatile world of cryptocurrency trading.
TradInsight is built around three core components:
The system works by collecting data, performing analysis, and then executing trades based on sophisticated AI-driven insights. Let’s explore each component in detail.
The technical analysis module processes market data from cryptocurrency exchanges (primarily Binance) and calculates various indicators to identify market trends and potential entry/exit points.
Key features include:
def technical_analysis(target: str, config: dict) -> TechnicalAnalysis:
"""
Perform technical analysis on the target cryptocurrency
"""
ohlcv = get_ohlcv(target, config['data']['interval'], config['data']['lookback'])
indicators = get_indicators(ohlcv, **config['indicators'])
bitcoin_dominance = get_bitcoin_dominance(config['bitcoin_dominance']['days'])
derivative = get_derivative_data(target, config['derivative'])
# Process data and generate insights with LLM...
The sentiment analysis component evaluates market sentiment by gathering data from various sources:
def sentimental_analysis(target: str, config: dict) -> SentimentalAnalysis:
"""
Analyze sentiment for the target cryptocurrency
"""
news_sentiment = get_news_sentiment(target)
fear_and_greed_index = fetch_fear_and_greed_index()
# Process sentiment data with LLM...
What sets TradInsight apart is its AI-powered portfolio management system. The framework leverages advanced language models to process complex technical and sentiment data, then generate actionable trading recommendations:
The system uses a carefully designed prompt structure to guide the language model toward producing consistent, well-reasoned trading decisions:
messages = [
SystemMessage(content=portfolio_management_system_prompt),
HumanMessage(content=user_prompt)
]
response = model.invoke(messages)
formatter = formatter.with_structured_output(OrderBook)
formatted_response = formatter.invoke(response.content)
orders = formatted_response.orders
TradInsight can automatically execute trading decisions through its integration with cryptocurrency exchanges:
The framework integrates with Supabase for persistent storage of:
This creates a valuable history for back-testing and strategy refinement.
TradInsight is designed to be highly customizable:
Here’s a simplified example of how TradInsight operates:
TradInsight represents a sophisticated approach to cryptocurrency trading that combines traditional technical analysis with cutting-edge AI capabilities. By leveraging the power of large language models and integrating diverse data sources, it provides traders with comprehensive insights and automation capabilities.
Whether you’re a seasoned trader looking to automate your strategy or a developer interested in AI applications in finance, TradInsight offers a flexible framework that can be customized to various trading approaches and risk profiles.
The project is continuously evolving, with opportunities to extend its capabilities through additional data sources, improved AI models, and enhanced trading strategies.
Exploring the future, one post at a time.