Пример #1
0
function localOrderAdd($type, $amount, $price)
{
    global $percentual;
    global $fake;
    global $bidfee;
    $infodata = get_infodataf($fake);
    $info = get_infodata($infodata, $fake);
    $ok = 0;
    $amount = $amount * 1.0E-8;
    $price = $price * 1.0E-5;
    if ($type == "ask" and round($info["btc_balance"], 2) >= round($amount, 2)) {
        $info["usd_balance"] = $info["usd_balance"] + $amount * $price;
        $info["btc_balance"] = $info["btc_balance"] - $info["btc_balance"];
        $ok = 1;
    }
    if ($type == "bid" and round($info["usd_balance"], 2) >= round($price * $amount, 2)) {
        $info["btc_balance"] = $info["btc_balance"] + $amount;
        $info["btc_balance"] = $info["btc_balance"] - percentual($bidfee, $info["btc_balance"]);
        $info["usd_balance"] = $info["usd_balance"] - $info["usd_balance"];
        $ok = 1;
    }
    if ($ok == 1) {
        $fakedata["data"]["Login"] = $info["logged"];
        $fakedata["data"]["Trade_Fee"] = $info["trade_fee"];
        $fakedata["data"]["Wallets"]["BTC"]["Balance"]["value"] = $info["btc_balance"];
        $fakedata["data"]["Wallets"]["USD"]["Balance"]["value"] = $info["usd_balance"];
        $fakedata["trade_mode"] = $info["trade_mode"];
        $fakedata["balancing"] = $info["balancing"];
        $info = get_infodata($fakedata, $fake = true, $replace = true);
        $result["result"] = "success";
        $result["data"] = "98374829984767289039847839";
        return $result;
    } else {
        $result["result"] = "error";
        return $result;
    }
    //die;
}
Пример #2
0
     cli_beep();
 } else {
     cli_beep();
     sleep(1);
     cli_beep();
     sleep(1);
     cli_beep();
 }
 $log = "#transaction";
 if ($sudden_mode == 1) {
     $log = "#suddenmode";
 }
 if ($balancing == 1) {
     $log = "#unbalancing";
 }
 $infodata = get_infodataf($fake);
 $info = get_infodata($infodata, $fake);
 $wallet_amount = "[btc:" . round($info["btc_balance"], 4) . "/usd:" . round($info["usd_balance"], 2) . "]";
 $line = "\$" . $transa["type"] . " " . $wallet_amount . " @ \$" . $transa["price"] . " (" . $transa["prem"] . ") {$log}";
 wfile($lastfile_clean, $line);
 if ($balancing != 1) {
     if ($enable_tweet) {
         tweet($tmhOAuth, $line . " {$twitter_users}");
     }
     if ($wall == 1) {
         wfilew($lastfile, $transa["type"] . "," . $wallet_amount . "," . $transa["price"] . "," . $transa["datetime"] . "," . $transa["prem"] . ",{$log},\r\n");
     } else {
         wfilew($lastfile, $transa["type"] . "," . $wallet_amount . "," . $transa["price"] . "," . $transa["datetime"] . "," . $transa["prem"] . ",{$log},\r\n");
     }
     $dt = date("Y-m-d H:i:s");
     if ($fake == true and $paper == false) {