本文整理汇总了PHP中Status::getParam方法的典型用法代码示例。如果您正苦于以下问题:PHP Status::getParam方法的具体用法?PHP Status::getParam怎么用?PHP Status::getParam使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Status
的用法示例。
在下文中一共展示了Status::getParam方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: __construct
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;
}
示例2: __construct
public function __construct()
{
//Инициализируем переменные
$this->fee = 0.2 / 100;
// Комиссия за операцию
$this->imp_div = 1 / 100;
// Процент при котором считать подъем/падение = 1%
//$this->buy_sum = 350; // Покупать на 300 руб.
$this->buy_value = 0.01;
// Сколько покупать
$this->buystep_n = 5;
// Смотрим по ... блоков
$this->sellstep_n = 4;
// Смотрим по ... блоков
$this->analize_period = 60 * 60 * 1;
// Период за который анализируем график (6 часов)
$this->min_income = 10;
// Мин. доход
$this->balance = Status::getParam('balance');
$this->balance_btc = Status::getParam('balance_btc');
$this->order_cnt = 0;
$this->bought = Buy::model()->with('sell')->findAll();
$this->total_income = Sell::getTotalIncome();
}
示例3: actionChart
public function actionChart($type = 'btc_rur')
{
$buy = new Buy();
$exch = Exchange::getAllByDt('btc_rur', '2013-12-16', '2014-01-06');
$data_buy = array();
$data_sell = array();
foreach ($exch as $item) {
$tm = strtotime($item['dt']) * 1000 + 4 * 60 * 60 * 1000;
$data_buy[] = array($tm, (double) $item['buy']);
$data_sell[] = array($tm, (double) $item['sell']);
}
// Покупки
$orders = Order::model()->findAll();
$lastEx = Exchange::getLast();
$status['total_income'] = Sell::getTotalIncome();
$status['balance'] = Status::getParam('balance');
$status['balance_btc'] = Status::getParam('balance_btc');
$status['total_balance'] = $status['balance'] + $status['balance_btc'] * $lastEx->sell;
$this->render('chart', array('data_buy' => json_encode($data_buy), 'data_sell' => json_encode($data_sell), 'orders' => $orders, 'status' => $status));
}