filtrix-cli 0.1.0__tar.gz → 0.3.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.
Files changed (51) hide show
  1. filtrix_cli-0.3.0/.gitignore +5 -0
  2. {filtrix_cli-0.1.0 → filtrix_cli-0.3.0}/LICENSE +21 -21
  3. {filtrix_cli-0.1.0 → filtrix_cli-0.3.0}/PKG-INFO +24 -8
  4. {filtrix_cli-0.1.0 → filtrix_cli-0.3.0}/README.md +64 -48
  5. {filtrix_cli-0.1.0 → filtrix_cli-0.3.0}/pyproject.toml +51 -51
  6. filtrix_cli-0.3.0/src/filtrix_cli/AGENTS.md +83 -0
  7. filtrix_cli-0.3.0/src/filtrix_cli/__init__.py +1 -0
  8. {filtrix_cli-0.1.0 → filtrix_cli-0.3.0}/src/filtrix_cli/__main__.py +71 -60
  9. {filtrix_cli-0.1.0 → filtrix_cli-0.3.0}/src/filtrix_cli/client.py +199 -132
  10. {filtrix_cli-0.1.0 → filtrix_cli-0.3.0}/src/filtrix_cli/commands/backtest.py +34 -25
  11. filtrix_cli-0.3.0/src/filtrix_cli/commands/filters.py +19 -0
  12. filtrix_cli-0.3.0/src/filtrix_cli/commands/market.py +68 -0
  13. filtrix_cli-0.3.0/src/filtrix_cli/commands/research.py +240 -0
  14. {filtrix_cli-0.1.0 → filtrix_cli-0.3.0}/src/filtrix_cli/commands/screen.py +24 -22
  15. filtrix_cli-0.3.0/tests/test_cmd_market.py +163 -0
  16. {filtrix_cli-0.1.0 → filtrix_cli-0.3.0}/tests/test_cmd_read.py +59 -71
  17. filtrix_cli-0.3.0/tests/test_cmd_research.py +195 -0
  18. {filtrix_cli-0.1.0 → filtrix_cli-0.3.0}/tests/test_smoke.py +17 -17
  19. filtrix_cli-0.1.0/src/filtrix_cli/AGENTS.md +0 -47
  20. filtrix_cli-0.1.0/src/filtrix_cli/__init__.py +0 -1
  21. filtrix_cli-0.1.0/src/filtrix_cli/commands/filters.py +0 -21
  22. {filtrix_cli-0.1.0 → filtrix_cli-0.3.0}/src/filtrix_cli/auth.py +0 -0
  23. {filtrix_cli-0.1.0 → filtrix_cli-0.3.0}/src/filtrix_cli/commands/__init__.py +0 -0
  24. {filtrix_cli-0.1.0 → filtrix_cli-0.3.0}/src/filtrix_cli/commands/_helpers.py +0 -0
  25. {filtrix_cli-0.1.0 → filtrix_cli-0.3.0}/src/filtrix_cli/commands/account.py +0 -0
  26. {filtrix_cli-0.1.0 → filtrix_cli-0.3.0}/src/filtrix_cli/commands/authcmd.py +0 -0
  27. {filtrix_cli-0.1.0 → filtrix_cli-0.3.0}/src/filtrix_cli/commands/configcmd.py +0 -0
  28. {filtrix_cli-0.1.0 → filtrix_cli-0.3.0}/src/filtrix_cli/commands/keys.py +0 -0
  29. {filtrix_cli-0.1.0 → filtrix_cli-0.3.0}/src/filtrix_cli/commands/llms.py +0 -0
  30. {filtrix_cli-0.1.0 → filtrix_cli-0.3.0}/src/filtrix_cli/commands/ticker.py +0 -0
  31. {filtrix_cli-0.1.0 → filtrix_cli-0.3.0}/src/filtrix_cli/config.py +0 -0
  32. {filtrix_cli-0.1.0 → filtrix_cli-0.3.0}/src/filtrix_cli/filters.py +0 -0
  33. {filtrix_cli-0.1.0 → filtrix_cli-0.3.0}/src/filtrix_cli/output.py +0 -0
  34. {filtrix_cli-0.1.0 → filtrix_cli-0.3.0}/src/filtrix_cli/render.py +0 -0
  35. {filtrix_cli-0.1.0 → filtrix_cli-0.3.0}/src/filtrix_cli/state.py +0 -0
  36. {filtrix_cli-0.1.0 → filtrix_cli-0.3.0}/tests/__init__.py +0 -0
  37. {filtrix_cli-0.1.0 → filtrix_cli-0.3.0}/tests/test_auth.py +0 -0
  38. {filtrix_cli-0.1.0 → filtrix_cli-0.3.0}/tests/test_client.py +0 -0
  39. {filtrix_cli-0.1.0 → filtrix_cli-0.3.0}/tests/test_client_register.py +0 -0
  40. {filtrix_cli-0.1.0 → filtrix_cli-0.3.0}/tests/test_cmd_auth.py +0 -0
  41. {filtrix_cli-0.1.0 → filtrix_cli-0.3.0}/tests/test_cmd_backtest_screen.py +0 -0
  42. {filtrix_cli-0.1.0 → filtrix_cli-0.3.0}/tests/test_cmd_config.py +0 -0
  43. {filtrix_cli-0.1.0 → filtrix_cli-0.3.0}/tests/test_cmd_keys.py +0 -0
  44. {filtrix_cli-0.1.0 → filtrix_cli-0.3.0}/tests/test_cmd_llms.py +0 -0
  45. {filtrix_cli-0.1.0 → filtrix_cli-0.3.0}/tests/test_cmd_profile.py +0 -0
  46. {filtrix_cli-0.1.0 → filtrix_cli-0.3.0}/tests/test_cmd_register.py +0 -0
  47. {filtrix_cli-0.1.0 → filtrix_cli-0.3.0}/tests/test_config.py +0 -0
  48. {filtrix_cli-0.1.0 → filtrix_cli-0.3.0}/tests/test_filters.py +0 -0
  49. {filtrix_cli-0.1.0 → filtrix_cli-0.3.0}/tests/test_helpers.py +0 -0
  50. {filtrix_cli-0.1.0 → filtrix_cli-0.3.0}/tests/test_output.py +0 -0
  51. {filtrix_cli-0.1.0 → filtrix_cli-0.3.0}/tests/test_render.py +0 -0
@@ -0,0 +1,5 @@
1
+ dist/
2
+ build/
3
+ *.egg-info/
4
+ __pycache__/
5
+ *.pyc
@@ -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.4
1
+ Metadata-Version: 2.5
2
2
  Name: filtrix-cli
3
- Version: 0.1.0
3
+ Version: 0.3.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 backtests/screens/ticker/account
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,12 +57,24 @@ filtrix auth register --email you@example.com --accept-tos
57
57
  ## Examples
58
58
 
59
59
  ```bash
60
- filtrix backtest --filter "gap_gup>=50" --filter "price_price<5"
61
- filtrix screen --filter "gap_gup>=50" --limit 20
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 filters --search gap
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
73
+ filtrix runs save -f "gap_gup>=20" -f "price_price<10" --name "Small gappers" --wait
74
+ filtrix runs list
75
+ filtrix simulate --run-id 42 --entry open_at_0930 --exit stop_loss_take_profit --sl 0.03 --tp 0.06 --wait
76
+ filtrix runs context 42 ABCD 2025-03-14 # daily + minute bars of one event
77
+ filtrix jobs get JOB_ID
66
78
  filtrix keys create --name laptop
67
79
  filtrix llms # machine-readable usage guide for AI agents
68
80
  ```
@@ -71,7 +83,11 @@ filtrix llms # machine-readable usage guide for AI agents
71
83
 
72
84
  Output is human-readable in a terminal and JSON when piped or with the global `--json` flag.
73
85
  Global flags (`--json`, `--quiet`, `--profile`, `--api-key`, `--base-url`) go BEFORE the subcommand.
74
- Exit codes: 0 ok, 2 usage, 3 not-found, 4 auth, 5 rate-limited, 6 network, 1 server.
86
+ Exit codes: 0 ok, 2 usage, 3 not-found, 4 auth, 5 rate-limited, 6 network or `--wait` timeout, 1 server
87
+ or failed job.
88
+
89
+ `runs save` and `simulate` start background jobs; `--wait` polls until they finish. `runs delete` needs
90
+ `--yes` when not interactive.
75
91
 
76
92
  ## Configuration
77
93
 
@@ -1,48 +1,64 @@
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 backtests/screens/ticker/account
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 backtest --filter "gap_gup>=50" --filter "price_price<5"
29
- filtrix screen --filter "gap_gup>=50" --limit 20
30
- filtrix --json screen --filter "gap_gup>=50" # force JSON in a terminal
31
- filtrix ticker NVDA
32
- filtrix filters --search gap
33
- filtrix account
34
- filtrix keys create --name laptop
35
- filtrix llms # machine-readable usage guide for AI agents
36
- ```
37
-
38
- ## Output & scripting
39
-
40
- Output is human-readable in a terminal and JSON when piped or with the global `--json` flag.
41
- Global flags (`--json`, `--quiet`, `--profile`, `--api-key`, `--base-url`) go BEFORE the subcommand.
42
- Exit codes: 0 ok, 2 usage, 3 not-found, 4 auth, 5 rate-limited, 6 network, 1 server.
43
-
44
- ## Configuration
45
-
46
- Settings resolve in order: CLI flag > environment variable > config file
47
- (`filtrix config path` shows the location). Use `--profile NAME` for multiple environments.
48
- 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
+ # 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 runs save -f "gap_gup>=20" -f "price_price<10" --name "Small gappers" --wait
42
+ filtrix runs list
43
+ filtrix simulate --run-id 42 --entry open_at_0930 --exit stop_loss_take_profit --sl 0.03 --tp 0.06 --wait
44
+ filtrix runs context 42 ABCD 2025-03-14 # daily + minute bars of one event
45
+ filtrix jobs get JOB_ID
46
+ filtrix keys create --name laptop
47
+ filtrix llms # machine-readable usage guide for AI agents
48
+ ```
49
+
50
+ ## Output & scripting
51
+
52
+ Output is human-readable in a terminal and JSON when piped or with the global `--json` flag.
53
+ Global flags (`--json`, `--quiet`, `--profile`, `--api-key`, `--base-url`) go BEFORE the subcommand.
54
+ Exit codes: 0 ok, 2 usage, 3 not-found, 4 auth, 5 rate-limited, 6 network or `--wait` timeout, 1 server
55
+ or failed job.
56
+
57
+ `runs save` and `simulate` start background jobs; `--wait` polls until they finish. `runs delete` needs
58
+ `--yes` when not interactive.
59
+
60
+ ## Configuration
61
+
62
+ Settings resolve in order: CLI flag > environment variable > config file
63
+ (`filtrix config path` shows the location). Use `--profile NAME` for multiple environments.
64
+ 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.1.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.3.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"
@@ -0,0 +1,83 @@
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, incl. `--wait` giving up on a job that is still running (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, jobs get are free. Resets at midnight America/New_York.
22
+ - Saved runs and simulations also have plan limits (`filtrix account`). `runs save`, `simulate`, `runs share|unshare|delete`
23
+ and `jobs cancel` change your account; an OAuth token granted read-only cannot run them.
24
+ - Key management: `filtrix auth login` first (stores a JWT).
25
+
26
+ ## Commands
27
+ - filtrix meta (free) outcome definitions + units, limits, quotas, data coverage
28
+ - filtrix filters [--search TEXT] [--type number|date|string|time|enum] [--limit N] (no auth; ranked search)
29
+ - filtrix backtest --filter "COL OP VAL" [--filter ...] [--outcome ...] [--threshold X] [--pos-min A --pos-max B]
30
+ [--sample N] [--start YYYY-MM-DD] [--end YYYY-MM-DD] [--flat-threshold F]
31
+ - filtrix screen --filter ... [--limit N] [--offset N] [--field COL ...]
32
+ - filtrix ticker SYMBOL metadata (name, sector, market cap)
33
+ - filtrix overview SYMBOL last close, 1d/5d/20d moves, 52-week range, TTM fundamentals (verified email)
34
+ - filtrix gaps SYMBOL [--threshold 10] [--direction up|down] [--stat avg|median] this ticker's own gap history
35
+ - filtrix daily SYMBOL [--limit 250] daily OHLCV bars, oldest first (max 500)
36
+ - filtrix coverage [SYMBOL] first/last event date and counts
37
+ - filtrix premarket (free) today's premarket gappers with historical stats
38
+ - filtrix account (free) tier, quota used/remaining, reset time, capabilities
39
+ - filtrix runs list [--limit 20] [--offset 0] your saved runs with summaries
40
+ - filtrix runs get RUN_ID filters, outcome, summary, share link
41
+ - filtrix runs rows RUN_ID [--limit 100] [--offset 0] the run's events with outcome values (max 500)
42
+ - filtrix runs save --filter ... [--name N] [--outcome ...] [--row-filter all|positive|negative|neutral|nonzero]
43
+ [backtest options] [--wait] [--timeout 600] saves a run (background job)
44
+ - filtrix runs share|unshare RUN_ID public read-only link on/off
45
+ - filtrix runs delete RUN_ID --yes permanent; --yes is required when not interactive
46
+ - filtrix runs context RUN_ID SYMBOL DATE [--lookback 120] daily + that day's minute bars for one event
47
+ - filtrix simulate (--run-id N | --filter ...) --entry open_at_0930|green_to_red|red_to_green|bar_break
48
+ [--within-minutes M] --exit close_1600|hold_minutes|stop_loss_take_profit
49
+ [--hold-minutes M] [--sl 0.02] [--tp 0.05] [--side long|short] [--bar-minutes 1..30]
50
+ [--limit-pairs 200] [--wait] [--timeout 600]
51
+ - filtrix jobs get JOB_ID (free) status, progress, result
52
+ - filtrix jobs cancel JOB_ID
53
+ - filtrix keys list|create|revoke
54
+ - filtrix auth login|logout|status
55
+ - filtrix auth register --email E --password P --accept-tos (emails a 6-digit code, then prompts for it, then auto-logs-in)
56
+ - filtrix auth verify-code CODE --email E --password P (resume a pending signup)
57
+ - filtrix auth resend-code --email E
58
+ - filtrix config get|set|list|path
59
+
60
+ Note: global flags like `--json` go BEFORE the subcommand (e.g. `filtrix --json backtest ...`).
61
+
62
+ ## Background jobs
63
+ `runs save` and `simulate` print {"job_id","status":"queued","poll"}. Add `--wait` to poll until the job ends
64
+ (prints the finished job; a failed job exits 1, `--timeout` seconds without an end exits 6), or poll with
65
+ `filtrix jobs get JOB_ID`. At most 2 jobs run at a time per account (429 otherwise).
66
+ A simulation's result: summary (n_trades, win_rate 0..1, profit_factor, avg_pnl / total_pnl in USD per share,
67
+ avg_holding_min), up to 200 trades with pnl_pct, run_id. Definitions: `filtrix meta --json` -> "simulation".
68
+ --sl / --tp are fractions (0.02 = 2%).
69
+
70
+ ## Filter DSL
71
+ "COL OP VAL", operators: >= <= != = > < like in. Repeat --filter for AND.
72
+ Examples: "gap_gup>=10", "price_price<5", "earnings_date_days_earningd=0.25", "sic_code in 7372,7389".
73
+ Use the RAW schema column names from `filtrix filters` (e.g. price_price, float_shares_float) — these
74
+ can differ from screen's friendlier output field names (price, float_shares). Unknown columns return exit 2.
75
+ For exact control, pass `--filters-json '[{"column":...,"operator":...,"value":...,"value_type":...}]'`
76
+ or `--filters-json -` to read the JSON array from stdin.
77
+
78
+ ## Discover filters
79
+ Run `filtrix filters --search "<words>" --json` to find columns (raw name, Trade-Ideas code, description,
80
+ operators, value type). `filtrix meta --json` defines every backtest outcome and its unit:
81
+ day_close_position (0 = closed at the low, 1 = at the high; default), day_return (fraction),
82
+ reg_pct / hi_to_cl_pct / lo_to_cl_pct (percent). Each backtest response also carries
83
+ outcome_definition, direction_rule (what long/short/flat_pct mean) and bucket_prob_definition.
@@ -0,0 +1 @@
1
+ __version__ = "0.3.0"
@@ -1,60 +1,71 @@
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
- app = typer.Typer(
16
- add_completion=False,
17
- help="FILTRIX CLI — terminal access to the FILTRIX backtest engine.",
18
- )
19
-
20
-
21
- @app.callback(invoke_without_command=True)
22
- def _root(
23
- ctx: typer.Context,
24
- json: bool = typer.Option(False, "--json", help="Force JSON output to stdout."),
25
- quiet: bool = typer.Option(False, "--quiet", "-q", help="Bare values only."),
26
- no_color: bool = typer.Option(False, "--no-color", help="Disable colored output."),
27
- profile: str = typer.Option(None, "--profile", help="Config profile to use."),
28
- api_key: str = typer.Option(None, "--api-key", help="Override API key for this run."),
29
- base_url: str = typer.Option(None, "--base-url", help="Override API base URL for this run."),
30
- ) -> None:
31
- """FILTRIX CLI — terminal access to the FILTRIX backtest engine."""
32
- set_state(json=json, quiet=quiet, no_color=no_color,
33
- profile=profile, api_key=api_key, base_url=base_url)
34
- if ctx.invoked_subcommand is None:
35
- typer.echo(ctx.get_help())
36
-
37
-
38
- @app.command()
39
- def version() -> None:
40
- """Print the CLI version."""
41
- typer.echo(f"filtrix-cli {__version__}")
42
-
43
-
44
- app.command("backtest")(backtest_cmd.backtest)
45
- app.command("screen")(screen_cmd.screen)
46
- app.command("ticker")(ticker_cmd.ticker)
47
- app.command("filters")(filters_cmd.filters)
48
- app.command("account")(account_cmd.account)
49
- app.add_typer(keys_cmd.app, name="keys")
50
- app.add_typer(authcmd.app, name="auth")
51
- app.add_typer(configcmd.app, name="config")
52
- app.command("llms")(llms_cmd.llms)
53
-
54
-
55
- def main() -> None:
56
- app()
57
-
58
-
59
- if __name__ == "__main__":
60
- main()
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
+ from filtrix_cli.commands import research as research_cmd
16
+
17
+ app = typer.Typer(
18
+ add_completion=False,
19
+ help="FILTRIX CLI — terminal access to the FILTRIX backtest engine.",
20
+ )
21
+
22
+
23
+ @app.callback(invoke_without_command=True)
24
+ def _root(
25
+ ctx: typer.Context,
26
+ json: bool = typer.Option(False, "--json", help="Force JSON output to stdout."),
27
+ quiet: bool = typer.Option(False, "--quiet", "-q", help="Bare values only."),
28
+ no_color: bool = typer.Option(False, "--no-color", help="Disable colored output."),
29
+ profile: str = typer.Option(None, "--profile", help="Config profile to use."),
30
+ api_key: str = typer.Option(None, "--api-key", help="Override API key for this run."),
31
+ base_url: str = typer.Option(None, "--base-url", help="Override API base URL for this run."),
32
+ ) -> None:
33
+ """FILTRIX CLI — terminal access to the FILTRIX backtest engine."""
34
+ set_state(json=json, quiet=quiet, no_color=no_color,
35
+ profile=profile, api_key=api_key, base_url=base_url)
36
+ if ctx.invoked_subcommand is None:
37
+ typer.echo(ctx.get_help())
38
+
39
+
40
+ @app.command()
41
+ def version() -> None:
42
+ """Print the CLI version."""
43
+ typer.echo(f"filtrix-cli {__version__}")
44
+
45
+
46
+ app.command("backtest")(backtest_cmd.backtest)
47
+ app.command("screen")(screen_cmd.screen)
48
+ app.command("ticker")(ticker_cmd.ticker)
49
+ app.command("filters")(filters_cmd.filters)
50
+ app.command("account")(account_cmd.account)
51
+ app.add_typer(keys_cmd.app, name="keys")
52
+ app.add_typer(authcmd.app, name="auth")
53
+ app.add_typer(configcmd.app, name="config")
54
+ app.command("llms")(llms_cmd.llms)
55
+ app.command("meta")(market_cmd.meta)
56
+ app.command("coverage")(market_cmd.coverage)
57
+ app.command("overview")(market_cmd.overview)
58
+ app.command("gaps")(market_cmd.gaps)
59
+ app.command("daily")(market_cmd.daily)
60
+ app.command("premarket")(market_cmd.premarket)
61
+ app.add_typer(research_cmd.runs_app, name="runs")
62
+ app.command("simulate")(research_cmd.simulate)
63
+ app.add_typer(research_cmd.jobs_app, name="jobs")
64
+
65
+
66
+ def main() -> None:
67
+ app()
68
+
69
+
70
+ if __name__ == "__main__":
71
+ main()