mirror of
https://github.com/freqtrade/freqtrade.git
synced 2024-11-10 10:21:59 +00:00
Update imports in test directory
This commit is contained in:
parent
38c69e9258
commit
7767ad9d6e
|
@ -4,9 +4,13 @@ from unittest.mock import MagicMock
|
||||||
import pytest
|
import pytest
|
||||||
import rapidjson
|
import rapidjson
|
||||||
|
|
||||||
from freqtrade.commands.build_config_commands import (ask_user_config, ask_user_overwrite,
|
from freqtrade.commands.build_config_commands import (
|
||||||
start_new_config, validate_is_float,
|
ask_user_config,
|
||||||
validate_is_int)
|
ask_user_overwrite,
|
||||||
|
start_new_config,
|
||||||
|
validate_is_float,
|
||||||
|
validate_is_int,
|
||||||
|
)
|
||||||
from freqtrade.exceptions import OperationalException
|
from freqtrade.exceptions import OperationalException
|
||||||
from tests.conftest import get_args, log_has_re
|
from tests.conftest import get_args, log_has_re
|
||||||
|
|
||||||
|
|
|
@ -8,16 +8,35 @@ from zipfile import ZipFile
|
||||||
|
|
||||||
import pytest
|
import pytest
|
||||||
|
|
||||||
from freqtrade.commands import (start_backtesting_show, start_convert_data, start_convert_trades,
|
from freqtrade.commands import (
|
||||||
start_create_userdir, start_download_data, start_hyperopt_list,
|
start_backtesting_show,
|
||||||
start_hyperopt_show, start_install_ui, start_list_data,
|
start_convert_data,
|
||||||
start_list_exchanges, start_list_markets, start_list_strategies,
|
start_convert_trades,
|
||||||
start_list_timeframes, start_new_strategy, start_show_config,
|
start_create_userdir,
|
||||||
start_show_trades, start_strategy_update, start_test_pairlist,
|
start_download_data,
|
||||||
start_trading, start_webserver)
|
start_hyperopt_list,
|
||||||
|
start_hyperopt_show,
|
||||||
|
start_install_ui,
|
||||||
|
start_list_data,
|
||||||
|
start_list_exchanges,
|
||||||
|
start_list_markets,
|
||||||
|
start_list_strategies,
|
||||||
|
start_list_timeframes,
|
||||||
|
start_new_strategy,
|
||||||
|
start_show_config,
|
||||||
|
start_show_trades,
|
||||||
|
start_strategy_update,
|
||||||
|
start_test_pairlist,
|
||||||
|
start_trading,
|
||||||
|
start_webserver,
|
||||||
|
)
|
||||||
from freqtrade.commands.db_commands import start_convert_db
|
from freqtrade.commands.db_commands import start_convert_db
|
||||||
from freqtrade.commands.deploy_commands import (clean_ui_subdir, download_and_install_ui,
|
from freqtrade.commands.deploy_commands import (
|
||||||
get_ui_download_url, read_ui_version)
|
clean_ui_subdir,
|
||||||
|
download_and_install_ui,
|
||||||
|
get_ui_download_url,
|
||||||
|
read_ui_version,
|
||||||
|
)
|
||||||
from freqtrade.commands.list_commands import start_list_freqAI_models
|
from freqtrade.commands.list_commands import start_list_freqAI_models
|
||||||
from freqtrade.configuration import setup_utils_configuration
|
from freqtrade.configuration import setup_utils_configuration
|
||||||
from freqtrade.enums import RunMode
|
from freqtrade.enums import RunMode
|
||||||
|
@ -25,8 +44,16 @@ from freqtrade.exceptions import OperationalException
|
||||||
from freqtrade.persistence.models import init_db
|
from freqtrade.persistence.models import init_db
|
||||||
from freqtrade.persistence.pairlock_middleware import PairLocks
|
from freqtrade.persistence.pairlock_middleware import PairLocks
|
||||||
from freqtrade.util import dt_floor_day, dt_now, dt_utc
|
from freqtrade.util import dt_floor_day, dt_now, dt_utc
|
||||||
from tests.conftest import (CURRENT_TEST_STRATEGY, EXMS, create_mock_trades, get_args, log_has,
|
from tests.conftest import (
|
||||||
log_has_re, patch_exchange, patched_configuration_load_config_file)
|
CURRENT_TEST_STRATEGY,
|
||||||
|
EXMS,
|
||||||
|
create_mock_trades,
|
||||||
|
get_args,
|
||||||
|
log_has,
|
||||||
|
log_has_re,
|
||||||
|
patch_exchange,
|
||||||
|
patched_configuration_load_config_file,
|
||||||
|
)
|
||||||
from tests.conftest_trades import MOCK_TRADE_COUNT
|
from tests.conftest_trades import MOCK_TRADE_COUNT
|
||||||
|
|
||||||
|
|
||||||
|
|
|
@ -24,11 +24,25 @@ from freqtrade.persistence import LocalTrade, Order, Trade, init_db
|
||||||
from freqtrade.resolvers import ExchangeResolver
|
from freqtrade.resolvers import ExchangeResolver
|
||||||
from freqtrade.util import dt_now, dt_ts
|
from freqtrade.util import dt_now, dt_ts
|
||||||
from freqtrade.worker import Worker
|
from freqtrade.worker import Worker
|
||||||
from tests.conftest_trades import (leverage_trade, mock_trade_1, mock_trade_2, mock_trade_3,
|
from tests.conftest_trades import (
|
||||||
mock_trade_4, mock_trade_5, mock_trade_6, short_trade)
|
leverage_trade,
|
||||||
from tests.conftest_trades_usdt import (mock_trade_usdt_1, mock_trade_usdt_2, mock_trade_usdt_3,
|
mock_trade_1,
|
||||||
mock_trade_usdt_4, mock_trade_usdt_5, mock_trade_usdt_6,
|
mock_trade_2,
|
||||||
mock_trade_usdt_7)
|
mock_trade_3,
|
||||||
|
mock_trade_4,
|
||||||
|
mock_trade_5,
|
||||||
|
mock_trade_6,
|
||||||
|
short_trade,
|
||||||
|
)
|
||||||
|
from tests.conftest_trades_usdt import (
|
||||||
|
mock_trade_usdt_1,
|
||||||
|
mock_trade_usdt_2,
|
||||||
|
mock_trade_usdt_3,
|
||||||
|
mock_trade_usdt_4,
|
||||||
|
mock_trade_usdt_5,
|
||||||
|
mock_trade_usdt_6,
|
||||||
|
mock_trade_usdt_7,
|
||||||
|
)
|
||||||
|
|
||||||
|
|
||||||
logging.getLogger('').setLevel(logging.INFO)
|
logging.getLogger('').setLevel(logging.INFO)
|
||||||
|
|
|
@ -7,16 +7,32 @@ from pandas import DataFrame, DateOffset, Timestamp, to_datetime
|
||||||
|
|
||||||
from freqtrade.configuration import TimeRange
|
from freqtrade.configuration import TimeRange
|
||||||
from freqtrade.constants import LAST_BT_RESULT_FN
|
from freqtrade.constants import LAST_BT_RESULT_FN
|
||||||
from freqtrade.data.btanalysis import (BT_DATA_COLUMNS, analyze_trade_parallelism,
|
from freqtrade.data.btanalysis import (
|
||||||
extract_trades_of_period, get_latest_backtest_filename,
|
BT_DATA_COLUMNS,
|
||||||
get_latest_hyperopt_file, load_backtest_data,
|
analyze_trade_parallelism,
|
||||||
load_backtest_metadata, load_trades, load_trades_from_db)
|
extract_trades_of_period,
|
||||||
|
get_latest_backtest_filename,
|
||||||
|
get_latest_hyperopt_file,
|
||||||
|
load_backtest_data,
|
||||||
|
load_backtest_metadata,
|
||||||
|
load_trades,
|
||||||
|
load_trades_from_db,
|
||||||
|
)
|
||||||
from freqtrade.data.history import load_data, load_pair_history
|
from freqtrade.data.history import load_data, load_pair_history
|
||||||
from freqtrade.data.metrics import (calculate_cagr, calculate_calmar, calculate_csum,
|
from freqtrade.data.metrics import (
|
||||||
calculate_expectancy, calculate_market_change,
|
calculate_cagr,
|
||||||
calculate_max_drawdown, calculate_sharpe, calculate_sortino,
|
calculate_calmar,
|
||||||
calculate_underwater, combine_dataframes_with_mean,
|
calculate_csum,
|
||||||
combined_dataframes_with_rel_mean, create_cum_profit)
|
calculate_expectancy,
|
||||||
|
calculate_market_change,
|
||||||
|
calculate_max_drawdown,
|
||||||
|
calculate_sharpe,
|
||||||
|
calculate_sortino,
|
||||||
|
calculate_underwater,
|
||||||
|
combine_dataframes_with_mean,
|
||||||
|
combined_dataframes_with_rel_mean,
|
||||||
|
create_cum_profit,
|
||||||
|
)
|
||||||
from freqtrade.exceptions import OperationalException
|
from freqtrade.exceptions import OperationalException
|
||||||
from freqtrade.util import dt_utc
|
from freqtrade.util import dt_utc
|
||||||
from tests.conftest import CURRENT_TEST_STRATEGY, create_mock_trades
|
from tests.conftest import CURRENT_TEST_STRATEGY, create_mock_trades
|
||||||
|
|
|
@ -8,13 +8,24 @@ import pytest
|
||||||
from pandas.testing import assert_frame_equal
|
from pandas.testing import assert_frame_equal
|
||||||
|
|
||||||
from freqtrade.configuration.timerange import TimeRange
|
from freqtrade.configuration.timerange import TimeRange
|
||||||
from freqtrade.data.converter import (convert_ohlcv_format, convert_trades_format,
|
from freqtrade.data.converter import (
|
||||||
convert_trades_to_ohlcv, ohlcv_fill_up_missing_data,
|
convert_ohlcv_format,
|
||||||
ohlcv_to_dataframe, reduce_dataframe_footprint,
|
convert_trades_format,
|
||||||
trades_df_remove_duplicates, trades_dict_to_list,
|
convert_trades_to_ohlcv,
|
||||||
trades_to_ohlcv, trim_dataframe)
|
ohlcv_fill_up_missing_data,
|
||||||
from freqtrade.data.history import (get_timerange, load_data, load_pair_history,
|
ohlcv_to_dataframe,
|
||||||
validate_backtest_data)
|
reduce_dataframe_footprint,
|
||||||
|
trades_df_remove_duplicates,
|
||||||
|
trades_dict_to_list,
|
||||||
|
trades_to_ohlcv,
|
||||||
|
trim_dataframe,
|
||||||
|
)
|
||||||
|
from freqtrade.data.history import (
|
||||||
|
get_timerange,
|
||||||
|
load_data,
|
||||||
|
load_pair_history,
|
||||||
|
validate_backtest_data,
|
||||||
|
)
|
||||||
from freqtrade.data.history.datahandlers import IDataHandler
|
from freqtrade.data.history.datahandlers import IDataHandler
|
||||||
from freqtrade.enums import CandleType
|
from freqtrade.enums import CandleType
|
||||||
from freqtrade.exchange import timeframe_to_minutes, timeframe_to_seconds
|
from freqtrade.exchange import timeframe_to_minutes, timeframe_to_seconds
|
||||||
|
|
|
@ -13,8 +13,11 @@ from freqtrade.configuration import TimeRange
|
||||||
from freqtrade.constants import AVAILABLE_DATAHANDLERS
|
from freqtrade.constants import AVAILABLE_DATAHANDLERS
|
||||||
from freqtrade.data.history.datahandlers.featherdatahandler import FeatherDataHandler
|
from freqtrade.data.history.datahandlers.featherdatahandler import FeatherDataHandler
|
||||||
from freqtrade.data.history.datahandlers.hdf5datahandler import HDF5DataHandler
|
from freqtrade.data.history.datahandlers.hdf5datahandler import HDF5DataHandler
|
||||||
from freqtrade.data.history.datahandlers.idatahandler import (IDataHandler, get_datahandler,
|
from freqtrade.data.history.datahandlers.idatahandler import (
|
||||||
get_datahandlerclass)
|
IDataHandler,
|
||||||
|
get_datahandler,
|
||||||
|
get_datahandlerclass,
|
||||||
|
)
|
||||||
from freqtrade.data.history.datahandlers.jsondatahandler import JsonDataHandler, JsonGzDataHandler
|
from freqtrade.data.history.datahandlers.jsondatahandler import JsonDataHandler, JsonGzDataHandler
|
||||||
from freqtrade.data.history.datahandlers.parquetdatahandler import ParquetDataHandler
|
from freqtrade.data.history.datahandlers.parquetdatahandler import ParquetDataHandler
|
||||||
from freqtrade.enums import CandleType, TradingMode
|
from freqtrade.enums import CandleType, TradingMode
|
||||||
|
|
|
@ -17,19 +17,31 @@ from freqtrade.constants import DATETIME_PRINT_FORMAT
|
||||||
from freqtrade.data.converter import ohlcv_to_dataframe
|
from freqtrade.data.converter import ohlcv_to_dataframe
|
||||||
from freqtrade.data.history import get_datahandler
|
from freqtrade.data.history import get_datahandler
|
||||||
from freqtrade.data.history.datahandlers.jsondatahandler import JsonDataHandler, JsonGzDataHandler
|
from freqtrade.data.history.datahandlers.jsondatahandler import JsonDataHandler, JsonGzDataHandler
|
||||||
from freqtrade.data.history.history_utils import (_download_pair_history, _download_trades_history,
|
from freqtrade.data.history.history_utils import (
|
||||||
_load_cached_data_for_updating, get_timerange,
|
_download_pair_history,
|
||||||
load_data, load_pair_history,
|
_download_trades_history,
|
||||||
|
_load_cached_data_for_updating,
|
||||||
|
get_timerange,
|
||||||
|
load_data,
|
||||||
|
load_pair_history,
|
||||||
refresh_backtest_ohlcv_data,
|
refresh_backtest_ohlcv_data,
|
||||||
refresh_backtest_trades_data, refresh_data,
|
refresh_backtest_trades_data,
|
||||||
validate_backtest_data)
|
refresh_data,
|
||||||
|
validate_backtest_data,
|
||||||
|
)
|
||||||
from freqtrade.enums import CandleType, TradingMode
|
from freqtrade.enums import CandleType, TradingMode
|
||||||
from freqtrade.exchange import timeframe_to_minutes
|
from freqtrade.exchange import timeframe_to_minutes
|
||||||
from freqtrade.misc import file_dump_json
|
from freqtrade.misc import file_dump_json
|
||||||
from freqtrade.resolvers import StrategyResolver
|
from freqtrade.resolvers import StrategyResolver
|
||||||
from freqtrade.util import dt_ts, dt_utc
|
from freqtrade.util import dt_ts, dt_utc
|
||||||
from tests.conftest import (CURRENT_TEST_STRATEGY, EXMS, get_patched_exchange, log_has, log_has_re,
|
from tests.conftest import (
|
||||||
patch_exchange)
|
CURRENT_TEST_STRATEGY,
|
||||||
|
EXMS,
|
||||||
|
get_patched_exchange,
|
||||||
|
log_has,
|
||||||
|
log_has_re,
|
||||||
|
patch_exchange,
|
||||||
|
)
|
||||||
|
|
||||||
|
|
||||||
def _clean_test_file(file: Path) -> None:
|
def _clean_test_file(file: Path) -> None:
|
||||||
|
|
|
@ -16,8 +16,12 @@ from freqtrade.enums import ExitType
|
||||||
from freqtrade.exceptions import OperationalException
|
from freqtrade.exceptions import OperationalException
|
||||||
from freqtrade.util.datetime_helpers import dt_ts, dt_utc
|
from freqtrade.util.datetime_helpers import dt_ts, dt_utc
|
||||||
from tests.conftest import EXMS, get_patched_freqtradebot, log_has
|
from tests.conftest import EXMS, get_patched_freqtradebot, log_has
|
||||||
from tests.optimize import (BTContainer, BTrade, _build_backtest_dataframe,
|
from tests.optimize import (
|
||||||
_get_frame_time_from_offset)
|
BTContainer,
|
||||||
|
BTrade,
|
||||||
|
_build_backtest_dataframe,
|
||||||
|
_get_frame_time_from_offset,
|
||||||
|
)
|
||||||
|
|
||||||
|
|
||||||
# Cases to be tested:
|
# Cases to be tested:
|
||||||
|
|
|
@ -11,17 +11,42 @@ from numpy import NaN
|
||||||
from pandas import DataFrame
|
from pandas import DataFrame
|
||||||
|
|
||||||
from freqtrade.enums import CandleType, MarginMode, RunMode, TradingMode
|
from freqtrade.enums import CandleType, MarginMode, RunMode, TradingMode
|
||||||
from freqtrade.exceptions import (ConfigurationError, DDosProtection, DependencyException,
|
from freqtrade.exceptions import (
|
||||||
ExchangeError, InsufficientFundsError, InvalidOrderException,
|
ConfigurationError,
|
||||||
OperationalException, PricingError, TemporaryError)
|
DDosProtection,
|
||||||
from freqtrade.exchange import (Binance, Bybit, Exchange, Kraken, market_is_active,
|
DependencyException,
|
||||||
timeframe_to_prev_date)
|
ExchangeError,
|
||||||
from freqtrade.exchange.common import (API_FETCH_ORDER_RETRY_COUNT, API_RETRY_COUNT,
|
InsufficientFundsError,
|
||||||
calculate_backoff, remove_exchange_credentials)
|
InvalidOrderException,
|
||||||
|
OperationalException,
|
||||||
|
PricingError,
|
||||||
|
TemporaryError,
|
||||||
|
)
|
||||||
|
from freqtrade.exchange import (
|
||||||
|
Binance,
|
||||||
|
Bybit,
|
||||||
|
Exchange,
|
||||||
|
Kraken,
|
||||||
|
market_is_active,
|
||||||
|
timeframe_to_prev_date,
|
||||||
|
)
|
||||||
|
from freqtrade.exchange.common import (
|
||||||
|
API_FETCH_ORDER_RETRY_COUNT,
|
||||||
|
API_RETRY_COUNT,
|
||||||
|
calculate_backoff,
|
||||||
|
remove_exchange_credentials,
|
||||||
|
)
|
||||||
from freqtrade.resolvers.exchange_resolver import ExchangeResolver
|
from freqtrade.resolvers.exchange_resolver import ExchangeResolver
|
||||||
from freqtrade.util import dt_now, dt_ts
|
from freqtrade.util import dt_now, dt_ts
|
||||||
from tests.conftest import (EXMS, generate_test_data_raw, get_mock_coro, get_patched_exchange,
|
from tests.conftest import (
|
||||||
log_has, log_has_re, num_log_has_re)
|
EXMS,
|
||||||
|
generate_test_data_raw,
|
||||||
|
get_mock_coro,
|
||||||
|
get_patched_exchange,
|
||||||
|
log_has,
|
||||||
|
log_has_re,
|
||||||
|
num_log_has_re,
|
||||||
|
)
|
||||||
|
|
||||||
|
|
||||||
# Make sure to always keep one exchange here which is NOT subclassed!!
|
# Make sure to always keep one exchange here which is NOT subclassed!!
|
||||||
|
|
|
@ -2,15 +2,30 @@
|
||||||
from datetime import datetime, timedelta, timezone
|
from datetime import datetime, timedelta, timezone
|
||||||
|
|
||||||
import pytest
|
import pytest
|
||||||
from ccxt import (DECIMAL_PLACES, ROUND, ROUND_DOWN, ROUND_UP, SIGNIFICANT_DIGITS, TICK_SIZE,
|
from ccxt import (
|
||||||
TRUNCATE)
|
DECIMAL_PLACES,
|
||||||
|
ROUND,
|
||||||
|
ROUND_DOWN,
|
||||||
|
ROUND_UP,
|
||||||
|
SIGNIFICANT_DIGITS,
|
||||||
|
TICK_SIZE,
|
||||||
|
TRUNCATE,
|
||||||
|
)
|
||||||
|
|
||||||
from freqtrade.enums import RunMode
|
from freqtrade.enums import RunMode
|
||||||
from freqtrade.exceptions import OperationalException
|
from freqtrade.exceptions import OperationalException
|
||||||
from freqtrade.exchange import (amount_to_contract_precision, amount_to_precision,
|
from freqtrade.exchange import (
|
||||||
date_minus_candles, price_to_precision, timeframe_to_minutes,
|
amount_to_contract_precision,
|
||||||
timeframe_to_msecs, timeframe_to_next_date, timeframe_to_prev_date,
|
amount_to_precision,
|
||||||
timeframe_to_resample_freq, timeframe_to_seconds)
|
date_minus_candles,
|
||||||
|
price_to_precision,
|
||||||
|
timeframe_to_minutes,
|
||||||
|
timeframe_to_msecs,
|
||||||
|
timeframe_to_next_date,
|
||||||
|
timeframe_to_prev_date,
|
||||||
|
timeframe_to_resample_freq,
|
||||||
|
timeframe_to_seconds,
|
||||||
|
)
|
||||||
from freqtrade.exchange.check_exchange import check_exchange
|
from freqtrade.exchange.check_exchange import check_exchange
|
||||||
from tests.conftest import log_has_re
|
from tests.conftest import log_has_re
|
||||||
|
|
||||||
|
|
|
@ -14,8 +14,14 @@ from freqtrade.enums.candletype import CandleType
|
||||||
from freqtrade.exceptions import OperationalException
|
from freqtrade.exceptions import OperationalException
|
||||||
from freqtrade.freqai.data_kitchen import FreqaiDataKitchen
|
from freqtrade.freqai.data_kitchen import FreqaiDataKitchen
|
||||||
from freqtrade.optimize.backtesting import Backtesting
|
from freqtrade.optimize.backtesting import Backtesting
|
||||||
from tests.conftest import (CURRENT_TEST_STRATEGY, get_args, get_patched_exchange, log_has_re,
|
from tests.conftest import (
|
||||||
patch_exchange, patched_configuration_load_config_file)
|
CURRENT_TEST_STRATEGY,
|
||||||
|
get_args,
|
||||||
|
get_patched_exchange,
|
||||||
|
log_has_re,
|
||||||
|
patch_exchange,
|
||||||
|
patched_configuration_load_config_file,
|
||||||
|
)
|
||||||
from tests.freqai.conftest import get_patched_freqai_strategy
|
from tests.freqai.conftest import get_patched_freqai_strategy
|
||||||
|
|
||||||
|
|
||||||
|
|
|
@ -11,8 +11,12 @@ from freqtrade.data.dataprovider import DataProvider
|
||||||
from freqtrade.exceptions import OperationalException
|
from freqtrade.exceptions import OperationalException
|
||||||
from freqtrade.freqai.data_kitchen import FreqaiDataKitchen
|
from freqtrade.freqai.data_kitchen import FreqaiDataKitchen
|
||||||
from tests.conftest import get_patched_exchange
|
from tests.conftest import get_patched_exchange
|
||||||
from tests.freqai.conftest import (get_patched_data_kitchen, get_patched_freqai_strategy, is_mac,
|
from tests.freqai.conftest import (
|
||||||
make_unfiltered_dataframe)
|
get_patched_data_kitchen,
|
||||||
|
get_patched_freqai_strategy,
|
||||||
|
is_mac,
|
||||||
|
make_unfiltered_dataframe,
|
||||||
|
)
|
||||||
|
|
||||||
|
|
||||||
@pytest.mark.parametrize(
|
@pytest.mark.parametrize(
|
||||||
|
|
|
@ -14,8 +14,13 @@ from freqtrade.optimize.backtesting import Backtesting
|
||||||
from freqtrade.persistence import Trade
|
from freqtrade.persistence import Trade
|
||||||
from freqtrade.plugins.pairlistmanager import PairListManager
|
from freqtrade.plugins.pairlistmanager import PairListManager
|
||||||
from tests.conftest import EXMS, create_mock_trades, get_patched_exchange, log_has_re
|
from tests.conftest import EXMS, create_mock_trades, get_patched_exchange, log_has_re
|
||||||
from tests.freqai.conftest import (get_patched_freqai_strategy, is_arm, is_mac, make_rl_config,
|
from tests.freqai.conftest import (
|
||||||
mock_pytorch_mlp_model_training_parameters)
|
get_patched_freqai_strategy,
|
||||||
|
is_arm,
|
||||||
|
is_mac,
|
||||||
|
make_rl_config,
|
||||||
|
mock_pytorch_mlp_model_training_parameters,
|
||||||
|
)
|
||||||
|
|
||||||
|
|
||||||
def can_run_model(model: str) -> None:
|
def can_run_model(model: str) -> None:
|
||||||
|
|
|
@ -13,23 +13,55 @@ from pandas import DataFrame
|
||||||
from sqlalchemy import select
|
from sqlalchemy import select
|
||||||
|
|
||||||
from freqtrade.constants import CANCEL_REASON, UNLIMITED_STAKE_AMOUNT
|
from freqtrade.constants import CANCEL_REASON, UNLIMITED_STAKE_AMOUNT
|
||||||
from freqtrade.enums import (CandleType, ExitCheckTuple, ExitType, RPCMessageType, RunMode,
|
from freqtrade.enums import (
|
||||||
SignalDirection, State)
|
CandleType,
|
||||||
from freqtrade.exceptions import (DependencyException, ExchangeError, InsufficientFundsError,
|
ExitCheckTuple,
|
||||||
InvalidOrderException, OperationalException, PricingError,
|
ExitType,
|
||||||
TemporaryError)
|
RPCMessageType,
|
||||||
|
RunMode,
|
||||||
|
SignalDirection,
|
||||||
|
State,
|
||||||
|
)
|
||||||
|
from freqtrade.exceptions import (
|
||||||
|
DependencyException,
|
||||||
|
ExchangeError,
|
||||||
|
InsufficientFundsError,
|
||||||
|
InvalidOrderException,
|
||||||
|
OperationalException,
|
||||||
|
PricingError,
|
||||||
|
TemporaryError,
|
||||||
|
)
|
||||||
from freqtrade.freqtradebot import FreqtradeBot
|
from freqtrade.freqtradebot import FreqtradeBot
|
||||||
from freqtrade.persistence import Order, PairLocks, Trade
|
from freqtrade.persistence import Order, PairLocks, Trade
|
||||||
from freqtrade.plugins.protections.iprotection import ProtectionReturn
|
from freqtrade.plugins.protections.iprotection import ProtectionReturn
|
||||||
from freqtrade.util.datetime_helpers import dt_now, dt_utc
|
from freqtrade.util.datetime_helpers import dt_now, dt_utc
|
||||||
from freqtrade.worker import Worker
|
from freqtrade.worker import Worker
|
||||||
from tests.conftest import (EXMS, create_mock_trades, create_mock_trades_usdt,
|
from tests.conftest import (
|
||||||
get_patched_freqtradebot, get_patched_worker, log_has, log_has_re,
|
EXMS,
|
||||||
patch_edge, patch_exchange, patch_get_signal, patch_wallet,
|
create_mock_trades,
|
||||||
patch_whitelist)
|
create_mock_trades_usdt,
|
||||||
from tests.conftest_trades import (MOCK_TRADE_COUNT, entry_side, exit_side, mock_order_2,
|
get_patched_freqtradebot,
|
||||||
mock_order_2_sell, mock_order_3, mock_order_3_sell, mock_order_4,
|
get_patched_worker,
|
||||||
mock_order_5_stoploss, mock_order_6_sell)
|
log_has,
|
||||||
|
log_has_re,
|
||||||
|
patch_edge,
|
||||||
|
patch_exchange,
|
||||||
|
patch_get_signal,
|
||||||
|
patch_wallet,
|
||||||
|
patch_whitelist,
|
||||||
|
)
|
||||||
|
from tests.conftest_trades import (
|
||||||
|
MOCK_TRADE_COUNT,
|
||||||
|
entry_side,
|
||||||
|
exit_side,
|
||||||
|
mock_order_2,
|
||||||
|
mock_order_2_sell,
|
||||||
|
mock_order_3,
|
||||||
|
mock_order_3_sell,
|
||||||
|
mock_order_4,
|
||||||
|
mock_order_5_stoploss,
|
||||||
|
mock_order_6_sell,
|
||||||
|
)
|
||||||
from tests.conftest_trades_usdt import mock_trade_usdt_4
|
from tests.conftest_trades_usdt import mock_trade_usdt_4
|
||||||
|
|
||||||
|
|
||||||
|
|
|
@ -11,8 +11,16 @@ from freqtrade.freqtradebot import FreqtradeBot
|
||||||
from freqtrade.persistence import Order, Trade
|
from freqtrade.persistence import Order, Trade
|
||||||
from freqtrade.persistence.models import PairLock
|
from freqtrade.persistence.models import PairLock
|
||||||
from freqtrade.util.datetime_helpers import dt_now
|
from freqtrade.util.datetime_helpers import dt_now
|
||||||
from tests.conftest import (EXMS, get_patched_freqtradebot, log_has, log_has_re, patch_edge,
|
from tests.conftest import (
|
||||||
patch_exchange, patch_get_signal, patch_whitelist)
|
EXMS,
|
||||||
|
get_patched_freqtradebot,
|
||||||
|
log_has,
|
||||||
|
log_has_re,
|
||||||
|
patch_edge,
|
||||||
|
patch_exchange,
|
||||||
|
patch_get_signal,
|
||||||
|
patch_whitelist,
|
||||||
|
)
|
||||||
from tests.conftest_trades import entry_side, exit_side
|
from tests.conftest_trades import entry_side, exit_side
|
||||||
from tests.freqtradebot.test_freqtradebot import patch_RPCManager
|
from tests.freqtradebot.test_freqtradebot import patch_RPCManager
|
||||||
|
|
||||||
|
|
|
@ -9,8 +9,13 @@ from freqtrade.enums import ExitType, TradingMode
|
||||||
from freqtrade.optimize.backtesting import Backtesting
|
from freqtrade.optimize.backtesting import Backtesting
|
||||||
from freqtrade.persistence.trade_model import LocalTrade
|
from freqtrade.persistence.trade_model import LocalTrade
|
||||||
from tests.conftest import EXMS, patch_exchange
|
from tests.conftest import EXMS, patch_exchange
|
||||||
from tests.optimize import (BTContainer, BTrade, _build_backtest_dataframe,
|
from tests.optimize import (
|
||||||
_get_frame_time_from_offset, tests_timeframe)
|
BTContainer,
|
||||||
|
BTrade,
|
||||||
|
_build_backtest_dataframe,
|
||||||
|
_get_frame_time_from_offset,
|
||||||
|
tests_timeframe,
|
||||||
|
)
|
||||||
|
|
||||||
|
|
||||||
# Test 0: Sell with signal sell in candle 3
|
# Test 0: Sell with signal sell in candle 3
|
||||||
|
|
|
@ -26,8 +26,15 @@ from freqtrade.optimize.backtesting import Backtesting
|
||||||
from freqtrade.persistence import LocalTrade, Trade
|
from freqtrade.persistence import LocalTrade, Trade
|
||||||
from freqtrade.resolvers import StrategyResolver
|
from freqtrade.resolvers import StrategyResolver
|
||||||
from freqtrade.util.datetime_helpers import dt_utc
|
from freqtrade.util.datetime_helpers import dt_utc
|
||||||
from tests.conftest import (CURRENT_TEST_STRATEGY, EXMS, get_args, log_has, log_has_re,
|
from tests.conftest import (
|
||||||
patch_exchange, patched_configuration_load_config_file)
|
CURRENT_TEST_STRATEGY,
|
||||||
|
EXMS,
|
||||||
|
get_args,
|
||||||
|
log_has,
|
||||||
|
log_has_re,
|
||||||
|
patch_exchange,
|
||||||
|
patched_configuration_load_config_file,
|
||||||
|
)
|
||||||
|
|
||||||
|
|
||||||
ORDER_TYPES = [
|
ORDER_TYPES = [
|
||||||
|
|
|
@ -6,8 +6,14 @@ from unittest.mock import MagicMock
|
||||||
from freqtrade.commands.optimize_commands import setup_optimize_configuration, start_edge
|
from freqtrade.commands.optimize_commands import setup_optimize_configuration, start_edge
|
||||||
from freqtrade.enums import RunMode
|
from freqtrade.enums import RunMode
|
||||||
from freqtrade.optimize.edge_cli import EdgeCli
|
from freqtrade.optimize.edge_cli import EdgeCli
|
||||||
from tests.conftest import (CURRENT_TEST_STRATEGY, EXMS, get_args, log_has, patch_exchange,
|
from tests.conftest import (
|
||||||
patched_configuration_load_config_file)
|
CURRENT_TEST_STRATEGY,
|
||||||
|
EXMS,
|
||||||
|
get_args,
|
||||||
|
log_has,
|
||||||
|
patch_exchange,
|
||||||
|
patched_configuration_load_config_file,
|
||||||
|
)
|
||||||
|
|
||||||
|
|
||||||
def test_setup_optimize_configuration_without_arguments(mocker, default_conf, caplog) -> None:
|
def test_setup_optimize_configuration_without_arguments(mocker, default_conf, caplog) -> None:
|
||||||
|
|
|
@ -20,8 +20,16 @@ from freqtrade.optimize.optimize_reports import generate_strategy_stats
|
||||||
from freqtrade.optimize.space import SKDecimal
|
from freqtrade.optimize.space import SKDecimal
|
||||||
from freqtrade.strategy import IntParameter
|
from freqtrade.strategy import IntParameter
|
||||||
from freqtrade.util import dt_utc
|
from freqtrade.util import dt_utc
|
||||||
from tests.conftest import (CURRENT_TEST_STRATEGY, EXMS, get_args, get_markets, log_has, log_has_re,
|
from tests.conftest import (
|
||||||
patch_exchange, patched_configuration_load_config_file)
|
CURRENT_TEST_STRATEGY,
|
||||||
|
EXMS,
|
||||||
|
get_args,
|
||||||
|
get_markets,
|
||||||
|
log_has,
|
||||||
|
log_has_re,
|
||||||
|
patch_exchange,
|
||||||
|
patched_configuration_load_config_file,
|
||||||
|
)
|
||||||
|
|
||||||
|
|
||||||
def generate_result_metrics():
|
def generate_result_metrics():
|
||||||
|
|
|
@ -10,21 +10,33 @@ import pytest
|
||||||
from freqtrade.configuration import TimeRange
|
from freqtrade.configuration import TimeRange
|
||||||
from freqtrade.constants import BACKTEST_BREAKDOWNS, DATETIME_PRINT_FORMAT, LAST_BT_RESULT_FN
|
from freqtrade.constants import BACKTEST_BREAKDOWNS, DATETIME_PRINT_FORMAT, LAST_BT_RESULT_FN
|
||||||
from freqtrade.data import history
|
from freqtrade.data import history
|
||||||
from freqtrade.data.btanalysis import (get_latest_backtest_filename, load_backtest_data,
|
from freqtrade.data.btanalysis import (
|
||||||
load_backtest_stats)
|
get_latest_backtest_filename,
|
||||||
|
load_backtest_data,
|
||||||
|
load_backtest_stats,
|
||||||
|
)
|
||||||
from freqtrade.edge import PairInfo
|
from freqtrade.edge import PairInfo
|
||||||
from freqtrade.enums import ExitType
|
from freqtrade.enums import ExitType
|
||||||
from freqtrade.optimize.optimize_reports import (generate_backtest_stats, generate_daily_stats,
|
from freqtrade.optimize.optimize_reports import (
|
||||||
generate_edge_table, generate_pair_metrics,
|
generate_backtest_stats,
|
||||||
|
generate_daily_stats,
|
||||||
|
generate_edge_table,
|
||||||
|
generate_pair_metrics,
|
||||||
generate_periodic_breakdown_stats,
|
generate_periodic_breakdown_stats,
|
||||||
generate_strategy_comparison,
|
generate_strategy_comparison,
|
||||||
generate_trading_stats, show_sorted_pairlist,
|
generate_trading_stats,
|
||||||
|
show_sorted_pairlist,
|
||||||
store_backtest_analysis_results,
|
store_backtest_analysis_results,
|
||||||
store_backtest_stats, text_table_bt_results,
|
store_backtest_stats,
|
||||||
text_table_strategy)
|
text_table_bt_results,
|
||||||
|
text_table_strategy,
|
||||||
|
)
|
||||||
from freqtrade.optimize.optimize_reports.bt_output import text_table_tags
|
from freqtrade.optimize.optimize_reports.bt_output import text_table_tags
|
||||||
from freqtrade.optimize.optimize_reports.optimize_reports import (_get_resample_from_period,
|
from freqtrade.optimize.optimize_reports.optimize_reports import (
|
||||||
calc_streak, generate_tag_metrics)
|
_get_resample_from_period,
|
||||||
|
calc_streak,
|
||||||
|
generate_tag_metrics,
|
||||||
|
)
|
||||||
from freqtrade.resolvers.strategy_resolver import StrategyResolver
|
from freqtrade.resolvers.strategy_resolver import StrategyResolver
|
||||||
from freqtrade.util import dt_ts
|
from freqtrade.util import dt_ts
|
||||||
from freqtrade.util.datetime_helpers import dt_from_ts, dt_utc
|
from freqtrade.util.datetime_helpers import dt_from_ts, dt_utc
|
||||||
|
|
|
@ -10,8 +10,13 @@ from freqtrade.enums import TradingMode
|
||||||
from freqtrade.exceptions import DependencyException
|
from freqtrade.exceptions import DependencyException
|
||||||
from freqtrade.persistence import LocalTrade, Order, Trade, init_db
|
from freqtrade.persistence import LocalTrade, Order, Trade, init_db
|
||||||
from freqtrade.util import dt_now
|
from freqtrade.util import dt_now
|
||||||
from tests.conftest import (create_mock_trades, create_mock_trades_usdt,
|
from tests.conftest import (
|
||||||
create_mock_trades_with_leverage, log_has, log_has_re)
|
create_mock_trades,
|
||||||
|
create_mock_trades_usdt,
|
||||||
|
create_mock_trades_with_leverage,
|
||||||
|
log_has,
|
||||||
|
log_has_re,
|
||||||
|
)
|
||||||
|
|
||||||
|
|
||||||
spot, margin, futures = TradingMode.SPOT, TradingMode.MARGIN, TradingMode.FUTURES
|
spot, margin, futures = TradingMode.SPOT, TradingMode.MARGIN, TradingMode.FUTURES
|
||||||
|
|
|
@ -7,8 +7,13 @@ from freqtrade.data.history.history_utils import get_timerange
|
||||||
from freqtrade.optimize.backtesting import Backtesting
|
from freqtrade.optimize.backtesting import Backtesting
|
||||||
from freqtrade.persistence import Trade, disable_database_use, enable_database_use
|
from freqtrade.persistence import Trade, disable_database_use, enable_database_use
|
||||||
from freqtrade.persistence.custom_data import CustomDataWrapper
|
from freqtrade.persistence.custom_data import CustomDataWrapper
|
||||||
from tests.conftest import (EXMS, create_mock_trades_usdt, generate_test_data,
|
from tests.conftest import (
|
||||||
get_patched_freqtradebot, patch_exchange)
|
EXMS,
|
||||||
|
create_mock_trades_usdt,
|
||||||
|
generate_test_data,
|
||||||
|
get_patched_freqtradebot,
|
||||||
|
patch_exchange,
|
||||||
|
)
|
||||||
|
|
||||||
|
|
||||||
@pytest.mark.usefixtures("init_persistence")
|
@pytest.mark.usefixtures("init_persistence")
|
||||||
|
|
|
@ -19,8 +19,16 @@ from freqtrade.plugins.pairlist.pairlist_helpers import dynamic_expand_pairlist,
|
||||||
from freqtrade.plugins.pairlistmanager import PairListManager
|
from freqtrade.plugins.pairlistmanager import PairListManager
|
||||||
from freqtrade.resolvers import PairListResolver
|
from freqtrade.resolvers import PairListResolver
|
||||||
from freqtrade.util.datetime_helpers import dt_now
|
from freqtrade.util.datetime_helpers import dt_now
|
||||||
from tests.conftest import (EXMS, create_mock_trades_usdt, generate_test_data, get_patched_exchange,
|
from tests.conftest import (
|
||||||
get_patched_freqtradebot, log_has, log_has_re, num_log_has)
|
EXMS,
|
||||||
|
create_mock_trades_usdt,
|
||||||
|
generate_test_data,
|
||||||
|
get_patched_exchange,
|
||||||
|
get_patched_freqtradebot,
|
||||||
|
log_has,
|
||||||
|
log_has_re,
|
||||||
|
num_log_has,
|
||||||
|
)
|
||||||
|
|
||||||
|
|
||||||
# Exclude RemotePairList from tests.
|
# Exclude RemotePairList from tests.
|
||||||
|
|
|
@ -13,8 +13,13 @@ from freqtrade.persistence import Order, Trade
|
||||||
from freqtrade.persistence.key_value_store import set_startup_time
|
from freqtrade.persistence.key_value_store import set_startup_time
|
||||||
from freqtrade.rpc import RPC, RPCException
|
from freqtrade.rpc import RPC, RPCException
|
||||||
from freqtrade.rpc.fiat_convert import CryptoToFiatConverter
|
from freqtrade.rpc.fiat_convert import CryptoToFiatConverter
|
||||||
from tests.conftest import (EXMS, create_mock_trades, create_mock_trades_usdt,
|
from tests.conftest import (
|
||||||
get_patched_freqtradebot, patch_get_signal)
|
EXMS,
|
||||||
|
create_mock_trades,
|
||||||
|
create_mock_trades_usdt,
|
||||||
|
get_patched_freqtradebot,
|
||||||
|
patch_get_signal,
|
||||||
|
)
|
||||||
|
|
||||||
|
|
||||||
def test_rpc_trade_status(default_conf, ticker, fee, mocker) -> None:
|
def test_rpc_trade_status(default_conf, ticker, fee, mocker) -> None:
|
||||||
|
|
|
@ -30,8 +30,16 @@ from freqtrade.rpc.api_server.api_auth import create_token, get_user_from_token
|
||||||
from freqtrade.rpc.api_server.uvicorn_threaded import UvicornServer
|
from freqtrade.rpc.api_server.uvicorn_threaded import UvicornServer
|
||||||
from freqtrade.rpc.api_server.webserver_bgwork import ApiBG
|
from freqtrade.rpc.api_server.webserver_bgwork import ApiBG
|
||||||
from freqtrade.util.datetime_helpers import format_date
|
from freqtrade.util.datetime_helpers import format_date
|
||||||
from tests.conftest import (CURRENT_TEST_STRATEGY, EXMS, create_mock_trades, get_mock_coro,
|
from tests.conftest import (
|
||||||
get_patched_freqtradebot, log_has, log_has_re, patch_get_signal)
|
CURRENT_TEST_STRATEGY,
|
||||||
|
EXMS,
|
||||||
|
create_mock_trades,
|
||||||
|
get_mock_coro,
|
||||||
|
get_patched_freqtradebot,
|
||||||
|
log_has,
|
||||||
|
log_has_re,
|
||||||
|
patch_get_signal,
|
||||||
|
)
|
||||||
|
|
||||||
|
|
||||||
BASE_URI = "/api/v1"
|
BASE_URI = "/api/v1"
|
||||||
|
|
|
@ -22,8 +22,14 @@ from telegram.error import BadRequest, NetworkError, TelegramError
|
||||||
from freqtrade import __version__
|
from freqtrade import __version__
|
||||||
from freqtrade.constants import CANCEL_REASON
|
from freqtrade.constants import CANCEL_REASON
|
||||||
from freqtrade.edge import PairInfo
|
from freqtrade.edge import PairInfo
|
||||||
from freqtrade.enums import (ExitType, MarketDirection, RPCMessageType, RunMode, SignalDirection,
|
from freqtrade.enums import (
|
||||||
State)
|
ExitType,
|
||||||
|
MarketDirection,
|
||||||
|
RPCMessageType,
|
||||||
|
RunMode,
|
||||||
|
SignalDirection,
|
||||||
|
State,
|
||||||
|
)
|
||||||
from freqtrade.exceptions import OperationalException
|
from freqtrade.exceptions import OperationalException
|
||||||
from freqtrade.freqtradebot import FreqtradeBot
|
from freqtrade.freqtradebot import FreqtradeBot
|
||||||
from freqtrade.loggers import setup_logging
|
from freqtrade.loggers import setup_logging
|
||||||
|
@ -33,9 +39,18 @@ from freqtrade.rpc import RPC
|
||||||
from freqtrade.rpc.rpc import RPCException
|
from freqtrade.rpc.rpc import RPCException
|
||||||
from freqtrade.rpc.telegram import Telegram, authorized_only
|
from freqtrade.rpc.telegram import Telegram, authorized_only
|
||||||
from freqtrade.util.datetime_helpers import dt_now
|
from freqtrade.util.datetime_helpers import dt_now
|
||||||
from tests.conftest import (CURRENT_TEST_STRATEGY, EXMS, create_mock_trades,
|
from tests.conftest import (
|
||||||
create_mock_trades_usdt, get_patched_freqtradebot, log_has, log_has_re,
|
CURRENT_TEST_STRATEGY,
|
||||||
patch_exchange, patch_get_signal, patch_whitelist)
|
EXMS,
|
||||||
|
create_mock_trades,
|
||||||
|
create_mock_trades_usdt,
|
||||||
|
get_patched_freqtradebot,
|
||||||
|
log_has,
|
||||||
|
log_has_re,
|
||||||
|
patch_exchange,
|
||||||
|
patch_get_signal,
|
||||||
|
patch_whitelist,
|
||||||
|
)
|
||||||
|
|
||||||
|
|
||||||
@pytest.fixture(autouse=True)
|
@pytest.fixture(autouse=True)
|
||||||
|
|
|
@ -8,8 +8,13 @@ from pandas import DataFrame
|
||||||
|
|
||||||
import freqtrade.vendor.qtpylib.indicators as qtpylib
|
import freqtrade.vendor.qtpylib.indicators as qtpylib
|
||||||
from freqtrade.persistence import Trade
|
from freqtrade.persistence import Trade
|
||||||
from freqtrade.strategy import (BooleanParameter, DecimalParameter, IntParameter, IStrategy,
|
from freqtrade.strategy import (
|
||||||
RealParameter)
|
BooleanParameter,
|
||||||
|
DecimalParameter,
|
||||||
|
IntParameter,
|
||||||
|
IStrategy,
|
||||||
|
RealParameter,
|
||||||
|
)
|
||||||
|
|
||||||
|
|
||||||
class StrategyTestV3(IStrategy):
|
class StrategyTestV3(IStrategy):
|
||||||
|
|
|
@ -18,12 +18,23 @@ from freqtrade.optimize.space import SKDecimal
|
||||||
from freqtrade.persistence import PairLocks, Trade
|
from freqtrade.persistence import PairLocks, Trade
|
||||||
from freqtrade.resolvers import StrategyResolver
|
from freqtrade.resolvers import StrategyResolver
|
||||||
from freqtrade.strategy.hyper import detect_parameters
|
from freqtrade.strategy.hyper import detect_parameters
|
||||||
from freqtrade.strategy.parameters import (BaseParameter, BooleanParameter, CategoricalParameter,
|
from freqtrade.strategy.parameters import (
|
||||||
DecimalParameter, IntParameter, RealParameter)
|
BaseParameter,
|
||||||
|
BooleanParameter,
|
||||||
|
CategoricalParameter,
|
||||||
|
DecimalParameter,
|
||||||
|
IntParameter,
|
||||||
|
RealParameter,
|
||||||
|
)
|
||||||
from freqtrade.strategy.strategy_wrapper import strategy_safe_wrapper
|
from freqtrade.strategy.strategy_wrapper import strategy_safe_wrapper
|
||||||
from freqtrade.util import dt_now
|
from freqtrade.util import dt_now
|
||||||
from tests.conftest import (CURRENT_TEST_STRATEGY, TRADE_SIDES, create_mock_trades, log_has,
|
from tests.conftest import (
|
||||||
log_has_re)
|
CURRENT_TEST_STRATEGY,
|
||||||
|
TRADE_SIDES,
|
||||||
|
create_mock_trades,
|
||||||
|
log_has,
|
||||||
|
log_has_re,
|
||||||
|
)
|
||||||
|
|
||||||
from .strats.strategy_test_v3 import StrategyTestV3
|
from .strats.strategy_test_v3 import StrategyTestV3
|
||||||
|
|
||||||
|
|
|
@ -12,18 +12,28 @@ from freqtrade.commands import Arguments
|
||||||
from freqtrade.configuration import Configuration, validate_config_consistency
|
from freqtrade.configuration import Configuration, validate_config_consistency
|
||||||
from freqtrade.configuration.config_secrets import sanitize_config
|
from freqtrade.configuration.config_secrets import sanitize_config
|
||||||
from freqtrade.configuration.config_validation import validate_config_schema
|
from freqtrade.configuration.config_validation import validate_config_schema
|
||||||
from freqtrade.configuration.deprecated_settings import (check_conflicting_settings,
|
from freqtrade.configuration.deprecated_settings import (
|
||||||
|
check_conflicting_settings,
|
||||||
process_deprecated_setting,
|
process_deprecated_setting,
|
||||||
process_removed_setting,
|
process_removed_setting,
|
||||||
process_temporary_deprecated_settings)
|
process_temporary_deprecated_settings,
|
||||||
|
)
|
||||||
from freqtrade.configuration.environment_vars import _flat_vars_to_nested_dict
|
from freqtrade.configuration.environment_vars import _flat_vars_to_nested_dict
|
||||||
from freqtrade.configuration.load_config import (load_config_file, load_file, load_from_files,
|
from freqtrade.configuration.load_config import (
|
||||||
log_config_error_range)
|
load_config_file,
|
||||||
|
load_file,
|
||||||
|
load_from_files,
|
||||||
|
log_config_error_range,
|
||||||
|
)
|
||||||
from freqtrade.constants import DEFAULT_DB_DRYRUN_URL, DEFAULT_DB_PROD_URL, ENV_VAR_PREFIX
|
from freqtrade.constants import DEFAULT_DB_DRYRUN_URL, DEFAULT_DB_PROD_URL, ENV_VAR_PREFIX
|
||||||
from freqtrade.enums import RunMode
|
from freqtrade.enums import RunMode
|
||||||
from freqtrade.exceptions import OperationalException
|
from freqtrade.exceptions import OperationalException
|
||||||
from tests.conftest import (CURRENT_TEST_STRATEGY, log_has, log_has_re,
|
from tests.conftest import (
|
||||||
patched_configuration_load_config_file)
|
CURRENT_TEST_STRATEGY,
|
||||||
|
log_has,
|
||||||
|
log_has_re,
|
||||||
|
patched_configuration_load_config_file,
|
||||||
|
)
|
||||||
|
|
||||||
|
|
||||||
@pytest.fixture(scope="function")
|
@pytest.fixture(scope="function")
|
||||||
|
|
|
@ -5,8 +5,12 @@ from unittest.mock import MagicMock
|
||||||
|
|
||||||
import pytest
|
import pytest
|
||||||
|
|
||||||
from freqtrade.configuration.directory_operations import (chown_user_directory, copy_sample_files,
|
from freqtrade.configuration.directory_operations import (
|
||||||
create_datadir, create_userdata_dir)
|
chown_user_directory,
|
||||||
|
copy_sample_files,
|
||||||
|
create_datadir,
|
||||||
|
create_userdata_dir,
|
||||||
|
)
|
||||||
from freqtrade.exceptions import OperationalException
|
from freqtrade.exceptions import OperationalException
|
||||||
from tests.conftest import log_has, log_has_re
|
from tests.conftest import log_has, log_has_re
|
||||||
|
|
||||||
|
|
|
@ -4,10 +4,17 @@ import sys
|
||||||
import pytest
|
import pytest
|
||||||
|
|
||||||
from freqtrade.exceptions import OperationalException
|
from freqtrade.exceptions import OperationalException
|
||||||
from freqtrade.loggers import (FTBufferingHandler, FTStdErrStreamHandler, set_loggers,
|
from freqtrade.loggers import (
|
||||||
setup_logging, setup_logging_pre)
|
FTBufferingHandler,
|
||||||
from freqtrade.loggers.set_log_levels import (reduce_verbosity_for_bias_tester,
|
FTStdErrStreamHandler,
|
||||||
restore_verbosity_for_bias_tester)
|
set_loggers,
|
||||||
|
setup_logging,
|
||||||
|
setup_logging_pre,
|
||||||
|
)
|
||||||
|
from freqtrade.loggers.set_log_levels import (
|
||||||
|
reduce_verbosity_for_bias_tester,
|
||||||
|
restore_verbosity_for_bias_tester,
|
||||||
|
)
|
||||||
|
|
||||||
|
|
||||||
def test_set_loggers() -> None:
|
def test_set_loggers() -> None:
|
||||||
|
|
|
@ -12,8 +12,12 @@ from freqtrade.exceptions import ConfigurationError, FreqtradeException, Operati
|
||||||
from freqtrade.freqtradebot import FreqtradeBot
|
from freqtrade.freqtradebot import FreqtradeBot
|
||||||
from freqtrade.main import main
|
from freqtrade.main import main
|
||||||
from freqtrade.worker import Worker
|
from freqtrade.worker import Worker
|
||||||
from tests.conftest import (log_has, log_has_re, patch_exchange,
|
from tests.conftest import (
|
||||||
patched_configuration_load_config_file)
|
log_has,
|
||||||
|
log_has_re,
|
||||||
|
patch_exchange,
|
||||||
|
patched_configuration_load_config_file,
|
||||||
|
)
|
||||||
|
|
||||||
|
|
||||||
def test_parse_args_None(caplog) -> None:
|
def test_parse_args_None(caplog) -> None:
|
||||||
|
|
|
@ -7,10 +7,19 @@ from unittest.mock import MagicMock
|
||||||
import pandas as pd
|
import pandas as pd
|
||||||
import pytest
|
import pytest
|
||||||
|
|
||||||
from freqtrade.misc import (dataframe_to_json, deep_merge_dicts, file_dump_json, file_load_json,
|
from freqtrade.misc import (
|
||||||
is_file_in_dir, json_to_dataframe, pair_to_filename,
|
dataframe_to_json,
|
||||||
parse_db_uri_for_logging, plural, safe_value_fallback,
|
deep_merge_dicts,
|
||||||
safe_value_fallback2)
|
file_dump_json,
|
||||||
|
file_load_json,
|
||||||
|
is_file_in_dir,
|
||||||
|
json_to_dataframe,
|
||||||
|
pair_to_filename,
|
||||||
|
parse_db_uri_for_logging,
|
||||||
|
plural,
|
||||||
|
safe_value_fallback,
|
||||||
|
safe_value_fallback2,
|
||||||
|
)
|
||||||
|
|
||||||
|
|
||||||
def test_file_dump_json(mocker) -> None:
|
def test_file_dump_json(mocker) -> None:
|
||||||
|
|
|
@ -12,10 +12,20 @@ from freqtrade.data import history
|
||||||
from freqtrade.data.btanalysis import load_backtest_data
|
from freqtrade.data.btanalysis import load_backtest_data
|
||||||
from freqtrade.data.metrics import create_cum_profit
|
from freqtrade.data.metrics import create_cum_profit
|
||||||
from freqtrade.exceptions import OperationalException
|
from freqtrade.exceptions import OperationalException
|
||||||
from freqtrade.plot.plotting import (add_areas, add_indicators, add_profit, create_plotconfig,
|
from freqtrade.plot.plotting import (
|
||||||
generate_candlestick_graph, generate_plot_filename,
|
add_areas,
|
||||||
generate_profit_graph, init_plotscript, load_and_plot_trades,
|
add_indicators,
|
||||||
plot_profit, plot_trades, store_plot_file)
|
add_profit,
|
||||||
|
create_plotconfig,
|
||||||
|
generate_candlestick_graph,
|
||||||
|
generate_plot_filename,
|
||||||
|
generate_profit_graph,
|
||||||
|
init_plotscript,
|
||||||
|
load_and_plot_trades,
|
||||||
|
plot_profit,
|
||||||
|
plot_trades,
|
||||||
|
store_plot_file,
|
||||||
|
)
|
||||||
from freqtrade.resolvers import StrategyResolver
|
from freqtrade.resolvers import StrategyResolver
|
||||||
from tests.conftest import get_args, log_has, log_has_re, patch_exchange
|
from tests.conftest import get_args, log_has, log_has_re, patch_exchange
|
||||||
|
|
||||||
|
|
|
@ -8,8 +8,13 @@ from sqlalchemy import select
|
||||||
from freqtrade.constants import UNLIMITED_STAKE_AMOUNT
|
from freqtrade.constants import UNLIMITED_STAKE_AMOUNT
|
||||||
from freqtrade.exceptions import DependencyException
|
from freqtrade.exceptions import DependencyException
|
||||||
from freqtrade.persistence import Trade
|
from freqtrade.persistence import Trade
|
||||||
from tests.conftest import (EXMS, create_mock_trades, create_mock_trades_usdt,
|
from tests.conftest import (
|
||||||
get_patched_freqtradebot, patch_wallet)
|
EXMS,
|
||||||
|
create_mock_trades,
|
||||||
|
create_mock_trades_usdt,
|
||||||
|
get_patched_freqtradebot,
|
||||||
|
patch_wallet,
|
||||||
|
)
|
||||||
|
|
||||||
|
|
||||||
def test_sync_wallet_at_boot(mocker, default_conf):
|
def test_sync_wallet_at_boot(mocker, default_conf):
|
||||||
|
|
|
@ -3,8 +3,11 @@ import shutil
|
||||||
import pytest
|
import pytest
|
||||||
|
|
||||||
from freqtrade.persistence import Trade
|
from freqtrade.persistence import Trade
|
||||||
from freqtrade.util.migrations import (migrate_binance_futures_data, migrate_binance_futures_names,
|
from freqtrade.util.migrations import (
|
||||||
migrate_data)
|
migrate_binance_futures_data,
|
||||||
|
migrate_binance_futures_names,
|
||||||
|
migrate_data,
|
||||||
|
)
|
||||||
from tests.conftest import create_mock_trades_usdt, log_has
|
from tests.conftest import create_mock_trades_usdt, log_has
|
||||||
|
|
||||||
|
|
||||||
|
|
|
@ -3,8 +3,18 @@ from datetime import datetime, timedelta, timezone
|
||||||
import pytest
|
import pytest
|
||||||
import time_machine
|
import time_machine
|
||||||
|
|
||||||
from freqtrade.util import (dt_floor_day, dt_from_ts, dt_now, dt_ts, dt_ts_def, dt_ts_none, dt_utc,
|
from freqtrade.util import (
|
||||||
format_date, format_ms_time, shorten_date)
|
dt_floor_day,
|
||||||
|
dt_from_ts,
|
||||||
|
dt_now,
|
||||||
|
dt_ts,
|
||||||
|
dt_ts_def,
|
||||||
|
dt_ts_none,
|
||||||
|
dt_utc,
|
||||||
|
format_date,
|
||||||
|
format_ms_time,
|
||||||
|
shorten_date,
|
||||||
|
)
|
||||||
from freqtrade.util.datetime_helpers import dt_humanize_delta
|
from freqtrade.util.datetime_helpers import dt_humanize_delta
|
||||||
|
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue
Block a user