113c6dfd71
11 funciones puras con implementación real: SMA, EMA, RSI, BollingerBands, VWAP, LogReturn, AnnualizedVolatility, SharpeRatio, MaxDrawdown, NormalizeOHLCV, TickToOHLCV 4 funciones impuras (stubs): FetchOHLCV, StreamTicks, WriteOHLCVToParquet, LoadOHLCVFromDuckDB Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
875 B
875 B
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 | ||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
| max_drawdown | function | go | finance | 1.0.0 | pure | func MaxDrawdown(values []float64) (maxDD float64, start, end int) | Calcula el maximo drawdown de una curva de equity, retornando la magnitud y los indices pico-valle. |
|
|
|
false | false | functions/finance/max_drawdown.go |
max_drawdown
Calcula el maximo drawdown (caida maxima desde un pico hasta un valle) como fraccion del pico. Retorna la magnitud (0 a 1) y los indices de inicio y fin.
Ejemplo
dd, s, e := finance.MaxDrawdown([]float64{100, 120, 90, 110, 80})
// dd = (120-80)/120 = 0.3333, s = 1, e = 4