Merge branch 'develop' into feat/new_args_system
This commit is contained in:
commit
0c3a8ddfb9
@ -44,7 +44,7 @@
|
|||||||
"ZEC/BTC",
|
"ZEC/BTC",
|
||||||
"XLM/BTC",
|
"XLM/BTC",
|
||||||
"NXT/BTC",
|
"NXT/BTC",
|
||||||
"POWR/BTC",
|
"TRX/BTC",
|
||||||
"ADA/BTC",
|
"ADA/BTC",
|
||||||
"XMR/BTC"
|
"XMR/BTC"
|
||||||
],
|
],
|
||||||
|
@ -78,7 +78,7 @@
|
|||||||
"ZEC/BTC",
|
"ZEC/BTC",
|
||||||
"XLM/BTC",
|
"XLM/BTC",
|
||||||
"NXT/BTC",
|
"NXT/BTC",
|
||||||
"POWR/BTC",
|
"TRX/BTC",
|
||||||
"ADA/BTC",
|
"ADA/BTC",
|
||||||
"XMR/BTC"
|
"XMR/BTC"
|
||||||
],
|
],
|
||||||
|
@ -78,7 +78,7 @@
|
|||||||
"ZEC/BTC",
|
"ZEC/BTC",
|
||||||
"XLM/BTC",
|
"XLM/BTC",
|
||||||
"NXT/BTC",
|
"NXT/BTC",
|
||||||
"POWR/BTC",
|
"TRX/BTC",
|
||||||
"ADA/BTC",
|
"ADA/BTC",
|
||||||
"XMR/BTC"
|
"XMR/BTC"
|
||||||
],
|
],
|
||||||
|
@ -125,11 +125,11 @@ def test_create_cum_profit(testdatadir):
|
|||||||
bt_data = load_backtest_data(filename)
|
bt_data = load_backtest_data(filename)
|
||||||
timerange = TimeRange.parse_timerange("20180110-20180112")
|
timerange = TimeRange.parse_timerange("20180110-20180112")
|
||||||
|
|
||||||
df = load_pair_history(pair="POWR/BTC", ticker_interval='5m',
|
df = load_pair_history(pair="TRX/BTC", ticker_interval='5m',
|
||||||
datadir=testdatadir, timerange=timerange)
|
datadir=testdatadir, timerange=timerange)
|
||||||
|
|
||||||
cum_profits = create_cum_profit(df.set_index('date'),
|
cum_profits = create_cum_profit(df.set_index('date'),
|
||||||
bt_data[bt_data["pair"] == 'POWR/BTC'],
|
bt_data[bt_data["pair"] == 'TRX/BTC'],
|
||||||
"cum_profits", timeframe="5m")
|
"cum_profits", timeframe="5m")
|
||||||
assert "cum_profits" in cum_profits.columns
|
assert "cum_profits" in cum_profits.columns
|
||||||
assert cum_profits.iloc[0]['cum_profits'] == 0
|
assert cum_profits.iloc[0]['cum_profits'] == 0
|
||||||
@ -143,11 +143,11 @@ def test_create_cum_profit1(testdatadir):
|
|||||||
bt_data.loc[:, 'close_time'] = bt_data.loc[:, 'close_time'] + DateOffset(seconds=20)
|
bt_data.loc[:, 'close_time'] = bt_data.loc[:, 'close_time'] + DateOffset(seconds=20)
|
||||||
timerange = TimeRange.parse_timerange("20180110-20180112")
|
timerange = TimeRange.parse_timerange("20180110-20180112")
|
||||||
|
|
||||||
df = load_pair_history(pair="POWR/BTC", ticker_interval='5m',
|
df = load_pair_history(pair="TRX/BTC", ticker_interval='5m',
|
||||||
datadir=testdatadir, timerange=timerange)
|
datadir=testdatadir, timerange=timerange)
|
||||||
|
|
||||||
cum_profits = create_cum_profit(df.set_index('date'),
|
cum_profits = create_cum_profit(df.set_index('date'),
|
||||||
bt_data[bt_data["pair"] == 'POWR/BTC'],
|
bt_data[bt_data["pair"] == 'TRX/BTC'],
|
||||||
"cum_profits", timeframe="5m")
|
"cum_profits", timeframe="5m")
|
||||||
assert "cum_profits" in cum_profits.columns
|
assert "cum_profits" in cum_profits.columns
|
||||||
assert cum_profits.iloc[0]['cum_profits'] == 0
|
assert cum_profits.iloc[0]['cum_profits'] == 0
|
||||||
|
@ -537,7 +537,7 @@ def test_generate_optimizer(mocker, default_conf) -> None:
|
|||||||
})
|
})
|
||||||
|
|
||||||
trades = [
|
trades = [
|
||||||
('POWR/BTC', 0.023117, 0.000233, 100)
|
('TRX/BTC', 0.023117, 0.000233, 100)
|
||||||
]
|
]
|
||||||
labels = ['currency', 'profit_percent', 'profit_abs', 'trade_duration']
|
labels = ['currency', 'profit_percent', 'profit_abs', 'trade_duration']
|
||||||
backtest_result = pd.DataFrame.from_records(trades, columns=labels)
|
backtest_result = pd.DataFrame.from_records(trades, columns=labels)
|
||||||
|
@ -53,10 +53,10 @@ def test_init_plotscript(default_conf, mocker, testdatadir):
|
|||||||
assert "trades" in ret
|
assert "trades" in ret
|
||||||
assert "pairs" in ret
|
assert "pairs" in ret
|
||||||
|
|
||||||
default_conf['pairs'] = ["POWR/BTC", "ADA/BTC"]
|
default_conf['pairs'] = ["TRX/BTC", "ADA/BTC"]
|
||||||
ret = init_plotscript(default_conf)
|
ret = init_plotscript(default_conf)
|
||||||
assert "tickers" in ret
|
assert "tickers" in ret
|
||||||
assert "POWR/BTC" in ret["tickers"]
|
assert "TRX/BTC" in ret["tickers"]
|
||||||
assert "ADA/BTC" in ret["tickers"]
|
assert "ADA/BTC" in ret["tickers"]
|
||||||
|
|
||||||
|
|
||||||
@ -228,12 +228,12 @@ def test_add_profit(testdatadir):
|
|||||||
bt_data = load_backtest_data(filename)
|
bt_data = load_backtest_data(filename)
|
||||||
timerange = TimeRange.parse_timerange("20180110-20180112")
|
timerange = TimeRange.parse_timerange("20180110-20180112")
|
||||||
|
|
||||||
df = history.load_pair_history(pair="POWR/BTC", ticker_interval='5m',
|
df = history.load_pair_history(pair="TRX/BTC", ticker_interval='5m',
|
||||||
datadir=testdatadir, timerange=timerange)
|
datadir=testdatadir, timerange=timerange)
|
||||||
fig = generate_empty_figure()
|
fig = generate_empty_figure()
|
||||||
|
|
||||||
cum_profits = create_cum_profit(df.set_index('date'),
|
cum_profits = create_cum_profit(df.set_index('date'),
|
||||||
bt_data[bt_data["pair"] == 'POWR/BTC'],
|
bt_data[bt_data["pair"] == 'TRX/BTC'],
|
||||||
"cum_profits", timeframe="5m")
|
"cum_profits", timeframe="5m")
|
||||||
|
|
||||||
fig1 = add_profit(fig, row=2, data=cum_profits, column='cum_profits', name='Profits')
|
fig1 = add_profit(fig, row=2, data=cum_profits, column='cum_profits', name='Profits')
|
||||||
@ -247,7 +247,7 @@ def test_generate_profit_graph(testdatadir):
|
|||||||
filename = testdatadir / "backtest-result_test.json"
|
filename = testdatadir / "backtest-result_test.json"
|
||||||
trades = load_backtest_data(filename)
|
trades = load_backtest_data(filename)
|
||||||
timerange = TimeRange.parse_timerange("20180110-20180112")
|
timerange = TimeRange.parse_timerange("20180110-20180112")
|
||||||
pairs = ["POWR/BTC", "ADA/BTC"]
|
pairs = ["TRX/BTC", "ADA/BTC"]
|
||||||
|
|
||||||
tickers = history.load_data(datadir=testdatadir,
|
tickers = history.load_data(datadir=testdatadir,
|
||||||
pairs=pairs,
|
pairs=pairs,
|
||||||
|
2
tests/testdata/backtest-result_test.json
vendored
2
tests/testdata/backtest-result_test.json
vendored
File diff suppressed because one or more lines are too long
2
tests/testdata/pairs.json
vendored
2
tests/testdata/pairs.json
vendored
@ -9,7 +9,7 @@
|
|||||||
"LTC/BTC",
|
"LTC/BTC",
|
||||||
"NEO/BTC",
|
"NEO/BTC",
|
||||||
"NXT/BTC",
|
"NXT/BTC",
|
||||||
"POWR/BTC",
|
"TRX/BTC",
|
||||||
"STORJ/BTC",
|
"STORJ/BTC",
|
||||||
"QTUM/BTC",
|
"QTUM/BTC",
|
||||||
"WAVES/BTC",
|
"WAVES/BTC",
|
||||||
|
Loading…
Reference in New Issue
Block a user