From 3ac5b918996cafbf0dfe63531c8fe361d40d4875 Mon Sep 17 00:00:00 2001 From: hroff-1902 Date: Thu, 3 Oct 2019 02:58:45 +0300 Subject: [PATCH 1/2] Add market() method to dataprovider --- freqtrade/data/dataprovider.py | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/freqtrade/data/dataprovider.py b/freqtrade/data/dataprovider.py index 7d5e4540b..b564dbec8 100644 --- a/freqtrade/data/dataprovider.py +++ b/freqtrade/data/dataprovider.py @@ -85,6 +85,14 @@ class DataProvider: logger.warning(f"No data found for ({pair}, {ticker_interval}).") return data + def market(self, pair: str): + """ + Return market data for the pair + :param pair: Pair to get the data for + :return: Market data dict from ccxt or None if market info is not available for the pair + """ + return self._exchange.markets.get(pair) + def ticker(self, pair: str): """ Return last ticker data From 613300c61db36c6673281fcdf84ff0d2942d9083 Mon Sep 17 00:00:00 2001 From: hroff-1902 Date: Tue, 8 Oct 2019 00:38:20 +0300 Subject: [PATCH 2/2] Add short description of the market() method into docs --- docs/strategy-customization.md | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/docs/strategy-customization.md b/docs/strategy-customization.md index b927e5aad..caa465069 100644 --- a/docs/strategy-customization.md +++ b/docs/strategy-customization.md @@ -282,6 +282,8 @@ Please always check the mode of operation to select the correct method to get da - `ohlcv(pair, ticker_interval)` - Currently cached ticker data for the pair, returns DataFrame or empty DataFrame. - `historic_ohlcv(pair, ticker_interval)` - Returns historical data stored on disk. - `get_pair_dataframe(pair, ticker_interval)` - This is a universal method, which returns either historical data (for backtesting) or cached live data (for the Dry-Run and Live-Run modes). +- `orderbook(pair, maximum)` - Returns latest orderbook data for the pair, a dict with bids/asks with a total of `maximum` entries. +- `market(pair)` - Returns market data for the pair: fees, limits, precisions, activity flag, etc. See [ccxt documentation](https://github.com/ccxt/ccxt/wiki/Manual#markets) for more details on Market data structure. - `runmode` - Property containing the current runmode. #### Example: fetch live ohlcv / historic data for the first informative pair @@ -346,7 +348,7 @@ def informative_pairs(self): It is however better to use resampling to longer time-intervals when possible to avoid hammering the exchange with too many requests and risk beeing blocked. -### Additional data - Wallets +### Additional data (Wallets) The strategy provides access to the `Wallets` object. This contains the current balances on the exchange.