Improve migrations
This commit is contained in:
@@ -88,8 +88,9 @@ def migrate_trades_and_orders_table(
|
|||||||
stop_loss_pct = get_column_def(cols, 'stop_loss_pct', 'null')
|
stop_loss_pct = get_column_def(cols, 'stop_loss_pct', 'null')
|
||||||
initial_stop_loss = get_column_def(cols, 'initial_stop_loss', '0.0')
|
initial_stop_loss = get_column_def(cols, 'initial_stop_loss', '0.0')
|
||||||
initial_stop_loss_pct = get_column_def(cols, 'initial_stop_loss_pct', 'null')
|
initial_stop_loss_pct = get_column_def(cols, 'initial_stop_loss_pct', 'null')
|
||||||
is_stop_loss_trailing = get_column_def(cols, 'is_stop_loss_trailing',
|
is_stop_loss_trailing = get_column_def(
|
||||||
'stop_loss_pct <> initial_stop_loss_pct')
|
cols, 'is_stop_loss_trailing',
|
||||||
|
f'coalesce({stop_loss_pct}, 0.0) <> coalesce({initial_stop_loss_pct}, 0.0)')
|
||||||
stoploss_order_id = get_column_def(cols, 'stoploss_order_id', 'null')
|
stoploss_order_id = get_column_def(cols, 'stoploss_order_id', 'null')
|
||||||
stoploss_last_update = get_column_def(cols, 'stoploss_last_update', 'null')
|
stoploss_last_update = get_column_def(cols, 'stoploss_last_update', 'null')
|
||||||
max_rate = get_column_def(cols, 'max_rate', '0.0')
|
max_rate = get_column_def(cols, 'max_rate', '0.0')
|
||||||
|
|||||||
@@ -52,4 +52,5 @@ def test_strategy_test_v3(dataframe_1m, fee, is_short, side):
|
|||||||
side=side) is True
|
side=side) is True
|
||||||
|
|
||||||
assert strategy.custom_stoploss(pair='ETH/BTC', trade=trade, current_time=datetime.now(),
|
assert strategy.custom_stoploss(pair='ETH/BTC', trade=trade, current_time=datetime.now(),
|
||||||
current_rate=20_000, current_profit=0.05) == strategy.stoploss
|
current_rate=20_000, current_profit=0.05, after_fill=False
|
||||||
|
) == strategy.stoploss
|
||||||
|
|||||||
Reference in New Issue
Block a user