InTouch Hub · Blue Isle Software

Stocks Portfolio Watch

Iterates a portfolio of tickers and fires a per-ticker alert when any drops more than the configured percentage.

stocksmarketsfor-eachiteration

Stocks Portfolio Watch

Iterates over a portfolio of stock tickers and fires a per-ticker alert when any drops more than 5% intraday.

What it does

On each fire, the monitor uses the for_each: block to loop over a literal list of tickers. Per ticker:

  1. The check fires (stock-price tool with symbols: {{ticker}}).
  2. The when: arms evaluate against THAT ticker's outputs.
  3. If today's change is ≤ -5%, fire a notify; otherwise the else: arm matches.

So a 4-ticker portfolio + one bad mover produces one notification (not four, not zero). The loop variable {{ticker}} is interpolated both into the check args AND into the condition / notify body — same value in scope across all three.

Edit before installing

In monitor.yaml:

Bindings used per iteration

Tool used

stock-price — hub-installed YAML tool, queries Yahoo Finance. No API key required.

Pattern showcase

This is the literal for_each iteration pattern. The portfolio lives in the monitor's YAML, so to edit your watchlist you edit the file.

The alternative for_each.source: form (covered by the news-sentiment-check monitor) pulls the iteration list dynamically from a tool — useful when the "what to watch" list itself changes (e.g. a holdings query, an unresolved- incidents list).

Watch-out

Per-fire token usage: a 10-ticker portfolio = 10 separate stock-price tool calls each fire. For large portfolios, either lower the schedule cadence (daily instead of hourly) or pass all tickers in one call via the single-arm stock-price-watch monitor with symbols: AAPL,MSFT,NVDA,... and reference each price directly in the condition.