change profile analyst prompt
This commit is contained in:
parent
3798bf0b1f
commit
2a6fde7d0c
|
|
@ -11,14 +11,19 @@ def create_profile_analyst(llm):
|
|||
ticker = state["ticker_of_interest"]
|
||||
|
||||
tools = [
|
||||
get_news,
|
||||
get_global_news,
|
||||
# get_news,
|
||||
# get_global_news,
|
||||
]
|
||||
|
||||
system_message = (
|
||||
"You are a news researcher tasked with analyzing recent news and trends over the past week. Please write a comprehensive report of the current state of the world that is relevant for trading and macroeconomics. Use the available tools: get_news(query, start_date, end_date) for crypto-specific or targeted news searches, and get_global_news(curr_date, look_back_days, limit) for broader macroeconomic news. Do not simply state the trends are mixed, provide detailed and finegrained analysis and insights that may help traders make decisions."
|
||||
+ """ 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."""
|
||||
)
|
||||
system_message = """You are a Profile and Portfolio Analyst tasked with providing a deep-dive assessment of the user's personal trading account and financial health. Your role is to bridge the gap between market opportunities and the user's actual capacity to trade. Your objective is to write a comprehensive report detailing the user's buying power, asset allocation, risk exposure, and active market participation.
|
||||
|
||||
Use the available tools:
|
||||
- `get_account_balance`: To determine total equity, available free margin for new trades, and locked capital.
|
||||
- `get_portfolio_holdings`: To analyze current asset distribution, sector concentration (e.g., heavy on DeFi vs. Layer 1s), and unrealized PnL.
|
||||
- `get_open_orders`: To identify capital tied up in pending limit orders or stop-losses that may need adjustment.
|
||||
- `get_trade_history`: To review recent trading performance and identify behavioral patterns (e.g., panic selling or FOMO buying).
|
||||
|
||||
Do not simply list the user's balances or holdings. You must provide detailed and finegrained analysis and insights. For instance, warn the user if they are overexposed to a single volatile asset, point out if they have too many "stale" open orders locking up funds that could be used elsewhere, or analyze if their current cash position allows for aggressive or conservative moves based on the market conditions. Your report should serve as a risk management check before any new trades are executed. Make sure to append a Markdown table at the end of the report to organize key portfolio metrics (Total Equity, Free Margin, Top Holdings, Risk Level) and actionable recommendations, organized and easy to read."""
|
||||
|
||||
prompt = ChatPromptTemplate.from_messages(
|
||||
[
|
||||
|
|
|
|||
|
|
@ -0,0 +1,61 @@
|
|||
from langchain_core.tools import tool
|
||||
from typing import Annotated
|
||||
from tradingagents.dataflows.interface import route_to_vendor
|
||||
|
||||
@tool
|
||||
def get_account_balance(
|
||||
curr_date: Annotated[str, "Current date in yyyy-mm-dd format"],
|
||||
) -> str:
|
||||
"""
|
||||
Retrieve the user's account balance information.
|
||||
Uses the configured profile_data vendor.
|
||||
Args:
|
||||
curr_date (str): Current date in yyyy-mm-dd format
|
||||
Returns:
|
||||
str: A report of the user's account balance
|
||||
"""
|
||||
return route_to_vendor("get_account_balance", curr_date)
|
||||
|
||||
@tool
|
||||
def get_portfolio_holdings(
|
||||
curr_date: Annotated[str, "Current date in yyyy-mm-dd format"],
|
||||
) -> str:
|
||||
"""
|
||||
Retrieve the user's portfolio holdings information.
|
||||
Uses the configured profile_data vendor.
|
||||
Args:
|
||||
curr_date (str): Current date in yyyy-mm-dd format
|
||||
Returns:
|
||||
str: A report of the user's portfolio holdings
|
||||
"""
|
||||
return route_to_vendor("get_portfolio_holdings", curr_date)
|
||||
|
||||
@tool
|
||||
def get_open_orders(
|
||||
curr_date: Annotated[str, "Current date in yyyy-mm-dd format"],
|
||||
) -> str:
|
||||
"""
|
||||
Retrieve the user's open orders information.
|
||||
Uses the configured profile_data vendor.
|
||||
Args:
|
||||
curr_date (str): Current date in yyyy-mm-dd format
|
||||
Returns:
|
||||
str: A report of the user's open orders
|
||||
"""
|
||||
return route_to_vendor("get_open_orders", curr_date)
|
||||
|
||||
@tool
|
||||
def get_trade_history(
|
||||
curr_date: Annotated[str, "Current date in yyyy-mm-dd format"],
|
||||
look_back_days: Annotated[int, "Number of days to look back"] = 30,
|
||||
) -> str:
|
||||
"""
|
||||
Retrieve the user's trade history information.
|
||||
Uses the configured profile_data vendor.
|
||||
Args:
|
||||
curr_date (str): Current date in yyyy-mm-dd format
|
||||
look_back_days (int): Number of days to look back (default 30)
|
||||
Returns:
|
||||
str: A report of the user's trade history
|
||||
"""
|
||||
return route_to_vendor("get_trade_history", curr_date, look_back_days)
|
||||
Loading…
Reference in New Issue