コード例 #1
0
ファイル: Bot.php プロジェクト: HotAttack/btcbot
 public function cancelOrder($order)
 {
     $res = $this->api->CancelOrder($order);
     if ($res['success'] == 1) {
         $this->setBalance($res['return']['funds']['rur']);
         $this->setBalanceBtc($res['return']['funds']['btc']);
         $order->status = 'cancel';
         $order->close_dtm = $this->current_exchange->dtm;
         $order->save();
         // Пишем баланс
         if ($order->type == 'buy') {
             Balance::add('rur', 'Отмена ордера №' . $order->id . ' на покупку', $order->summ);
         } else {
             Balance::add('btc', 'Отмена ордера №' . $order->id . ' на продажу', $order->count);
         }
     }
 }