feat: funciones Python datascience, finance, cybersecurity y pipelines
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>
This commit is contained in:
@@ -0,0 +1,41 @@
|
||||
---
|
||||
name: generate_taker_order
|
||||
kind: function
|
||||
lang: py
|
||||
domain: finance
|
||||
version: "1.0.0"
|
||||
purity: pure
|
||||
signature: "generate_taker_order(alpha: float, size_min: float, size_max: float, buy_prob: float, seed: int | None) -> dict"
|
||||
description: "Genera una market order de taker con tamano distribuido segun power-law (Pareto). Alpha bajo produce ordenes mas grandes (ballenas)."
|
||||
tags: [simulation, taker, power-law, montecarlo, finance, order-book]
|
||||
uses_functions: []
|
||||
uses_types: []
|
||||
returns: []
|
||||
returns_optional: false
|
||||
error_type: ""
|
||||
imports: [numpy]
|
||||
tested: false
|
||||
tests: []
|
||||
test_file_path: ""
|
||||
file_path: "python/functions/finance/finance.py"
|
||||
---
|
||||
|
||||
## Ejemplo
|
||||
|
||||
```python
|
||||
order = generate_taker_order(
|
||||
alpha=2.0,
|
||||
size_min=1.0,
|
||||
size_max=100.0,
|
||||
buy_prob=0.5,
|
||||
seed=42,
|
||||
)
|
||||
# {'side': 'buy', 'qty': 3.7}
|
||||
```
|
||||
|
||||
## Notas
|
||||
|
||||
Funcion pura cuando se fija seed. Con seed=None el resultado es no deterministico.
|
||||
La distribucion Pareto con alpha=2 modela bien la distribucion empirica de tamaños de ordenes en mercados reales.
|
||||
`size_max` actua como techo (clipping) para evitar ordenes extremas.
|
||||
Retorna dict con keys: `side` ('buy' o 'sell') y `qty` (float redondeado a 1 decimal).
|
||||
Reference in New Issue
Block a user