Back to Ccxt

Exchange Rate Limiter RollingWindow

wiki/examples/php/exchange-rate-limiter-rollingWindow.md

4.5.52933 B
Original Source
php
<?php
namespace ccxt;
include_once (__DIR__.'/../../ccxt.php');
// ----------------------------------------------------------------------------

// PLEASE DO NOT EDIT THIS FILE, IT IS GENERATED AND WILL BE OVERWRITTEN:
// https://github.com/ccxt/ccxt/blob/master/CONTRIBUTING.md#how-to-contribute-code

// -----------------------------------------------------------------------------

error_reporting(E_ALL);
date_default_timezone_set('UTC');

use ccxt\Precise;
use React\Async;
use React\Promise;


// AUTO-TRANSPILE //
function example() {
   return Async\async(function () {
       $myex = new \ccxt\async\okx(array(
           'rateLimiterAlgorithm' => 'rollingWindow',
           'rollingWindowSize' => 10000,
       ));
       $trades = Async\await($myex->fetch_ohlcv('BTC/USDT'));
       var_dump($trades);
   }) ();
}


Async\await(example());