average bitcoin price

prediction


$avg + $sd) return true; return false; } $avg = $sd = $n = 0; $mresults = do_query('SELECT table_name, `column`, has_volume, has_currency, source_name FROM meta'); while($mrow = fetch_row($mresults)) { $v = '0 AS volume'; $has_volume = $mrow['has_volume']; if ($has_volume == 1) $v = 'volume'; $col = $mrow['column']; $table = $mrow['table_name']; $source_name = $mrow['source_name']; $where = ''; if ($mrow['has_currency'] == 1) $where = "WHERE currency='USD' "; $query = "SELECT UNIX_TIMESTAMP(NOW()) - UNIX_TIMESTAMP(ts) AS age, $col AS val, $v, '$table' as `table`, '$source_name' as source_name, '$has_volume' AS has_volume FROM $table $where ORDER BY ts DESC LIMIT 1"; $results = do_query($query); $row = fetch_row($results); $rows[] = $row; $avg += $row['val']; $sd += pow($row['val'], 2.0); $n++; } $avg /= $n; $sd = sqrt($sd / $n - pow($avg, 2.0)); $maxage = -1; $avgage = 0; $nval = 0; foreach($rows as $key) { if (outlier($avg, $sd, $key['val'])) continue; $age = $key['age']; if ($age > $maxage) $maxage = $age; $avgage += $age; $nval++; } $tdiv = $tv = 0; foreach($rows as $key) { if (outlier($avg, $sd, $key['val'])) continue; $mul = $maxage + 1 - $key['age']; $tv += $key['val'] * $mul; $tdiv += $mul; } ?>

general

global non-weighted average:
global non-weighted standard deviation:

average weighted by "age" of each "measurement"

For each exchange, determine how long ago the last sample (=ticker fetch) was done. Then, multiply each rating by "maximum_age - current_age".
weighted average:dollar per bitcoin
oldest value:seconds
average age:seconds
number of sources:
0) { $age = $key['age']; if ($age > $maxage) $maxage = $age; $avgage += $age; $tdiv += $mul; $tv += $key['val'] * $mul; $nval++; } } ?>

average weighted by volume of trading platform

When calculating the average, the weight of each rating (per exchange) is the volume traded at that exchange.
weighted average:dollar per bitcoin
totale volume:
average volume:
oldest value:seconds
average age:seconds
number of sources:

meta & specific

source nameage of last "measurement"volume in tickervolumelatest valueoutlier
yes' : 'no'; ?>




mail@vanheusden.com