Ejemplo n.º 1
0
    $raw_json = file_get_contents($data_munched);
    sleep(1);
}
$raw_array = json_decode($raw_json, true);
echo "<table id='t01' class='sortable'>";
echo "<tr><th>Pair</th>";
#get TH
foreach ($frames_available as $frames) {
    echo "<th>ALix {$frames}</th>";
}
echo "</tr>";
#put out exchanges
$alix_total = array();
foreach ($raw_array as $exchange) {
    $name = $exchange["query_pair"];
    $pair_link = pair2link($name);
    echo "<tr><td>{$pair_link}</td>";
    foreach ($exchange["content"] as $alix_frames) {
        $alix = round($alix_frames["alix"], 4);
        $frame = $alix_frames["frame"];
        @($alix_total[$frame] = $alix_total[$frame] + $alix);
        if ($alix > 0) {
            echo "<td>{$alix}</td>";
        } else {
            echo "<td class='red'>0</td>";
        }
    }
}
echo "</tr>";
echo "<tfoot><tr><td>Total (NBT)</td>";
foreach ($frames_available as $frames) {
Ejemplo n.º 2
0
 usort($content["exchanges"], 'sort_index');
 $timestamp = $content["timestamp"];
 $btc_usd = $content["btc_usd"];
 date_default_timezone_set('UTC');
 $date = date("d.m.Y, H:i:s", $timestamp);
 echo "<table id='t01'>";
 echo "<tr><th>Pair</th><th>Ask</th><th>Bid</th><th>Total</th><th></th><th>Ask {$line_title}</th><th>Bid {$line_title}</th><th>Total {$line_title}</th><th>Tolerance</th></tr>";
 $total_all = 0;
 $bid_all = 0;
 $ask_all = 0;
 $ask_all_avg = 0;
 $bid_all_avg = 0;
 $total_all_avg = 0;
 foreach ($content["exchanges"] as $exchange) {
     $pair = $exchange["pair"];
     $pair_link = pair2link($pair);
     $tolerance = $exchange["amount"]["tolerance"];
     $ask_wall = round($exchange["amount"]["ask_total"], 4);
     $bid_wall = round($exchange["amount"]["bid_total"], 4);
     $pair_15_ask_avg = round($var["{$pair}" . "_ask"], 4);
     $pair_15_bid_avg = round($var["{$pair}" . "_bid"], 4);
     $pair_15_total_avg = round($var["{$pair}" . "_total"], 4);
     $total = round($ask_wall + $bid_wall, 4);
     $total_avg = $pair_15_ask_avg + $pair_15_bid_avg;
     echo "<tr>";
     echo "<td>{$pair_link}</td>";
     if ($ask_wall > 0) {
         echo "<td>{$ask_wall}</td>";
     } else {
         echo "<td class='red'>0</td>";
     }