Skip to content

Commit

Permalink
added examples/order-book-extra-level-depth-param
Browse files Browse the repository at this point in the history
  • Loading branch information
kroitor committed Sep 30, 2017
1 parent da5afd1 commit 89b2a51
Show file tree
Hide file tree
Showing 3 changed files with 48 additions and 0 deletions.
19 changes: 19 additions & 0 deletions examples/js/order-book-extra-level-depth-param.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
"use strict";

const ccxt = require ('../../ccxt')
const asTable = require ('as-table')
const log = require ('ololog')

require ('ansicolor').nice;

(async function test () {

const exchange = new ccxt.bitfinex ()
const orders = await exchange.fetchOrderBook ('BTC/USD', {
'limit_bids': 5, // max = 50
'limit_asks': 5, // may be 0 in which case the array is empty
'group': 1, // 1 = orders are grouped by price, 0 = orders are separate
})

log (orders)
}) ()
17 changes: 17 additions & 0 deletions examples/php/order-book-level-depth-extra-param.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
<?php

$root = dirname (dirname (dirname (__FILE__)));

include $root . '/build/ccxt.php';

date_default_timezone_set ('UTC');

// instantiate the exchange by id
$exchange = '\\ccxt\\kraken';
$exchange = new $exchange ();
var_dump ($exchange->fetch_order_book ('BTC/USD', array (
'count' => 10, // up to ten order on each side for example
)));


?>
12 changes: 12 additions & 0 deletions examples/py/order-book-extra-level-depth-param.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
# -*- coding: utf-8 -*-

import os
import sys

root = os.path.dirname(os.path.dirname(os.path.dirname(os.path.abspath(__file__))))
sys.path.append(root)

import ccxt # noqa: E402

# return up to ten bidasks on each side of the order book stack
print(ccxt.cex().fetch_order_book('BTC/USD', {'depth': 10}))

0 comments on commit 89b2a51

Please sign in to comment.