Signals and click-to-trade
Bring many accounts online the moment a signal goes out, so the click executes at once.
Some products don't trade continuously. A signal goes out, people look at it, and each decides with a click whether to take the trade. Keeping every account's terminal running all day for that is wasteful — but starting a terminal when someone clicks means they wait for a broker login.
The pattern that works: start the terminals when the signal goes out, not when the click comes.
Connect accounts as warm-on-demand
Connect each user's account with "mode": "warm_on_demand". Nothing runs for
it until you ask; it costs nothing while idle.
Prepare when the signal goes out
One call brings every follower's account online:
curl -sS -X POST "https://api.fxapis.com/v1/accounts/prepare" \
-H "Authorization: Bearer $FXAPIS_KEY" \
-H "Content-Type: application/json" \
-d '{ "accountIds": ["0d7c1f5e-…", "5a91e0c3-…", "c3b2d8f1-…"] }'{
"data": [
{ "accountId": "0d7c1f5e-…", "result": "starting", "message": null },
{ "accountId": "5a91e0c3-…", "result": "already_running", "message": null },
{ "accountId": "c3b2d8f1-…", "result": "needs_operator", "message": "This account needs attention before it can connect (invalid_credentials)." }
]
}Up to 200 accounts per call. Each reports its own result: needs_operator
means a human must fix something (a wrong password, 2FA) and retrying will not
help.
Place the order when the user clicks
By the time someone has read the signal, their terminal is logged in —
typically about ten seconds after prepare — and the order goes straight
through. If they click while it is still starting, the API answers 409
ACCOUNT_NOT_READY and nothing is sent — retry after a moment with the same
Idempotency-Key. An account nobody prepared starts on its first order, which
then takes as long as a broker login.
Let it stop on its own
A warm-on-demand terminal stops after a quiet period with no orders, so an idle day runs nothing. Open positions are unaffected: their stops live at the broker.
Several accounts, one instruction
If every follower should get the same trade without a click, use an execution wave instead: one request, released to every account together, with a result per account.