예제 #1
0
 public function CancelOrder($order)
 {
     // Если отменяем виртуально
     if (self::isVirtual) {
         return $this->CancelOrderVirtual($order);
     }
     $BTCeAPI = BTCeAPI::get_Instance();
     try {
         $res = $BTCeAPI->apiQuery('CancelOrder', array('order_id' => $order->id));
     } catch (BTCeAPIException $e) {
         Log::Error('Не удалось удалить ордер ' . $e->getMessage());
         return false;
     }
     return $res;
 }
예제 #2
0
 public static function updatePrices($pair = 'btc_rur')
 {
     $BTCeAPI = BTCeAPI::get_Instance();
     $ticker = $BTCeAPI->getPairTicker($pair);
     $ticker = $ticker['ticker'];
     $exchange = new Exchange();
     $exchange->buy = $ticker['buy'];
     $exchange->sell = $ticker['sell'];
     $exchange->dtm = date('Y-m-d H:i:s', $ticker['updated']);
     $exchange->pair = $pair;
     $exchange->save();
     return $exchange;
 }