PHP 8.3.21 Released!

trader_avgprice

(PECL trader >= 0.2.0)

trader_avgpriceAverage Price

Description

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

Parameters

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.

Return Values

Returns an array with calculated data or false on failure.

add a note

User Contributed Notes 1 note

up
1
geekgirl dot joy at gmail dot com
4 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

Follow Lee on X/Twitter - Father, Husband, Serial builder creating AI, crypto, games & web tools. We are friends :) AI Will Come To Life!

Check out: eBank.nz (Art Generator) | Netwrck.com (AI Tools) | Text-Generator.io (AI API) | BitBank.nz (Crypto AI) | ReadingTime (Kids Reading) | RewordGame | BigMultiplayerChess | WebFiddle | How.nz | Helix AI Assistant