CakeFest 2024: The Official CakePHP Conference

trader_avgprice

(PECL trader >= 0.2.0)

trader_avgpricePrecio medio

Descripción

trader_avgprice(
    array $open,
    array $high,
    array $low,
    array $close
): array

Parámetros

open

Precio de apertura, array de valores reales.

high

Precio alto, array de valores reales.

low

Precio bajo, array de valores reales.

close

Precio de cierre, array de valores reales.

Valores devueltos

Devuelve un array con los datos calculados o false en caso de fallo.

add a note

User Contributed Notes 1 note

up
1
geekgirl dot joy at gmail dot com
3 years ago
<?php
$p
= trader_avgprice([1,2] , [1.2, 3] , [0.99, 2] , [1.2, 2.5]);
var_dump($p);
/*
array(2) {
[0]=>
float(1.097) // (1 + 1.2 + 0.99 + 1.2) / 4
[1]=>
float(2.375) // (2 + 3 + 2 + 2.5) / 4
}
*/
To Top