Execution boundary
Connect your broker
The interesting part of this pipeline is not the order. It is everything before it.
The line, before anything else
TWMD is a data and verification layer. There is no order path, no broker credential is ever held, no position is visible, and nothing here can place, amend, cancel or size a trade. Any page with this title that implies otherwise is describing a product with a far larger surface — and the difference matters most to the people for whom it matters at all.
What is actually hard, and is ours
Placing an order is a solved problem your broker already documents. Making sure the signal was computed on data that was knowable at the time is not, and it is where quiet losses come from: a backtest that reads the future does not fail, it produces a better curve than the truth and you deploy it.
Signal to order, with the boundary in the code
import requests
def prices_as_of(symbol: str, as_of: str, limit: int = 250):
r = requests.get(
"https://api.twmarketdata.com/v2/datasets/twse-daily-price",
params={"symbol": symbol, "limit": limit, "as_of": as_of},
timeout=30,
)
r.raise_for_status()
body = r.json()
ctx = body["request_context"]
# Refuse to proceed if the filter did not apply. A silent present-value response is the one
# bug in a backtest that never announces itself.
assert ctx["point_in_time"], f"as_of was not applied: {ctx}"
return body["rows"]
decision = strategy(prices_as_of("2330", today))
# Everything past this line is your broker's SDK, your risk limits and your responsibility.
# TWMD has no order path, holds no broker credentials, and cannot place, amend, cancel or
# size a trade.
broker.place(decision)The assert is the load-bearing line. If the parameter is ever renamed or ignored you receive present values and the loop keeps running — so the check belongs in your code, not in your trust of ours. The request above needs no API key; you can run it before you have an account.
What is left behind afterwards
Every value the decision used resolves to a signed snapshot that a third party can verify with a keyless endpoint and a script that imports nothing of ours. That is not a claim about whether the trade was a good idea — it is the record of what the strategy could see, which is the question that gets asked afterwards and the one that is normally unanswerable.
Not investment advice.