refactor: replace 'company' naming with 'asset'

This commit is contained in:
Tomortec 2025-07-02 00:09:26 +08:00
parent 45de619585
commit 691f2835e1
18 changed files with 96 additions and 96 deletions

View File

@ -60,7 +60,7 @@ TradingAgents is a multi-agent trading framework that mirrors the dynamics of re
Our framework decomposes complex trading tasks into specialized roles. This ensures the system achieves a robust, scalable approach to market analysis and decision-making.
### Analyst Team
- Fundamentals Analyst: Evaluates company financials and performance metrics, identifying intrinsic values and potential red flags.
- Fundamentals Analyst: Evaluates asset financials and performance metrics, identifying intrinsic values and potential red flags.
- Sentiment Analyst: Analyzes social media and public sentiment using sentiment scoring algorithms to gauge short-term market mood.
- News Analyst: Monitors global news and macroeconomic indicators, interpreting the impact of events on market conditions.
- Technical Analyst: Utilizes technical indicators (like MACD and RSI) to detect trading patterns and forecast price movements.

View File

@ -7,8 +7,8 @@ from tradingagents.i18n import get_prompts
def create_fundamentals_analyst(llm, toolkit):
def fundamentals_analyst_node(state):
current_date = state["trade_date"]
ticker = state["company_of_interest"]
company_name = state["company_of_interest"]
ticker = state["asset_of_interest"]
asset_name = state["asset_of_interest"]
tools = [
toolkit.get_binance_ohlcv,

View File

@ -8,8 +8,8 @@ def create_market_analyst(llm, toolkit):
def market_analyst_node(state):
current_date = state["trade_date"]
ticker = state["company_of_interest"]
company_name = state["company_of_interest"]
ticker = state["asset_of_interest"]
asset_name = state["asset_of_interest"]
tools = [
toolkit.get_binance_data,

View File

@ -7,7 +7,7 @@ from tradingagents.i18n import get_prompts
def create_news_analyst(llm, toolkit):
def news_analyst_node(state):
current_date = state["trade_date"]
ticker = state["company_of_interest"]
ticker = state["asset_of_interest"]
tools = [
toolkit.get_binance_ohlcv,

View File

@ -7,8 +7,8 @@ from tradingagents.i18n import get_prompts
def create_social_media_analyst(llm, toolkit):
def social_media_analyst_node(state):
current_date = state["trade_date"]
ticker = state["company_of_interest"]
company_name = state["company_of_interest"]
ticker = state["asset_of_interest"]
asset_name = state["asset_of_interest"]
tools = [
toolkit.get_binance_ohlcv,

View File

@ -6,7 +6,7 @@ from tradingagents.i18n import get_prompts
def create_risk_manager(llm, memory):
def risk_manager_node(state) -> dict:
company_name = state["company_of_interest"]
asset_name = state["asset_of_interest"]
history = state["risk_debate_state"]["history"]
risk_debate_state = state["risk_debate_state"]

View File

@ -5,7 +5,7 @@ from tradingagents.i18n import get_prompts
def create_trader(llm, memory):
def trader_node(state, name):
company_name = state["company_of_interest"]
asset_name = state["asset_of_interest"]
investment_plan = state["investment_plan"]
market_research_report = state["market_report"]
sentiment_report = state["sentiment_report"]
@ -23,7 +23,7 @@ def create_trader(llm, memory):
context = {
"role": "user",
"content": get_prompts("trader", "user_message") \
.replace("{company_name}", company_name) \
.replace("{asset_name}", asset_name) \
.replace("{investment_plan}", investment_plan) \
.replace("{external_reports}", "\n".join(external_reports))
}

View File

@ -48,7 +48,7 @@ class RiskDebateState(TypedDict):
class AgentState(MessagesState):
company_of_interest: Annotated[str, "Company that we are interested in trading"]
asset_of_interest: Annotated[str, "Asset that we are interested in trading"]
trade_date: Annotated[str, "What date we are trading at"]
sender: Annotated[str, "Agent that sent this message"]

View File

@ -205,20 +205,20 @@ class Toolkit:
def get_reddit_stock_info(
ticker: Annotated[
str,
"Ticker of a company. e.g. AAPL, TSM",
"Ticker of a asset. e.g. AAPL, TSM",
],
curr_date: Annotated[str, "Current date you want to get news for"],
) -> str:
"""
Retrieve the latest news about a given stock from Reddit, given the current date.
Args:
ticker (str): Ticker of a company. e.g. AAPL, TSM
ticker (str): Ticker of a asset. e.g. AAPL, TSM
curr_date (str): current date in yyyy-mm-dd format to get news for
Returns:
str: A formatted dataframe containing the latest news about the company on the given date
str: A formatted dataframe containing the latest news about the asset on the given date
"""
stock_news_results = interface.get_reddit_company_news(ticker, curr_date, 7, 5)
stock_news_results = interface.get_reddit_asset_news(ticker, curr_date, 7, 5)
return stock_news_results
@ -245,16 +245,16 @@ class Toolkit:
@staticmethod
@tool
def get_stock_news_openai(
ticker: Annotated[str, "the company's ticker"],
ticker: Annotated[str, "the asset's ticker"],
curr_date: Annotated[str, "Current date in yyyy-mm-dd format"],
):
"""
Retrieve the latest news about a given stock by using OpenAI's news API.
Args:
ticker (str): Ticker of a company. e.g. AAPL, TSM
ticker (str): Ticker of a asset. e.g. AAPL, TSM
curr_date (str): Current date in yyyy-mm-dd format
Returns:
str: A formatted string containing the latest news about the company on the given date.
str: A formatted string containing the latest news about the asset on the given date.
"""
openai_news_results = interface.get_stock_news_openai(ticker, curr_date)
@ -281,16 +281,16 @@ class Toolkit:
@staticmethod
@tool
def get_fundamentals_openai(
ticker: Annotated[str, "the company's ticker"],
ticker: Annotated[str, "the asset's ticker"],
curr_date: Annotated[str, "Current date in yyyy-mm-dd format"],
):
"""
Retrieve the latest fundamental information about a given stock on a given date by using OpenAI's news API.
Args:
ticker (str): Ticker of a company. e.g. AAPL, TSM
ticker (str): Ticker of a asset. e.g. AAPL, TSM
curr_date (str): Current date in yyyy-mm-dd format
Returns:
str: A formatted string containing the latest fundamental information about the company on the given date.
str: A formatted string containing the latest fundamental information about the asset on the given date.
"""
openai_fundamentals_results = interface.get_fundamentals_openai(

View File

@ -8,7 +8,7 @@ from .interface import (
get_google_news,
get_fear_and_greed_index,
get_reddit_global_news,
get_reddit_company_news,
get_reddit_asset_news,
# Financial statements functions
# TODO
# Technical analysis functions
@ -25,7 +25,7 @@ __all__ = [
"get_google_news",
"get_fear_and_greed_index",
"get_reddit_global_news",
"get_reddit_company_news",
"get_reddit_asset_news",
# Financial statements functions
# TODO
# Technical analysis functions

View File

@ -192,8 +192,8 @@ def get_reddit_global_news(
return f"## Global News Reddit, from {before} to {curr_date}:\n{news_str}"
def get_reddit_company_news(
ticker: Annotated[str, "ticker symbol of the company"],
def get_reddit_asset_news(
ticker: Annotated[str, "ticker symbol of the asset"],
start_date: Annotated[str, "Start date in yyyy-mm-dd format"],
look_back_days: Annotated[int, "how many days to look back"],
max_limit_per_day: Annotated[int, "Maximum number of news per day"],
@ -201,7 +201,7 @@ def get_reddit_company_news(
"""
Retrieve the latest top reddit news
Args:
ticker: ticker symbol of the company
ticker: ticker symbol of the asset
start_date: Start date in yyyy-mm-dd format
end_date: End date in yyyy-mm-dd format
Returns:
@ -218,14 +218,14 @@ def get_reddit_company_news(
total_iterations = (start_date - curr_date).days + 1
pbar = tqdm(
desc=f"Getting Company News for {ticker} on {start_date}",
desc=f"Getting Asset News for {ticker} on {start_date}",
total=total_iterations,
)
while curr_date <= start_date:
curr_date_str = curr_date.strftime("%Y-%m-%d")
fetch_result = fetch_top_from_category(
"company_news",
"asset_news",
curr_date_str,
max_limit_per_day,
ticker,
@ -490,20 +490,20 @@ def get_fundamentals_openai(ticker, curr_date):
def get_finnhub_news(
ticker: Annotated[
str,
"Search query of a company's, e.g. 'AAPL, TSM, etc.",
"Search query of a asset's, e.g. 'AAPL, TSM, etc.",
],
curr_date: Annotated[str, "Current date in yyyy-mm-dd format"],
look_back_days: Annotated[int, "how many days to look back"],
):
"""
Retrieve news about a company within a time frame
Retrieve news about a asset within a time frame
Args
ticker (str): ticker for the company you are interested in
ticker (str): ticker for the asset you are interested in
start_date (str): Start date in yyyy-mm-dd format
end_date (str): End date in yyyy-mm-dd format
Returns
str: dataframe containing the news of the company in the time frame
str: dataframe containing the news of the asset in the time frame
"""
@ -529,8 +529,8 @@ def get_finnhub_news(
return f"## {ticker} News, from {before} to {curr_date}:\n" + str(combined_result)
@deprecated("Utilities only for stocks are deprecated.")
def get_finnhub_company_insider_sentiment(
ticker: Annotated[str, "ticker symbol for the company"],
def get_finnhub_asset_insider_sentiment(
ticker: Annotated[str, "ticker symbol for the asset"],
curr_date: Annotated[
str,
"current date of you are trading at, yyyy-mm-dd",
@ -538,9 +538,9 @@ def get_finnhub_company_insider_sentiment(
look_back_days: Annotated[int, "number of days to look back"],
):
"""
Retrieve insider sentiment about a company (retrieved from public SEC information) for the past 15 days
Retrieve insider sentiment about a asset (retrieved from public SEC information) for the past 15 days
Args:
ticker (str): ticker symbol of the company
ticker (str): ticker symbol of the asset
curr_date (str): current date you are trading on, yyyy-mm-dd
Returns:
str: a report of the sentiment in the past 15 days starting at curr_date
@ -570,7 +570,7 @@ def get_finnhub_company_insider_sentiment(
)
@deprecated("Utilities only for stocks are deprecated.")
def get_finnhub_company_insider_transactions(
def get_finnhub_asset_insider_transactions(
ticker: Annotated[str, "ticker symbol"],
curr_date: Annotated[
str,
@ -579,12 +579,12 @@ def get_finnhub_company_insider_transactions(
look_back_days: Annotated[int, "how many days to look back"],
):
"""
Retrieve insider transcaction information about a company (retrieved from public SEC information) for the past 15 days
Retrieve insider transcaction information about a asset (retrieved from public SEC information) for the past 15 days
Args:
ticker (str): ticker symbol of the company
ticker (str): ticker symbol of the asset
curr_date (str): current date you are trading at, yyyy-mm-dd
Returns:
str: a report of the company's insider transaction/trading informtaion in the past 15 days
str: a report of the asset's insider transaction/trading informtaion in the past 15 days
"""
date_obj = datetime.strptime(curr_date, "%Y-%m-%d")
@ -608,7 +608,7 @@ def get_finnhub_company_insider_transactions(
return (
f"## {ticker} insider transactions from {before} to {curr_date}:\n"
+ result_str
+ "The change field reflects the variation in share count—here a negative number indicates a reduction in holdings—while share specifies the total number of shares involved. The transactionPrice denotes the per-share price at which the trade was executed, and transactionDate marks when the transaction occurred. The name field identifies the insider making the trade, and transactionCode (e.g., S for sale) clarifies the nature of the transaction. FilingDate records when the transaction was officially reported, and the unique id links to the specific SEC filing, as indicated by the source. Additionally, the symbol ties the transaction to a particular company, isDerivative flags whether the trade involves derivative securities, and currency notes the currency context of the transaction."
+ "The change field reflects the variation in share count—here a negative number indicates a reduction in holdings—while share specifies the total number of shares involved. The transactionPrice denotes the per-share price at which the trade was executed, and transactionDate marks when the transaction occurred. The name field identifies the insider making the trade, and transactionCode (e.g., S for sale) clarifies the nature of the transaction. FilingDate records when the transaction was officially reported, and the unique id links to the specific SEC filing, as indicated by the source. Additionally, the symbol ties the transaction to a particular asset, isDerivative flags whether the trade involves derivative securities, and currency notes the currency context of the transaction."
)
@deprecated("Utilities only for stocks are deprecated.")
@ -616,7 +616,7 @@ def get_simfin_balance_sheet(
ticker: Annotated[str, "ticker symbol"],
freq: Annotated[
str,
"reporting frequency of the company's financial history: annual / quarterly",
"reporting frequency of the asset's financial history: annual / quarterly",
],
curr_date: Annotated[str, "current date you are trading at, yyyy-mm-dd"],
):
@ -663,7 +663,7 @@ def get_simfin_cashflow(
ticker: Annotated[str, "ticker symbol"],
freq: Annotated[
str,
"reporting frequency of the company's financial history: annual / quarterly",
"reporting frequency of the asset's financial history: annual / quarterly",
],
curr_date: Annotated[str, "current date you are trading at, yyyy-mm-dd"],
):
@ -702,7 +702,7 @@ def get_simfin_cashflow(
return (
f"## {freq} cash flow statement for {ticker} released on {str(latest_cash_flow['Publish Date'])[0:10]}: \n"
+ str(latest_cash_flow)
+ "\n\nThis includes metadata like reporting dates and currency, share details, and a breakdown of cash movements. Operating activities show cash generated from core business operations, including net income adjustments for non-cash items and working capital changes. Investing activities cover asset acquisitions/disposals and investments. Financing activities include debt transactions, equity issuances/repurchases, and dividend payments. The net change in cash represents the overall increase or decrease in the company's cash position during the reporting period."
+ "\n\nThis includes metadata like reporting dates and currency, share details, and a breakdown of cash movements. Operating activities show cash generated from core business operations, including net income adjustments for non-cash items and working capital changes. Investing activities cover asset acquisitions/disposals and investments. Financing activities include debt transactions, equity issuances/repurchases, and dividend payments. The net change in cash represents the overall increase or decrease in the asset's cash position during the reporting period."
)
@deprecated("Utilities only for stocks are deprecated.")
@ -710,7 +710,7 @@ def get_simfin_income_statements(
ticker: Annotated[str, "ticker symbol"],
freq: Annotated[
str,
"reporting frequency of the company's financial history: annual / quarterly",
"reporting frequency of the asset's financial history: annual / quarterly",
],
curr_date: Annotated[str, "current date you are trading at, yyyy-mm-dd"],
):
@ -749,12 +749,12 @@ def get_simfin_income_statements(
return (
f"## {freq} income statement for {ticker} released on {str(latest_income['Publish Date'])[0:10]}: \n"
+ str(latest_income)
+ "\n\nThis includes metadata like reporting dates and currency, share details, and a comprehensive breakdown of the company's financial performance. Starting with Revenue, it shows Cost of Revenue and resulting Gross Profit. Operating Expenses are detailed, including SG&A, R&D, and Depreciation. The statement then shows Operating Income, followed by non-operating items and Interest Expense, leading to Pretax Income. After accounting for Income Tax and any Extraordinary items, it concludes with Net Income, representing the company's bottom-line profit or loss for the period."
+ "\n\nThis includes metadata like reporting dates and currency, share details, and a comprehensive breakdown of the asset's financial performance. Starting with Revenue, it shows Cost of Revenue and resulting Gross Profit. Operating Expenses are detailed, including SG&A, R&D, and Depreciation. The statement then shows Operating Income, followed by non-operating items and Interest Expense, leading to Pretax Income. After accounting for Income Tax and any Extraordinary items, it concludes with Net Income, representing the asset's bottom-line profit or loss for the period."
)
@deprecated("Utilities only for stocks are deprecated.")
def get_stock_stats_indicators_window(
symbol: Annotated[str, "ticker symbol of the company"],
symbol: Annotated[str, "ticker symbol of the asset"],
indicator: Annotated[str, "technical indicator to get the analysis and report of"],
curr_date: Annotated[
str, "The current trading date you are trading on, YYYY-mm-dd"
@ -890,7 +890,7 @@ def get_stock_stats_indicators_window(
@deprecated("Utilities only for stocks are deprecated.")
def get_stockstats_indicator(
symbol: Annotated[str, "ticker symbol of the company"],
symbol: Annotated[str, "ticker symbol of the asset"],
indicator: Annotated[str, "technical indicator to get the analysis and report of"],
curr_date: Annotated[
str, "The current trading date you are trading on, YYYY-mm-dd"
@ -919,7 +919,7 @@ def get_stockstats_indicator(
@deprecated("Utilities only for stocks are deprecated.")
def get_YFin_data_window(
symbol: Annotated[str, "ticker symbol of the company"],
symbol: Annotated[str, "ticker symbol of the asset"],
curr_date: Annotated[str, "Start date in yyyy-mm-dd format"],
look_back_days: Annotated[int, "how many days to look back"],
) -> str:
@ -960,7 +960,7 @@ def get_YFin_data_window(
@deprecated("Utilities only for stocks are deprecated.")
def get_YFin_data_online(
symbol: Annotated[str, "ticker symbol of the company"],
symbol: Annotated[str, "ticker symbol of the asset"],
start_date: Annotated[str, "Start date in yyyy-mm-dd format"],
end_date: Annotated[str, "Start date in yyyy-mm-dd format"],
):
@ -1002,7 +1002,7 @@ def get_YFin_data_online(
@deprecated("Utilities only for stocks are deprecated.")
def get_YFin_data(
symbol: Annotated[str, "ticker symbol of the company"],
symbol: Annotated[str, "ticker symbol of the asset"],
start_date: Annotated[str, "Start date in yyyy-mm-dd format"],
end_date: Annotated[str, "Start date in yyyy-mm-dd format"],
) -> str:

View File

@ -7,14 +7,14 @@ from typing import Annotated
import os
import re
ticker_to_company = {
ticker_to_asset = {
"AAPL": "Apple",
"MSFT": "Microsoft",
"GOOGL": "Google",
"AMZN": "Amazon",
"TSLA": "Tesla",
"NVDA": "Nvidia",
"TSM": "Taiwan Semiconductor Manufacturing Company OR TSMC",
"TSM": "Taiwan Semiconductor Manufacturing Asset OR TSMC",
"JPM": "JPMorgan Chase OR JP Morgan",
"JNJ": "Johnson & Johnson OR JNJ",
"V": "Visa",
@ -96,13 +96,13 @@ def fetch_top_from_category(
if post_date != date:
continue
# if is company_news, check that the title or the content has the company's name (query) mentioned
if "company" in category and query:
# if is asset_news, check that the title or the content has the asset's name (query) mentioned
if "asset" in category and query:
search_terms = []
if "OR" in ticker_to_company[query]:
search_terms = ticker_to_company[query].split(" OR ")
if "OR" in ticker_to_asset[query]:
search_terms = ticker_to_asset[query].split(" OR ")
else:
search_terms = [ticker_to_company[query]]
search_terms = [ticker_to_asset[query]]
search_terms.append(query)

View File

@ -10,9 +10,9 @@ from warnings import deprecated
class StockstatsUtils:
@staticmethod
def get_stock_stats(
symbol: Annotated[str, "ticker symbol for the company"],
symbol: Annotated[str, "ticker symbol for the asset"],
indicator: Annotated[
str, "quantitative indicators based off of the stock data for the company"
str, "quantitative indicators based off of the stock data for the asset"
],
curr_date: Annotated[
str, "curr date for retrieving stock price data, YYYY-mm-dd"

View File

@ -50,25 +50,25 @@ class YFinanceUtils:
stock_info = ticker.info
return stock_info
def get_company_info(
def get_asset_info(
symbol: Annotated[str, "ticker symbol"],
save_path: Optional[str] = None,
) -> DataFrame:
"""Fetches and returns company information as a DataFrame."""
"""Fetches and returns asset information as a DataFrame."""
ticker = symbol
info = ticker.info
company_info = {
"Company Name": info.get("shortName", "N/A"),
asset_info = {
"Asset Name": info.get("shortName", "N/A"),
"Industry": info.get("industry", "N/A"),
"Sector": info.get("sector", "N/A"),
"Country": info.get("country", "N/A"),
"Website": info.get("website", "N/A"),
}
company_info_df = DataFrame([company_info])
asset_info_df = DataFrame([asset_info])
if save_path:
company_info_df.to_csv(save_path)
print(f"Company info for {ticker.ticker} saved to {save_path}")
return company_info_df
asset_info_df.to_csv(save_path)
print(f"Asset info for {ticker.ticker} saved to {save_path}")
return asset_info_df
def get_stock_dividends(
symbol: Annotated[str, "ticker symbol"],
@ -83,19 +83,19 @@ class YFinanceUtils:
return dividends
def get_income_stmt(symbol: Annotated[str, "ticker symbol"]) -> DataFrame:
"""Fetches and returns the latest income statement of the company as a DataFrame."""
"""Fetches and returns the latest income statement of the asset as a DataFrame."""
ticker = symbol
income_stmt = ticker.financials
return income_stmt
def get_balance_sheet(symbol: Annotated[str, "ticker symbol"]) -> DataFrame:
"""Fetches and returns the latest balance sheet of the company as a DataFrame."""
"""Fetches and returns the latest balance sheet of the asset as a DataFrame."""
ticker = symbol
balance_sheet = ticker.balance_sheet
return balance_sheet
def get_cash_flow(symbol: Annotated[str, "ticker symbol"]) -> DataFrame:
"""Fetches and returns the latest cash flow statement of the company as a DataFrame."""
"""Fetches and returns the latest cash flow statement of the asset as a DataFrame."""
ticker = symbol
cash_flow = ticker.cashflow
return cash_flow

View File

@ -16,12 +16,12 @@ class Propagator:
self.max_recur_limit = max_recur_limit
def create_initial_state(
self, company_name: str, trade_date: str, external_reports: list[str] = []
self, asset_name: str, trade_date: str, external_reports: list[str] = []
) -> Dict[str, Any]:
"""Create the initial state for the agent graph."""
return {
"messages": [("human", company_name)],
"company_of_interest": company_name,
"messages": [("human", asset_name)],
"asset_of_interest": asset_name,
"trade_date": str(trade_date),
"investment_debate_state": InvestDebateState(
{"history": "", "current_response": "", "count": 0}

View File

@ -147,14 +147,14 @@ class TradingAgentsGraph:
),
}
def propagate(self, company_name, trade_date):
"""Run the trading agents graph for a company on a specific date."""
def propagate(self, asset_name, trade_date):
"""Run the trading agents graph for a asset on a specific date."""
self.ticker = company_name
self.ticker = asset_name
# Initialize state
init_agent_state = self.propagator.create_initial_state(
company_name, trade_date
asset_name, trade_date
)
args = self.propagator.get_graph_args()
@ -185,7 +185,7 @@ class TradingAgentsGraph:
def _log_state(self, trade_date, final_state):
"""Log the final state to a JSON file."""
self.log_states_dict[str(trade_date)] = {
"company_of_interest": final_state["company_of_interest"],
"asset_of_interest": final_state["asset_of_interest"],
"trade_date": final_state["trade_date"],
"market_report": final_state["market_report"],
"sentiment_report": final_state["sentiment_report"],

View File

@ -8,13 +8,13 @@ PROMPTS = {
" If you or any other assistant has the FINAL TRANSACTION PROPOSAL: **BUY/HOLD/SELL** or deliverable,"
" prefix your response with FINAL TRANSACTION PROPOSAL: **BUY/HOLD/SELL** so the team knows to stop."
" You have access to the following tools: {tool_names}.\n{system_message}"
"For your reference, the current date is {current_date}. The company we want to look at is {ticker}",
"For your reference, the current date is {current_date}. The asset we want to look at is {ticker}",
),
#region Fundamentals Analyst
"fundamentals_analyst": {
"system_message": (
"You are a researcher tasked with analyzing fundamental information over the past week about an asset. Please write a comprehensive report of the asset's fundamental information such as financial documents, company profile, basic company financials, company financial history, insider sentiment and insider transactions to gain a full view of the company's fundamental information to inform traders. Make sure to include as much detail as possible. Do not simply state the trends are mixed, provide detailed and finegrained analysis and insights that may help traders make decisions. The report should not exceed {max_tokens}tokens." +
"You are a researcher tasked with analyzing fundamental information over the past week about an asset. Please write a comprehensive report of the asset's fundamental information such as financial documents, asset profile, basic asset financials, asset financial history, insider sentiment and insider transactions to gain a full view of the asset's fundamental information to inform traders. Make sure to include as much detail as possible. Do not simply state the trends are mixed, provide detailed and finegrained analysis and insights that may help traders make decisions. The report should not exceed {max_tokens}tokens." +
" Make sure to append a Markdown table at the end of the report to organize key points in the report, organized and easy to read."
)
},
@ -73,7 +73,7 @@ Write a very detailed and nuanced report of the trends you observe. Do not simpl
#region Social Media Analyst
"social_media_analyst": {
"system_message": (
"You are a social media and company specific news researcher/analyst tasked with analyzing social media posts, recent company news, and public sentiment for a specific company over the past week. You will be given a company's name your objective is to write a comprehensive long report detailing your analysis, insights, and implications for traders and investors on this company's current state after looking at social media and what people are saying about that company, analyzing sentiment data of what people feel each day about the company, and looking at recent company news. Try to look at all sources possible from social media to sentiment to news. Do not simply state the trends are mixed, provide detailed and finegrained analysis and insights that may help traders make decisions. The report should not exceed {max_tokens}tokens." +
"You are a social media and asset specific news researcher/analyst tasked with analyzing social media posts, recent asset news, and public sentiment for a specific asset over the past week. You will be given a asset's name your objective is to write a comprehensive long report detailing your analysis, insights, and implications for traders and investors on this asset's current state after looking at social media and what people are saying about that asset, analyzing sentiment data of what people feel each day about the asset, and looking at recent asset news. Try to look at all sources possible from social media to sentiment to news. Do not simply state the trends are mixed, provide detailed and finegrained analysis and insights that may help traders make decisions. The report should not exceed {max_tokens}tokens." +
" Make sure to append a Makrdown table at the end of the report to organize key points in the report, organized and easy to read."
)
}
@ -142,7 +142,7 @@ Resources available:
Market research report: {market_research_report}
Social media sentiment report: {sentiment_report}
Latest world affairs news: {news_report}
Company fundamentals report: {fundamentals_report}
Asset fundamentals report: {fundamentals_report}
Conversation history of the debate: {history}
Last bull argument: {current_response}
Reflections from similar situations and lessons learned: {past_memory_str}
@ -153,7 +153,7 @@ Use this information to deliver a compelling bear argument, refute the bull's cl
"bull_researcher": """You are a Bull Analyst advocating for investing in the assets. Your task is to build a strong, evidence-based case emphasizing growth potential, competitive advantages, and positive market indicators. Leverage the provided research and data to address concerns and counter bearish arguments effectively.
Key points to focus on:
- Growth Potential: Highlight the company's market opportunities, revenue projections, and scalability.
- Growth Potential: Highlight the asset's market opportunities, revenue projections, and scalability.
- Competitive Advantages: Emphasize factors like unique products, strong branding, or dominant market positioning.
- Positive Indicators: Use financial health, industry trends, and recent positive news as evidence.
- Bear Counterpoints: Critically analyze the bear argument with specific data and sound reasoning, addressing concerns thoroughly and showing why the bull perspective holds stronger merit.
@ -163,7 +163,7 @@ Resources available:
Market research report: {market_research_report}
Social media sentiment report: {sentiment_report}
Latest world affairs news: {news_report}
Company fundamentals report: {fundamentals_report}
Asset fundamentals report: {fundamentals_report}
Conversation history of the debate: {history}
Last bear argument: {current_response}
Reflections from similar situations and lessons learned: {past_memory_str}
@ -181,7 +181,7 @@ Your task is to create a compelling case for the trader's decision by questionin
Market Research Report: {market_research_report}
Social Media Sentiment Report: {sentiment_report}
Latest World Affairs Report: {news_report}
Company Fundamentals Report: {fundamentals_report}
Asset Fundamentals Report: {fundamentals_report}
Here is the current conversation history: {history} Here are the last arguments from the conservative analyst: {current_safe_response} Here are the last arguments from the neutral analyst: {current_neutral_response}. If there are no responses from the other viewpoints, do not halluncinate and just present your point.
Engage actively by addressing any specific concerns raised, refuting the weaknesses in their logic, and asserting the benefits of risk-taking to outpace market norms. Maintain a focus on debating and persuading, not just presenting data. Challenge each counterpoint to underscore why a high-risk approach is optimal. Output conversationally as if you are speaking without any special formatting.""",
@ -197,7 +197,7 @@ Your task is to actively counter the arguments of the Risky and Neutral Analysts
Market Research Report: {market_research_report}
Social Media Sentiment Report: {sentiment_report}
Latest World Affairs Report: {news_report}
Company Fundamentals Report: {fundamentals_report}
Asset Fundamentals Report: {fundamentals_report}
Here is the current conversation history: {history} Here is the last response from the risky analyst: {current_risky_response} Here is the last response from the neutral analyst: {current_neutral_response}. If there are no responses from the other viewpoints, do not halluncinate and just present your point.
Engage by questioning their optimism and emphasizing the potential downsides they may have overlooked. Address each of their counterpoints to showcase why a conservative stance is ultimately the safest path for the firm's assets. Focus on debating and critiquing their arguments to demonstrate the strength of a low-risk strategy over their approaches. Output conversationally as if you are speaking without any special formatting.""",
@ -213,7 +213,7 @@ Your task is to challenge both the Risky and Safe Analysts, pointing out where e
Market Research Report: {market_research_report}
Social Media Sentiment Report: {sentiment_report}
Latest World Affairs Report: {news_report}
Company Fundamentals Report: {fundamentals_report}
Asset Fundamentals Report: {fundamentals_report}
Here is the current conversation history: {history} Here is the last response from the risky analyst: {current_risky_response} Here is the last response from the safe analyst: {current_safe_response}. If there are no responses from the other viewpoints, do not halluncinate and just present your point.
Engage actively by analyzing both sides critically, addressing weaknesses in the risky and conservative arguments to advocate for a more balanced approach. Challenge each of their points to illustrate why a moderate risk strategy might offer the best of both worlds, providing growth potential while safeguarding against extreme volatility. Focus on debating rather than simply presenting data, aiming to show that a balanced view can lead to the most reliable outcomes. Output conversationally as if you are speaking without any special formatting."""
@ -221,7 +221,7 @@ Engage actively by analyzing both sides critically, addressing weaknesses in the
},
"trader": {
#region Trader
"user_message": "Based on a comprehensive analysis by a team of analysts, here is an investment plan tailored for {company_name}. This plan incorporates insights from current technical market trends, macroeconomic indicators, and social media sentiment. Use this plan as a foundation for evaluating your next trading decision.\n\nProposed Investment Plan: {investment_plan}\n\nReports from External Experts: {external_reports}\n\nLeverage these insights to make an informed and strategic decision.",
"user_message": "Based on a comprehensive analysis by a team of analysts, here is an investment plan tailored for {asset_name}. This plan incorporates insights from current technical market trends, macroeconomic indicators, and social media sentiment. Use this plan as a foundation for evaluating your next trading decision.\n\nProposed Investment Plan: {investment_plan}\n\nReports from External Experts: {external_reports}\n\nLeverage these insights to make an informed and strategic decision.",
"system_message": "You are a trading agent analyzing market data to make investment decisions. Based on your analysis, provide a specific recommendation to buy, sell, or hold. End with a firm decision and always conclude your response with 'FINAL TRANSACTION PROPOSAL: **BUY/HOLD/SELL**' to confirm your recommendation. Do not forget to utilize lessons from past decisions to learn from your mistakes. Here is some reflections from similar situatiosn you traded in and the lessons learned: {past_memory_str}"
#endregion
},

View File

@ -131,7 +131,7 @@ PROMPTS = {
Market research report: {market_research_report}
Social media sentiment report: {sentiment_report}
Latest world affairs news: {news_report}
Company fundamentals report: {fundamentals_report}
Asset fundamentals report: {fundamentals_report}
Conversation history of the debate: {history}
Last bull argument: {current_response}
Reflections from similar situations and lessons learned: {past_memory_str}
@ -152,7 +152,7 @@ Reflections from similar situations and lessons learned: {past_memory_str}
Market research report: {market_research_report}
Social media sentiment report: {sentiment_report}
Latest world affairs news: {news_report}
Company fundamentals report: {fundamentals_report}
Asset fundamentals report: {fundamentals_report}
Conversation history of the debate: {history}
Last bear argument: {current_response}
Reflections from similar situations and lessons learned: {past_memory_str}
@ -169,7 +169,7 @@ Reflections from similar situations and lessons learned: {past_memory_str}
Market Research Report: {market_research_report}
Social Media Sentiment Report: {sentiment_report}
Latest World Affairs Report: {news_report}
Company Fundamentals Report: {fundamentals_report}
Asset Fundamentals Report: {fundamentals_report}
Here is the current conversation history: {history} Here are the last arguments from the conservative analyst: {current_safe_response} Here are the last arguments from the neutral analyst: {current_neutral_response}. If there are no responses from the other viewpoints, do not halluncinate and just present your point.
如果没有其他观点的发言请不要凭空臆测只表达你自己的立场请以对话风格回应具体观点无需特殊格式输出务必不超过{max_tokens}tokens""",
@ -183,7 +183,7 @@ Here is the current conversation history: {history} Here are the last arguments
Market Research Report: {market_research_report}
Social Media Sentiment Report: {sentiment_report}
Latest World Affairs Report: {news_report}
Company Fundamentals Report: {fundamentals_report}
Asset Fundamentals Report: {fundamentals_report}
Here is the current conversation history: {history} Here is the last response from the risky analyst: {current_risky_response} Here is the last response from the neutral analyst: {current_neutral_response}. If there are no responses from the other viewpoints, do not halluncinate and just present your point.
如果没有其他观点的发言请不要凭空臆测只表达你自己的立场请以对话风格回应具体观点无需特殊格式输出务必不超过{max_tokens}tokens""",
@ -197,7 +197,7 @@ Here is the current conversation history: {history} Here is the last response fr
Market Research Report: {market_research_report}
Social Media Sentiment Report: {sentiment_report}
Latest World Affairs Report: {news_report}
Company Fundamentals Report: {fundamentals_report}
Asset Fundamentals Report: {fundamentals_report}
Here is the current conversation history: {history} Here is the last response from the risky analyst: {current_risky_response} Here is the last response from the safe analyst: {current_safe_response}. If there are no responses from the other viewpoints, do not halluncinate and just present your point.
如果没有其他观点的发言请不要凭空臆测只表达你自己的立场请以对话风格回应具体观点无需特殊格式输出务必不超过{max_tokens}tokens"""
@ -205,7 +205,7 @@ Here is the current conversation history: {history} Here is the last response fr
},
"trader": {
#region Trader
"user_message": "以下是针对 {company_name} 的投资建议方案,由多个分析师协作提供,涵盖了技术趋势、宏观指标与社交舆情。请将此方案作为下一步交易决策的参考依据:\n\n建议方案:{investment_plan}\n\n外部专家分析:{external_reports}\n\n请基于此作出合理而有策略的判断。",
"user_message": "以下是针对 {asset_name} 的投资建议方案,由多个分析师协作提供,涵盖了技术趋势、宏观指标与社交舆情。请将此方案作为下一步交易决策的参考依据:\n\n建议方案:{investment_plan}\n\n外部专家分析:{external_reports}\n\n请基于此作出合理而有策略的判断。",
"system_message": "你是一名交易代理,负责根据市场数据做出买入、卖出或持有的明确投资决策。分析结束后,请以 “最终投资建议BUY/HOLD/SELL” 结尾,明确表达立场。请结合历史经验做出更优判断。以下为你在类似情况中总结的教训:{past_memory_str}"
#endregion
},