Ejemplo n.º 1
0
 public static function get_Instance()
 {
     if (!self::$self) {
         self::$self = new APIProvider();
     }
     return self::$self;
 }
Ejemplo n.º 2
0
 public function __construct($exchange = false)
 {
     if (!$exchange) {
         $exchange = Exchange::getLast();
     }
     $this->current_exchange = $exchange;
     $this->curtime = strtotime($exchange->dtm);
     $this->balance = Status::getParam('balance');
     $this->balance_btc = Status::getParam('balance_btc');
     $this->total_income = 0;
     $this->buy_imp_dif = 0.005;
     // Шаг при анализе покупки 5% //150;
     $this->sell_imp_dif = 0.007;
     // Шаг при анализе продажи 7%
     $this->order_cnt = 0;
     // Периоды анализа графика для покупки и продажи (в сек.)
     $this->buy_periods = array(15 * 60, 30 * 60, 60 * 60, 2 * 60 * 60, 6 * 60 * 60, 24 * 60 * 60, 36 * 60 * 60);
     $this->sell_periods = array(60 * 60, 2 * 60 * 60, 6 * 60 * 60, 24 * 60 * 60, 36 * 60 * 60);
     $this->api = APIProvider::get_Instance();
     self::$self = $this;
 }