Skip to main content

mftik

The strategy SDK and command-line client for a MFTIK node — a self-hosted, mid-frequency algorithmic trading platform.

You run the node yourself with Docker Compose — mftik node-init writes the stack for you. This package is both that and what you install on the machine you write strategies on.

pip install mftik

Writing a strategy

A strategy is a subclass of Strategy and a directory of .py files. It reads market data through the hooks it overrides and trades through the accessors the base class binds.

from mftik.strategy import Strategy


class MyStrategy(Strategy):
    name = "my_strategy"

    async def on_best_quote(self, quote) -> None:
        await self.log(f"{quote.universal_ticker} {quote.bid}/{quote.ask}")

self.oms places and cancels orders, self.ledger reads balances, self.mds queries history the feeds do not carry, self.tape warms up on prints from before the session started, self.symbols gives you the tick and step sizes to round to, and self.timer schedules work. See Strategy's docstring for the full set of hooks.

A session that was running when STS went away can come back. Override on_rebuild and set rebuildable = True. Facts you remember while running are handed back there, before on_start; resting orders, fills and position come from recon, not from anything you stored. Leave rebuildable off if coming back would mean trading beside orders you no longer know are yours.

A strategy may import the standard library, mftik, and other files in its own directory — nothing else. The node runs the source you send it rather than an environment you built, so a third-party import would be a module that is not there. mftik check tells you before you push.

The client

mftik node-init ./mynode                 # a whole node: compose, edge, .env
mftik connect https://node.example.com   # sign in once; stores an API key
mftik whoami                             # who you are to that node
mftik profiles                           # every node this machine knows
mftik disconnect <name>                  # forget one
mftik init ./hello                       # scaffold, filled in from that node
mftik check ./hello                      # import gate and on_initialized, offline
mftik run ./hello                        # push, deploy, tail; ^C stops it
mftik push ./hello                       # copy the tree into the node's private registry
mftik run ./hello                        # push, deploy, tail the session log
mftik ps                                 # what is running
mftik logs -f <session>                  # what it is saying
mftik stop <session>                     # stop it

connect signs in with your password, mints an API key through that session, stores the key and drops the session — so the password is never written down. Profiles live in ~/.config/mftik/config.toml at mode 0600. For CI, pass an existing key with --token and no prompt is reached.

init is being built — see docs/CLI.md for the shape it is landing in.

License

MIT

Release files for mftik 0.4.1

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for mftik 0.4.1
File Size Uploaded
mftik-0.4.1.tar.gz 595.8 kB Details

Built distribution (wheel)

Table of built distributions (wheels) for mftik 0.4.1
File Interpreter ABI Platform
mftik-0.4.1-py3-none-any.whl Python 3 none any Details

Total release size: 1.1 MB

Release files / mftik-0.4.1.tar.gz

Download URL mftik-0.4.1.tar.gz
Size 595.8 kB
Tags Source
SHA-256 checksum
How to use checksums
0334b1be747f614e47a514a8b2f27f65a86f5eda74710fa9468ea702caa88534
BLAKE2b-256 checksum
How to use checksums
14ec37940343186b020af194bf817a69b6900dac615e783246d575c9da0cb949
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.14

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Aug 30, 2026.

Transparency log

Release files / mftik-0.4.1-py3-none-any.whl

Download URL mftik-0.4.1-py3-none-any.whl
Size 522.9 kB
Tags Python 3
SHA-256 checksum
How to use checksums
9c682f6d4a7768e4adcb17ef0edd1c44c304616ce149353db3c7f0cb74ab66d4
BLAKE2b-256 checksum
How to use checksums
20dae1817d1b938a4d3ee5903ae35f7bb37e4408e5c6f43b511a116c52ee89ca
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.14

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Aug 30, 2026.

Transparency log

Release history Release notifications | RSS feed

0.11.0

2 release files

0.10.0

2 release files

0.9.7

2 release files

0.9.6

2 release files

0.9.5

2 release files

0.6.0

2 release files

0.5.2

2 release files

This release

0.4.1 This release

2 release files

0.3.5

2 release files

0.3.1

2 release files

0.2.0

2 release files

0.0.11

2 release files

0.0.4

2 release files

0.0.3

2 release files

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page