Conditions | 2 |
Paths | 2 |
Total Lines | 17 |
Code Lines | 11 |
Lines | 0 |
Ratio | 0 % |
Changes | 0 |
1 | <?php |
||
15 | { |
||
16 | $bybit = (new BybitAPI())->setCredentials('https://api-testnet.bybit.com'); |
||
17 | |||
18 | $indexPriceKlineResponse = $bybit->publicEndpoint(IndexPriceKline::class, (new IndexPriceKlineRequest()) |
||
19 | ->setSymbol('BTCUSDT') |
||
20 | ->setInterval(EnumIntervals::HOUR_1) |
||
21 | ->setStart('2024-07-11 10:00:00') |
||
22 | ->setEnd('2024-07-12 11:00:00') |
||
23 | ->setLimit(4) |
||
24 | )->execute(); |
||
25 | |||
26 | echo "Return code: {$indexPriceKlineResponse->getReturnCode()}\n"; |
||
27 | echo "Return message: {$indexPriceKlineResponse->getReturnMessage()}\n"; |
||
28 | |||
29 | /** @var IndexPriceKlineResponseItem $indexItem */ |
||
30 | foreach ($indexPriceKlineResponse->getResult()->getKlineList() as $indexItem) { |
||
|
|||
31 | echo " --- \n"; |
||
32 | echo "Start Time: {$indexItem->getStartTime()->format('Y-m-d H:i:s')}\n"; |
||
41 | } |