Market data & brokerage
MFICore can read live market data and your brokerage account inside a workflow — quotes, positions, order history, whether the market is open — and it can place and cancel orders. An LLM node can summarize or analyze the data in between, and a notification node can tell you what happened.
Read this section before you enable anything. Order placement is real. A workflow that places orders will keep doing so on its schedule, whether or not you are watching, and whether or not its reasoning is any good. Everything below is built on the assumption that you will start on paper, watch it for a while, and only then consider real money.
MFICore does not decide what to trade. It runs the rules and prompts you write. Nothing here is financial advice, and no part of this system knows whether your strategy is sound.
What you can build today
- A morning briefing: your positions and how they moved overnight, summarized by the LLM and sent to your mailbox and phone (see Workflow notifications), or emailed to you.
- A watchlist report: quotes for a list of symbols on a schedule.
- A fill log: your recent orders written to a datastore table so you can chart activity over time.
- An alert: a condition on a price or a position's unrealized gain that sends you a message.
- A trade: rules or an LLM prompt that decide what to buy or sell, with server-enforced limits on how much. Start this in dry run — see Placing orders safely below.
Whatever you build, turn on Notify me if a run fails in the workflow's settings — otherwise a scheduled report that quietly starts failing just stops arriving, which is easy to mistake for "no news".
The quickest way to start
Rather than building this from scratch, import the Trading starter: a site dashboard → Import / Export → Start from a template. It brings a watchlist, a strategy table, a trade journal, an approval queue, eleven ready-made workflows, and its own Trading dashboard page with a per-symbol drill-down.
Nothing it imports can trade until you deliberately turn it on. Every workflow arrives switched off, every order step arrives in dry-run mode, and none of them are connected to your brokerage account yet.
Every step in every workflow reads one setting — the tradingAccount variable — rather than
naming your brokerage account individually. So connecting the whole thing is one edit, not dozens
spread across eleven workflows:
- Save your brokerage account under Account → Connectors, if you haven't yet.
- Open Automation → Variables, find
tradingAccount, and pick that account.
The checklist shown after importing links to both. Switching from paper to live later — or to a different account entirely — is that same single edit.
Then, in order:
- Add your watchlist symbols in the Datastore panel and enable the ones you want considered.
- Read the strategy prompt in the
strategy_configtable and edit it to suit you. It lives there rather than inside a workflow so you can tune it without opening the builder. - Enable the Account snapshot workflow. It only reads, and it is what fills in your Trading page.
- Enable the Morning briefing workflow next. It only reads and reports.
- Leave everything else off until the briefing has been giving you sensible output for a while.
That checklist stays on the import screen rather than on the Trading page, so the dashboard is a dashboard rather than a set of instructions you have already followed.
What each workflow is for
Eleven sounds like a lot. Two of them are subflows — Gather market context and Journal an order — which never run on their own; the others call them so the same research and the same journal entry aren't written out several times over. Of the rest, four only read (Morning briefing, Account snapshot, Position review, Fundamentals refresh), two propose without ordering (Propose trades, Position review), two do the bookkeeping (Watch open orders, Reconcile fills), and only two can ever place an order: Execute approved trades, which needs you to tick something first, and Autonomous paper trader, which does not — which is why it says paper on the tin.
Connecting an account
MFICore supports Alpaca. Add it on the main dashboard under Connectors, choosing Brokerage (Alpaca).
- In Alpaca, generate an API key pair. Note whether it is a paper or live key — they are separate and not interchangeable.
- In MFICore, enter a name, the API key id, and the API secret.
- Leave Paper trading ticked unless you specifically want to read your live account.
- Press Test connection. A successful test tells you which environment the credentials reached, so a mismatch is caught immediately rather than showing up as a confusing error inside a workflow.
Your API secret is stored write-only. It is never returned to the browser, and editing the account later leaves the secret field blank — leaving it blank keeps the stored value.
Paper and live
Paper trading uses Alpaca's simulated environment. It is the default, and it is the right choice while you are building and testing anything.
Saving an account as live requires ticking an explicit acknowledgement — a workflow using a live account can place real orders. Switching an account back to paper clears that acknowledgement, so going live again is always a fresh, deliberate act rather than something inherited from an earlier edit.
The environment is chosen from this account setting on the server. A workflow can never override it, which is why a mis-set toggle shows up as a failed connection test rather than as an order in the wrong account.
Trading guardrails
The connector carries the limits every order is checked against. They live on the account, not on a workflow, so no workflow — and no LLM writing into one — can raise them. Set them before you enable anything.
Max per order — the largest single order allowed. This starts at 0, and 0 refuses every order. That is deliberate: an unset limit should not mean "unlimited". You must set this before any order can be placed.
Max per symbol — a ceiling on how much of one symbol you can hold. Counts what you already hold, so a series of small buys cannot creep past it.
Max total exposure — a ceiling on everything held at once.
Max orders per day — counted at the broker, so it survives restarts and is not fooled by a workflow being re-run.
Symbol allowlist — if set, only these tickers can be traded. This is your protection against a typo or an invented ticker, and it is the single most useful setting here.
Trading enabled — the kill switch. Turning it off refuses all new orders immediately. Cancelling still works, deliberately: turning off trading should never strand orders you can no longer pull.
Block pattern day trades — on by default. Under $25,000 equity, more than three day trades in five business days gets your brokerage account restricted. With this on, MFICore stops opening new positions when your account is at risk of that. It never blocks a sell — being unable to exit is worse.
Be aware of the limit here: Alpaca does not tell us how many day trades you have used. MFICore can see that your broker has already classified you as a pattern day trader, and it acts on that, but it cannot count trades toward the limit for you. Your broker enforces the rule regardless and will reject an offending order — so you are not unprotected, but do not treat this setting as a complete safeguard.
Allow short selling — off by default. With it off, a sell can never exceed what you hold.
The workflow nodes
Add these from the Automation → Workflows builder in a site dashboard. Each one needs you to pick a saved brokerage account.
Market quote fetches the latest price for one or more symbols, and optionally recent bars. It
returns a list of quotes, each with a price, bid, ask, previous close, and an asOf timestamp.
Portfolio & positions returns your equity, cash, buying power, day-trade count, and every open position with its quantity, average entry price, market value, and unrealized gain or loss.
Broker orders lists your orders, or fetches one by id. It defaults to showing all orders, including rejected and cancelled ones, which is what you want when reconciling what actually happened.
Market news fetches recent headlines for symbols, using the same brokerage account — no extra setup. Full article text is off by default, because article bodies are long and crowd out everything else when passed to the LLM.
SEC filings looks up a US company's official filings with the SEC. It is free and needs no account. By default it returns the reported figures — revenue, net income, assets and so on — as numbers, rather than filing documents. A 10-K runs to hundreds of pages and simply will not fit in a prompt; the numbers will, and they are what the model can actually use.
Market clock tells you whether the market is open and when it next opens or closes. Put this at the front of any scheduled workflow and branch on it — a cron schedule fires on the clock and knows nothing about weekends or market holidays, so without this guard a holiday run will do work against a closed market.
Place order submits an order. This is the one node that spends money — see below.
Cancel order cancels an open order by id, typically one from an earlier order node.
A workflow can only use brokerage accounts owned by the site owner. This is what lets someone edit a site's workflows and use the owner's saved accounts without ever seeing the credentials.
Placing orders safely
Start with dry run. The Place order node has a Dry run switch that is on by default. With it on, the node works out exactly what it would send, checks it against every guardrail, records it in the run history — and stops there. Nothing reaches the broker.
Leave it on for a while. Read the runs. You are checking whether the orders it would have placed look like orders you would have placed. This costs nothing and is the only way to find out that a prompt does something silly in a situation you did not think of.
Then paper, then think hard about live. Turning off dry run on a paper account places simulated orders — real mechanics, fake money. Only after that behaves well for a meaningful stretch is a live account worth considering.
Use stop losses. The Place order node can attach a take-profit and a stop-loss to an order (a "bracket"). For anything running unattended this matters: without a stop, nothing closes a losing position for you. A workflow that only knows how to buy will happily keep buying.
What happens if a run crashes mid-order. Every order carries an id derived from the run and the node that placed it. If a run dies after the broker accepted an order and MFICore retries it, the retry sends the same id and the broker rejects the duplicate. You do not get two orders.
Scheduled workflows do not overlap. If a workflow is still running when its schedule fires again, the tick is skipped and noted in the log rather than starting a second copy. Two copies running at once would place two sets of orders, and the duplicate protection above does not cover that case — it only covers retries of the same run.
A rejected order is not a quiet one. The starter's Watch open orders workflow reads the broker
every quarter hour while the market is open and reacts to what each order actually did. A rejection —
usually a guardrail doing its job, an order over your cap, a symbol outside your allowlist, or not
enough buying power — marks the proposal it came from and sends you a message saying so. An order
still sitting unfilled after stale_order_minutes (a row in strategy_config, 45 by default) is
cancelled; clear that setting to zero if you would rather leave orders resting.
Your Trading page
The bundle brings a Trading page with it, at /trading on your site. It shows:
- Your equity, cash, buying power, and whether the market is open.
- An equity curve over time.
- Everything waiting on a decision from you, and the approval form itself.
- Every open position with its unrealised gain or loss.
- A link per watchlist symbol, opening that symbol's own page.
- Recent orders, and how past proposals turned out.
Everything on it comes from your own datastore, filled in by the Account snapshot workflow every five minutes while the market is open. That is why that workflow has to be enabled for the page to show anything, and why the numbers can be a few minutes behind the broker.
Proposals wait for you. The approval list is your site's live queue of everything proposed and not yet acted on — entries from Propose trades and suggested exits from Position review alike. It is the same list whether you open it from a notification, from this page, or a week later, and nothing on it expires. Ticking an item approves that specific proposal, so two proposals for the same ticker stay separate decisions.
Each symbol has its own page. The By symbol links open /trading-symbol filtered to one
ticker: its position value over time, its orders, and a timeline running from what the model proposed,
through what was ordered, to what the broker did with it. Opening that page without choosing a symbol
shows the whole account instead.
The page is only visible to signed-in users — it shows your account balance and positions, so it is deliberately not a public web page. You will need to be signed in to MFICore in the same browser to open it. It also doesn't appear in your site's menu or sitemap.
If your site uses your own domain rather than a
.sites.subdomain, a signed-in-only page can't work there yet — visitors on a custom domain have no way to carry an MFICore sign-in. Keep the trading bundle on a platform subdomain for now.
Since the page is an ordinary page, you can edit it: add notes, remove panels you don't look at, or build a different view entirely from the same data in Content → Pages.
If something goes wrong
Go to Account → Connectors, edit your brokerage account, and untick Trading enabled. That refuses every new order immediately, across every workflow and every site using that account, without you having to find and disable each one.
It then asks whether to also cancel orders already resting at the broker. That is a separate choice on purpose: if one of those resting orders is a protective stop-loss, cancelling it would leave the position more exposed, not less. Stopping alone is always safe; cancelling is a judgement call about what is currently resting.
Cancelling keeps working while trading is stopped, so you can always pull orders afterwards.
Then turn on Notify me if a run fails on your trading workflows if you have not already — see Workflow notifications. A trading workflow that fails silently is the one that will cost you.
Two things worth knowing
Free market data is delayed. Alpaca's free tier covers a single exchange and is partially delayed.
That is fine for a daily briefing and wrong for anything time-sensitive. Every quote comes back with
an asOf timestamp — pass it into your LLM prompt and store it with anything you journal, so you can
always tell how old the data behind a conclusion was.
An LLM will sound confident about noise. Given prices and headlines, a model will produce a fluent, decisive-sounding rationale whether or not there is any real signal in the data. Treat its output as a summary to read, not a conclusion to act on. Running a read-only briefing for a while is a good way to judge the quality of what it produces before you rely on it for anything.
Headlines are the weakest of the three sources. Anything carried by a free news feed has already been read by everyone else and is reflected in the price. Company filings are slower but more solid; prices are factual but delayed. None of them tell you what will happen next.
A note for administrators
The SEC filings node needs a contact address configured on the server
(MFICORE_SEC_CONTACT, for example MFICore ops@example.com). The SEC requires callers to identify
themselves and blocks anonymous requests, so the node refuses to run until this is set. It is a
server-wide setting rather than a per-workflow one because getting it wrong can get the whole
installation blocked, not just one workflow.
Rate limits
Alpaca allows roughly 200 requests per minute. If you loop over a long watchlist with high concurrency you can exceed that. MFICore automatically waits and retries when the broker rate-limits a request, but if a run still fails with a rate-limit error, lower the concurrency on your loop or split the watchlist across two scheduled runs.
Costs
Each broker node execution meters a small workflow-action credit, alongside the usual per-run charge. The Market clock node is free, so guarding a scheduled workflow with it never costs you anything. See Billing & usage for how metering works.