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.5.2

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.5.2
File Size Uploaded
mftik-0.5.2.tar.gz 608.3 kB Details

Built distribution (wheel)

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

Total release size: 1.1 MB

Release files / mftik-0.5.2.tar.gz

Download URL mftik-0.5.2.tar.gz
Size 608.3 kB
Tags Source
SHA-256 checksum
How to use checksums
b9ba95dbee9a71b12bfc5321ccb1863e974541fde9529f4f8bbb70cb48a0754c
BLAKE2b-256 checksum
How to use checksums
4b4b9963324f9fc39957c7fae8c378d6452f95daa5b668072131881d32676a9e
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 Sep 1, 2026.

Transparency log

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

Download URL mftik-0.5.2-py3-none-any.whl
Size 531.3 kB
Tags Python 3
SHA-256 checksum
How to use checksums
78f1a57585352957b7efef3db584681ca6a778c0eabedd35db0d1a1a58367f91
BLAKE2b-256 checksum
How to use checksums
fe00c11cf9fc8b76d6025f29d9cc88a8a02a9d944f1bbb86a00c3aa129f3628e
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 Sep 1, 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

This release

0.5.2 This release

2 release files

0.4.1

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