Update persistence to use timeframe

This commit is contained in:
Matthias
2020-06-02 10:02:24 +02:00
parent 09fe3c6f5e
commit af0f29e6b7
4 changed files with 18 additions and 12 deletions

View File

@@ -469,6 +469,7 @@ def test_migrate_old(mocker, default_conf, fee):
assert trade.fee_open_currency is None
assert trade.fee_close_cost is None
assert trade.fee_close_currency is None
assert trade.timeframe is None
trade = Trade.query.filter(Trade.id == 2).first()
assert trade.close_rate is not None
@@ -512,11 +513,11 @@ def test_migrate_new(mocker, default_conf, fee, caplog):
);"""
insert_table_old = """INSERT INTO trades (exchange, pair, is_open, fee,
open_rate, stake_amount, amount, open_date,
stop_loss, initial_stop_loss, max_rate)
stop_loss, initial_stop_loss, max_rate, ticker_interval)
VALUES ('binance', 'ETC/BTC', 1, {fee},
0.00258580, {stake}, {amount},
'2019-11-28 12:44:24.000000',
0.0, 0.0, 0.0)
0.0, 0.0, 0.0, '5m')
""".format(fee=fee.return_value,
stake=default_conf.get("stake_amount"),
amount=amount
@@ -554,7 +555,7 @@ def test_migrate_new(mocker, default_conf, fee, caplog):
assert trade.initial_stop_loss == 0.0
assert trade.sell_reason is None
assert trade.strategy is None
assert trade.ticker_interval is None
assert trade.timeframe == '5m'
assert trade.stoploss_order_id is None
assert trade.stoploss_last_update is None
assert log_has("trying trades_bak1", caplog)