Commit Graph

1112 Commits

Author SHA1 Message Date
Gerald Lonlas acbfe91f13 Allow EUR / USD as stake_currency
It will enable to trade with FIAT on exhanges like GDAX or Kraken.
2018-06-03 00:13:48 -07:00
Janne Sinivirta 7edafbb772
Merge pull request #823 from creslinux/timerange_unixtime_argument
Timerange unixtime argument
2018-06-03 07:22:41 +03:00
Janne Sinivirta a657e3d24a
Merge pull request #826 from gcarq/fix/hyperopt-stake_currency
Fix stake_currency returned by Hyperopt  …
2018-06-03 07:19:24 +03:00
Janne Sinivirta 2cd8782a88
Merge pull request #825 from gcarq/fix/hyperopt-in-progress
Fix the in-progress dot that does not show up during a Hyperopt run
2018-06-03 07:16:39 +03:00
Gerald Lonlas fe8ff1b929 Fix stake_currency return by Hyperopt
Hyperopt had BTC hard coded in the result. This commit  will display
the real stake_currency used.

If you used `"stake_currency": "USDT",` in your config file.
Before this commit you saw a message like:
"2 trades. Avg profit  0.13%. Total profit  0.00002651 BTC (0.0027Σ%). Avg duration 142.5 mins."

Now with the commit, we fix the wrong BTC currency:
"2 trades. Avg profit  0.13%. Total profit  0.00002651 USDT (0.0027Σ%). Avg duration 142.5 mins."
2018-06-02 14:07:31 -07:00
Gerald Lonlas 127cf5d619 Backtesting: Add the Interval required when data is missing
Change the message:
"No data for pair ETH/BTC, use --refresh-pairs-cached to download the data"
for:
"No data for pair: "ETH/BTC", Interval: 5m. Use --refresh-pairs-cached to download the data"

The message structure is unified with the download message:
"Download the pair: "ETH/BTC", Interval: 5m"
2018-06-02 13:55:05 -07:00
creslinux 94e586c049 Added unit test to check posix time arguments passed to timerange
Here is the pass report:
freqtrade_new creslin$ pytest freqtrade/tests/test_arguments.py
==================================================================== test session starts =====================================================================
platform darwin -- Python 3.6.5, pytest-3.6.0, py-1.5.3, pluggy-0.6.0
rootdir: /Users/creslin/PycharmProjects/freqtrade_new, inifile:
plugins: mock-1.10.0, cov-2.5.1
collected 19 items

freqtrade/tests/test_arguments.py ...................                                                                                                  [100%]

================================================================= 19 passed in 2.37 seconds ==================================================================
2018-06-02 22:46:54 +03:00
Gerald Lonlas dc65753a64 Fix the in-progress dot that does not show up during a Hyperopt run 2018-06-02 12:35:07 -07:00
creslin 43ba02afc6 Per feed back, kept the stype as date.
Use a tuple to keep as epoch int or process via arrow to timestamp.

I'll look at the test file also.
2018-06-02 21:59:18 +03:00
xmatthias 9537f17dd4 Fix test 2018-06-02 20:06:29 +02:00
Raymond Luo 2791d543ea Make backtesting report markdown shareable
Small tweak to make the backtesting report markdown ready and much easier to share reports on many markdown publishing tools and editors that already support Markdown Extra with just a copy and paste

Example:
![Example](https://i.imgur.com/HXlNkfm.png)
2018-06-02 19:52:16 +02:00
creslin 6ca375a397 Extend timerange to accept unix timestamps.
This gives greater granularity over backtest, parsing tickerfiles.

Example runs using date and unix time below.

/usr/local/Cellar/python3/3.6.2/Frameworks/Python.framework/Versions/3.6/bin/python3.6 /Users/creslin/PycharmProjects/freqtrade/scripts/report_correlation.py --timerange=20180528-20180529
2018-06-02 18:44:58,829 - freqtrade.configuration - INFO - Log level set to INFO
2018-06-02 18:44:58,830 - freqtrade.configuration - INFO - Using max_open_trades: 200 ...
2018-06-02 18:44:58,831 - freqtrade.configuration - INFO - Parameter --timerange detected: 20180528-20180529 ...
2018-06-02 18:44:58,831 - freqtrade.configuration - INFO - Parameter --datadir detected: freqtrade/tests/testdata ...
   BasePair      Pair  Correlation  BTC % Change  Pair % USD Ch  Pair % BTC Ch  Gain % on BTC        Start         Stop  BTC Volume
1  BTC_USDT   ETC_USD        0.965        -2.942         -4.070         -1.163      -1.128585  05-28 00:00  05-29 00:00      335.19
0  BTC_USDT   SNT_USD        0.943        -2.942         -5.857         -3.004      -2.915585  05-28 00:00  05-29 00:00      496.01
3  BTC_USDT  DASH_USD        0.902        -2.942         -9.034         -6.277      -6.092432  05-28 00:00  05-29 00:00      751.41
2  BTC_USDT   MTH_USD        0.954        -2.942         -9.290         -6.541      -6.348708  05-28 00:00  05-29 00:00       23.00
4  BTC_USDT   TRX_USD        0.951        -2.942        -13.647        -11.029     -10.704957  05-28 00:00  05-29 00:00    14544.57

Process finished with exit code 0

/usr/local/Cellar/python3/3.6.2/Frameworks/Python.framework/Versions/3.6/bin/python3.6 /Users/creslin/PycharmProjects/freqtrade/scripts/report_correlation.py --timerange=1527595200-1527618600
2018-06-02 18:47:40,382 - freqtrade.configuration - INFO - Log level set to INFO
2018-06-02 18:47:40,382 - freqtrade.configuration - INFO - Using max_open_trades: 200 ...
2018-06-02 18:47:40,383 - freqtrade.configuration - INFO - Parameter --timerange detected: 1527595200-1527618600 ...
2018-06-02 18:47:40,383 - freqtrade.configuration - INFO - Parameter --datadir detected: freqtrade/tests/testdata ...
   BasePair      Pair  Correlation  BTC % Change  Pair % USD Ch  Pair % BTC Ch  Gain % on BTC        Start         Stop  BTC Volume
0  BTC_USDT   SNT_USD        0.680           NaN            NaN            NaN            NaN  05-29 12:00  05-29 18:30    68866.30
1  BTC_USDT   ETC_USD        0.857           NaN            NaN            NaN            NaN  05-29 12:00  05-29 18:30   227514.17
2  BTC_USDT   MTH_USD        0.790           NaN            NaN            NaN            NaN  05-29 12:00  05-29 18:30    12103.96
3  BTC_USDT  DASH_USD        0.862           NaN            NaN            NaN            NaN  05-29 12:00  05-29 18:30    72982.78
4  BTC_USDT   TRX_USD        0.178           NaN            NaN            NaN            NaN  05-29 12:00  05-29 18:30  1258316.95

Process finished with exit code 0
2018-06-02 19:45:08 +03:00
Matthias 81bb128cf7
Merge pull request #822 from gcarq/fix/misleading_log
change misleading logging for datadir
2018-06-02 14:50:27 +02:00
xmatthias a8bf5092e8 add ignore explanation 2018-06-02 14:18:57 +02:00
xmatthias f88729f0e8 add ignore comment 2018-06-02 14:14:28 +02:00
xmatthias 3447e4bb97 comment on ignore hint 2018-06-02 14:13:17 +02:00
xmatthias 884395415f remove type:ignore 2018-06-02 14:10:15 +02:00
xmatthias 0007002c80 fix test failure 2018-06-02 14:07:54 +02:00
xmatthias 0a595190a3 fix last typechecks 2018-06-02 13:59:35 +02:00
xmatthias 32300f6d5f don't initialize with None where it's not necessary 2018-06-02 13:55:06 +02:00
xmatthias d9e951447f remove _init function in backtesting (and according test) 2018-06-02 13:54:22 +02:00
xmatthias 6fc21e30e5 remove unused import 2018-06-02 13:52:55 +02:00
xmatthias 6106822d10 typing 2018-06-02 13:44:41 +02:00
xmatthias 4a322abd4d Typecheck improvements 2018-06-02 13:44:05 +02:00
Janne Sinivirta b5c41ca0fc
Merge pull request #820 from gcarq/fix/backtesting_hint
Fix wrong hint '--update-pairs-cached' from Backtesting/Hyperopt
2018-06-02 11:39:09 +03:00
Janne Sinivirta a82a31341b change misleading logging for datadir 2018-06-02 11:32:05 +03:00
Gérald LONLAS 0980e7e82d
Merge pull request #766 from pan-long/forcesell-amount
Sell filled amount or an open limit buy order in forcesell.
2018-06-01 19:51:38 -07:00
Gerald Lonlas 792dd556a1 Fix wrong hint '--update-pairs-cached' from Backtesting/Hyperopt 2018-06-01 19:46:53 -07:00
xmatthias e28973c50a fix flake8 2018-05-31 22:17:46 +02:00
xmatthias 3fb1dd02f1 add typehints and type: ignores 2018-05-31 22:00:46 +02:00
xmatthias cf34b84cf1 add attributes with typehints 2018-05-31 21:59:22 +02:00
xmatthias f4f821e88e add typehints 2018-05-31 21:44:18 +02:00
xmatthias c0cef7250d typing - avoid variable reuse with differen ttype 2018-05-31 21:22:46 +02:00
xmatthias 2976a50c58 fix typing 2018-05-31 21:10:15 +02:00
xmatthias 69006b8fe8 flake8 2018-05-31 21:08:26 +02:00
xmatthias 4eb55acdbc fix typing 2018-05-31 21:04:10 +02:00
xmatthias 1352f135d0 typing 2018-05-31 20:55:45 +02:00
xmatthias 0d251cbfdd rpc type hints 2018-05-31 20:55:26 +02:00
xmatthias 4733aad7ff mypy_typing 2018-05-31 20:54:37 +02:00
xmatthias 48516e6e1e Add typehint 2018-05-31 20:41:05 +02:00
xmatthias 45909af7e0 type anotation fixes 2018-05-30 22:38:09 +02:00
xmatthias 88755fcded fix typing 2018-05-30 22:09:20 +02:00
xmatthias 0d6dffdc7e fix typehinting 2018-05-30 22:09:03 +02:00
xmatthias 9aa468adda fix for typehint 2018-05-30 22:01:29 +02:00
Samuel Husso c471ccb2db
Merge pull request #734 from arudov/fix/pair-downloads
Do not download pairs if --refresh-pairs-cached isn't set
2018-05-29 08:05:10 +03:00
Pan Long a98fcee4f9 Sell filled amount or an open limit buy order in forcesell.
Currently forcesell only cancels an open limit buy order and doesn't sell the filled amount.

After this change, forcesell will also update trade's amount to filled amount and sell the filled amount.
2018-05-26 09:55:31 +08:00
xmatthias 1ba5c5d9c6 set ccxt loglevel to info 2018-05-25 21:23:15 +02:00
Anton 8c22cfce37 Fix tests; fix codestyle 2018-05-21 23:15:01 +03:00
Anton e1cb0dbf28 Do not try to redownload pair data if --refresh-pairs-cached is not set 2018-05-21 22:31:08 +03:00
xmatthias e2efd7c6ec add test to verify network exception is cought on init of coinmarketcap 2018-05-21 20:03:25 +02:00
xmatthias 56e697acf5 Fix error initializing coinmarketcap 2018-05-21 20:01:41 +02:00
peterkorodi 0c051b1b7a Make plot_dataframe able to show trades stored in database. (#692)
* Show trades stored in db on the graph
2018-05-19 09:14:42 +03:00
Matthias Voppichler ef78f2f03a Add test for invalid order_fee dict 2018-05-15 20:13:43 +02:00
Matthias Voppichler a1fa688da0 Add tests for the new scenario 2018-05-15 19:49:47 +02:00
Matthias Voppichler 263bf918b1 Fix bug pointed out in #679 2018-05-15 19:49:28 +02:00
Anton d112d90e8e Make telegram message beautiful 2018-05-15 13:37:34 +03:00
Anton f175f48418 Fix get balance functionality 2018-05-15 00:31:56 +03:00
Matthias Voppichler 8549201502 add test for new fiat_convert logic 2018-05-13 20:46:02 +02:00
Matthias Voppichler b1c53ec656 refactor "patch_coinmarketcap" to conftest"
add patch_coinmarketcap to get_patched_freqtradebot
2018-05-13 20:04:40 +02:00
Matthias Voppichler 790f35a5c8 fix test which resets singleton without reinstating it 2018-05-13 20:03:54 +02:00
Matthias Voppichler 3246c60472 Fix coinmarketcap ticker 2018-05-13 20:00:38 +02:00
Matthias Voppichler 57fc9df5f3 Fix typo 2018-05-13 19:54:19 +02:00
Matthias Voppichler 144be37a9a Convert ID to string 2018-05-13 19:53:23 +02:00
Matthias Voppichler 9b8f90dc9f log error in find_price 2018-05-13 19:50:04 +02:00
Matthias Voppichler d07491ceb2 Dynamically load cryptomap 2018-05-13 19:46:08 +02:00
Matthias Voppichler 8f17b11610 Fix testfluke in hyperopt 2018-05-13 13:38:29 +02:00
Matthias Voppichler 8b098859f4 Reduce verbosity of get_ticker_history 2018-05-12 20:15:59 +02:00
Michael Egger 5b25ed99ac
Merge pull request #652 from gcarq/feat/objectify-ccxt
CCXT into use
2018-05-12 14:04:06 +02:00
Michael Egger edd840ac35
Merge pull request #640 from xmatthias/ccxt-obj-slippage
[cxxt][2/2] Add columns for slippage detection
2018-05-12 13:56:15 +02:00
Matthias Voppichler 58425993da Adapt tests to verify pair-conversion and exchange conversion 2018-05-12 13:39:29 +02:00
Matthias Voppichler e3ae1c6c2f Convert exchange-name to new format 2018-05-12 13:39:16 +02:00
Matthias Voppichler 40c581e5a8 Convert pair-format to new format 2018-05-12 13:37:42 +02:00
Matthias Voppichler 631081a2b2 Add additional tests 2018-05-12 10:37:17 +02:00
Matthias Voppichler 8e3ff8235f add explaining comments 2018-05-12 10:31:24 +02:00
Matthias Voppichler ada98abfee fix flake 2018-05-12 10:30:30 +02:00
Matthias Voppichler 49266fc4b8 Add migration test 2018-05-12 10:29:26 +02:00
Matthias Voppichler f5ff6ceead Rename instead of drop/create 2018-05-12 10:29:10 +02:00
Matthias Voppichler ab4e2bd5a9 Fix migrate script 2018-05-12 10:04:41 +02:00
Samuel Husso 01b6a0eb53 Freqtrade: ccxt release shall be called 0.17.0 2018-05-12 09:57:10 +03:00
Michael Egger 1dbdb880e6
Merge pull request #637 from arudov/fix/dl-testdata-period2
Time-range download of backtesting data
2018-05-07 17:19:54 +02:00
Matthias Voppichler ccf1c894b4 Inital try mirate 2018-05-06 09:09:53 +02:00
Matthias Voppichler d3fb2e4516 Add open_rate_requested and close_rate_requested for slippage detection 2018-05-05 12:57:07 +02:00
Anton 932b65da27 Fix test_optimize.py 2018-05-04 13:59:50 +03:00
Anton 2bfce64e6a Fix conflicts 2018-05-04 13:38:51 +03:00
Gert Wohlgemuth 6d2afdb146 added support for showing the exposed real value on the count table (#634) 2018-05-03 11:18:35 +02:00
gcarq 43fd9b37df fix 'max_open_trades must be greater than 0' regression 2018-05-03 10:48:25 +02:00
Anton ceeb98dda9 Fix conflicts 2018-05-03 11:16:29 +03:00
gcarq 306885e174 Merge branch 'develop' into feat/objectify-ccxt 2018-05-02 22:49:55 +02:00
Michael Egger 90a107393a
Merge pull request #622 from gcarq/fix/dl-testdata
fix download testdata
2018-05-02 22:06:43 +02:00
gcarq a76ed88496 Merge branch 'feat/objectify-ccxt' into feature/catch-exchange-errors 2018-05-02 20:03:13 +02:00
Anton 24ab1b5be5 Fix review comments, documenation update 2018-05-01 00:27:05 +03:00
Samuel Husso 842b0c2270 Exchange: fix missing comma and typehinting per PR comments 2018-04-29 18:55:43 +03:00
Anton a127e1db07 Fix case with empty dict 2018-04-28 01:40:48 +03:00
Anton 2267a420a4 Fix codestyle 2018-04-28 00:30:42 +03:00
Anton 82ea56c8fd Fix review comments. Add support of datetime timeganges 2018-04-28 00:16:34 +03:00
Michael Egger ecaf6b763c
Merge pull request #623 from xmatthias/cxxt_obj_sellfix
[cxxt][1/2] fix fee calculation in binance
2018-04-26 19:58:24 +02:00
Matthias Voppichler 0987af910e remove indicator name from comment 2018-04-25 20:03:32 +02:00
Matthias Voppichler 2e1124af1a remove unnecessary .keys() 2018-04-25 14:00:25 +02:00
Anton 2fe7812e20 Fix codestyle 2018-04-25 10:32:58 +03:00
Matthias Voppichler 8bd9ed1543 fix flake8 2018-04-25 09:13:56 +02:00
Matthias Voppichler 72c17e29c0 Add test for "no trades found" case 2018-04-25 09:08:02 +02:00
Matthias Voppichler 483415cd65 Add fee entry to DRY_ORDER dict as defined by ccxt 2018-04-25 09:03:32 +02:00
Matthias Voppichler 98669a3d62 remove duplicate log entry, fix key-error 2018-04-25 09:01:21 +02:00
Matthias Voppichler 9c2115c917 refactor get_real_amount 2018-04-25 08:52:08 +02:00
Matthias Voppichler f6ecd8e514 Add pytest fixture for real_amount test 2018-04-25 08:51:31 +02:00
Anton 6675120324 Add time range support to download_backtest_data 2018-04-25 02:11:07 +03:00
Matthias Voppichler ab6589d573 Fix comment and improve log message 2018-04-24 19:43:08 +02:00
Matthias Voppichler 9e94778fd7 simplify check for presence of list 2018-04-24 19:42:41 +02:00
Matthias Voppichler 2968347062 fix flake8 2018-04-23 20:32:46 +02:00
Matthias Voppichler 9450b76414 improve style of import in test 2018-04-23 20:08:58 +02:00
Matthias Voppichler d2608cbf13 improve check when not to run 2018-04-23 20:06:00 +02:00
Matthias Voppichler f580fbb91d remove maybe_update_amount and tests 2018-04-23 20:03:10 +02:00
gcarq 9b0fbbdc14 cancel_order: pass all positional arguments 2018-04-23 16:58:52 +02:00
gcarq aa213a3640 cancel_order: handle InvalidOrder exception 2018-04-23 16:58:32 +02:00
gcarq baeeaa777d get_balance: handle case if currency is not in response 2018-04-23 16:57:18 +02:00
gcarq 20af4bae7c retrier: raise initial exception instead of OperationalException 2018-04-23 16:56:35 +02:00
gcarq 5baab91bb5 catch TemporaryError for buy/sell in _process() 2018-04-22 20:28:39 +02:00
gcarq 4c49229b77 catch DependencyExceptions while selling 2018-04-22 20:27:34 +02:00
Matthias Voppichler 93a7c46977 optimize to only do network calls if necessary 2018-04-22 19:37:24 +02:00
gcarq bc2bd7fe1e add retrier decorator to all exchange functions except buy/sell 2018-04-22 17:28:49 +02:00
Matthias Voppichler a70958da41 test modify-logic 2018-04-22 11:05:23 +02:00
Samuel Husso 9f1544978d tests: use only coins that most likely are going to be in bittrex 2018-04-22 11:29:21 +03:00
Matthias Voppichler f838ba2a9b remove fee column from bot 2018-04-22 10:04:30 +02:00
Samuel Husso de8db9293c exchange: extract ccxt init to its own function (so that we can init ccxt from the scripts) 2018-04-22 10:57:48 +03:00
Samuel Husso fded8e5117 move download_backtest_data to scripts 2018-04-22 10:56:49 +03:00
Matthias Voppichler be95d699d2 only update if open_fee is set 2018-04-22 09:13:02 +02:00
gcarq 9ab4953472 fix backtesting testsuite 2018-04-22 00:21:03 +02:00
gcarq bbe3bc4423 catch ccxt.ExchangeError and retry 2018-04-22 00:20:15 +02:00
Matthias acb1b50924 [ccxt] fix unsupported fiat failures (#620)
* prepare to support FIAT/Crypto trading

* Don't fail fiat-convert for unsupported stake currencies

* remove commented code

* Add BNB to cryptomap

* Fix test-failure

* related to random execution as fee was not properly mocked if this is
one of the first tests
2018-04-21 23:20:12 +02:00
Matthias Voppichler a140748b5a Merge branch 'feat/objectify-ccxt' into cxxt_obj_sellfix 2018-04-21 22:39:22 +02:00
Matthias Voppichler 573b6b8e15 Remove unused line 2018-04-21 22:35:17 +02:00
Matthias 23e989d31f Fix tests run in random order (#599)
* allow tests to run in random mode

* Fix random test mode for fiat-convert

* allow random test execution in persistence

* fix pep8 styling

* use "usefixtures" to prevent pylint "unused parameter" message

* add pytest-random-order to travis
2018-04-21 21:21:50 +02:00
Matthias Voppichler 990f8a996b log in case of error 2018-04-21 21:01:53 +02:00
gcarq f4077a51c1 log hyperopt progress to stdout instead to the logger 2018-04-21 20:52:01 +02:00
gcarq 403f59ef45 use native python logger 2018-04-21 20:47:06 +02:00
Samuel Husso 001d7443da
Merge pull request #618 from gcarq/feature/add-get_fee-mocks
add mocks for exchange.get_fee
2018-04-21 21:26:22 +03:00
Matthias Voppichler ce90ee4ac2 have backtesting use fee_open and fee_close 2018-04-21 20:05:49 +02:00
Matthias Voppichler 06d230279c Fix tests 2018-04-21 20:05:39 +02:00
Matthias Voppichler 47748bc6f7 adjust tests for fee_open and fee_close 2018-04-21 19:55:48 +02:00
Matthias Voppichler a620aa8352 add columns fee_open and fee_close, update value 2018-04-21 19:47:08 +02:00
gcarq 09fb4ea584 add mocks for exchange.get_fee 2018-04-21 19:39:18 +02:00
gcarq 3997b6038d let cctx handle rate limits 2018-04-21 19:11:29 +02:00
Luis Felipe Díaz Chica 954c6e8c15 Write log when trying to sell opened trades (#608) 2018-04-21 18:44:57 +02:00
Matthias Voppichler 7f4c70827a Test get_amount_lots 2018-04-21 13:33:29 +02:00
Matthias Voppichler f69e8458f4 Add tests for update_real_amount 2018-04-21 13:33:29 +02:00
Matthias Voppichler 02f0f22621 fix comment 2018-04-21 13:33:29 +02:00
Matthias Voppichler 1d43dc229b refactor tests of get_real_amount 2018-04-21 13:33:29 +02:00
Matthias Voppichler c7d1a767f7 add get_trades_for_order 2018-04-21 13:33:29 +02:00
Matthias Voppichler 11d8f7d522 add get_real_amount and tests 2018-04-21 13:33:29 +02:00
gcarq 1332ab397f fix reference before assignment 2018-04-21 10:19:12 +03:00