while25 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.
- while25/__init__.py +341 -0
- while25/_costs/brokers/alpaca.json +96 -0
- while25/_costs/brokers/binance.json +34 -0
- while25/_costs/brokers/coinbase.json +34 -0
- while25/_costs/brokers/ibkr.json +39 -0
- while25/_costs/brokers/upstox.json +175 -0
- while25/_costs/brokers/zerodha.json +175 -0
- while25/_costs/crypto_alpaca.json +27 -0
- while25/_costs/global_crypto.json +18 -0
- while25/_costs/in_nse_equity.json +238 -0
- while25/_costs/in_nse_etf.json +352 -0
- while25/_costs/in_nse_fo.json +450 -0
- while25/_costs/us_crypto.json +18 -0
- while25/_costs/us_equity.json +175 -0
- while25/_costs/us_options.json +172 -0
- while25/_days.py +123 -0
- while25/_figures.py +233 -0
- while25/_runtime.py +49 -0
- while25/_universes/banknifty.json +80 -0
- while25/_universes/ndx100.json +520 -0
- while25/_universes/nifty50.json +260 -0
- while25/_universes/nifty500.json +2505 -0
- while25/_universes/sp500.json +2525 -0
- while25/assume.py +263 -0
- while25/backtest.py +881 -0
- while25/barline.py +160 -0
- while25/combo_legs.py +238 -0
- while25/errors.py +77 -0
- while25/fonts/IBMPlexMono-Regular.ttf +0 -0
- while25/fonts/IBMPlexMono-SemiBold.ttf +0 -0
- while25/fonts/Inter-Bold.ttf +0 -0
- while25/fonts/Inter-Regular.ttf +0 -0
- while25/fonts/Inter-SemiBold.ttf +0 -0
- while25/fonts/OFL-IBMPlexMono.txt +93 -0
- while25/fonts/OFL-Inter.txt +93 -0
- while25/future_pick.py +77 -0
- while25/inputs.py +215 -0
- while25/instruments.py +488 -0
- while25/modules.py +397 -0
- while25/money.py +24 -0
- while25/option_pick.py +221 -0
- while25/plots.py +147 -0
- while25/report.py +644 -0
- while25/ui.py +680 -0
- while25/universes.py +70 -0
- while25-0.1.0.dist-info/METADATA +3194 -0
- while25-0.1.0.dist-info/RECORD +50 -0
- while25-0.1.0.dist-info/WHEEL +5 -0
- while25-0.1.0.dist-info/licenses/LICENSE +201 -0
- while25-0.1.0.dist-info/top_level.txt +1 -0
while25/__init__.py
ADDED
|
@@ -0,0 +1,341 @@
|
|
|
1
|
+
"""The While25 Python SDK.
|
|
2
|
+
|
|
3
|
+
User code imports `while25`, never the terminal's runtime — this package is
|
|
4
|
+
the artifact published to PyPI, and the runtime around it is an implementation detail.
|
|
5
|
+
|
|
6
|
+
The package IS the API. Inside a running module every call is a package-level
|
|
7
|
+
call on the module the terminal is running:
|
|
8
|
+
|
|
9
|
+
import while25
|
|
10
|
+
from while25 import Strategy, on
|
|
11
|
+
|
|
12
|
+
class Breakout(Strategy):
|
|
13
|
+
id = "breakout"
|
|
14
|
+
|
|
15
|
+
@on.bar("IDX:IN:NIFTY", interval="5m")
|
|
16
|
+
def bar(self, ctx, bar):
|
|
17
|
+
rows = while25.candles("IDX:IN:NIFTY", "5m", limit=50)
|
|
18
|
+
if while25.market.is_open("IDX:IN:NIFTY") and bar["close"] > rows[-2]["high"]:
|
|
19
|
+
while25.buy("IDX:IN:NIFTY", 1, stop_loss=bar["low"])
|
|
20
|
+
while25.log("checked")
|
|
21
|
+
|
|
22
|
+
Shorten it yourself if you like (`import while25 as w25`); the package keeps
|
|
23
|
+
its full name. The `ctx` a handler receives is the same object the package
|
|
24
|
+
acts on, kept for explicit use and for tests.
|
|
25
|
+
"""
|
|
26
|
+
from . import _runtime, backtest, inputs, plots, ui
|
|
27
|
+
from ._runtime import use
|
|
28
|
+
from .errors import OrderRightsError, SubscriptionError, While25Error
|
|
29
|
+
from .instruments import Instrument
|
|
30
|
+
from .money import Money
|
|
31
|
+
from .plots import Band, Fill, Level, Plot
|
|
32
|
+
# NOT a file named bars.py: importing one would bind the submodule as
|
|
33
|
+
# `while25.bars`, in front of the live `while25.bars` an indicator reads
|
|
34
|
+
# (_LIVE_ATTRS below), and every indicator would be handed a module object.
|
|
35
|
+
from .barline import Bars
|
|
36
|
+
from .modules import App, Indicator, Module, Monitor, Strategy, Subscription, on
|
|
37
|
+
from .universes import universe, universe_info, universes
|
|
38
|
+
# A combo's leg (2026-10-25): a plain dict, built and checked with no module
|
|
39
|
+
# running, so a strategy can write its legs anywhere, and a test can too.
|
|
40
|
+
from .combo_legs import leg
|
|
41
|
+
|
|
42
|
+
SDK_VERSION = "0.1.0"
|
|
43
|
+
|
|
44
|
+
|
|
45
|
+
def _ctx():
|
|
46
|
+
return _runtime.current()
|
|
47
|
+
|
|
48
|
+
|
|
49
|
+
class _Namespace:
|
|
50
|
+
"""`while25.orders`, `while25.data`, ...: the running module's own."""
|
|
51
|
+
|
|
52
|
+
def __init__(self, name: str) -> None:
|
|
53
|
+
self._name = name
|
|
54
|
+
|
|
55
|
+
def __getattr__(self, attr: str):
|
|
56
|
+
try:
|
|
57
|
+
ctx = _ctx()
|
|
58
|
+
except RuntimeError:
|
|
59
|
+
if self._name == "data" and attr in ("catalog", "describe", "fetch", "get"):
|
|
60
|
+
raise RuntimeError(f"while25.data.{attr} runs inside the While25 desktop app") from None
|
|
61
|
+
raise
|
|
62
|
+
return getattr(getattr(ctx, self._name), attr)
|
|
63
|
+
|
|
64
|
+
def __dir__(self):
|
|
65
|
+
"""What this name really offers: the running module's own calls
|
|
66
|
+
(2026-11-14). It resolves each name only when called, so a listing
|
|
67
|
+
(`dir()`, `help()`, an editor's completion) used to show nothing: the
|
|
68
|
+
in-app assistant listed `while25.ai`, saw no function and told its
|
|
69
|
+
user that asking the AI did not exist. PUBLIC names only. A listing
|
|
70
|
+
grants nothing: every call is judged when it is made, by the runtime
|
|
71
|
+
and not by this package."""
|
|
72
|
+
try:
|
|
73
|
+
target = getattr(_ctx(), self._name)
|
|
74
|
+
except Exception: # noqa: BLE001 — no module running: nothing to list from
|
|
75
|
+
return sorted(super().__dir__())
|
|
76
|
+
return sorted(n for n in dir(target) if not n.startswith("_"))
|
|
77
|
+
|
|
78
|
+
def __repr__(self) -> str: # pragma: no cover - debugging aid
|
|
79
|
+
return f"<while25.{self._name}>"
|
|
80
|
+
|
|
81
|
+
|
|
82
|
+
data = _Namespace("data")
|
|
83
|
+
orders = _Namespace("orders")
|
|
84
|
+
portfolio = _Namespace("portfolio")
|
|
85
|
+
market = _Namespace("market")
|
|
86
|
+
chart = _Namespace("chart")
|
|
87
|
+
viz = _Namespace("viz")
|
|
88
|
+
# while25.ai.ask(question, data=, choices=, timeout=): one question for the
|
|
89
|
+
# AI, from a Monitor only (2026-11-13).
|
|
90
|
+
ai = _Namespace("ai")
|
|
91
|
+
|
|
92
|
+
|
|
93
|
+
# ---- the module itself ----
|
|
94
|
+
|
|
95
|
+
def log(message: str, level: str = "info") -> None:
|
|
96
|
+
"""Write to the module's console."""
|
|
97
|
+
return _ctx().log(message, level)
|
|
98
|
+
|
|
99
|
+
|
|
100
|
+
def notify(message: str, *, title: str = "", level: str = "info", symbol: str = "") -> None:
|
|
101
|
+
"""Tell the trader: a notice in the app, kept in its Monitors panel.
|
|
102
|
+
`level` "info" | "warn" | "error"; `symbol` the instrument it is about."""
|
|
103
|
+
return _ctx().notify(message, title=title, level=level, symbol=symbol)
|
|
104
|
+
|
|
105
|
+
|
|
106
|
+
def emit(name: str, payload=None) -> None:
|
|
107
|
+
"""Publish a signal another module can `@on.signal(name)`."""
|
|
108
|
+
return _ctx().emit(name, payload)
|
|
109
|
+
|
|
110
|
+
|
|
111
|
+
def subscribe(key: str, on_tick=None) -> bool:
|
|
112
|
+
"""Ask the terminal to make `key` live for this module.
|
|
113
|
+
|
|
114
|
+
Returns at once — the ask IS the subscription, so there is no verdict to
|
|
115
|
+
wait for and this can never time out. Raises SubscriptionError only for
|
|
116
|
+
what the engine refuses immediately (over the lane's cap, no vendor for
|
|
117
|
+
the key).
|
|
118
|
+
|
|
119
|
+
`on_tick=self.some_method` calls that method with (ctx, tick) on every
|
|
120
|
+
tick of `key`, as `@on.tick` does for a symbol written in the file — for a
|
|
121
|
+
symbol known only while running (a setting, an option from `option()`).
|
|
122
|
+
TypeError when it is not one of the strategy's own methods."""
|
|
123
|
+
if on_tick is None:
|
|
124
|
+
return _ctx().subscribe(key)
|
|
125
|
+
return _ctx().subscribe(key, on_tick=on_tick)
|
|
126
|
+
|
|
127
|
+
|
|
128
|
+
def unsubscribe(key: str) -> bool:
|
|
129
|
+
"""Give `key` back. A key this module never held is a no-op."""
|
|
130
|
+
return _ctx().unsubscribe(key)
|
|
131
|
+
|
|
132
|
+
|
|
133
|
+
def option(underlying: str, expiry, right, strike, *, settlement: str = "pm",
|
|
134
|
+
atm_from: str = "options") -> dict:
|
|
135
|
+
"""One listed option contract from a description:
|
|
136
|
+
|
|
137
|
+
c = while25.option("AAPL", expiry="26th", right="CALL", strike="ATM+2")
|
|
138
|
+
while25.buy(c["instrument_key"], c["lot_size"])
|
|
139
|
+
|
|
140
|
+
`strike` is a listed price or ATM / ATM+N / ATM-N (N strikes higher or
|
|
141
|
+
lower than the one nearest the money, calls and puts alike).
|
|
142
|
+
`settlement` "pm" (default) or "am"; `atm_from` "options" (default, the
|
|
143
|
+
forward the option prices place) or "spot" (the underlying's price).
|
|
144
|
+
See the guide's "Options" section for what it returns and refuses."""
|
|
145
|
+
return _ctx().option(underlying, expiry, right, strike,
|
|
146
|
+
settlement=settlement, atm_from=atm_from)
|
|
147
|
+
|
|
148
|
+
|
|
149
|
+
def future(root: str, expiry="front") -> dict:
|
|
150
|
+
"""One dated futures contract of a root:
|
|
151
|
+
|
|
152
|
+
c = while25.future("MNQ") # the chart's continuous MNQ's contract now
|
|
153
|
+
while25.buy(c["instrument_key"], 1)
|
|
154
|
+
while25.future("MNQ", "next") # the one after it, for a roll
|
|
155
|
+
while25.future("MNQ", "2027-03") # a named contract month
|
|
156
|
+
|
|
157
|
+
"front" rolls when the chart's continuous line rolls. Nothing is rolled
|
|
158
|
+
for you: call it again, and when the front has moved on, close the old
|
|
159
|
+
contract and open the new one. See the guide's "Futures" section."""
|
|
160
|
+
return _ctx().future(root, expiry)
|
|
161
|
+
|
|
162
|
+
|
|
163
|
+
def indicator(cls, *, bars=None, forming: bool = False, instrument: str = "",
|
|
164
|
+
interval: str = "", **params) -> dict:
|
|
165
|
+
"""Work another indicator out here, from the bars you hand it, drawing
|
|
166
|
+
nothing; returns what its compute() returned:
|
|
167
|
+
|
|
168
|
+
rsi = while25.indicator(MyRsi, bars=self.rows, length=14)["rsi"]
|
|
169
|
+
|
|
170
|
+
`bars`: your own, oldest first (warm-up and @on.bar bars, or candles()
|
|
171
|
+
rows); only a chart hands an indicator bars by itself. `forming=True`:
|
|
172
|
+
also the bar still forming on that @on.bar line, as While25 last sampled
|
|
173
|
+
it. `instrument` / `interval`: what it reads as
|
|
174
|
+
while25.instrument / interval, the bars' own when left out. Every other
|
|
175
|
+
keyword is one of its inputs. See the guide's "An indicator's numbers in
|
|
176
|
+
a strategy"."""
|
|
177
|
+
# Only what was asked for goes on: a test's stand-in ctx written before
|
|
178
|
+
# these two existed takes every other keyword as one of the inputs.
|
|
179
|
+
own = {}
|
|
180
|
+
if bars is not None:
|
|
181
|
+
own["bars"] = bars
|
|
182
|
+
if forming:
|
|
183
|
+
own["forming"] = True
|
|
184
|
+
return _ctx().indicator(cls, instrument=instrument, interval=interval, **own, **params)
|
|
185
|
+
|
|
186
|
+
|
|
187
|
+
def alive() -> bool:
|
|
188
|
+
"""False once the terminal has asked this module to stop — what a run()
|
|
189
|
+
loop checks to return in time.
|
|
190
|
+
|
|
191
|
+
The running module's ctx states it as a property (`ctx.alive`); calling
|
|
192
|
+
that bool raised TypeError, so every `while25.alive()` failed. A ctx a
|
|
193
|
+
test hands in may state it as a method instead: both are read."""
|
|
194
|
+
state = _ctx().alive
|
|
195
|
+
return bool(state() if callable(state) else state)
|
|
196
|
+
|
|
197
|
+
|
|
198
|
+
# ---- market data, one level up ----
|
|
199
|
+
|
|
200
|
+
def candles(symbol: str, interval: str = "1D", **kw) -> list:
|
|
201
|
+
"""while25.data.candles: start=, end=, limit=, source=, hours= ("eth" for
|
|
202
|
+
the full session; left out = the regular session), adjust= ("split"
|
|
203
|
+
for split-adjusted prices where the vendor states them) and price=
|
|
204
|
+
("mark" for a Binance USD-M futures contract's mark candles; left out =
|
|
205
|
+
the last trade)."""
|
|
206
|
+
return _ctx().data.candles(symbol, interval, **kw)
|
|
207
|
+
|
|
208
|
+
|
|
209
|
+
def history(symbol: str, interval: str = "1D", **kw) -> list:
|
|
210
|
+
return _ctx().data.history(symbol, interval, **kw)
|
|
211
|
+
|
|
212
|
+
|
|
213
|
+
def history_span(symbol: str, interval: str, start: str, end: str, **kw) -> dict:
|
|
214
|
+
"""while25.data.history_span: every bar of one series over [start, end],
|
|
215
|
+
fetched strictly through the engine's history service, with progress in
|
|
216
|
+
the module's log and the trading days it is missing. Blocks: call it from
|
|
217
|
+
on_start, a schedule or a run, never from a tick handler."""
|
|
218
|
+
return _ctx().data.history_span(symbol, interval, start, end, **kw)
|
|
219
|
+
|
|
220
|
+
|
|
221
|
+
def warmup(symbol: str, interval: str, bars: int, *, hours: "str | None" = None) -> list:
|
|
222
|
+
"""while25.data.warmup: the last `bars` finished bars of one of this
|
|
223
|
+
strategy's @on.bar lines, fetched the way a backtest's history is and
|
|
224
|
+
checked before it is handed on (no trading day missing, no bar still
|
|
225
|
+
forming, one grid with the line's live bars, no bar left out at the
|
|
226
|
+
join), in the shape an @on.bar handler's bar has. Call it in on_start;
|
|
227
|
+
a refusal raises and the start fails with the reason. A live bar it
|
|
228
|
+
already gave is not delivered to the line's handlers again."""
|
|
229
|
+
return _ctx().data.warmup(symbol, interval, bars, hours=hours)
|
|
230
|
+
|
|
231
|
+
|
|
232
|
+
def historical(symbol: str, interval: str = "1D", **kw) -> list:
|
|
233
|
+
"""while25.data.historical: candles(source="historical"), same hours= and
|
|
234
|
+
adjust=. Intraday intervals stay within a bar budget (about 17 days of
|
|
235
|
+
1m): a backtest's data comes from history_span()."""
|
|
236
|
+
return _ctx().data.historical(symbol, interval, **kw)
|
|
237
|
+
|
|
238
|
+
|
|
239
|
+
def intraday(symbol: str, interval: str = "5m", **kw) -> list:
|
|
240
|
+
"""while25.data.intraday: candles(source="intraday"), same hours=."""
|
|
241
|
+
return _ctx().data.intraday(symbol, interval, **kw)
|
|
242
|
+
|
|
243
|
+
|
|
244
|
+
def quote(symbol: str):
|
|
245
|
+
return _ctx().data.quote(symbol)
|
|
246
|
+
|
|
247
|
+
|
|
248
|
+
def quotes(symbols) -> list:
|
|
249
|
+
return _ctx().data.quotes(symbols)
|
|
250
|
+
|
|
251
|
+
|
|
252
|
+
def news(symbols=None, **kw) -> list:
|
|
253
|
+
return _ctx().data.news(symbols, **kw)
|
|
254
|
+
|
|
255
|
+
|
|
256
|
+
# ---- orders, one level up (Strategy only; the kind is enforced underneath) ----
|
|
257
|
+
#
|
|
258
|
+
# `quantity` is optional HERE because it is optional underneath: an order is
|
|
259
|
+
# sized by `quantity=` or by `amount=` (a cash amount), exactly one. A required
|
|
260
|
+
# positional here made `while25.buy(key, amount=5000)` a TypeError before the
|
|
261
|
+
# order code was ever reached, while the same call on `ctx.orders` worked. The
|
|
262
|
+
# "exactly one" rule is place()'s to state, in words, not Python's.
|
|
263
|
+
|
|
264
|
+
def buy(instrument_key: str, quantity=None, **kw) -> dict:
|
|
265
|
+
return _ctx().orders.buy(instrument_key, quantity, **kw)
|
|
266
|
+
|
|
267
|
+
|
|
268
|
+
def sell(instrument_key: str, quantity=None, **kw) -> dict:
|
|
269
|
+
return _ctx().orders.sell(instrument_key, quantity, **kw)
|
|
270
|
+
|
|
271
|
+
|
|
272
|
+
def place(instrument_key: str, side: str, quantity=None, **kw) -> dict:
|
|
273
|
+
return _ctx().orders.place(instrument_key, side, quantity, **kw)
|
|
274
|
+
|
|
275
|
+
|
|
276
|
+
def bracket(instrument_key: str, side: str, quantity=None, **kw) -> dict:
|
|
277
|
+
return _ctx().orders.bracket(instrument_key, side, quantity, **kw)
|
|
278
|
+
|
|
279
|
+
|
|
280
|
+
def cancel(order_id: str) -> dict:
|
|
281
|
+
return _ctx().orders.cancel(order_id)
|
|
282
|
+
|
|
283
|
+
|
|
284
|
+
def square_off(bracket_id: str) -> dict:
|
|
285
|
+
return _ctx().orders.square_off(bracket_id)
|
|
286
|
+
|
|
287
|
+
|
|
288
|
+
def combo(legs, lots=1, **kw) -> dict:
|
|
289
|
+
"""while25.orders.combo: two to ten option legs placed as ONE combo
|
|
290
|
+
(2026-10-25), the way Deploy in Options Execution places a design:
|
|
291
|
+
|
|
292
|
+
legs = [while25.leg(put_far, "BUY"), while25.leg(put_near, "SELL"),
|
|
293
|
+
while25.leg(call_near, "SELL"), while25.leg(call_far, "BUY")]
|
|
294
|
+
c = while25.combo(legs, lots=1, name="Iron condor")
|
|
295
|
+
|
|
296
|
+
order_type="MKT" (no leg states a price) or "LMT" (every leg its own
|
|
297
|
+
limit); also product=, validity=, hours=, name=, tag=, idempotency_key=.
|
|
298
|
+
See the guide's "Combos" section for how each broker takes it."""
|
|
299
|
+
return _ctx().orders.combo(legs, lots, **kw)
|
|
300
|
+
|
|
301
|
+
|
|
302
|
+
def modify(order_id: str, **kw) -> dict:
|
|
303
|
+
return _ctx().orders.modify(order_id, **kw)
|
|
304
|
+
|
|
305
|
+
|
|
306
|
+
# `while25.params`, `while25.instrument`, `while25.interval`, `while25.bars`,
|
|
307
|
+
# `while25.forming` and `while25.future_times` read the running module's own
|
|
308
|
+
# values at access time (PEP 562).
|
|
309
|
+
#
|
|
310
|
+
# `bars` / `forming` / `future_times` are what an INDICATOR is handed: the exact
|
|
311
|
+
# series the chart is drawing (scrollback included), the bucket still forming,
|
|
312
|
+
# and the projected grid a forecast must land on. They are package-level like
|
|
313
|
+
# everything else — the package IS the API, and an author should not have to
|
|
314
|
+
# switch spelling half-way through a file to reach the one thing compute() is
|
|
315
|
+
# actually about.
|
|
316
|
+
_LIVE_ATTRS = ("params", "instrument", "interval", "price",
|
|
317
|
+
"bars", "forming", "future_times")
|
|
318
|
+
|
|
319
|
+
|
|
320
|
+
def __getattr__(name: str):
|
|
321
|
+
if name in _LIVE_ATTRS:
|
|
322
|
+
return getattr(_ctx(), name)
|
|
323
|
+
raise AttributeError(f"module 'while25' has no attribute {name!r}")
|
|
324
|
+
|
|
325
|
+
|
|
326
|
+
__all__ = [
|
|
327
|
+
"App", "Indicator", "Module", "Monitor", "Strategy", "Subscription", "Bars",
|
|
328
|
+
"Plot", "Fill", "Level", "Band", "backtest", "inputs", "plots", "on", "ui", "use",
|
|
329
|
+
"While25Error", "OrderRightsError", "SubscriptionError",
|
|
330
|
+
"Money", "Instrument",
|
|
331
|
+
"data", "orders", "portfolio", "market", "chart", "viz", "ai",
|
|
332
|
+
"log", "notify", "emit", "subscribe", "unsubscribe", "option", "future", "indicator",
|
|
333
|
+
"alive",
|
|
334
|
+
"candles", "history", "history_span", "warmup", "historical", "intraday", "quote", "quotes",
|
|
335
|
+
"news",
|
|
336
|
+
"bars", "forming", "future_times",
|
|
337
|
+
"buy", "sell", "place", "bracket", "cancel", "modify", "square_off",
|
|
338
|
+
"combo", "leg",
|
|
339
|
+
"params", "instrument", "interval", "price",
|
|
340
|
+
"universe", "universe_info", "universes",
|
|
341
|
+
]
|
|
@@ -0,0 +1,96 @@
|
|
|
1
|
+
[
|
|
2
|
+
{
|
|
3
|
+
"_doc": "Retail self-directed account: no commission. Elite Smart Router and non-retail flow tariffs are not modelled.",
|
|
4
|
+
"schedule": "alpaca_us_eq",
|
|
5
|
+
"omitted": ["rounding to the cent", "Elite Smart Router and non-retail tariffs"],
|
|
6
|
+
"country": "US",
|
|
7
|
+
"segment": "EQ",
|
|
8
|
+
"currency": "USD",
|
|
9
|
+
"broker": "alpaca",
|
|
10
|
+
"rate_sets": [
|
|
11
|
+
{
|
|
12
|
+
"effective_from": "2026-10-24",
|
|
13
|
+
"source": "Alpaca Brokerage Fee Schedule (https://files.alpaca.markets/disclosures/library/BrokFeeSched.pdf), verified 2026-10-24",
|
|
14
|
+
"charges": [
|
|
15
|
+
{
|
|
16
|
+
"name": "commission",
|
|
17
|
+
"basis": "per_order",
|
|
18
|
+
"side": "both",
|
|
19
|
+
"product": "any",
|
|
20
|
+
"rate": 0,
|
|
21
|
+
"min": null,
|
|
22
|
+
"max": null,
|
|
23
|
+
"on": null
|
|
24
|
+
},
|
|
25
|
+
{
|
|
26
|
+
"name": "cat_fee",
|
|
27
|
+
"basis": "per_share",
|
|
28
|
+
"side": "both",
|
|
29
|
+
"product": "any",
|
|
30
|
+
"rate": 0.000003,
|
|
31
|
+
"min": null,
|
|
32
|
+
"max": null,
|
|
33
|
+
"on": null
|
|
34
|
+
}
|
|
35
|
+
]
|
|
36
|
+
}
|
|
37
|
+
]
|
|
38
|
+
},
|
|
39
|
+
{
|
|
40
|
+
"_doc": "Equity options, retail. Index options (USD 0.50/contract + per-symbol exchange fees) are not modelled. CAT is USD 0.000003 per executed equivalent share x 100 shares/contract.",
|
|
41
|
+
"schedule": "alpaca_us_opt",
|
|
42
|
+
"omitted": ["rounding to the cent", "index options (USD 0.50/contract plus per-symbol exchange fees)"],
|
|
43
|
+
"country": "US",
|
|
44
|
+
"segment": "OPT",
|
|
45
|
+
"currency": "USD",
|
|
46
|
+
"broker": "alpaca",
|
|
47
|
+
"rate_sets": [
|
|
48
|
+
{
|
|
49
|
+
"effective_from": "2026-10-24",
|
|
50
|
+
"source": "Alpaca Brokerage Fee Schedule (https://files.alpaca.markets/disclosures/library/BrokFeeSched.pdf), verified 2026-10-24",
|
|
51
|
+
"charges": [
|
|
52
|
+
{
|
|
53
|
+
"name": "commission",
|
|
54
|
+
"basis": "per_contract",
|
|
55
|
+
"side": "both",
|
|
56
|
+
"product": "any",
|
|
57
|
+
"rate": 0,
|
|
58
|
+
"min": null,
|
|
59
|
+
"max": null,
|
|
60
|
+
"on": null
|
|
61
|
+
},
|
|
62
|
+
{
|
|
63
|
+
"name": "orf",
|
|
64
|
+
"basis": "per_contract",
|
|
65
|
+
"side": "both",
|
|
66
|
+
"product": "any",
|
|
67
|
+
"rate": 0.015,
|
|
68
|
+
"min": null,
|
|
69
|
+
"max": null,
|
|
70
|
+
"on": null
|
|
71
|
+
},
|
|
72
|
+
{
|
|
73
|
+
"name": "occ_clearing",
|
|
74
|
+
"basis": "per_contract",
|
|
75
|
+
"side": "both",
|
|
76
|
+
"product": "any",
|
|
77
|
+
"rate": 0.025,
|
|
78
|
+
"min": null,
|
|
79
|
+
"max": null,
|
|
80
|
+
"on": null
|
|
81
|
+
},
|
|
82
|
+
{
|
|
83
|
+
"name": "cat_fee",
|
|
84
|
+
"basis": "per_contract",
|
|
85
|
+
"side": "both",
|
|
86
|
+
"product": "any",
|
|
87
|
+
"rate": 0.0003,
|
|
88
|
+
"min": null,
|
|
89
|
+
"max": null,
|
|
90
|
+
"on": null
|
|
91
|
+
}
|
|
92
|
+
]
|
|
93
|
+
}
|
|
94
|
+
]
|
|
95
|
+
}
|
|
96
|
+
]
|
|
@@ -0,0 +1,34 @@
|
|
|
1
|
+
[
|
|
2
|
+
{
|
|
3
|
+
"_doc": "Binance global spot: the only charge is Binance's trading fee, Regular User tier (30-day volume under 1,000,000 USD), maker 0.100% and taker 0.100% — one rate, so no maker/taker split is lost. Binance charges the fee in the asset RECEIVED (a BUY's fee comes off the base coin, a SELL's off the quote); costed here as a percentage of the turnover in the schedule currency, which is the same figure for a pair quoted in USDT. The 25% BNB discount is not modelled (BNB fees are kept out, never guessed).",
|
|
4
|
+
"schedule": "binance_global_crypto",
|
|
5
|
+
"omitted": [
|
|
6
|
+
"the 25% BNB fee discount (BNB fees are kept out, never guessed)",
|
|
7
|
+
"VIP volume tiers above the Regular User tier",
|
|
8
|
+
"promotional taker rates on some pairs (USDC-quoted pairs: taker 0.095%)",
|
|
9
|
+
"a pair quoted in another asset than USDT: the percentage is the same, but the figure is in that quote asset while the schedule labels it USDT"
|
|
10
|
+
],
|
|
11
|
+
"country": "GLOBAL",
|
|
12
|
+
"segment": "CRYPTO",
|
|
13
|
+
"currency": "USDT",
|
|
14
|
+
"broker": "binance",
|
|
15
|
+
"rate_sets": [
|
|
16
|
+
{
|
|
17
|
+
"effective_from": "2026-11-04",
|
|
18
|
+
"source": "Binance spot fee schedule, Regular User row (30D volume < 1,000,000 USD or >= 0 BNB): maker 0.100% / taker 0.100% (https://www.binance.com/en/fee/schedule); fee taken in the asset received per https://www.binance.com/en-NZ/support/faq/what-is-binance-spot-trading-fee-and-how-to-calculate-e85d6e703b874674840122196b89780a; both read 2026-11-04",
|
|
19
|
+
"charges": [
|
|
20
|
+
{
|
|
21
|
+
"name": "commission",
|
|
22
|
+
"basis": "turnover",
|
|
23
|
+
"side": "both",
|
|
24
|
+
"product": "any",
|
|
25
|
+
"rate": 0.001,
|
|
26
|
+
"min": null,
|
|
27
|
+
"max": null,
|
|
28
|
+
"on": null
|
|
29
|
+
}
|
|
30
|
+
]
|
|
31
|
+
}
|
|
32
|
+
]
|
|
33
|
+
}
|
|
34
|
+
]
|
|
@@ -0,0 +1,34 @@
|
|
|
1
|
+
[
|
|
2
|
+
{
|
|
3
|
+
"_doc": "Coinbase Advanced (the Advanced Trade API orders the terminal sends): the only charge is Coinbase's trading fee. Intro tier (30-day spot volume from $0), costed at its TAKER rate on every fill (a market fill removes liquidity); the maker rate, the volume tiers and the stablecoin pairs' own rates are not modelled. Coinbase states its rates are not the same in every region: these are the rates on the fee page the account owner read.",
|
|
4
|
+
"schedule": "coinbase_us_crypto",
|
|
5
|
+
"omitted": [
|
|
6
|
+
"the maker rate (Intro 0.50%): every fill is costed at the Intro taker rate",
|
|
7
|
+
"volume tiers Advanced 1 to VIP 8 (from $10K 30-day spot volume: Advanced 1 0.35% / 0.75%, Advanced 2 0.15% / 0.30%, Advanced 3 0.10% / 0.15%, VIP 1 0.06% / 0.10% ... VIP 8 0.00% / 0.02%)",
|
|
8
|
+
"stablecoin pairs (USDT-USDC, USDC-EUR, DAI-USD and the others Coinbase lists: maker 0.000%, taker 0.001%; USDT-USD 0.005% / 0.010%): costed at the Intro taker rate",
|
|
9
|
+
"regional rate tables: Coinbase states its fees differ by region"
|
|
10
|
+
],
|
|
11
|
+
"country": "US",
|
|
12
|
+
"segment": "CRYPTO",
|
|
13
|
+
"currency": "USD",
|
|
14
|
+
"broker": "coinbase",
|
|
15
|
+
"rate_sets": [
|
|
16
|
+
{
|
|
17
|
+
"effective_from": "2026-11-04",
|
|
18
|
+
"source": "Coinbase Advanced fee page (coinbase.com/advanced-fees), Fees tab, Spot, Intro tier (30-day spot volume from $0): maker 0.5000%, taker 0.9000%; read from the page as shown to the account owner (screenshots, 2026-11-04)",
|
|
19
|
+
"charges": [
|
|
20
|
+
{
|
|
21
|
+
"name": "commission",
|
|
22
|
+
"basis": "turnover",
|
|
23
|
+
"side": "both",
|
|
24
|
+
"product": "any",
|
|
25
|
+
"rate": 0.009,
|
|
26
|
+
"min": null,
|
|
27
|
+
"max": null,
|
|
28
|
+
"on": null
|
|
29
|
+
}
|
|
30
|
+
]
|
|
31
|
+
}
|
|
32
|
+
]
|
|
33
|
+
}
|
|
34
|
+
]
|
|
@@ -0,0 +1,39 @@
|
|
|
1
|
+
[
|
|
2
|
+
{
|
|
3
|
+
"_doc": "IBKR Pro Fixed only. The published 1%-of-trade-value per-order cap is not expressible (max is an absolute amount) and is omitted: commission is overstated when price < USD 0.50. IBKR Pro Tiered and US options (premium-banded per-contract rate) are not modelled.",
|
|
4
|
+
"schedule": "ibkr_us_eq",
|
|
5
|
+
"omitted": ["IBKR Pro Tiered pricing", "the 1%-of-trade-value per-order commission cap"],
|
|
6
|
+
"country": "US",
|
|
7
|
+
"segment": "EQ",
|
|
8
|
+
"currency": "USD",
|
|
9
|
+
"broker": "ibkr",
|
|
10
|
+
"rate_sets": [
|
|
11
|
+
{
|
|
12
|
+
"effective_from": "2026-10-24",
|
|
13
|
+
"source": "IBKR Pro Fixed, US stocks: USD 0.005/share, min USD 1.00/order (exchange + clearing fees included); FINRA CAT USD 0.000003/share (https://www.interactivebrokers.com/en/pricing/commissions-stocks.php), verified 2026-10-24",
|
|
14
|
+
"charges": [
|
|
15
|
+
{
|
|
16
|
+
"name": "commission",
|
|
17
|
+
"basis": "per_share",
|
|
18
|
+
"side": "both",
|
|
19
|
+
"product": "any",
|
|
20
|
+
"rate": 0.005,
|
|
21
|
+
"min": 1.0,
|
|
22
|
+
"max": null,
|
|
23
|
+
"on": null
|
|
24
|
+
},
|
|
25
|
+
{
|
|
26
|
+
"name": "cat_fee",
|
|
27
|
+
"basis": "per_share",
|
|
28
|
+
"side": "both",
|
|
29
|
+
"product": "any",
|
|
30
|
+
"rate": 0.000003,
|
|
31
|
+
"min": null,
|
|
32
|
+
"max": null,
|
|
33
|
+
"on": null
|
|
34
|
+
}
|
|
35
|
+
]
|
|
36
|
+
}
|
|
37
|
+
]
|
|
38
|
+
}
|
|
39
|
+
]
|