/** * Returns summarised historical trading data for a given currency pair. Data is summarised into * 1 hour intervals. * @note This method caches return values for 30 minutes. Calling it more than once per 30 * minutes will result in cached data being returned. * @param string $primaryCurrencyCode The digital currency for which to retrieve the trade * history summary. Must be a valid primary currency, which can be checked via the * getValidPrimaryCurrencyCodes() method. * @param string $secondaryCurrencyCode The fiat currency in which to retrieve the trade history * summary. Must be a valid secondary currency, which can be checked via the * getValidSecondaryCurrencyCodes() method. * @param int $numberOfHoursInThePastToRetrieve How many past hours of historical summary data * to retrieve (maximum is 240). * @return TradeHistorySummary */ public function getTradeHistorySummary($primaryCurrencyCode, $secondaryCurrencyCode, $numberOfHoursInThePastToRetrieve) { return TradeHistorySummary::createFromObject($this->getEndpoint('GetTradeHistorySummary', ['primaryCurrencyCode' => $primaryCurrencyCode, 'secondaryCurrencyCode' => $secondaryCurrencyCode, 'numberOfHoursInThePastToRetrieve' => $numberOfHoursInThePastToRetrieve])); }
public function setUp() { parent::setUp(); $obj = (object) ["CreatedTimestampUtc" => "2014-08-05T09:02:57.5440691Z", "HistorySummaryItems" => [(object) ["AverageSecondaryCurrencyPrice" => 510.0, "ClosingSecondaryCurrencyPrice" => 510.0, "StartTimestampUtc" => "2014-08-04T09:00:00Z", "EndTimestampUtc" => "2014-08-04T10:00:00Z", "HighestSecondaryCurrencyPrice" => 510.0, "LowestSecondaryCurrencyPrice" => 510.0, "NumberOfTrades" => 0, "OpeningSecondaryCurrencyPrice" => 510.0, "PrimaryCurrencyVolume" => 0.0, "SecondaryCurrencyVolume" => 0.0], (object) ["AverageSecondaryCurrencyPrice" => 510.0, "ClosingSecondaryCurrencyPrice" => 510.0, "StartTimestampUtc" => "2014-08-04T09:00:00Z", "EndTimestampUtc" => "2014-08-04T10:00:00Z", "HighestSecondaryCurrencyPrice" => 510.0, "LowestSecondaryCurrencyPrice" => 510.0, "NumberOfTrades" => 0, "OpeningSecondaryCurrencyPrice" => 510.0, "PrimaryCurrencyVolume" => 0.0, "SecondaryCurrencyVolume" => 0.0]], "NumberOfHoursInThePastToRetrieve" => 1, "PrimaryCurrencyCode" => "Xbt", "SecondaryCurrencyCode" => "Usd"]; $this->tradeHistorySummary = TradeHistorySummary::createFromObject($obj); }