Weekly Investor Sentiment AI Trading Bot¶
Every week, prominent fund managers, macro strategists, and market commentators share their highest-conviction ideas across financial news, public letters, podcasts, and YouTube/social channels. This bot runs a weekly LumiBot research agent over open web, news, and social/YouTube sources out of the box, with an optional vidIQ MCP plug-in for deeper YouTube transcript analysis, and hands four to eight diversified stock or ETF picks to a trading agent.
View or Run on BotSpot Marketplace
Explore live AI trading bots, cloud backtests, and one-click broker connections on BotSpot Marketplace without local setup.
How it works¶
This strategy runs on a weekly cadence (Mondays, or immediately on first launch) using two specialized agents:
Research agent scans weekly investor sentiment across financial news, web articles, letters, podcasts, and YouTube or social trends covering investors such as Ray Dalio, Bill Ackman, Stan Druckenmiller, Chris Camillo, Peter Thiel, Paul Tudor Jones, David Einhorn, Howard Marks, Warren Buffett, and David Tepper. Set
use_vidiq_mcp=Trueto optionally plug in the remote vidIQ MCP server via LumiBot’s built-inMCPServerclient for extra YouTube search and transcript coverage. It returns four to eight concrete stock or ETF ideas with dates and theses.Trading agent builds a diversified portfolio of four to eight holdings mirroring those verified ideas, investing roughly 95% of available equity with at most 25% in any single ticker. When weekly investor sentiment shifts, it sells outdated holdings first, never shorts, and never exceeds available cash.
Want to follow a different list of investors, industry podcasts, or sector experts? Edit the names directly in the researcher’s prompt.
Run it on BotSpot¶
Explore AI strategies and run bots in the cloud on BotSpot Marketplace. BotSpot hosts LumiBot strategies, tracks backtests, and links your broker account without local server maintenance.
Using Claude, ChatGPT, Codex, or Cursor to customize this bot? Connect the free BotSpot MCP for LumiBot strategy skills and cloud backtesting. Want structured guidance on connecting external MCP servers and live trading bots? Check out BotSpot Courses or join the free AI Trading Challenge.
The code¶
The full strategy fits in under 100 lines of Python, runs out of the box with built-in web and news research, and shows how cleanly an optional remote MCP server (such as vidIQ) plugs in via MCPServer.
"""Weekly Investor Sentiment & Top-Investor Views AI Trading Bot.
Once a week, a research agent scans broad investor sentiment across financial
news, web interviews, shareholder letters, and YouTube/social trends covering
prominent investors (Ray Dalio, Bill Ackman, Stan Druckenmiller, Chris Camillo,
Peter Thiel, Paul Tudor Jones, David Einhorn, Howard Marks, Warren Buffett, and
David Tepper). An optional vidIQ MCP plug-in (``use_vidiq_mcp=True``) adds
deeper YouTube search and transcript lookups. A trading agent then mirrors the
highest-conviction ideas across 4 to 8 diversified stocks or ETFs.
"""
from lumibot.components.agents import MCPServer
from lumibot.strategies import Strategy
class WeeklyInvestorViewsVidIQStrategy(Strategy):
parameters = {
"model": "openai/gpt-6-luna",
"use_vidiq_mcp": False,
}
def initialize(self):
self.sleeptime = "1D"
model = self.parameters["model"]
mcp_servers = []
if self.parameters.get("use_vidiq_mcp"):
mcp_servers.append(
MCPServer(
name="vidiq",
transport="streamable_http",
url="https://mcp.vidiq.com/mcp",
auth_token_env="VIDIQ_API_KEY",
exposed_tools=["vidiq_balance", "vidiq_youtube_search", "vidiq_video_transcript"],
)
)
self.agents.create(
name="researcher",
model=model,
allow_trading=False,
allow_network=True,
mcp_servers=mcp_servers,
system_prompt=(
"Research weekly investor sentiment from the last 30 days (published before today) "
"across financial news, web articles, investor letters, podcasts, and YouTube or "
"social trends featuring top investors: Ray Dalio, Bill Ackman, Stan Druckenmiller, "
"Chris Camillo, Peter Thiel, Paul Tudor Jones, David Einhorn, Howard Marks, Warren "
"Buffett, and David Tepper. When optional vidIQ YouTube access is connected, use it "
"for recent interview transcripts too. Return 4 to 8 diversified stock or ETF ideas "
"with who said it, the publication date, the sentiment direction, and the thesis. "
"Use only sources published before today. Do not trade."
),
)
self.agents.create(
name="trader",
model=model,
allow_trading=True,
system_prompt=(
"Build a diversified portfolio mirroring the highest-conviction investable ideas "
"from the weekly investor sentiment research (stocks, ETFs, or leveraged ETFs only "
"when an investor explicitly favors that exposure). Invest about 95% of available "
"equity across 4 to 8 holdings with at most 25% per ticker, selling outdated "
"holdings first when weekly views shift. Size orders from current market prices, "
"never short, and never exceed available cash."
),
)
def on_trading_iteration(self):
now = self.get_datetime()
week_key = f"{now.isocalendar().year}-W{now.isocalendar().week:02d}"
if self.vars.get("last_week_key") == week_key:
return
# Run on Mondays, or immediately on first launch before any weekly rebalance has run.
if now.weekday() != 0 and self.vars.get("last_week_key") is not None:
return
research = self.agents["researcher"].run(
task_prompt="Research weekly investor sentiment across web, news, and YouTube or social trends.",
context={"previous_research": self.vars.get("last_research", "none yet")},
)
self.vars.set("last_research", research.summary)
self.agents["trader"].run(
task_prompt="Rebalance the portfolio to mirror this week's top investor sentiment ideas.",
context={"research": research.summary},
)
self.vars.set("last_week_key", week_key)
if __name__ == "__main__":
from lumibot.credentials import IS_BACKTESTING
if IS_BACKTESTING:
from lumibot.backtesting import YahooDataBacktesting
WeeklyInvestorViewsVidIQStrategy.backtest(YahooDataBacktesting)
else:
WeeklyInvestorViewsVidIQStrategy().run_live()
Run it yourself¶
pip install lumibot
python -m lumibot.example_strategies.ai_weekly_investor_views_vidiq
Set OPENAI_API_KEY and your broker credentials (for example ALPACA_API_KEY, ALPACA_API_SECRET, and ALPACA_IS_PAPER=true) in your .env file. To enable the optional vidIQ YouTube MCP plug-in, also set VIDIQ_API_KEY and pass parameters={"use_vidiq_mcp": True}. To run locally with a ChatGPT subscription instead of an OpenAI API key, follow Use your ChatGPT subscription and change model to chatgpt/gpt-6-luna.
With IS_BACKTESTING=true, the script runs a historical backtest on Yahoo Finance daily data over BACKTESTING_START and BACKTESTING_END. With IS_BACKTESTING=false, the same strategy runs live with your configured broker.
Good to know¶
No third-party MCP key is required by default; built-in web and news research works immediately, and vidIQ MCP is an opt-in plug-in for deeper YouTube transcript analysis.
Weekly gating via
self.varsensures the agents run once per ISO week rather than re-querying web and social sources every single trading day.In historical backtests, the research agent filters strictly to sources published before the simulated date, and web/MCP search availability for older material depends on what each source returns.
This example is inspired by public commentary and is not affiliated with or endorsed by any named investor or vidIQ. Backtest results do not guarantee future performance.
See AI Trading Bot Examples for more AI trading bots and Backtest, paper, or live: choose the runner for backtest and live runners.