47fac22230
- .claude/CLAUDE.md - .claude/commands/subagentes.md - .claude/rules/INDEX.md - .mcp.json - bash/functions/cybersecurity/analyze_dns.md - bash/functions/cybersecurity/audit_http_headers.md - bash/functions/cybersecurity/audit_ssh_config.md - bash/functions/cybersecurity/check_firewall.md - bash/functions/cybersecurity/detect_suspicious_users.md - bash/functions/cybersecurity/encrypt_file.md - ... Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
39 lines
1.0 KiB
Markdown
39 lines
1.0 KiB
Markdown
---
|
|
name: vwap
|
|
kind: function
|
|
lang: go
|
|
domain: finance
|
|
version: "1.0.0"
|
|
purity: pure
|
|
signature: "func VWAP(prices, volumes []float64) float64"
|
|
description: "Calcula el Volume Weighted Average Price (VWAP) a partir de precios y volumenes."
|
|
tags: [finance, indicator, vwap, volume, pendiente-usar]
|
|
uses_functions: []
|
|
uses_types: []
|
|
returns: []
|
|
returns_optional: false
|
|
error_type: ""
|
|
imports: []
|
|
params:
|
|
- name: prices
|
|
desc: "slice de precios de ticks o velas (ej: [100.0, 102.0, 101.0])"
|
|
- name: volumes
|
|
desc: "slice de volúmenes correspondientes (mismo tamaño que prices)"
|
|
output: "precio promedio ponderado por volumen en unidad de moneda (ej: 100.95)"
|
|
tested: false
|
|
tests: []
|
|
test_file_path: ""
|
|
file_path: "functions/finance/vwap.go"
|
|
---
|
|
|
|
# vwap
|
|
|
|
Calcula el VWAP (Volume Weighted Average Price). Es la suma de (precio * volumen) dividida por la suma de volumenes.
|
|
|
|
## Ejemplo
|
|
|
|
```go
|
|
v := finance.VWAP([]float64{100, 102, 101}, []float64{500, 300, 200})
|
|
// v = (100*500 + 102*300 + 101*200) / (500+300+200)
|
|
```
|