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

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.3.5
File Size Uploaded
mftik-0.3.5.tar.gz 498.5 kB Details

Built distribution (wheel)

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

Total release size: 932.2 kB

Release files / mftik-0.3.5.tar.gz

Download URL mftik-0.3.5.tar.gz
Size 498.5 kB
Tags Source
SHA-256 checksum
How to use checksums
b2d7965ecfcfd4217287f2f05023e24cc5595d1a2e57430c506f4d46444babdd
BLAKE2b-256 checksum
How to use checksums
09fb6dd7738db0c09d835949788f2931a725cbceded2b5dfabb277617feb10c7
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 24, 2026.

Transparency log

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

Download URL mftik-0.3.5-py3-none-any.whl
Size 433.7 kB
Tags Python 3
SHA-256 checksum
How to use checksums
e56b77445bdc8797b4793723604278ad12ab204d435b260220cea0d893eb625f
BLAKE2b-256 checksum
How to use checksums
456d3d56010946bdce8d2b13d1d87ec10d32b619ef395fe25a54a6e464f71a4a
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 24, 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

0.4.1

2 release files

This release

0.3.5 This release

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