837563c3ba
Datascience: aggregate_by_group, deduplicate_entities/relations, detect_drift, diff_entities/relations, extract_entities/relations_llm, hotness_score, melt, merge_graphs, pivot, build_entity/relation_schema_prompt. Finance: avellaneda_stoikov_quotes, generate_gbm_prices, generate_taker_order, hawkes_intensity + módulo finance.py. Cybersecurity: envelope_encrypt/decrypt + módulo cybersecurity.py. Pipelines: extraction_pipeline, monte_carlo_market, run_market_sim. Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
1.4 KiB
1.4 KiB
name, kind, lang, domain, version, purity, signature, description, tags, uses_functions, uses_types, returns, returns_optional, error_type, imports, tested, tests, test_file_path, file_path
| name | kind | lang | domain | version | purity | signature | description | tags | uses_functions | uses_types | returns | returns_optional | error_type | imports | tested | tests | test_file_path | file_path | ||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
| avellaneda_stoikov_quotes | function | py | finance | 1.0.0 | pure | avellaneda_stoikov_quotes(mid_price: float, inventory: float, gamma: float, sigma: float, spread_base: float, n_levels: int, qty_base: float) -> list[dict] | Genera ordenes de market maker usando el modelo Avellaneda-Stoikov. Calcula precio de reserva y half spread optimos segun inventario y volatilidad. |
|
false | false | python/functions/finance/finance.py |
Ejemplo
orders = avellaneda_stoikov_quotes(
mid_price=100.0,
inventory=0.0,
gamma=0.1,
sigma=0.02,
spread_base=0.5,
n_levels=3,
qty_base=10.0,
)
# [
# {'side': 'buy', 'price': 99.75, 'qty': 10.0},
# {'side': 'sell', 'price': 100.25, 'qty': 10.0},
# ...
# ]
Notas
Funcion pura — sin aleatoriedad.
gamma controla la aversion al riesgo de inventario: mayor gamma = spreads mas amplios.
inventory positivo sesga los quotes hacia venta (reduce inventario largo).
Cada nivel adicional ensancha el spread en half_spread * 0.5 y aumenta la cantidad en qty_base * 0.5.
Ordenes con precio <= 0 se descartan automaticamente.