Loading...
Loading...
Update Margin Dashboard with Fidelity balance data and calculate margin-living strategy metrics. Monitors margin balance, interest costs, coverage ratios, and scaling thresholds. Triggers safety alerts for large draws and provides time-based scaling recommendations. Use when updating margin, balances, coverage ratio, or margin strategy analysis.
npx skill4agent add aojdevstudio/finance-guru margin-management.env.env.examplepython-dotenv.envFG_STRATEGY_START_DATEFG_MARGIN_INTEREST_RATEFG_MARGIN_INTEREST_RATE_DECIMALFG_MARGIN_JUMP_ALERT_THRESHOLDFG_CURRENT_MONTHLY_DRAWFG_MONTH6_DRAW_TARGETFG_MONTH12_DRAW_TARGETFG_MONTH18_DRAW_TARGETFG_BUSINESS_INCOME_MONTHLYFG_BUSINESS_INJECTION_REDFG_BUSINESS_INJECTION_CRITICALFG_PORTFOLIO_BASELINE_VALUEFG_MARGIN_BASELINE_BALANCEFG_DIVIDEND_MONTHLY_INCOMEnotebooks/updates/Balances_for_Account_{account_id}.csvBalance,Day change
Total account value,${FG_PORTFOLIO_BASELINE_VALUE_RAW},${FG_PORTFOLIO_DAY_CHANGE_RAW} → Portfolio Value
Margin buying power,${FG_MARGIN_BUYING_POWER_RAW},${FG_MARGIN_BUYING_POWER_DAY_CHANGE_RAW}
Net debit,${FG_MARGIN_BASELINE_BALANCE_RAW},${FG_MARGIN_DAY_CHANGE_RAW} → Margin Balance (abs value)
Margin interest accrued this month,${FG_MARGIN_INTEREST_ACCRUED_THIS_MONTH_RAW}, → Monthly Interest (actual)Previous: ${FG_MARGIN_BASELINE_BALANCE}
Current: ${FG_MARGIN_JUMP_EXAMPLE_CURRENT} (+${FG_MARGIN_JUMP_EXAMPLE_DIFF}) → 🚨 ALERT - Confirm intentional drawdate +"%Y-%m-%d"Date: ${FG_MARGIN_EXAMPLE_DATE}
Margin Balance: ${FG_MARGIN_BASELINE_BALANCE}
Interest Rate: ${FG_MARGIN_INTEREST_RATE}
Monthly Interest Cost: ${FG_MARGIN_MONTHLY_INTEREST_COST}
Notes: Month 1 - Building foundation, on track per strategyimport os
from datetime import datetime
months_elapsed = (current_date - datetime.fromisoformat(os.getenv("FG_STRATEGY_START_DATE"))).days // 30
if months_elapsed < 6:
note = f"Month {months_elapsed} - Building foundation, on track per strategy"
elif months_elapsed < 12:
note = f"Month {months_elapsed} - Approaching Month 6 milestone"
elif months_elapsed < 18:
note = f"Month {months_elapsed} - Approaching break-even milestone"
else:
note = f"Month {months_elapsed} - Mature strategy, monitor scaling"= Latest entry from Margin Dashboard
Example: ${FG_MARGIN_BASELINE_BALANCE}= Latest calculated cost
Example: ${FG_MARGIN_MONTHLY_INTEREST_COST}/month= Monthly Interest Cost × 12
Example: ${FG_MARGIN_MONTHLY_INTEREST_COST} × 12 = ${FG_MARGIN_ANNUAL_INTEREST_COST}/year= Pull from Dividend Tracker "TOTAL EXPECTED DIVIDENDS"
Example: ${FG_DIVIDEND_MONTHLY_INCOME}/month= Dividend Income ÷ Monthly Interest Cost
Formula: =IFERROR(Dividends / Interest, 0)
Example: ${FG_DIVIDEND_MONTHLY_INCOME} ÷ ${FG_MARGIN_MONTHLY_INTEREST_COST} = ${FG_DIVIDEND_COVERAGE_RATIO} 🟢Before: =B10 / B11 (causes #DIV/0! when margin = 0)
After: =IFERROR(B10 / B11, 0) (returns 0 when no margin)= Total account value ÷ Margin Balance
Example: ${FG_PORTFOLIO_BASELINE_VALUE} ÷ ${FG_MARGIN_BASELINE_BALANCE} = ${FG_PORTFOLIO_MARGIN_RATIO} 🟢🟢🟢Current monthly draw: ${FG_CURRENT_MONTHLY_DRAW} (fixed expenses only)
Target: Start with ${FG_CURRENT_MONTHLY_DRAW}, scale to ${FG_MONTH6_DRAW_TARGET}, ${FG_MONTH12_DRAW_TARGET}, ${FG_MONTH18_DRAW_TARGET} based on dataimport os
from datetime import datetime
start = datetime.fromisoformat(os.getenv("FG_STRATEGY_START_DATE"))
current = datetime.now()
months_elapsed = (current - start).days // 30📊 MONTH 6 MILESTONE CHECK:
✅ Dividends: ${FG_DIVIDEND_MONTHLY_INCOME}/month (need ${FG_MONTH6_DIVIDEND_MINIMUM})
✅ Portfolio-to-Margin Ratio: ${FG_PORTFOLIO_MARGIN_RATIO} (need 4:1+)
✅ Dividend Growth: On track
🎯 RECOMMENDATION: Scale margin draw to ${FG_MONTH6_DRAW_TARGET}/month (add mortgage)
- Current: ${FG_CURRENT_MONTHLY_DRAW} (fixed expenses only)
- New: ${FG_MONTH6_DRAW_TARGET} (fixed + mortgage)
- Safety margin: Excellent📊 MONTH 12 BREAK-EVEN CHECK:
Expected Dividends: ${FG_MONTH12_DIVIDEND_TARGET}/month (goal: break-even with margin interest)
✅ IF achieved: Consider scaling to ${FG_MONTH12_DRAW_TARGET}/month (add some variable expenses)
⚠️ IF not: Hold at ${FG_MONTH6_DRAW_TARGET}, assess strategy📊 MONTH 18 MATURE STRATEGY CHECK:
Expected Dividends: ${FG_MONTH18_DIVIDEND_TARGET}/month
Expected Margin: Declining (dividends paying down debt)
✅ IF achieved: Consider scaling to ${FG_MONTH18_DRAW_TARGET}/month (most variable expenses)
⚠️ IF not: Hold current level, reassess timeline✅ Ratio > 4:1 AND dividends covering interest
Status: On track, continue per strategy⚠️ Ratio 3.5-4:1 OR dividend coverage declining
Action: Pause scaling, monitor weekly🚨 Ratio < 3:1 OR dividend cuts detected
Action: STOP draws, inject ${FG_BUSINESS_INJECTION_RED} business income⛔ Ratio < 2.5:1 OR margin call risk
Action: STOP draws, inject ${FG_BUSINESS_INJECTION_CRITICAL} business income, consider selling hedge (SQQQ)Portfolio Value: ${FG_PORTFOLIO_BASELINE_VALUE}
Margin Balance: ${FG_MARGIN_BASELINE_BALANCE}
Ratio: ${FG_PORTFOLIO_MARGIN_RATIO} 🟢🟢🟢
Monthly Interest: ${FG_MARGIN_MONTHLY_INTEREST_COST}
Dividend Income: ${FG_DIVIDEND_MONTHLY_INCOME}
Coverage: ${FG_DIVIDEND_COVERAGE_RATIO} 🟢
Status: Excellent - building foundationPortfolio Value: ${FG_MONTH6_PROJECTED_PORTFOLIO} (projected with W2 contributions)
Margin Balance: ${FG_MONTH6_PROJECTED_MARGIN} (scaled to ${FG_MONTH6_DRAW_TARGET}/month draw)
Ratio: ${FG_MONTH6_PROJECTED_RATIO} 🟢
Monthly Interest: ${FG_MONTH6_PROJECTED_MONTHLY_INTEREST}
Dividend Income: ${FG_CURRENT_MONTHLY_DRAW} (projected)
Coverage: ${FG_MONTH6_PROJECTED_COVERAGE} 🟢
Status: Healthy - on track for break-evenPortfolio Value: ${FG_MONTH15_PROJECTED_PORTFOLIO}
Margin Balance: ${FG_MONTH15_PROJECTED_MARGIN} (scaled to ${FG_MONTH12_DRAW_TARGET}/month draw)
Ratio: ${FG_MONTH15_PROJECTED_RATIO} 🟢
Monthly Interest: ${FG_MONTH15_PROJECTED_MONTHLY_INTEREST}
Dividend Income: ${FG_MONTH15_PROJECTED_DIVIDEND_INCOME}
Coverage: ${FG_MONTH15_PROJECTED_COVERAGE} 🟢
Status: Break-even achieved, dividends > interestfin-guru/data/user-profile.yamlgoogle_sheets.portfolio_tracker.spreadsheet_id// STEP 1: Read Spreadsheet ID from user profile
// Load fin-guru/data/user-profile.yaml
// Extract: google_sheets.portfolio_tracker.spreadsheet_id
// STEP 2: Read Margin Dashboard
mcp__gdrive__sheets(
operation: "spreadsheets.values.get",
params: {
spreadsheetId: SPREADSHEET_ID, // from user-profile.yaml
range: "Margin Dashboard!A2:E50"
}
)
// STEP 3: Add new margin entry
mcp__gdrive__sheets(
operation: "spreadsheets.values.update",
params: {
spreadsheetId: SPREADSHEET_ID, // from user-profile.yaml
range: "Margin Dashboard!A2:E2",
valueInputOption: "USER_ENTERED",
requestBody: {
values: [[date, balance, rate, monthly_cost, notes]]
}
}
)fin-guru-private/fin-guru/strategies/active/margin-living-master-strategy.mdfin-guru-private/fin-guru/strategies/active/portfolio-master-strategy.mdfin-guru/data/user-profile.yamlfin-guru/data/spreadsheet-architecture.mdnotebooks/updates/date