Пример #1
0
<?php

require_once "../php/main.php";
$id = argreq("id");
$code = argreq("code");
if (check_ticker_passcode($id, $code)) {
    api_done(array("ticker" => get_ticker($id)));
}
api_error();
Пример #2
0
<?php

require_once "../php/main.php";
$id = argreq("id");
$ticker = get_ticker($id);
if ($ticker) {
    api_done(array("ticker" => $ticker));
}
api_error();
Пример #3
0
    } else {
        $ticker_huobi['status'] = 'error';
        $ticker_huobi['spread'] = $oldticker_huobi['ask'] - $oldticker_huobi['bid'];
        $ticker_huobi['ask'] = $oldticker_bix['mid'] + $ticker_huobi['spread'] / 2 + $oldticker_huobi['premium'];
        $ticker_huobi['bid'] = $oldticker_bix['mid'] - $ticker_huobi['spread'] / 2 + $oldticker_huobi['premium'];
        $ticker_huobi['timestamp'] = $oldticker_bix['timestamp'];
        echo time() . " - Error - Setting virtual price for Huobi" . PHP_EOL;
        echo time() . " - Last Huobi Ticker: " . json_encode($oldticker_huobi) . PHP_EOL;
        echo time() . " - Virtual Huobi Ticker: " . json_encode($ticker_huobi) . PHP_EOL . PHP_EOL;
    }
    // check data and calculate the average best bid and ask price
    $time_now = time();
    $latency_bfx = $time_now - intval($ticker_bfx['timestamp']);
    $latency_bstmp = $time_now - intval($ticker_bstmp['timestamp']);
    $latency_huobi = $time_now - intval($ticker_huobi['timestamp']);
    echo time() . " - Last Trade - Bitfinex: " . $latency_bfx . " / Bitstamp: " . $latency_bstmp . " / Huobi: " . $latency_huobi . PHP_EOL;
    $ticker['ask'] = round(($ticker_bfx['ask'] * 3 + $ticker_bstmp['ask'] * 2 + $ticker_huobi['ask'] * 1) / 6, 2);
    $ticker['bid'] = round(($ticker_bfx['bid'] * 3 + $ticker_bstmp['bid'] * 2 + $ticker_huobi['bid'] * 1) / 6, 2);
    $ticker['mid'] = round(($ticker['ask'] + $ticker['bid']) / 2, 2);
    $ticker['ts'] = time();
    $comm = fopen($apiDir, "w");
    $comm_message = json_encode($ticker);
    fwrite($comm, $comm_message);
    fclose($comm);
    return $ticker;
}
while (true) {
    usleep(10000);
    $bix = get_ticker();
    echo PHP_EOL . time() . " - BIX Ticker: " . json_encode($bix) . PHP_EOL;
}
Пример #4
0
    $body .= "<p>\n";
    $body .= "go to ";
    $url = "https://cast.google.com/publish/#/overview";
    $body .= mklink_nw($url, $url);
    $body .= " then click Add New Application, then Custom Receiver.\n";
    $body .= "Give a name of your choice and for the url, enter:\n";
    $body .= "</p>\n";
    $body .= "<p>\n";
    $body .= sprintf("<input type='text' readonly='readonly'" . " size='50' value='%s' />\n", h($receiver_url));
    $body .= "</p>\n";
    $body .= "<p>\n";
    $body .= "After you Save, you'll get an application id.  Add it" . " to the array \$app_db at the top of index.php\n";
    $body .= "</p>\n";
    pfinish();
}
$tick = get_ticker();
$body .= sprintf("<div>tick = %d</div>\n", $tick);
$body .= "<div>\n";
$body .= mklink_nw("google cast console", "https://cast.google.com/publish/#/overview");
$body .= "</div>\n";
$body .= "<div>\n";
$body .= mklink_nw($receiver_url, $receiver_url);
$body .= "</div>\n";
$body .= "<div>\n";
$body .= "<form method='get' action='#' id='sender_form'>\n";
$body .= "<input id='sender_data' type='text' size='30' />\n";
$body .= "</form>\n";
$body .= "<input id='stop_button' type='button' value='Stop' />\n";
$body .= "<input id='reload_receiver_button' type='button'" . " value='Reload receiver' />\n";
$body .= "<input id='reconnect_button' type='button'" . " value='Reconnect to jrconsole' />\n";
$body .= "<input id='game_up_button' type='button'" . " value='up' />\n";
Пример #5
0
 //echo $ticker["ticker_last"];
 $hora = end($F1);
 $hora = explode(",", $hora);
 $times = date('i', strtotime($hora[0]));
 $hora_old = $times;
 wfilew($datachart, $line);
 $voll = vol_anormal(1);
 if ($voll != false) {
     echo "\n*** High volume detected! " . $voll;
     if ($enable_tweet) {
         tweet($tmhOAuth, "High volume detected! " . $voll . " {$twitter_users}");
     }
 }
 $last_order = get_lasttrade_local($last_two_orders);
 $ticker = get_tickerf($fake);
 $ticker = get_ticker($ticker, $fake);
 if (1 == 1) {
     echo "\n*** Checking for open orders... ";
     $myorders = get_orders($fake);
     if (count($myorders["data"]) >= 1) {
         echo "waiting " . count($myorders["data"]) . " orders to process.";
     } else {
         echo " no orders.";
         $transa = false;
         $wall = false;
         if ($info["trade_mode"] == "ask") {
             if ($reverse_prices == 1) {
                 $ticker["ticker_sell"] = $ticker["ticker_buy"];
             }
             $range = $ticker["ticker_sell"] - ($last_order["price"] + $up_diff);
             //$updown=