alphaspec 0.1.0__py3-none-any.whl
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.
- alphaspec/__init__.py +8 -0
- alphaspec/_data/catalog/i18n/en.json +1016 -0
- alphaspec/_data/catalog/indicators.json +9790 -0
- alphaspec/_data/docs/MARKETS.md +29 -0
- alphaspec/_data/docs/RULES.md +133 -0
- alphaspec/_data/docs/RUNTIME_API.md +80 -0
- alphaspec/_data/docs/SPEC.md +99 -0
- alphaspec/_data/examples/artifacts/01-ema-cross-us-equity.json +20 -0
- alphaspec/_data/examples/artifacts/02-rsi-reversion-params.json +25 -0
- alphaspec/_data/examples/artifacts/03-mtf-trend-pullback.json +25 -0
- alphaspec/_data/examples/artifacts/04-breakout-retest-sequence.json +58 -0
- alphaspec/_data/examples/artifacts/05-cn-limit-up-pullback.json +33 -0
- alphaspec/_data/examples/scores/01-model-scores-cn-stock.json +17 -0
- alphaspec/_data/examples/scores/02-target-weights-us-equity.json +13 -0
- alphaspec/_data/schema/0.1/artifact.schema.json +259 -0
- alphaspec/_data/schema/0.1/common.schema.json +96 -0
- alphaspec/_data/schema/0.1/evidence.schema.json +152 -0
- alphaspec/_data/schema/0.1/gate-result.schema.json +55 -0
- alphaspec/_data/schema/0.1/score.schema.json +79 -0
- alphaspec/_data/skills/alphaspec/SKILL.md +93 -0
- alphaspec/_resources.py +77 -0
- alphaspec/cli.py +360 -0
- alphaspec/client.py +146 -0
- alphaspec/lints.py +266 -0
- alphaspec/mcp_server.py +231 -0
- alphaspec/validate.py +108 -0
- alphaspec-0.1.0.dist-info/METADATA +322 -0
- alphaspec-0.1.0.dist-info/RECORD +31 -0
- alphaspec-0.1.0.dist-info/WHEEL +4 -0
- alphaspec-0.1.0.dist-info/entry_points.txt +3 -0
- alphaspec-0.1.0.dist-info/licenses/LICENSE +202 -0
|
@@ -0,0 +1,322 @@
|
|
|
1
|
+
Metadata-Version: 2.5
|
|
2
|
+
Name: alphaspec
|
|
3
|
+
Version: 0.1.0
|
|
4
|
+
Summary: The auditable contract between alpha and execution: JSON schemas, a validator and lint rules for declarative trading strategies.
|
|
5
|
+
Project-URL: Homepage, https://github.com/openalpha-dev/alphaspec
|
|
6
|
+
Project-URL: Documentation, https://github.com/openalpha-dev/alphaspec#readme
|
|
7
|
+
Project-URL: Changelog, https://github.com/openalpha-dev/alphaspec/blob/main/CHANGELOG.md
|
|
8
|
+
Project-URL: Schemas, https://openalpha-dev.github.io/alphaspec/schema/0.1/
|
|
9
|
+
Author: OpenAlpha contributors
|
|
10
|
+
License-Expression: Apache-2.0
|
|
11
|
+
License-File: LICENSE
|
|
12
|
+
Keywords: ai-agent,backtest,dsl,json-schema,quant,strategy,trading
|
|
13
|
+
Classifier: Development Status :: 2 - Pre-Alpha
|
|
14
|
+
Classifier: Intended Audience :: Developers
|
|
15
|
+
Classifier: Intended Audience :: Financial and Insurance Industry
|
|
16
|
+
Classifier: Programming Language :: Python :: 3
|
|
17
|
+
Classifier: Topic :: Office/Business :: Financial :: Investment
|
|
18
|
+
Requires-Python: >=3.10
|
|
19
|
+
Requires-Dist: jsonschema>=4.18
|
|
20
|
+
Requires-Dist: referencing>=0.30
|
|
21
|
+
Provides-Extra: dev
|
|
22
|
+
Requires-Dist: mcp>=1.2; extra == 'dev'
|
|
23
|
+
Requires-Dist: pytest>=7; extra == 'dev'
|
|
24
|
+
Provides-Extra: mcp
|
|
25
|
+
Requires-Dist: mcp>=1.2; extra == 'mcp'
|
|
26
|
+
Description-Content-Type: text/markdown
|
|
27
|
+
|
|
28
|
+
# AlphaSpec
|
|
29
|
+
|
|
30
|
+
**A business language for trading strategies that humans, AI agents and execution systems can all read, check and agree on.**
|
|
31
|
+
|
|
32
|
+
[中文说明](https://github.com/openalpha-dev/alphaspec/blob/main/README.zh-CN.md) ·
|
|
33
|
+
[Spec](https://github.com/openalpha-dev/alphaspec/blob/main/docs/SPEC.md) ·
|
|
34
|
+
[Lint rules](https://github.com/openalpha-dev/alphaspec/blob/main/docs/RULES.md) ·
|
|
35
|
+
[Runtime API](https://github.com/openalpha-dev/alphaspec/blob/main/docs/RUNTIME_API.md) ·
|
|
36
|
+
[Reference runtime: EasyQuant](https://www.goeasyquant.com)
|
|
37
|
+
|
|
38
|
+
AlphaSpec is an open specification for handing a trading strategy, or a model's output, to an
|
|
39
|
+
execution system. A strategy is a JSON document: indicators, entry and exit conditions, universe
|
|
40
|
+
and risk settings. There is no code in it, so everything that matters can be checked before
|
|
41
|
+
anything runs, by a validator, by a risk reviewer, or by the AI that wrote it.
|
|
42
|
+
|
|
43
|
+
```bash
|
|
44
|
+
pip install "alphaspec[mcp]"
|
|
45
|
+
alphaspec validate my_strategy.json
|
|
46
|
+
```
|
|
47
|
+
|
|
48
|
+
## Why a strategy DSL, and why now
|
|
49
|
+
|
|
50
|
+
> **The bottleneck of AI-driven research was never the model. It is the missing feedback loop: a
|
|
51
|
+
> model never learns what its signals did in a real market.**
|
|
52
|
+
|
|
53
|
+
**AI made writing strategies cheap. It did not make trusting them cheap.** An agent can produce a
|
|
54
|
+
hundred candidate strategies in an afternoon. What it cannot do on its own is tell which of them
|
|
55
|
+
survive look-ahead bias, multiple testing and real trading rules. The bottleneck has moved from
|
|
56
|
+
*producing* ideas to *verifying* them, and verification needs something both sides can read.
|
|
57
|
+
|
|
58
|
+
Generated code is the wrong medium for that. It is different every time, reveals what it does only
|
|
59
|
+
when executed, needs a sandbox, and a risk desk cannot approve it line by line. A declarative
|
|
60
|
+
document can be:
|
|
61
|
+
|
|
62
|
+
- **validated on the spot** by a schema and semantic lint rules, with no sandbox;
|
|
63
|
+
- **constrained at generation time**, so a model can only emit well-formed documents;
|
|
64
|
+
- **diffed**: "the oversold threshold changed from 30 to 28" is a change a person can review;
|
|
65
|
+
- **audited** field by field by a risk desk;
|
|
66
|
+
- **free of injection surface**: there is nowhere to put code.
|
|
67
|
+
|
|
68
|
+
That makes AlphaSpec a **business language between people and machines**. A person states an idea in
|
|
69
|
+
plain words; an agent turns it into a document built from a shared vocabulary of indicators whose
|
|
70
|
+
meaning, units and pitfalls are written down; the validator says exactly what is wrong and why; the
|
|
71
|
+
runtime executes the same document the person reviewed. Every party is looking at the same thing.
|
|
72
|
+
|
|
73
|
+
AlphaSpec is **not trying to replace Python**. Research in whatever you like: pandas, PyTorch,
|
|
74
|
+
LightGBM, any agent framework. AlphaSpec is the boundary: what crosses into execution must be a
|
|
75
|
+
document that can be checked, compared and audited.
|
|
76
|
+
|
|
77
|
+
## What it defines
|
|
78
|
+
|
|
79
|
+
Two ways in, written by you or your agent:
|
|
80
|
+
|
|
81
|
+
| Level | Document | For | You send |
|
|
82
|
+
|---|---|---|---|
|
|
83
|
+
| **L1 · Score** | [`score`](https://github.com/openalpha-dev/alphaspec/blob/main/schema/0.1/score.schema.json) | ML teams, factor researchers | `(asOf, market, symbol, score)` or target weights |
|
|
84
|
+
| **L2 · Artifact** | [`artifact`](https://github.com/openalpha-dev/alphaspec/blob/main/schema/0.1/artifact.schema.json) | rule-based strategies, AI agents | a rule tree with parameters, universe and risk overrides |
|
|
85
|
+
|
|
86
|
+
Two ways back, written by the runtime and never by the submitter:
|
|
87
|
+
|
|
88
|
+
| Document | What it answers |
|
|
89
|
+
|---|---|
|
|
90
|
+
| [`gate-result`](https://github.com/openalpha-dev/alphaspec/blob/main/schema/0.1/gate-result.schema.json) | Did it pass, judged on figures the runtime **recomputed itself**, check by check |
|
|
91
|
+
| [`evidence`](https://github.com/openalpha-dev/alphaspec/blob/main/schema/0.1/evidence.schema.json) | What happened in a real market: rejections, slippage, fills, deviation from target, every number with its caliber |
|
|
92
|
+
|
|
93
|
+
The way back is the point. Research tools see prices, news and filings; none of that says whether
|
|
94
|
+
an order was rejected, how much slippage it paid, or how far the portfolio drifted from its target.
|
|
95
|
+
Only an execution system knows, and only if it reports it in a form the research side can read.
|
|
96
|
+
`gate-result` and `evidence` are that form: the feedback loop the model was missing.
|
|
97
|
+
|
|
98
|
+
```mermaid
|
|
99
|
+
flowchart LR
|
|
100
|
+
R["Your research<br/>Python · ML · AI agent"] -->|AlphaSpec document| V["alphaspec<br/>local validation"]
|
|
101
|
+
V -->|HTTPS · API key| E["Runtime<br/>backtest on windows it chooses"]
|
|
102
|
+
E --> G{"Gate"}
|
|
103
|
+
G -->|passed| P["Paper trading"]
|
|
104
|
+
P -.->|institutions| L["Live execution"]
|
|
105
|
+
G -.->|gate-result| R
|
|
106
|
+
P -.->|evidence| R
|
|
107
|
+
```
|
|
108
|
+
|
|
109
|
+
A short artifact:
|
|
110
|
+
|
|
111
|
+
```json
|
|
112
|
+
{
|
|
113
|
+
"contractVersion": "0.1",
|
|
114
|
+
"kind": "artifact",
|
|
115
|
+
"title": "RSI rebound above the 60-day average",
|
|
116
|
+
"market": "cn_stock",
|
|
117
|
+
"timeframe": "1d",
|
|
118
|
+
"dsl": {
|
|
119
|
+
"version": 1,
|
|
120
|
+
"params": { "oversold": 30 },
|
|
121
|
+
"indicators": {
|
|
122
|
+
"rsi": { "type": "RSI", "period": 14 },
|
|
123
|
+
"ma60": { "type": "SMA", "period": 60 }
|
|
124
|
+
},
|
|
125
|
+
"entry": { "type": "AND",
|
|
126
|
+
"left": { "type": "CROSS_UP", "left": { "ind": "rsi" }, "right": { "ref": "oversold" } },
|
|
127
|
+
"right": { "type": "GT", "left": { "ind": "close" }, "right": { "ind": "ma60" } } },
|
|
128
|
+
"exit": { "type": "GTE", "left": { "ind": "rsi" }, "right": { "const": 70 } }
|
|
129
|
+
},
|
|
130
|
+
"universe": { "mode": "SYMBOLS", "symbols": ["600519.SH", "000333.SZ"] },
|
|
131
|
+
"producer": { "kind": "AI_AGENT", "name": "my-agent@0.1", "searchTrials": 3 }
|
|
132
|
+
}
|
|
133
|
+
```
|
|
134
|
+
|
|
135
|
+
`producer.searchTrials` is how many candidates the search tried, discarded ones included. The more
|
|
136
|
+
you tried, the higher the bar the gate sets, so luck is not mistaken for skill.
|
|
137
|
+
|
|
138
|
+
## How a submission runs today
|
|
139
|
+
|
|
140
|
+
The reference runtime is **EasyQuant**. A submitted artifact goes through the same path a strategy
|
|
141
|
+
built in its own UI does:
|
|
142
|
+
|
|
143
|
+
1. **Validate twice.** Locally by `alphaspec`, then again by the runtime, which also compiles the
|
|
144
|
+
rule tree in its own engine.
|
|
145
|
+
2. **Backtest on windows the runtime chooses.** One continuous backtest, reported as two segments:
|
|
146
|
+
for daily strategies the last 4 years in-sample and the most recent year out-of-sample; for
|
|
147
|
+
intraday strategies 18 months and 6 months. Returns are annualised on trading time; China's T+1,
|
|
148
|
+
price limits and lot sizes apply.
|
|
149
|
+
3. **Gate, check by check.** In-sample return, drawdown and Sharpe; out-of-sample performance
|
|
150
|
+
**relative to the market index** over the same period; a Deflated Sharpe test that uses
|
|
151
|
+
`searchTrials`; structural look-ahead checks. Each check returns its metric, actual value,
|
|
152
|
+
threshold and a hint, so an agent can act on it instead of guessing.
|
|
153
|
+
4. **Promote to paper trading.** A passing artifact becomes a paper-trading strategy in the
|
|
154
|
+
submitter's account, created disabled; the person starts it.
|
|
155
|
+
5. **Go live, for institutions.** On the institutional edition the same strategy runs against
|
|
156
|
+
broker counters through the same risk checks and ledger, and execution evidence flows back.
|
|
157
|
+
|
|
158
|
+
An API key can submit, evaluate, read results and promote. It cannot place orders or touch
|
|
159
|
+
accounts. An agent passes through exactly the same door as a person.
|
|
160
|
+
|
|
161
|
+
## About EasyQuant
|
|
162
|
+
|
|
163
|
+
[EasyQuant](https://www.goeasyquant.com) is a quantitative strategy delivery platform: research,
|
|
164
|
+
backtesting, paper trading and live execution on one engine, so the number you saw in a backtest is
|
|
165
|
+
computed the same way as the order that reaches the market. It is built around four principles:
|
|
166
|
+
**explainable** (every signal, rejection and fill carries a reason), **reproducible** (one engine for
|
|
167
|
+
backtest, paper and live), **operable** (monitoring, alerting, reconciliation) and **extensible**
|
|
168
|
+
(new markets, data sources and counters plug in behind stable interfaces).
|
|
169
|
+
|
|
170
|
+
- **Markets**: China A-shares, ETFs and convertible bonds, futures and options, Hong Kong and US
|
|
171
|
+
equities, crypto spot.
|
|
172
|
+
- **Execution**: broker and exchange counters such as CTP, XTP, QMT, PTrade, TORA and IBKR; pre-trade
|
|
173
|
+
risk checks on a single order path; a cash and position ledger reconciled against the broker.
|
|
174
|
+
- **Research**: 220+ indicators and chart patterns with written semantics (the same catalog
|
|
175
|
+
AlphaSpec ships), factor research, visual rule canvas, stock pools, parameter scans with
|
|
176
|
+
out-of-sample validation.
|
|
177
|
+
- **Built-in AI research**: describe what you want in plain words. *AI stock screening* turns
|
|
178
|
+
"low valuation, high dividend, no ST" into screening conditions you can adjust, shows the
|
|
179
|
+
candidates and why each was picked, and saves them as a stock pool. *AI strategy drafting* turns a
|
|
180
|
+
trading idea into entry, exit and risk rules, validates them, opens them on the visual canvas with
|
|
181
|
+
buy and sell points previewed, and from there into backtesting and paper trading. Nothing is saved
|
|
182
|
+
or run until you confirm.
|
|
183
|
+
- **Two editions**: an institutional console for funds, brokerage quant desks and studios, including
|
|
184
|
+
live trading; and a [personal edition](https://trade.goeasyquant.com) with AI-assisted research,
|
|
185
|
+
backtesting and paper trading, where any user can create an AlphaSpec API key for free.
|
|
186
|
+
|
|
187
|
+
### AI writes the same document you would
|
|
188
|
+
|
|
189
|
+
A strategy drafted by EasyQuant's AI, one built by hand on its canvas, and one submitted as AlphaSpec by
|
|
190
|
+
an outside agent are the **same kind of object**: a rule tree from the same indicator vocabulary,
|
|
191
|
+
compiled by the same engine, backtested under the same rules and judged by the same gate. The AI does
|
|
192
|
+
not produce a pile of code that differs every run and can only be proven right by running it. It
|
|
193
|
+
produces a document you can read before it runs, change by hand, compare with the last version, and
|
|
194
|
+
hand back to the AI to improve. That is what makes AI output something a person can take
|
|
195
|
+
responsibility for.
|
|
196
|
+
|
|
197
|
+
## An open ecosystem
|
|
198
|
+
|
|
199
|
+
AlphaSpec lives under **[openalpha-dev](https://github.com/openalpha-dev)**, a family of open
|
|
200
|
+
components around one idea: alpha should be easy to express, honest to evaluate and safe to execute.
|
|
201
|
+
|
|
202
|
+
- **Any runtime can implement it.** A compliant runtime must pass every case in
|
|
203
|
+
[`conformance/cases`](https://github.com/openalpha-dev/alphaspec/tree/main/conformance/cases).
|
|
204
|
+
EasyQuant is the reference, not the gatekeeper.
|
|
205
|
+
- **Any agent can use it.** The Agent Skill and MCP server work with Claude Code, Cursor, Codex and
|
|
206
|
+
any MCP client. EasyQuant's own AI research assistant uses the same public API and nothing more:
|
|
207
|
+
if it needed a private shortcut, the ecosystem would not be real.
|
|
208
|
+
- **More components to come**, including **AlphaSpace**, a local research desk that brings your own
|
|
209
|
+
model, data and LLM key and submits through the same API, and pieces of the execution stack such as
|
|
210
|
+
risk checks, published as independent modules.
|
|
211
|
+
|
|
212
|
+
## Getting started
|
|
213
|
+
|
|
214
|
+
### Command line and Python
|
|
215
|
+
|
|
216
|
+
```bash
|
|
217
|
+
pip install alphaspec
|
|
218
|
+
alphaspec examples # documents to start from
|
|
219
|
+
alphaspec catalog --search breakout # indicators, with meaning, parameters and pitfalls
|
|
220
|
+
alphaspec validate my_strategy.json # errors and warnings, each with a fix hint
|
|
221
|
+
alphaspec rules --explain AS003 # why a rule exists
|
|
222
|
+
```
|
|
223
|
+
|
|
224
|
+
Submitting to a runtime (EasyQuant: create the key under *Account → API Keys*):
|
|
225
|
+
|
|
226
|
+
```bash
|
|
227
|
+
export ALPHASPEC_BASE_URL=https://trade.goeasyquant.com
|
|
228
|
+
export ALPHASPEC_API_KEY=eqk_...
|
|
229
|
+
|
|
230
|
+
alphaspec whoami
|
|
231
|
+
alphaspec submit my_strategy.json --evaluate --promote
|
|
232
|
+
```
|
|
233
|
+
|
|
234
|
+
```python
|
|
235
|
+
from alphaspec import Client
|
|
236
|
+
|
|
237
|
+
c = Client() # reads ALPHASPEC_BASE_URL and ALPHASPEC_API_KEY
|
|
238
|
+
aid = c.submit(doc)["artifactId"] # validates locally first
|
|
239
|
+
c.evaluate(aid)
|
|
240
|
+
gate = c.wait(aid)
|
|
241
|
+
if gate["passed"]:
|
|
242
|
+
c.promote(aid, name="my strategy")
|
|
243
|
+
```
|
|
244
|
+
|
|
245
|
+
### Agent Skill (agents that can run commands)
|
|
246
|
+
|
|
247
|
+
```bash
|
|
248
|
+
alphaspec skill --install ~/.claude/skills # or your agent's skills directory
|
|
249
|
+
```
|
|
250
|
+
|
|
251
|
+
The skill teaches the agent the workflow: start from an example, look indicators up instead of
|
|
252
|
+
guessing, validate until clean, report `searchTrials` honestly, never quote numbers the runtime did
|
|
253
|
+
not return.
|
|
254
|
+
|
|
255
|
+
### MCP (agents without a shell)
|
|
256
|
+
|
|
257
|
+
```json
|
|
258
|
+
{
|
|
259
|
+
"mcpServers": {
|
|
260
|
+
"alphaspec": {
|
|
261
|
+
"command": "alphaspec-mcp",
|
|
262
|
+
"env": {
|
|
263
|
+
"ALPHASPEC_BASE_URL": "https://trade.goeasyquant.com",
|
|
264
|
+
"ALPHASPEC_API_KEY": "eqk_..."
|
|
265
|
+
}
|
|
266
|
+
}
|
|
267
|
+
}
|
|
268
|
+
}
|
|
269
|
+
```
|
|
270
|
+
|
|
271
|
+
The client speaks MCP to a local `alphaspec-mcp` process over stdio; that process calls the runtime
|
|
272
|
+
over HTTPS with the same client as the CLI, so the key only ever goes to the runtime. Tools:
|
|
273
|
+
`validate`, `explain_rule`, `search_indicators`, `get_indicator`, `get_schema`, `list_examples`,
|
|
274
|
+
`get_example`, `get_doc` (offline) and `whoami`, `submit`, `evaluate`, `gate_result`,
|
|
275
|
+
`list_submissions`, `promote` (runtime). There is no order tool.
|
|
276
|
+
|
|
277
|
+
## Lint rules are where the experience lives
|
|
278
|
+
|
|
279
|
+
Each rule in [docs/RULES.md](https://github.com/openalpha-dev/alphaspec/blob/main/docs/RULES.md)
|
|
280
|
+
exists because a runtime once accepted that mistake, ran it, and produced wrong numbers without an
|
|
281
|
+
error. Some examples:
|
|
282
|
+
|
|
283
|
+
- **AS003**: a daily indicator read from the still-forming daily bar inside an intraday strategy.
|
|
284
|
+
In a backtest that bar already contains the close: look-ahead.
|
|
285
|
+
- **AS001**: an indicator alias with a typo. The rule compiles to nothing and never fires.
|
|
286
|
+
- **AS011**: `600000` instead of `600000.SH`. On venue-qualified markets the bare code is a
|
|
287
|
+
different series.
|
|
288
|
+
- **AS012**: AI-generated output that does not report how many candidates were tried, which leaves
|
|
289
|
+
nothing to correct a multiple-testing-inflated Sharpe ratio with.
|
|
290
|
+
|
|
291
|
+
The indicator catalog carries the same kind of knowledge: `close > DAY_HIGH` can never be true
|
|
292
|
+
because the day's high includes the current bar; the catalog says so and points to
|
|
293
|
+
`DAY_HIGH_BEFORE`.
|
|
294
|
+
|
|
295
|
+
## Markets
|
|
296
|
+
|
|
297
|
+
Market rules are scoped, not removed. Core indicators work on any market. Indicators that encode a
|
|
298
|
+
market's own rules, such as China's daily price limits, belong to an extension profile and are
|
|
299
|
+
rejected where those rules do not exist. See
|
|
300
|
+
[docs/MARKETS.md](https://github.com/openalpha-dev/alphaspec/blob/main/docs/MARKETS.md).
|
|
301
|
+
|
|
302
|
+
## Repository layout
|
|
303
|
+
|
|
304
|
+
```
|
|
305
|
+
schema/0.1/ JSON Schemas: the normative contract
|
|
306
|
+
catalog/ indicator catalog with semantics (Chinese and English)
|
|
307
|
+
conformance/cases/ accept/reject cases every compliant runtime must agree with
|
|
308
|
+
examples/ documents that pass with zero issues
|
|
309
|
+
src/alphaspec/ validator, CLI, runtime client, MCP server
|
|
310
|
+
skills/alphaspec/ Agent Skill
|
|
311
|
+
docs/ semantics, lint rules, markets, runtime API
|
|
312
|
+
```
|
|
313
|
+
|
|
314
|
+
## Versioning
|
|
315
|
+
|
|
316
|
+
Every document carries `contractVersion`, so a runtime can refuse what it does not understand.
|
|
317
|
+
Breaking changes bump the contract version. Schemas are published at their `$id` URLs, e.g.
|
|
318
|
+
`https://openalpha-dev.github.io/alphaspec/schema/0.1/artifact.schema.json`.
|
|
319
|
+
|
|
320
|
+
## License
|
|
321
|
+
|
|
322
|
+
Apache-2.0
|
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
alphaspec/__init__.py,sha256=8_KzuaSq7qqLNj90L2VomFwnzsc7izpFqkzh7I8gE2g,441
|
|
2
|
+
alphaspec/_resources.py,sha256=woFjS_GrG0bw7gaSQfIT02act0IRjQbe5q3SNVMJOWU,2601
|
|
3
|
+
alphaspec/cli.py,sha256=1PtWrWPlsCx5K9mq6iOWDF_oSBmWkpmCn1pGrRybqU8,15421
|
|
4
|
+
alphaspec/client.py,sha256=ZOLJABpQwjzd4ystc81BqRV5gI4tfb_7GlpGJ8o7KMQ,6102
|
|
5
|
+
alphaspec/lints.py,sha256=EsBXt41QTKdNMTQhR-NiqnjtDdJsp020OgN3rL5MT-Y,11489
|
|
6
|
+
alphaspec/mcp_server.py,sha256=JHvdgTaI3r_Z5ItdKIyFnMf9CMmA_w0ZgBzfsIo8u34,9480
|
|
7
|
+
alphaspec/validate.py,sha256=BLuSvN7Dt1emR8WRx8v6UgLtoN1v--JOiGCKBktdY30,3780
|
|
8
|
+
alphaspec/_data/catalog/indicators.json,sha256=7WXN09oS8oVdozqUm0RY7uXZsllz8sZkdcAGq709eAk,422773
|
|
9
|
+
alphaspec/_data/catalog/i18n/en.json,sha256=HFqbICVTxq6hvV-0BPGqsASPVcqitHMI86fcuna_YCc,158511
|
|
10
|
+
alphaspec/_data/docs/MARKETS.md,sha256=RsSLLK86fvuM5EDNvPoRr6bxtDalQgp1q0nAjNj--1Q,1730
|
|
11
|
+
alphaspec/_data/docs/RULES.md,sha256=mkMeLVu9857mHY_4jt4-fcQ03-iGEL0N4GcpK-2Nkk0,4592
|
|
12
|
+
alphaspec/_data/docs/RUNTIME_API.md,sha256=_g-6zCZhYjyz7z7heqby7ngFCntXqhFtGt3Ea3lWwHQ,4194
|
|
13
|
+
alphaspec/_data/docs/SPEC.md,sha256=bC5VfXx4UhNy3Cr_XARDIbloFv004iNt_VKWQiMjz6g,4786
|
|
14
|
+
alphaspec/_data/examples/artifacts/01-ema-cross-us-equity.json,sha256=cwj4uSm9tJcz2Rig1ADzspocq4KhXPrSCApIhV3d49U,776
|
|
15
|
+
alphaspec/_data/examples/artifacts/02-rsi-reversion-params.json,sha256=kxU847NPq6c0RYYUwkDhWi1lm30IT1NogJg5cntvTHg,1016
|
|
16
|
+
alphaspec/_data/examples/artifacts/03-mtf-trend-pullback.json,sha256=zIYsVvmWMhTGpK3GMBNclTlXXTxrVkRfx7Xq_CKOjk4,1184
|
|
17
|
+
alphaspec/_data/examples/artifacts/04-breakout-retest-sequence.json,sha256=CV23IooLHOlLqSueIV5L7Wq3vSKFw4fQw26p0eukTNE,1254
|
|
18
|
+
alphaspec/_data/examples/artifacts/05-cn-limit-up-pullback.json,sha256=BMOhRwcYD-N8TLPR8FOdp3M0oQJ4wyv2GVeqJdFxoUU,1680
|
|
19
|
+
alphaspec/_data/examples/scores/01-model-scores-cn-stock.json,sha256=KRNsMyUpXrYKBXr9bHt4gr6YEAGIszGmyVn-ydTupTs,627
|
|
20
|
+
alphaspec/_data/examples/scores/02-target-weights-us-equity.json,sha256=CIljymRPBp4dwaaQqm8gzzVoDwygouVxBtwffazKG18,332
|
|
21
|
+
alphaspec/_data/schema/0.1/artifact.schema.json,sha256=D8O9yJtLP_ihm91U6lekps9-rsZt2-pWPNIHXOznZyo,11847
|
|
22
|
+
alphaspec/_data/schema/0.1/common.schema.json,sha256=vgnwuQhgYLAQr0U1G_95LSNaGLU4aZaO-JCVeuN7Jos,5084
|
|
23
|
+
alphaspec/_data/schema/0.1/evidence.schema.json,sha256=fa6qPMxZaJP8uR1AeTW-Pvgru4tMQ0RyHE0zwDAD5aA,6063
|
|
24
|
+
alphaspec/_data/schema/0.1/gate-result.schema.json,sha256=iB7MR4mAAUQjcRvKzeHEkST6t_QOqigCPbInwn5fhy8,2825
|
|
25
|
+
alphaspec/_data/schema/0.1/score.schema.json,sha256=SZ4OIFJtRnA77WkmyoDbj5Bk7Ce7ImGWgpIBzqZPCZw,3542
|
|
26
|
+
alphaspec/_data/skills/alphaspec/SKILL.md,sha256=PmVjPQYhfZBtsNoH8lNu2daWjHRkbbsnqt3dTiZFvv8,6210
|
|
27
|
+
alphaspec-0.1.0.dist-info/METADATA,sha256=4fbZQL-j1-ZpCj7rN0ysQj87pet5hjqayM5-4Y4sYfk,15934
|
|
28
|
+
alphaspec-0.1.0.dist-info/WHEEL,sha256=W3fkpkm7-wf9vBI5Z-7s0eWkeM-spu78I8Neb98DeEg,87
|
|
29
|
+
alphaspec-0.1.0.dist-info/entry_points.txt,sha256=XeVbKgg8dCzV6f44MmRoIr0VdkrjNDFHx8-0E_mYvfk,91
|
|
30
|
+
alphaspec-0.1.0.dist-info/licenses/LICENSE,sha256=z8d0m5b2O9McPEK1xHG_dWgUBT6EfBDz6wA0F7xSPTA,11358
|
|
31
|
+
alphaspec-0.1.0.dist-info/RECORD,,
|
|
@@ -0,0 +1,202 @@
|
|
|
1
|
+
|
|
2
|
+
Apache License
|
|
3
|
+
Version 2.0, January 2004
|
|
4
|
+
http://www.apache.org/licenses/
|
|
5
|
+
|
|
6
|
+
TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION
|
|
7
|
+
|
|
8
|
+
1. Definitions.
|
|
9
|
+
|
|
10
|
+
"License" shall mean the terms and conditions for use, reproduction,
|
|
11
|
+
and distribution as defined by Sections 1 through 9 of this document.
|
|
12
|
+
|
|
13
|
+
"Licensor" shall mean the copyright owner or entity authorized by
|
|
14
|
+
the copyright owner that is granting the License.
|
|
15
|
+
|
|
16
|
+
"Legal Entity" shall mean the union of the acting entity and all
|
|
17
|
+
other entities that control, are controlled by, or are under common
|
|
18
|
+
control with that entity. For the purposes of this definition,
|
|
19
|
+
"control" means (i) the power, direct or indirect, to cause the
|
|
20
|
+
direction or management of such entity, whether by contract or
|
|
21
|
+
otherwise, or (ii) ownership of fifty percent (50%) or more of the
|
|
22
|
+
outstanding shares, or (iii) beneficial ownership of such entity.
|
|
23
|
+
|
|
24
|
+
"You" (or "Your") shall mean an individual or Legal Entity
|
|
25
|
+
exercising permissions granted by this License.
|
|
26
|
+
|
|
27
|
+
"Source" form shall mean the preferred form for making modifications,
|
|
28
|
+
including but not limited to software source code, documentation
|
|
29
|
+
source, and configuration files.
|
|
30
|
+
|
|
31
|
+
"Object" form shall mean any form resulting from mechanical
|
|
32
|
+
transformation or translation of a Source form, including but
|
|
33
|
+
not limited to compiled object code, generated documentation,
|
|
34
|
+
and conversions to other media types.
|
|
35
|
+
|
|
36
|
+
"Work" shall mean the work of authorship, whether in Source or
|
|
37
|
+
Object form, made available under the License, as indicated by a
|
|
38
|
+
copyright notice that is included in or attached to the work
|
|
39
|
+
(an example is provided in the Appendix below).
|
|
40
|
+
|
|
41
|
+
"Derivative Works" shall mean any work, whether in Source or Object
|
|
42
|
+
form, that is based on (or derived from) the Work and for which the
|
|
43
|
+
editorial revisions, annotations, elaborations, or other modifications
|
|
44
|
+
represent, as a whole, an original work of authorship. For the purposes
|
|
45
|
+
of this License, Derivative Works shall not include works that remain
|
|
46
|
+
separable from, or merely link (or bind by name) to the interfaces of,
|
|
47
|
+
the Work and Derivative Works thereof.
|
|
48
|
+
|
|
49
|
+
"Contribution" shall mean any work of authorship, including
|
|
50
|
+
the original version of the Work and any modifications or additions
|
|
51
|
+
to that Work or Derivative Works thereof, that is intentionally
|
|
52
|
+
submitted to Licensor for inclusion in the Work by the copyright owner
|
|
53
|
+
or by an individual or Legal Entity authorized to submit on behalf of
|
|
54
|
+
the copyright owner. For the purposes of this definition, "submitted"
|
|
55
|
+
means any form of electronic, verbal, or written communication sent
|
|
56
|
+
to the Licensor or its representatives, including but not limited to
|
|
57
|
+
communication on electronic mailing lists, source code control systems,
|
|
58
|
+
and issue tracking systems that are managed by, or on behalf of, the
|
|
59
|
+
Licensor for the purpose of discussing and improving the Work, but
|
|
60
|
+
excluding communication that is conspicuously marked or otherwise
|
|
61
|
+
designated in writing by the copyright owner as "Not a Contribution."
|
|
62
|
+
|
|
63
|
+
"Contributor" shall mean Licensor and any individual or Legal Entity
|
|
64
|
+
on behalf of whom a Contribution has been received by Licensor and
|
|
65
|
+
subsequently incorporated within the Work.
|
|
66
|
+
|
|
67
|
+
2. Grant of Copyright License. Subject to the terms and conditions of
|
|
68
|
+
this License, each Contributor hereby grants to You a perpetual,
|
|
69
|
+
worldwide, non-exclusive, no-charge, royalty-free, irrevocable
|
|
70
|
+
copyright license to reproduce, prepare Derivative Works of,
|
|
71
|
+
publicly display, publicly perform, sublicense, and distribute the
|
|
72
|
+
Work and such Derivative Works in Source or Object form.
|
|
73
|
+
|
|
74
|
+
3. Grant of Patent License. Subject to the terms and conditions of
|
|
75
|
+
this License, each Contributor hereby grants to You a perpetual,
|
|
76
|
+
worldwide, non-exclusive, no-charge, royalty-free, irrevocable
|
|
77
|
+
(except as stated in this section) patent license to make, have made,
|
|
78
|
+
use, offer to sell, sell, import, and otherwise transfer the Work,
|
|
79
|
+
where such license applies only to those patent claims licensable
|
|
80
|
+
by such Contributor that are necessarily infringed by their
|
|
81
|
+
Contribution(s) alone or by combination of their Contribution(s)
|
|
82
|
+
with the Work to which such Contribution(s) was submitted. If You
|
|
83
|
+
institute patent litigation against any entity (including a
|
|
84
|
+
cross-claim or counterclaim in a lawsuit) alleging that the Work
|
|
85
|
+
or a Contribution incorporated within the Work constitutes direct
|
|
86
|
+
or contributory patent infringement, then any patent licenses
|
|
87
|
+
granted to You under this License for that Work shall terminate
|
|
88
|
+
as of the date such litigation is filed.
|
|
89
|
+
|
|
90
|
+
4. Redistribution. You may reproduce and distribute copies of the
|
|
91
|
+
Work or Derivative Works thereof in any medium, with or without
|
|
92
|
+
modifications, and in Source or Object form, provided that You
|
|
93
|
+
meet the following conditions:
|
|
94
|
+
|
|
95
|
+
(a) You must give any other recipients of the Work or
|
|
96
|
+
Derivative Works a copy of this License; and
|
|
97
|
+
|
|
98
|
+
(b) You must cause any modified files to carry prominent notices
|
|
99
|
+
stating that You changed the files; and
|
|
100
|
+
|
|
101
|
+
(c) You must retain, in the Source form of any Derivative Works
|
|
102
|
+
that You distribute, all copyright, patent, trademark, and
|
|
103
|
+
attribution notices from the Source form of the Work,
|
|
104
|
+
excluding those notices that do not pertain to any part of
|
|
105
|
+
the Derivative Works; and
|
|
106
|
+
|
|
107
|
+
(d) If the Work includes a "NOTICE" text file as part of its
|
|
108
|
+
distribution, then any Derivative Works that You distribute must
|
|
109
|
+
include a readable copy of the attribution notices contained
|
|
110
|
+
within such NOTICE file, excluding those notices that do not
|
|
111
|
+
pertain to any part of the Derivative Works, in at least one
|
|
112
|
+
of the following places: within a NOTICE text file distributed
|
|
113
|
+
as part of the Derivative Works; within the Source form or
|
|
114
|
+
documentation, if provided along with the Derivative Works; or,
|
|
115
|
+
within a display generated by the Derivative Works, if and
|
|
116
|
+
wherever such third-party notices normally appear. The contents
|
|
117
|
+
of the NOTICE file are for informational purposes only and
|
|
118
|
+
do not modify the License. You may add Your own attribution
|
|
119
|
+
notices within Derivative Works that You distribute, alongside
|
|
120
|
+
or as an addendum to the NOTICE text from the Work, provided
|
|
121
|
+
that such additional attribution notices cannot be construed
|
|
122
|
+
as modifying the License.
|
|
123
|
+
|
|
124
|
+
You may add Your own copyright statement to Your modifications and
|
|
125
|
+
may provide additional or different license terms and conditions
|
|
126
|
+
for use, reproduction, or distribution of Your modifications, or
|
|
127
|
+
for any such Derivative Works as a whole, provided Your use,
|
|
128
|
+
reproduction, and distribution of the Work otherwise complies with
|
|
129
|
+
the conditions stated in this License.
|
|
130
|
+
|
|
131
|
+
5. Submission of Contributions. Unless You explicitly state otherwise,
|
|
132
|
+
any Contribution intentionally submitted for inclusion in the Work
|
|
133
|
+
by You to the Licensor shall be under the terms and conditions of
|
|
134
|
+
this License, without any additional terms or conditions.
|
|
135
|
+
Notwithstanding the above, nothing herein shall supersede or modify
|
|
136
|
+
the terms of any separate license agreement you may have executed
|
|
137
|
+
with Licensor regarding such Contributions.
|
|
138
|
+
|
|
139
|
+
6. Trademarks. This License does not grant permission to use the trade
|
|
140
|
+
names, trademarks, service marks, or product names of the Licensor,
|
|
141
|
+
except as required for reasonable and customary use in describing the
|
|
142
|
+
origin of the Work and reproducing the content of the NOTICE file.
|
|
143
|
+
|
|
144
|
+
7. Disclaimer of Warranty. Unless required by applicable law or
|
|
145
|
+
agreed to in writing, Licensor provides the Work (and each
|
|
146
|
+
Contributor provides its Contributions) on an "AS IS" BASIS,
|
|
147
|
+
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
|
|
148
|
+
implied, including, without limitation, any warranties or conditions
|
|
149
|
+
of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A
|
|
150
|
+
PARTICULAR PURPOSE. You are solely responsible for determining the
|
|
151
|
+
appropriateness of using or redistributing the Work and assume any
|
|
152
|
+
risks associated with Your exercise of permissions under this License.
|
|
153
|
+
|
|
154
|
+
8. Limitation of Liability. In no event and under no legal theory,
|
|
155
|
+
whether in tort (including negligence), contract, or otherwise,
|
|
156
|
+
unless required by applicable law (such as deliberate and grossly
|
|
157
|
+
negligent acts) or agreed to in writing, shall any Contributor be
|
|
158
|
+
liable to You for damages, including any direct, indirect, special,
|
|
159
|
+
incidental, or consequential damages of any character arising as a
|
|
160
|
+
result of this License or out of the use or inability to use the
|
|
161
|
+
Work (including but not limited to damages for loss of goodwill,
|
|
162
|
+
work stoppage, computer failure or malfunction, or any and all
|
|
163
|
+
other commercial damages or losses), even if such Contributor
|
|
164
|
+
has been advised of the possibility of such damages.
|
|
165
|
+
|
|
166
|
+
9. Accepting Warranty or Additional Liability. While redistributing
|
|
167
|
+
the Work or Derivative Works thereof, You may choose to offer,
|
|
168
|
+
and charge a fee for, acceptance of support, warranty, indemnity,
|
|
169
|
+
or other liability obligations and/or rights consistent with this
|
|
170
|
+
License. However, in accepting such obligations, You may act only
|
|
171
|
+
on Your own behalf and on Your sole responsibility, not on behalf
|
|
172
|
+
of any other Contributor, and only if You agree to indemnify,
|
|
173
|
+
defend, and hold each Contributor harmless for any liability
|
|
174
|
+
incurred by, or claims asserted against, such Contributor by reason
|
|
175
|
+
of your accepting any such warranty or additional liability.
|
|
176
|
+
|
|
177
|
+
END OF TERMS AND CONDITIONS
|
|
178
|
+
|
|
179
|
+
APPENDIX: How to apply the Apache License to your work.
|
|
180
|
+
|
|
181
|
+
To apply the Apache License to your work, attach the following
|
|
182
|
+
boilerplate notice, with the fields enclosed by brackets "[]"
|
|
183
|
+
replaced with your own identifying information. (Don't include
|
|
184
|
+
the brackets!) The text should be enclosed in the appropriate
|
|
185
|
+
comment syntax for the file format. We also recommend that a
|
|
186
|
+
file or class name and description of purpose be included on the
|
|
187
|
+
same "printed page" as the copyright notice for easier
|
|
188
|
+
identification within third-party archives.
|
|
189
|
+
|
|
190
|
+
Copyright [yyyy] [name of copyright owner]
|
|
191
|
+
|
|
192
|
+
Licensed under the Apache License, Version 2.0 (the "License");
|
|
193
|
+
you may not use this file except in compliance with the License.
|
|
194
|
+
You may obtain a copy of the License at
|
|
195
|
+
|
|
196
|
+
http://www.apache.org/licenses/LICENSE-2.0
|
|
197
|
+
|
|
198
|
+
Unless required by applicable law or agreed to in writing, software
|
|
199
|
+
distributed under the License is distributed on an "AS IS" BASIS,
|
|
200
|
+
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
201
|
+
See the License for the specific language governing permissions and
|
|
202
|
+
limitations under the License.
|