<?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
}
*/
(PECL trader >= 0.2.0)
trader_avgprice — Average Price
$open
, array $high
, array $low
, array $close
)
open
Opening price, array of real values.
high
High price, array of real values.
low
Low price, array of real values.
close
Closing price, array of real values.
Returns an array with calculated data or false on failure.
<?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
}
*/