Exemple #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;
}
Exemple #2
0
             echo "\n*** Skipped automatic stoploss action";
         } else {
             $infodata = get_infodataf($fake);
             $info = get_infodata($infodata, $fake);
             $transa = ask($info, $ticker["ticker_sell"], $last_order, $wall, $info["balancing"], $sudden_mode);
         }
     }
 } else {
     if ($info["trade_mode"] == "bid") {
         if ($reverse_prices == 1) {
             $ticker["ticker_buy"] = $ticker["ticker_sell"];
         }
         $range = $last_order["price"] - percentual($percentual, $last_order["price"]) - $down_diff - $ticker["ticker_buy"];
         $direction = "<" . market_direction($dire, true, $ema) . "/up>";
         $next_price = $last_order["price"] - percentual($percentual, $last_order["price"]) - $down_diff;
         $stoploss = $last_order["price"] + percentual($percentual, $last_order["price"]) + $down_diff_inv;
         $nm = status($ticker["ticker_buy"], $info["trade_mode"], $next_price, $stoploss, $last_order["type"], $last_order["price"], $direction, $last_order["prem"]);
         wfilenew($nextmov, $nm);
         if ($ticker["ticker_buy"] <= $next_price and market_direction($dire, true, $ema) == "up" or $ticker["ticker_buy"] >= $stoploss and market_direction($dire, false, $ema) == "up" or $sudden_mode == 1) {
             if ($ticker["ticker_buy"] >= $stoploss and market_direction($dire, false, $ema) == "up") {
                 echo "\n*** #Hit wall!";
                 $wall = 1;
                 if ($manualstoploss == 0) {
                     $sudden_mode = 1;
                 }
             }
             if ($sudden_mode == 1) {
                 $wall = false;
                 echo "\n*** #SUDDEN MODE on!";
                 $sudden_mode = 1;
                 $ticker["ticker_buy"] = $ticker["ticker_sell"];