filtrix-cli 0.1.0__tar.gz → 0.2.0__tar.gz
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- filtrix_cli-0.2.0/.gitignore +5 -0
- {filtrix_cli-0.1.0 → filtrix_cli-0.2.0}/LICENSE +21 -21
- {filtrix_cli-0.1.0 → filtrix_cli-0.2.0}/PKG-INFO +14 -7
- {filtrix_cli-0.1.0 → filtrix_cli-0.2.0}/README.md +55 -48
- {filtrix_cli-0.1.0 → filtrix_cli-0.2.0}/pyproject.toml +51 -51
- {filtrix_cli-0.1.0 → filtrix_cli-0.2.0}/src/filtrix_cli/AGENTS.md +59 -47
- filtrix_cli-0.2.0/src/filtrix_cli/__init__.py +1 -0
- {filtrix_cli-0.1.0 → filtrix_cli-0.2.0}/src/filtrix_cli/__main__.py +67 -60
- {filtrix_cli-0.1.0 → filtrix_cli-0.2.0}/src/filtrix_cli/client.py +163 -132
- {filtrix_cli-0.1.0 → filtrix_cli-0.2.0}/src/filtrix_cli/commands/backtest.py +34 -25
- filtrix_cli-0.2.0/src/filtrix_cli/commands/filters.py +19 -0
- filtrix_cli-0.2.0/src/filtrix_cli/commands/market.py +68 -0
- {filtrix_cli-0.1.0 → filtrix_cli-0.2.0}/src/filtrix_cli/commands/screen.py +24 -22
- filtrix_cli-0.2.0/tests/test_cmd_market.py +163 -0
- {filtrix_cli-0.1.0 → filtrix_cli-0.2.0}/tests/test_cmd_read.py +59 -71
- {filtrix_cli-0.1.0 → filtrix_cli-0.2.0}/tests/test_smoke.py +17 -17
- filtrix_cli-0.1.0/src/filtrix_cli/__init__.py +0 -1
- filtrix_cli-0.1.0/src/filtrix_cli/commands/filters.py +0 -21
- {filtrix_cli-0.1.0 → filtrix_cli-0.2.0}/src/filtrix_cli/auth.py +0 -0
- {filtrix_cli-0.1.0 → filtrix_cli-0.2.0}/src/filtrix_cli/commands/__init__.py +0 -0
- {filtrix_cli-0.1.0 → filtrix_cli-0.2.0}/src/filtrix_cli/commands/_helpers.py +0 -0
- {filtrix_cli-0.1.0 → filtrix_cli-0.2.0}/src/filtrix_cli/commands/account.py +0 -0
- {filtrix_cli-0.1.0 → filtrix_cli-0.2.0}/src/filtrix_cli/commands/authcmd.py +0 -0
- {filtrix_cli-0.1.0 → filtrix_cli-0.2.0}/src/filtrix_cli/commands/configcmd.py +0 -0
- {filtrix_cli-0.1.0 → filtrix_cli-0.2.0}/src/filtrix_cli/commands/keys.py +0 -0
- {filtrix_cli-0.1.0 → filtrix_cli-0.2.0}/src/filtrix_cli/commands/llms.py +0 -0
- {filtrix_cli-0.1.0 → filtrix_cli-0.2.0}/src/filtrix_cli/commands/ticker.py +0 -0
- {filtrix_cli-0.1.0 → filtrix_cli-0.2.0}/src/filtrix_cli/config.py +0 -0
- {filtrix_cli-0.1.0 → filtrix_cli-0.2.0}/src/filtrix_cli/filters.py +0 -0
- {filtrix_cli-0.1.0 → filtrix_cli-0.2.0}/src/filtrix_cli/output.py +0 -0
- {filtrix_cli-0.1.0 → filtrix_cli-0.2.0}/src/filtrix_cli/render.py +0 -0
- {filtrix_cli-0.1.0 → filtrix_cli-0.2.0}/src/filtrix_cli/state.py +0 -0
- {filtrix_cli-0.1.0 → filtrix_cli-0.2.0}/tests/__init__.py +0 -0
- {filtrix_cli-0.1.0 → filtrix_cli-0.2.0}/tests/test_auth.py +0 -0
- {filtrix_cli-0.1.0 → filtrix_cli-0.2.0}/tests/test_client.py +0 -0
- {filtrix_cli-0.1.0 → filtrix_cli-0.2.0}/tests/test_client_register.py +0 -0
- {filtrix_cli-0.1.0 → filtrix_cli-0.2.0}/tests/test_cmd_auth.py +0 -0
- {filtrix_cli-0.1.0 → filtrix_cli-0.2.0}/tests/test_cmd_backtest_screen.py +0 -0
- {filtrix_cli-0.1.0 → filtrix_cli-0.2.0}/tests/test_cmd_config.py +0 -0
- {filtrix_cli-0.1.0 → filtrix_cli-0.2.0}/tests/test_cmd_keys.py +0 -0
- {filtrix_cli-0.1.0 → filtrix_cli-0.2.0}/tests/test_cmd_llms.py +0 -0
- {filtrix_cli-0.1.0 → filtrix_cli-0.2.0}/tests/test_cmd_profile.py +0 -0
- {filtrix_cli-0.1.0 → filtrix_cli-0.2.0}/tests/test_cmd_register.py +0 -0
- {filtrix_cli-0.1.0 → filtrix_cli-0.2.0}/tests/test_config.py +0 -0
- {filtrix_cli-0.1.0 → filtrix_cli-0.2.0}/tests/test_filters.py +0 -0
- {filtrix_cli-0.1.0 → filtrix_cli-0.2.0}/tests/test_helpers.py +0 -0
- {filtrix_cli-0.1.0 → filtrix_cli-0.2.0}/tests/test_output.py +0 -0
- {filtrix_cli-0.1.0 → filtrix_cli-0.2.0}/tests/test_render.py +0 -0
|
@@ -1,21 +1,21 @@
|
|
|
1
|
-
MIT License
|
|
2
|
-
|
|
3
|
-
Copyright (c) 2026 Filtrix
|
|
4
|
-
|
|
5
|
-
Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
6
|
-
of this software and associated documentation files (the "Software"), to deal
|
|
7
|
-
in the Software without restriction, including without limitation the rights
|
|
8
|
-
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
9
|
-
copies of the Software, and to permit persons to whom the Software is
|
|
10
|
-
furnished to do so, subject to the following conditions:
|
|
11
|
-
|
|
12
|
-
The above copyright notice and this permission notice shall be included in all
|
|
13
|
-
copies or substantial portions of the Software.
|
|
14
|
-
|
|
15
|
-
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
16
|
-
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
17
|
-
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
18
|
-
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
19
|
-
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
20
|
-
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
|
21
|
-
SOFTWARE.
|
|
1
|
+
MIT License
|
|
2
|
+
|
|
3
|
+
Copyright (c) 2026 Filtrix
|
|
4
|
+
|
|
5
|
+
Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
6
|
+
of this software and associated documentation files (the "Software"), to deal
|
|
7
|
+
in the Software without restriction, including without limitation the rights
|
|
8
|
+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
9
|
+
copies of the Software, and to permit persons to whom the Software is
|
|
10
|
+
furnished to do so, subject to the following conditions:
|
|
11
|
+
|
|
12
|
+
The above copyright notice and this permission notice shall be included in all
|
|
13
|
+
copies or substantial portions of the Software.
|
|
14
|
+
|
|
15
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
16
|
+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
17
|
+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
18
|
+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
19
|
+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
20
|
+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
|
21
|
+
SOFTWARE.
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
Metadata-Version: 2.
|
|
1
|
+
Metadata-Version: 2.5
|
|
2
2
|
Name: filtrix-cli
|
|
3
|
-
Version: 0.
|
|
3
|
+
Version: 0.2.0
|
|
4
4
|
Summary: Agent-first command-line interface for the FILTRIX backtest engine.
|
|
5
5
|
Project-URL: Homepage, https://filtrix.net
|
|
6
6
|
Project-URL: Documentation, https://pypi.org/project/filtrix-cli/
|
|
@@ -43,7 +43,7 @@ pipx install filtrix-cli # or: uvx filtrix-cli ...
|
|
|
43
43
|
## Authenticate
|
|
44
44
|
|
|
45
45
|
```bash
|
|
46
|
-
export FILTRIX_API_KEY=flt_your_key # for
|
|
46
|
+
export FILTRIX_API_KEY=flt_your_key # for every read command
|
|
47
47
|
filtrix auth login # for managing API keys (stores a JWT)
|
|
48
48
|
```
|
|
49
49
|
|
|
@@ -57,11 +57,18 @@ filtrix auth register --email you@example.com --accept-tos
|
|
|
57
57
|
## Examples
|
|
58
58
|
|
|
59
59
|
```bash
|
|
60
|
-
filtrix
|
|
61
|
-
filtrix
|
|
60
|
+
filtrix meta # outcomes, units, limits, quota (free)
|
|
61
|
+
filtrix filters --search "relative volume" # find column names (no key needed)
|
|
62
|
+
filtrix backtest --filter "gap_gup>=50" --filter "price_price<5" --sample 5
|
|
63
|
+
filtrix backtest -f "gap_gup>=10" --outcome day_return --threshold 0
|
|
64
|
+
filtrix screen --filter "gap_gup>=50" --limit 20 --field rv_computed
|
|
62
65
|
filtrix --json screen --filter "gap_gup>=50" # force JSON in a terminal
|
|
63
|
-
filtrix ticker NVDA
|
|
64
|
-
filtrix
|
|
66
|
+
filtrix ticker NVDA # metadata
|
|
67
|
+
filtrix overview NVDA # price, moves, 52-week range, fundamentals
|
|
68
|
+
filtrix gaps TSLA --threshold 10 --direction down # this ticker's own gap history
|
|
69
|
+
filtrix daily AAPL --limit 60 # daily OHLCV bars
|
|
70
|
+
filtrix coverage TSLA # how much history
|
|
71
|
+
filtrix premarket # today's premarket gappers (free)
|
|
65
72
|
filtrix account
|
|
66
73
|
filtrix keys create --name laptop
|
|
67
74
|
filtrix llms # machine-readable usage guide for AI agents
|
|
@@ -1,48 +1,55 @@
|
|
|
1
|
-
# filtrix-cli
|
|
2
|
-
|
|
3
|
-
Agent-first command-line interface to [FILTRIX](https://filtrix.net) — historical trading-pattern backtesting.
|
|
4
|
-
|
|
5
|
-
## Install
|
|
6
|
-
|
|
7
|
-
```bash
|
|
8
|
-
pipx install filtrix-cli # or: uvx filtrix-cli ...
|
|
9
|
-
```
|
|
10
|
-
|
|
11
|
-
## Authenticate
|
|
12
|
-
|
|
13
|
-
```bash
|
|
14
|
-
export FILTRIX_API_KEY=flt_your_key # for
|
|
15
|
-
filtrix auth login # for managing API keys (stores a JWT)
|
|
16
|
-
```
|
|
17
|
-
|
|
18
|
-
### Sign up (terminal)
|
|
19
|
-
|
|
20
|
-
```bash
|
|
21
|
-
filtrix auth register --email you@example.com --accept-tos
|
|
22
|
-
# FILTRIX emails a 6-digit code; paste it when prompted; you're logged in.
|
|
23
|
-
```
|
|
24
|
-
|
|
25
|
-
## Examples
|
|
26
|
-
|
|
27
|
-
```bash
|
|
28
|
-
filtrix
|
|
29
|
-
filtrix
|
|
30
|
-
filtrix
|
|
31
|
-
filtrix
|
|
32
|
-
filtrix
|
|
33
|
-
filtrix
|
|
34
|
-
filtrix
|
|
35
|
-
filtrix
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
1
|
+
# filtrix-cli
|
|
2
|
+
|
|
3
|
+
Agent-first command-line interface to [FILTRIX](https://filtrix.net) — historical trading-pattern backtesting.
|
|
4
|
+
|
|
5
|
+
## Install
|
|
6
|
+
|
|
7
|
+
```bash
|
|
8
|
+
pipx install filtrix-cli # or: uvx filtrix-cli ...
|
|
9
|
+
```
|
|
10
|
+
|
|
11
|
+
## Authenticate
|
|
12
|
+
|
|
13
|
+
```bash
|
|
14
|
+
export FILTRIX_API_KEY=flt_your_key # for every read command
|
|
15
|
+
filtrix auth login # for managing API keys (stores a JWT)
|
|
16
|
+
```
|
|
17
|
+
|
|
18
|
+
### Sign up (terminal)
|
|
19
|
+
|
|
20
|
+
```bash
|
|
21
|
+
filtrix auth register --email you@example.com --accept-tos
|
|
22
|
+
# FILTRIX emails a 6-digit code; paste it when prompted; you're logged in.
|
|
23
|
+
```
|
|
24
|
+
|
|
25
|
+
## Examples
|
|
26
|
+
|
|
27
|
+
```bash
|
|
28
|
+
filtrix meta # outcomes, units, limits, quota (free)
|
|
29
|
+
filtrix filters --search "relative volume" # find column names (no key needed)
|
|
30
|
+
filtrix backtest --filter "gap_gup>=50" --filter "price_price<5" --sample 5
|
|
31
|
+
filtrix backtest -f "gap_gup>=10" --outcome day_return --threshold 0
|
|
32
|
+
filtrix screen --filter "gap_gup>=50" --limit 20 --field rv_computed
|
|
33
|
+
filtrix --json screen --filter "gap_gup>=50" # force JSON in a terminal
|
|
34
|
+
filtrix ticker NVDA # metadata
|
|
35
|
+
filtrix overview NVDA # price, moves, 52-week range, fundamentals
|
|
36
|
+
filtrix gaps TSLA --threshold 10 --direction down # this ticker's own gap history
|
|
37
|
+
filtrix daily AAPL --limit 60 # daily OHLCV bars
|
|
38
|
+
filtrix coverage TSLA # how much history
|
|
39
|
+
filtrix premarket # today's premarket gappers (free)
|
|
40
|
+
filtrix account
|
|
41
|
+
filtrix keys create --name laptop
|
|
42
|
+
filtrix llms # machine-readable usage guide for AI agents
|
|
43
|
+
```
|
|
44
|
+
|
|
45
|
+
## Output & scripting
|
|
46
|
+
|
|
47
|
+
Output is human-readable in a terminal and JSON when piped or with the global `--json` flag.
|
|
48
|
+
Global flags (`--json`, `--quiet`, `--profile`, `--api-key`, `--base-url`) go BEFORE the subcommand.
|
|
49
|
+
Exit codes: 0 ok, 2 usage, 3 not-found, 4 auth, 5 rate-limited, 6 network, 1 server.
|
|
50
|
+
|
|
51
|
+
## Configuration
|
|
52
|
+
|
|
53
|
+
Settings resolve in order: CLI flag > environment variable > config file
|
|
54
|
+
(`filtrix config path` shows the location). Use `--profile NAME` for multiple environments.
|
|
55
|
+
Credentials (API key / JWT) are stored in cleartext in this TOML file (best-effort `chmod 600` on POSIX) — treat it like an SSH key.
|
|
@@ -1,51 +1,51 @@
|
|
|
1
|
-
[build-system]
|
|
2
|
-
requires = ["hatchling"]
|
|
3
|
-
build-backend = "hatchling.build"
|
|
4
|
-
|
|
5
|
-
[project]
|
|
6
|
-
name = "filtrix-cli"
|
|
7
|
-
version = "0.
|
|
8
|
-
description = "Agent-first command-line interface for the FILTRIX backtest engine."
|
|
9
|
-
readme = "README.md"
|
|
10
|
-
requires-python = ">=3.10"
|
|
11
|
-
license = {text = "MIT"}
|
|
12
|
-
authors = [
|
|
13
|
-
{name = "Filtrix", email = "team@filtrix.net"},
|
|
14
|
-
]
|
|
15
|
-
keywords = ["filtrix", "cli", "trading", "backtest", "screener", "ai-agents", "quant"]
|
|
16
|
-
classifiers = [
|
|
17
|
-
"Development Status :: 4 - Beta",
|
|
18
|
-
"Environment :: Console",
|
|
19
|
-
"Intended Audience :: Developers",
|
|
20
|
-
"Intended Audience :: Financial and Insurance Industry",
|
|
21
|
-
"License :: OSI Approved :: MIT License",
|
|
22
|
-
"Programming Language :: Python :: 3",
|
|
23
|
-
"Programming Language :: Python :: 3.10",
|
|
24
|
-
"Programming Language :: Python :: 3.11",
|
|
25
|
-
"Programming Language :: Python :: 3.12",
|
|
26
|
-
"Topic :: Office/Business :: Financial :: Investment",
|
|
27
|
-
]
|
|
28
|
-
dependencies = [
|
|
29
|
-
"typer>=0.12",
|
|
30
|
-
"rich>=13",
|
|
31
|
-
"httpx>=0.27",
|
|
32
|
-
"platformdirs>=4",
|
|
33
|
-
"tomli-w>=1.0",
|
|
34
|
-
"tomli>=2.0; python_version < '3.11'",
|
|
35
|
-
]
|
|
36
|
-
|
|
37
|
-
[project.optional-dependencies]
|
|
38
|
-
dev = ["pytest>=8", "respx>=0.21"]
|
|
39
|
-
|
|
40
|
-
[project.urls]
|
|
41
|
-
Homepage = "https://filtrix.net"
|
|
42
|
-
Documentation = "https://pypi.org/project/filtrix-cli/"
|
|
43
|
-
|
|
44
|
-
[project.scripts]
|
|
45
|
-
filtrix = "filtrix_cli.__main__:main"
|
|
46
|
-
|
|
47
|
-
[tool.hatch.build.targets.wheel]
|
|
48
|
-
packages = ["src/filtrix_cli"]
|
|
49
|
-
|
|
50
|
-
[tool.hatch.build.targets.wheel.force-include]
|
|
51
|
-
"src/filtrix_cli/AGENTS.md" = "filtrix_cli/AGENTS.md"
|
|
1
|
+
[build-system]
|
|
2
|
+
requires = ["hatchling"]
|
|
3
|
+
build-backend = "hatchling.build"
|
|
4
|
+
|
|
5
|
+
[project]
|
|
6
|
+
name = "filtrix-cli"
|
|
7
|
+
version = "0.2.0"
|
|
8
|
+
description = "Agent-first command-line interface for the FILTRIX backtest engine."
|
|
9
|
+
readme = "README.md"
|
|
10
|
+
requires-python = ">=3.10"
|
|
11
|
+
license = {text = "MIT"}
|
|
12
|
+
authors = [
|
|
13
|
+
{name = "Filtrix", email = "team@filtrix.net"},
|
|
14
|
+
]
|
|
15
|
+
keywords = ["filtrix", "cli", "trading", "backtest", "screener", "ai-agents", "quant"]
|
|
16
|
+
classifiers = [
|
|
17
|
+
"Development Status :: 4 - Beta",
|
|
18
|
+
"Environment :: Console",
|
|
19
|
+
"Intended Audience :: Developers",
|
|
20
|
+
"Intended Audience :: Financial and Insurance Industry",
|
|
21
|
+
"License :: OSI Approved :: MIT License",
|
|
22
|
+
"Programming Language :: Python :: 3",
|
|
23
|
+
"Programming Language :: Python :: 3.10",
|
|
24
|
+
"Programming Language :: Python :: 3.11",
|
|
25
|
+
"Programming Language :: Python :: 3.12",
|
|
26
|
+
"Topic :: Office/Business :: Financial :: Investment",
|
|
27
|
+
]
|
|
28
|
+
dependencies = [
|
|
29
|
+
"typer>=0.12",
|
|
30
|
+
"rich>=13",
|
|
31
|
+
"httpx>=0.27",
|
|
32
|
+
"platformdirs>=4",
|
|
33
|
+
"tomli-w>=1.0",
|
|
34
|
+
"tomli>=2.0; python_version < '3.11'",
|
|
35
|
+
]
|
|
36
|
+
|
|
37
|
+
[project.optional-dependencies]
|
|
38
|
+
dev = ["pytest>=8", "respx>=0.21"]
|
|
39
|
+
|
|
40
|
+
[project.urls]
|
|
41
|
+
Homepage = "https://filtrix.net"
|
|
42
|
+
Documentation = "https://pypi.org/project/filtrix-cli/"
|
|
43
|
+
|
|
44
|
+
[project.scripts]
|
|
45
|
+
filtrix = "filtrix_cli.__main__:main"
|
|
46
|
+
|
|
47
|
+
[tool.hatch.build.targets.wheel]
|
|
48
|
+
packages = ["src/filtrix_cli"]
|
|
49
|
+
|
|
50
|
+
[tool.hatch.build.targets.wheel.force-include]
|
|
51
|
+
"src/filtrix_cli/AGENTS.md" = "filtrix_cli/AGENTS.md"
|
|
@@ -1,47 +1,59 @@
|
|
|
1
|
-
# filtrix-cli — agent guide
|
|
2
|
-
|
|
3
|
-
Structured command-line access to the FILTRIX historical backtest engine.
|
|
4
|
-
|
|
5
|
-
## Output contract
|
|
6
|
-
- Add `--json` (or pipe stdout) to get JSON on stdout. Human tables otherwise.
|
|
7
|
-
- Data goes to stdout; errors/progress go to stderr.
|
|
8
|
-
- Errors (stderr, JSON): {"error":{"type","message","status","retryable","suggestion","input"}}.
|
|
9
|
-
|
|
10
|
-
## Exit codes
|
|
11
|
-
- 0 success
|
|
12
|
-
- 1 server/unexpected error (retryable)
|
|
13
|
-
- 2 usage / invalid filter
|
|
14
|
-
- 3 not found
|
|
15
|
-
- 4 authentication required/failed
|
|
16
|
-
- 5 rate limited (retryable)
|
|
17
|
-
- 6 network/timeout (retryable)
|
|
18
|
-
|
|
19
|
-
## Auth
|
|
20
|
-
- Reads/backtests: set env FILTRIX_API_KEY=flt_... (or `filtrix config set api_key ...`).
|
|
21
|
-
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
- filtrix
|
|
26
|
-
- filtrix
|
|
27
|
-
- filtrix
|
|
28
|
-
-
|
|
29
|
-
- filtrix
|
|
30
|
-
- filtrix
|
|
31
|
-
- filtrix
|
|
32
|
-
- filtrix
|
|
33
|
-
- filtrix
|
|
34
|
-
- filtrix
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
##
|
|
47
|
-
|
|
1
|
+
# filtrix-cli — agent guide
|
|
2
|
+
|
|
3
|
+
Structured command-line access to the FILTRIX historical backtest engine.
|
|
4
|
+
|
|
5
|
+
## Output contract
|
|
6
|
+
- Add `--json` (or pipe stdout) to get JSON on stdout. Human tables otherwise.
|
|
7
|
+
- Data goes to stdout; errors/progress go to stderr.
|
|
8
|
+
- Errors (stderr, JSON): {"error":{"type","message","status","retryable","suggestion","input"}}.
|
|
9
|
+
|
|
10
|
+
## Exit codes
|
|
11
|
+
- 0 success
|
|
12
|
+
- 1 server/unexpected error (retryable)
|
|
13
|
+
- 2 usage / invalid filter
|
|
14
|
+
- 3 not found
|
|
15
|
+
- 4 authentication required/failed
|
|
16
|
+
- 5 rate limited (retryable)
|
|
17
|
+
- 6 network/timeout (retryable)
|
|
18
|
+
|
|
19
|
+
## Auth
|
|
20
|
+
- Reads/backtests: set env FILTRIX_API_KEY=flt_... (or `filtrix config set api_key ...`).
|
|
21
|
+
- Quota: 50 requests/day free, 1000 Pro; meta, filters, account, premarket are free. Resets at midnight America/New_York.
|
|
22
|
+
- Key management: `filtrix auth login` first (stores a JWT).
|
|
23
|
+
|
|
24
|
+
## Commands
|
|
25
|
+
- filtrix meta (free) outcome definitions + units, limits, quotas, data coverage
|
|
26
|
+
- filtrix filters [--search TEXT] [--type number|date|string|time|enum] [--limit N] (no auth; ranked search)
|
|
27
|
+
- filtrix backtest --filter "COL OP VAL" [--filter ...] [--outcome ...] [--threshold X] [--pos-min A --pos-max B]
|
|
28
|
+
[--sample N] [--start YYYY-MM-DD] [--end YYYY-MM-DD] [--flat-threshold F]
|
|
29
|
+
- filtrix screen --filter ... [--limit N] [--offset N] [--field COL ...]
|
|
30
|
+
- filtrix ticker SYMBOL metadata (name, sector, market cap)
|
|
31
|
+
- filtrix overview SYMBOL last close, 1d/5d/20d moves, 52-week range, TTM fundamentals (verified email)
|
|
32
|
+
- filtrix gaps SYMBOL [--threshold 10] [--direction up|down] [--stat avg|median] this ticker's own gap history
|
|
33
|
+
- filtrix daily SYMBOL [--limit 250] daily OHLCV bars, oldest first (max 500)
|
|
34
|
+
- filtrix coverage [SYMBOL] first/last event date and counts
|
|
35
|
+
- filtrix premarket (free) today's premarket gappers with historical stats
|
|
36
|
+
- filtrix account (free) tier, quota used/remaining, reset time, capabilities
|
|
37
|
+
- filtrix keys list|create|revoke
|
|
38
|
+
- filtrix auth login|logout|status
|
|
39
|
+
- filtrix auth register --email E --password P --accept-tos (emails a 6-digit code, then prompts for it, then auto-logs-in)
|
|
40
|
+
- filtrix auth verify-code CODE --email E --password P (resume a pending signup)
|
|
41
|
+
- filtrix auth resend-code --email E
|
|
42
|
+
- filtrix config get|set|list|path
|
|
43
|
+
|
|
44
|
+
Note: global flags like `--json` go BEFORE the subcommand (e.g. `filtrix --json backtest ...`).
|
|
45
|
+
|
|
46
|
+
## Filter DSL
|
|
47
|
+
"COL OP VAL", operators: >= <= != = > < like in. Repeat --filter for AND.
|
|
48
|
+
Examples: "gap_gup>=10", "price_price<5", "earnings_date_days_earningd=0.25", "sic_code in 7372,7389".
|
|
49
|
+
Use the RAW schema column names from `filtrix filters` (e.g. price_price, float_shares_float) — these
|
|
50
|
+
can differ from screen's friendlier output field names (price, float_shares). Unknown columns return exit 2.
|
|
51
|
+
For exact control, pass `--filters-json '[{"column":...,"operator":...,"value":...,"value_type":...}]'`
|
|
52
|
+
or `--filters-json -` to read the JSON array from stdin.
|
|
53
|
+
|
|
54
|
+
## Discover filters
|
|
55
|
+
Run `filtrix filters --search "<words>" --json` to find columns (raw name, Trade-Ideas code, description,
|
|
56
|
+
operators, value type). `filtrix meta --json` defines every backtest outcome and its unit:
|
|
57
|
+
day_close_position (0 = closed at the low, 1 = at the high; default), day_return (fraction),
|
|
58
|
+
reg_pct / hi_to_cl_pct / lo_to_cl_pct (percent). Each backtest response also carries
|
|
59
|
+
outcome_definition, direction_rule (what long/short/flat_pct mean) and bucket_prob_definition.
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
__version__ = "0.2.0"
|
|
@@ -1,60 +1,67 @@
|
|
|
1
|
-
import typer
|
|
2
|
-
|
|
3
|
-
from filtrix_cli import __version__
|
|
4
|
-
from filtrix_cli.state import set_state
|
|
5
|
-
from filtrix_cli.commands import backtest as backtest_cmd
|
|
6
|
-
from filtrix_cli.commands import screen as screen_cmd
|
|
7
|
-
from filtrix_cli.commands import ticker as ticker_cmd
|
|
8
|
-
from filtrix_cli.commands import filters as filters_cmd
|
|
9
|
-
from filtrix_cli.commands import account as account_cmd
|
|
10
|
-
from filtrix_cli.commands import keys as keys_cmd
|
|
11
|
-
from filtrix_cli.commands import authcmd
|
|
12
|
-
from filtrix_cli.commands import configcmd
|
|
13
|
-
from filtrix_cli.commands import llms as llms_cmd
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
app.command("
|
|
46
|
-
app.command("
|
|
47
|
-
app.command("
|
|
48
|
-
app.command("
|
|
49
|
-
app.
|
|
50
|
-
app.add_typer(
|
|
51
|
-
app.add_typer(
|
|
52
|
-
app.
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
1
|
+
import typer
|
|
2
|
+
|
|
3
|
+
from filtrix_cli import __version__
|
|
4
|
+
from filtrix_cli.state import set_state
|
|
5
|
+
from filtrix_cli.commands import backtest as backtest_cmd
|
|
6
|
+
from filtrix_cli.commands import screen as screen_cmd
|
|
7
|
+
from filtrix_cli.commands import ticker as ticker_cmd
|
|
8
|
+
from filtrix_cli.commands import filters as filters_cmd
|
|
9
|
+
from filtrix_cli.commands import account as account_cmd
|
|
10
|
+
from filtrix_cli.commands import keys as keys_cmd
|
|
11
|
+
from filtrix_cli.commands import authcmd
|
|
12
|
+
from filtrix_cli.commands import configcmd
|
|
13
|
+
from filtrix_cli.commands import llms as llms_cmd
|
|
14
|
+
from filtrix_cli.commands import market as market_cmd
|
|
15
|
+
|
|
16
|
+
app = typer.Typer(
|
|
17
|
+
add_completion=False,
|
|
18
|
+
help="FILTRIX CLI — terminal access to the FILTRIX backtest engine.",
|
|
19
|
+
)
|
|
20
|
+
|
|
21
|
+
|
|
22
|
+
@app.callback(invoke_without_command=True)
|
|
23
|
+
def _root(
|
|
24
|
+
ctx: typer.Context,
|
|
25
|
+
json: bool = typer.Option(False, "--json", help="Force JSON output to stdout."),
|
|
26
|
+
quiet: bool = typer.Option(False, "--quiet", "-q", help="Bare values only."),
|
|
27
|
+
no_color: bool = typer.Option(False, "--no-color", help="Disable colored output."),
|
|
28
|
+
profile: str = typer.Option(None, "--profile", help="Config profile to use."),
|
|
29
|
+
api_key: str = typer.Option(None, "--api-key", help="Override API key for this run."),
|
|
30
|
+
base_url: str = typer.Option(None, "--base-url", help="Override API base URL for this run."),
|
|
31
|
+
) -> None:
|
|
32
|
+
"""FILTRIX CLI — terminal access to the FILTRIX backtest engine."""
|
|
33
|
+
set_state(json=json, quiet=quiet, no_color=no_color,
|
|
34
|
+
profile=profile, api_key=api_key, base_url=base_url)
|
|
35
|
+
if ctx.invoked_subcommand is None:
|
|
36
|
+
typer.echo(ctx.get_help())
|
|
37
|
+
|
|
38
|
+
|
|
39
|
+
@app.command()
|
|
40
|
+
def version() -> None:
|
|
41
|
+
"""Print the CLI version."""
|
|
42
|
+
typer.echo(f"filtrix-cli {__version__}")
|
|
43
|
+
|
|
44
|
+
|
|
45
|
+
app.command("backtest")(backtest_cmd.backtest)
|
|
46
|
+
app.command("screen")(screen_cmd.screen)
|
|
47
|
+
app.command("ticker")(ticker_cmd.ticker)
|
|
48
|
+
app.command("filters")(filters_cmd.filters)
|
|
49
|
+
app.command("account")(account_cmd.account)
|
|
50
|
+
app.add_typer(keys_cmd.app, name="keys")
|
|
51
|
+
app.add_typer(authcmd.app, name="auth")
|
|
52
|
+
app.add_typer(configcmd.app, name="config")
|
|
53
|
+
app.command("llms")(llms_cmd.llms)
|
|
54
|
+
app.command("meta")(market_cmd.meta)
|
|
55
|
+
app.command("coverage")(market_cmd.coverage)
|
|
56
|
+
app.command("overview")(market_cmd.overview)
|
|
57
|
+
app.command("gaps")(market_cmd.gaps)
|
|
58
|
+
app.command("daily")(market_cmd.daily)
|
|
59
|
+
app.command("premarket")(market_cmd.premarket)
|
|
60
|
+
|
|
61
|
+
|
|
62
|
+
def main() -> None:
|
|
63
|
+
app()
|
|
64
|
+
|
|
65
|
+
|
|
66
|
+
if __name__ == "__main__":
|
|
67
|
+
main()
|