prevDay get 24hr ticker price change statistics for symbols

$prevDay = $api->prevDay("BNBBTC");

@param $symbol (optional) symbol to get the previous day change for
@return array with error message or array of prevDay change
@throws \Exception
484491
public function prevDay(string $symbol = null)
    {
        $additionalData = [];
        if (is_null($symbol) === false) {
            $additionalData = [
                'symbol' => $symbol,
            ];
        }
        return $this->httpRequest("v1/ticker/24hr", "GET", $additionalData);
    }
1199244
public function getSpecialPriceForCurrency($currency = 'EUR')
    {
        $specialPrices = $this->entity->getSpecialPrices();
        if ($specialPrices) {
            foreach ($specialPrices as $specialPriceEntity) {
                if ($specialPriceEntity->getCurrency()->getCode() == $currency) {
                    $startDate = $specialPriceEntity->getStartDate();
                    $endDate = $specialPriceEntity->getEndDate();
                    $now = new \DateTime();
                    if (($now >= $startDate && $now <= $endDate) ||
                        ($now >= $startDate && empty($endDate)) ||
                        (empty($startDate) && empty($endDate))
                    ) {
                        return $specialPriceEntity;
                    }
                }
            }
        }

        return null;
    }
680439
public function get($symbol)
    {
        $request = new Request("get", sprintf('token/%s', $symbol));

        $response = $this->client->send($request);

        return $response;
    }
72115
public function getNotationValue($notation, &$errors = null)
    {
        $type = $this->getNotationType($notation, $params, $errors);

        if (in_array($type, static::TYPE_WITHOUT_VALUE)) {
            return;
        }

        switch ($type) {
            case 'integer':
                return (int) $notation;
            case 'boolean':
                return (bool) $notation;
            case 'string':
                return isset($params['Default']) ? $params['Default'] : (string) $notation;
            case 'float':
                return (float) $notation;
            case 'double':
                return (float) $notation;
            case 'enum':
                return $params['Default'];
            case 'time':
                return static::parseTime($notation);
            case 'date':
                return static::parseDate($notation);
            case 'datetime':
                return static::parseDatetime($notation);
        }

        $errors[] = "irrational value for '{$notation}' by type '{$type}'";
        // called if detected type not is handled
        //throw new Exception("No PSEUDOTYPE value for '{$type}' => '{$notation}'");
    }
183910
public function trades($symbols, callable $callback)
    {
        if (!is_array($symbols)) {
            $symbols = [
                $symbols,
            ];
        }

        $loop = \React\EventLoop\Factory::create();
        $react = new \React\Socket\Connector($loop);
        $connector = new \Ratchet\Client\Connector($loop, $react);
        foreach ($symbols as $symbol) {
            if (!isset($this->info[$symbol])) {
                $this->info[$symbol] = [];
            }

            // $this->info[$symbol]['tradesCallback'] = $callback;

            $endpoint = strtolower($symbol) . '@trades';
            $this->subscriptions[$endpoint] = true;

            $connector($this->stream . strtolower($symbol) . '@aggTrade')->then(function ($ws) use ($callback, $symbol, $loop, $endpoint) {
                $ws->on('message', function ($data) use ($ws, $callback, $loop, $endpoint) {
                    if ($this->subscriptions[$endpoint] === false) {
                        //$this->subscriptions[$endpoint] = null;
                        $loop->stop();
                        return; //return $ws->close();
                    }
                    $json = json_decode($data, true);
                    $symbol = $json['s'];
                    $price = $json['p'];
                    $quantity = $json['q'];
                    $timestamp = $json['T'];
                    $maker = $json['m'] ? 'true' : 'false';
                    $trades = [
                        "price" => $price,
                        "quantity" => $quantity,
                        "timestamp" => $timestamp,
                        "maker" => $maker,
                    ];
                    // $this->info[$symbol]['tradesCallback']($this, $symbol, $trades);
                    call_user_func($callback, $this, $symbol, $trades);
                });
                $ws->on('close', function ($code = null, $reason = null) use ($symbol, $loop) {
                    // WPCS: XSS OK.
                    echo "trades({$symbol}) WebSocket Connection closed! ({$code} - {$reason})" . PHP_EOL;
                    $loop->stop();
                });
            }, function ($e) use ($loop, $symbol) {
                // WPCS: XSS OK.
                echo "trades({$symbol}) Could not connect: {$e->getMessage()}" . PHP_EOL;
                $loop->stop();
            });
        }
        $loop->run();
    }
432084
public function getFormattedPrice($price, $symbol = 'EUR', $locale = 'de')
    {
        return $this->priceFormatter->format(
            (float) $price,
            null,
            $locale,
            $symbol,
            PriceFormatter::CURRENCY_LOCATION_SUFFIX
        );
    }
915873
def ticker(rest):
	""
	ticker = rest.upper()
	# let's use Yahoo's nifty csv facility, and pull last time/price both
	symbol = 's'
	last_trade_price = 'l1'
	last_trade_time = 't1'
	change_percent = 'p2'
	format = ''.join((symbol, last_trade_time, last_trade_price, change_percent))
	url = (
		'http://finance.yahoo.com/d/quotes.csv?s=%(ticker)s&f=%(format)s'
		% locals())
	stock_info = csv.reader(util.open_url(url).text.splitlines())
	last_trade, = stock_info
	ticker_given, time, price, diff = last_trade
	if ticker_given != ticker:
		return "d'oh... could not find information for symbol %s" % ticker
	return '%(ticker)s at %(time)s (ET): %(price)s (%(diff)s)' % locals()
1263485
public function getOpenOrders($symbol = false, $limit = 100)
    {

        $data = array();
        if($symbol) $data['Market'] = $symbol;
        if($limit) $data['Count'] = $limit;

        $b = $this->queryPrivate('GetOpenOrders', $data, "POST");
        return $b['Data'];

    }
806446
public function getMerchantsGroupAccounts($merchantGroupId, DateTime $pastDate)
    {
        $parameters = array('merchantGroupId' => $merchantGroupId, 'pastDate' => $pastDate->format('Y-m-d'));
        $data = $this->callSoap('getMerchantsGroupAccounts', $parameters);
        $result = array();
        foreach ($data['dataMerchantsGroupAccounts']->item as $index => $item) {
            $result[] = (array)$item;
        }
        return $result;
    }
1174725
public function viewDeposits($symbol, $method=false) {
          if(!$method) {
              $result = $this->queryPrivate("DepositMethods", ['asset' => $symbol]);
              $method = $result['result'][0]['method'];
          }
          return $this->queryPrivate("DepositStatus", ['asset' => $symbol, 'method' => $method]);
       }
214595
def today(self, symbol):
        

        data = self._get(self.url_for(PATH_TODAY, (symbol)))

        # convert all values to floats
        return self._convert_to_floats(data)
1139676
public static function getChanges(array $new, array $previous)
    {
        $changes = [];
        $changedKeys = array_keys(array_diff_assoc($new, $previous));
        foreach ($changedKeys as $key) {
            $changes[$key] = isset($previous[$key]) ? [$previous[$key], $new[$key]] : $new[$key];
        }

        return $changes;
    }
1208406
protected function parseTransactionValueTimestamp()
    {
        $results = [];
        if (preg_match(self::PATTERN_TAG_61, $this->getCurrentTransactionData(), $results)) {
            return $this->sanitizeTimestamp($results[1]);
        }

        return 0;
    }
20379
private function chartHandler(string $symbol, string $interval, \stdClass $json)
    {
        if (!$this->info[$symbol][$interval]['firstOpen']) { // Wait for /kline to finish loading
            $this->chartQueue[$symbol][$interval][] = $json;
            return;
        }
        $chart = $json->k;
        $symbol = $json->s;
        $interval = $chart->i;
        $tick = $chart->t;
        if ($tick < $this->info[$symbol][$interval]['firstOpen']) {
            return;
        }
        // Filter out of sync data
        $open = $chart->o;
        $high = $chart->h;
        $low = $chart->l;
        $close = $chart->c;
        $volume = $chart->q; // +trades buyVolume assetVolume makerVolume
        $this->charts[$symbol][$interval][$tick] = [
            "open" => $open,
            "high" => $high,
            "low" => $low,
            "close" => $close,
            "volume" => $volume,
        ];
    }
396122
public function return404($notifier = false, \Exception $exception = null)
    {
    	if (!defined('ERROR_404'))
    	{
    	    define('ERROR_404', 'Y');
    	}

        \CHTTP::SetStatus('404 Not Found');

        if ($exception !== false)
        {
            if ($notifier === false)
            {
                $this->exceptionNotifier = false;
            }

            if ($exception instanceof \Exception)
            {
                throw $exception;
            }
            else
            {
                throw new \Exception('Page not found');
            }
        }
    }
338501
public static function previousDay($ts = null, $day = sfTime::SUNDAY)
	{
		// default to now
		if ($ts === null) $ts = sfDateTimeToolkit::now();
		
		// get offsets from sunday
		$offset1 = date('w', $ts);
		$offset2 = $day;
		
		// adjust if date wraps into last week
		$offset1 += $offset1 > $offset2 ? 0 : 7;
		
		return sfTime::subtractDay($ts, $offset1 - $offset2);
	}
807327
public function get_prev_day($daytimestamp) {
        $date = new \DateTime();
        $date->setTimestamp($daytimestamp);
        $date->modify('-1 day');

        return $date->getTimestamp();
    }