- Virtual Environment: Created and activated
- Dependencies: Installed (anthropic, yfinance, pandas, numpy, pyyaml)
- Watchlists: 3 pre-configured (vantage_portfolio, ai_verticals, energy_ai)
- Agents: Ready (watchlist_watcher.py, test_harness.py)
- Configuration: VIF framework config ready (config/vif_config.yml)
cd c:/Users/marti/vif-trading-system
source venv/Scripts/activate # Windows
# source venv/bin/activate # Linux/Macpython agents/test_harness.pyOutput: Mock VIF analysis showing the system structure. Results saved to reports/test_analysis.json.
First, add credits to your Anthropic account:
- Go to https://console.anthropic.com/account/billing/overview
- Purchase credits (even $5 allows hundreds of analyses)
Then run:
python agents/watchlist_watcher.py --watchlist energy_ai
python agents/watchlist_watcher.py --watchlist ai_verticals
python agents/watchlist_watcher.py --watchlist vantage_portfoliopython agents/watchlist_watcher.py --all1. Watchlist Parser (watchlist_watcher.py)
- Loads
.txtfiles fromwatchlists/directory - Cleans and deduplicates tickers
- Strips exchange prefixes (NASDAQ:, NYSE:, etc.)
2. Data Fetcher (watchlist_watcher.py)
- Fetches OHLCV data from Yahoo Finance
- Computes RSI, MA, volume indicators
- Caches locally to reduce API calls
- Falls back to mock data if API unavailable
3. VIF Analyst (Claude API)
- Analyzes market data with VIF framework
- Outputs BUY/SELL/HOLD signals with confidence
- Identifies gamma regime, structural levels, kill switches
- Returns JSON with full reasoning
vif-trading-system/
├── agents/
│ ├── watchlist_watcher.py # Main agent (live data + Claude)
│ └── test_harness.py # Local test (no API needed)
├── watchlists/
│ ├── vantage_portfolio.txt # 85+ mixed holdings
│ ├── ai_verticals.txt # 35+ AI/semiconductor
│ └── energy_ai.txt # 13 energy+AI tickers
├── config/
│ └── vif_config.yml # VIF parameters & kill switches
├── reports/
│ └── analysis_*.json # Output reports (auto-generated)
├── data/
│ └── *.pkl # Cached market data (auto-generated)
├── .env # Your API key (KEEP SECRET)
├── .env.example # Template (safe to share)
└── venv/ # Python virtual environment
Edit config/vif_config.yml to customize:
VIF Thresholds:
vif_framework:
gamma_regime:
positive_threshold: 0.5 # Adjust gamma detection sensitivity
negative_threshold: -0.5
structural_levels:
lookback_days: 20 # Historical window for support/resistance
volume:
ma_period: 20 # Moving average period
strong_threshold: 1.5 # 1.5x average = strong volumeKill Switches (override conditions):
kill_switches:
k1: "Extreme Volatility (RSI > 80 or < 20)"
k2: "Gap Risk (5-day range > 10%)"
k3: "Low Liquidity (Volume < 1M)"
k4: "News Risk (earnings within 5 days)"
k5: "Correlation Risk (>0.8 with index)"
k6: "Technical Breakdown (close below MA)"Data Fetching:
data_fetching:
batch_size: 15 # Tickers per Claude call (token control)
period_default: "5d" # Data lookback: 1d, 5d, 1mo, etc.
cache_ttl_hours: 24 # Cache expirationPer Watchlist Analysis:
- Input: ~500 tokens (market data summary)
- Output: ~1000 tokens (JSON signals)
- Total: ~1,500 tokens per watchlist
Pricing (Claude Opus 4.7):
- Input: $5 per 1M tokens
- Output: $25 per 1M tokens
- Cost per watchlist: ~$0.02-0.03
Usage Examples:
- Daily (3 watchlists): 45,000 tokens = $0.40/day
- 50 days of daily analysis: $20 budget
Solution: Add credits at https://console.anthropic.com/account/billing/overview
Solution: Yahoo Finance may not have data. Use test_harness.py instead or check ticker symbol.
Solution:
source venv/Scripts/activate
pip install anthropicSolution: Already fixed in test_harness.py. Update your script.
- Add Anthropic API Credits → https://console.anthropic.com/account/billing/overview
- Run Test:
python agents/test_harness.py(verify system works) - Run Live:
python agents/watchlist_watcher.py --watchlist energy_ai - Schedule: Set up daily cron/scheduler for automated analysis
- Integrate: Export to Slack, email, or dashboard of choice
- Export from TradingView Desktop as
.txt - Place in
watchlists/directory - Run:
python agents/watchlist_watcher.py --watchlist mylist
Edit config/vif_config.yml thresholds, then re-run analysis.
python agents/watchlist_watcher.py --watchlist energy_ai --period 1mo