General Introduction
A_Share_investment_Agent is an A-share investment decision aid based on a multi-intelligence system. The system is designed to generate trading signals by using multiple collaborative intelligences to analyze market data, calculate the intrinsic value of stocks, and analyze market sentiment as well as fundamental data. This approach helps investors better understand market dynamics and make more informed investment decisions. The program is for educational purposes only and is not intended for actual trading or investing.
Function List
- Market data analysis: collection and pre-processing of market data
- Valuation Agents: Calculate the intrinsic value of a stock and generate trading signals
- Sentiment Brokerage: Analyzing Market Sentiment and Generating Trading Signals
- Fundamental Agents: Analyze fundamental data and generate trading signals
- Comprehensive Trading Signal Generation: Integrate signals generated by various intelligences to provide comprehensive trading recommendations
Using Help
Installation process
- Clone the project code:
git clone https://github.com/24mlight/A_Share_investment_Agent.git cd A_Share_investment_Agent
2. Install the dependencies:
```bash
pip install -r requirements.txt
- Configure environment variables:
Based on the project's.env.example
file creates a.env
file and fill in the appropriate configuration entries.
Functional operation flow
Market Data Analysis
The Market Data Analysis module is responsible for collecting and pre-processing market data. By calling the data source API, the latest market data is regularly obtained and preprocessed for subsequent use by the intelligences.
Valuation Agent
The Valuation Agent module is responsible for calculating the intrinsic value of a stock based on market data. The module uses various valuation models, such as discounted cash flow models, relative valuation models, etc., to generate an estimate of the intrinsic value of each stock.
emotional agent
The Sentiment Proxy module generates market sentiment signals by analyzing market sentiment data from news, social media, and other channels. The module uses natural language processing techniques to extract the sentiment tendencies in the text and convert them into quantitative signals.
Fundamental Agents
The Fundamental Proxy module generates fundamental signals by analyzing a company's financial statements, operating data, and other fundamental information. The module uses financial ratio analysis, trend analysis, and other methods to assess a company's fundamental position.
Integrated trading signal generation
The integrated trading signal generation module integrates the signals generated by the various intelligences to provide integrated trading recommendations. The signals from the various intelligences are fused to generate the final trading recommendations through methods such as weighted averaging and voting mechanisms.
usage example
Below is a usage example showing how to run the entire system and get trade recommendations:
from agents import MarketDataAnalyst, ValuationAgent, SentimentAgent, FundamentalsAgent, TradeSignalGenerator
# Initialize each agent
market_data_analyst = MarketDataAnalyst()
valuation_agent = ValuationAgent()
sentiment_agent = SentimentAgent()
fundamentals_agent = FundamentalsAgent()
trade_signal_generator = TradeSignalGenerator()
# Get market data
market_data = market_data_analyst.get_market_data()
# Generate signals for each intelligence
valuation_signal = valuation_agent.generate_signal(market_data)
sentiment_signal = sentiment_agent.generate_signal(market_data)
fundamentals_signal = fundamentals_agent.generate_signal(market_data)
# Integrated Trading Signal
final_trade_signal = trade_signal_generator.generate_signal([valuation_signal, sentiment_signal, fundamentals_signal])
print(f "Composite trade signal: {final_trade_signal}")