Add required arguments to Trade method

This commit is contained in:
Matthias 2019-12-17 06:58:10 +01:00
parent 39197458f4
commit 0b5354f13d
3 changed files with 82 additions and 27 deletions

View File

@ -125,6 +125,7 @@ def test_min_roi_reached(default_conf, fee) -> None:
trade = Trade( trade = Trade(
pair='ETH/BTC', pair='ETH/BTC',
stake_amount=0.001, stake_amount=0.001,
amount=5,
open_date=arrow.utcnow().shift(hours=-1).datetime, open_date=arrow.utcnow().shift(hours=-1).datetime,
fee_open=fee.return_value, fee_open=fee.return_value,
fee_close=fee.return_value, fee_close=fee.return_value,
@ -162,6 +163,7 @@ def test_min_roi_reached2(default_conf, fee) -> None:
trade = Trade( trade = Trade(
pair='ETH/BTC', pair='ETH/BTC',
stake_amount=0.001, stake_amount=0.001,
amount=5,
open_date=arrow.utcnow().shift(hours=-1).datetime, open_date=arrow.utcnow().shift(hours=-1).datetime,
fee_open=fee.return_value, fee_open=fee.return_value,
fee_close=fee.return_value, fee_close=fee.return_value,
@ -195,6 +197,7 @@ def test_min_roi_reached3(default_conf, fee) -> None:
trade = Trade( trade = Trade(
pair='ETH/BTC', pair='ETH/BTC',
stake_amount=0.001, stake_amount=0.001,
amount=5,
open_date=arrow.utcnow().shift(hours=-1).datetime, open_date=arrow.utcnow().shift(hours=-1).datetime,
fee_open=fee.return_value, fee_open=fee.return_value,
fee_close=fee.return_value, fee_close=fee.return_value,

View File

@ -1512,13 +1512,15 @@ def test_update_trade_state(mocker, default_conf, limit_buy_order, caplog) -> No
mocker.patch('freqtrade.freqtradebot.FreqtradeBot.get_real_amount', mocker.patch('freqtrade.freqtradebot.FreqtradeBot.get_real_amount',
return_value=limit_buy_order['amount']) return_value=limit_buy_order['amount'])
trade = Trade() trade = Trade(
# Mock session away open_order_id=123,
Trade.session = MagicMock() fee_open=0.001,
trade.open_order_id = '123' fee_close=0.001,
trade.open_fee = 0.001 open_rate=0.01,
open_date=arrow.utcnow().datetime,
amount=11,
)
# Add datetime explicitly since sqlalchemy defaults apply only once written to database # Add datetime explicitly since sqlalchemy defaults apply only once written to database
trade.open_date = arrow.utcnow().datetime
freqtrade.update_trade_state(trade) freqtrade.update_trade_state(trade)
# Test amount not modified by fee-logic # Test amount not modified by fee-logic
assert not log_has_re(r'Applying fee to .*', caplog) assert not log_has_re(r'Applying fee to .*', caplog)
@ -1541,7 +1543,7 @@ def test_update_trade_state(mocker, default_conf, limit_buy_order, caplog) -> No
assert log_has_re('Found open order for.*', caplog) assert log_has_re('Found open order for.*', caplog)
def test_update_trade_state_withorderdict(default_conf, trades_for_order, limit_buy_order, mocker): def test_update_trade_state_withorderdict(default_conf, trades_for_order, limit_buy_order, fee, mocker):
mocker.patch('freqtrade.exchange.Exchange.get_trades_for_order', return_value=trades_for_order) mocker.patch('freqtrade.exchange.Exchange.get_trades_for_order', return_value=trades_for_order)
# get_order should not be called!! # get_order should not be called!!
mocker.patch('freqtrade.exchange.Exchange.get_order', MagicMock(side_effect=ValueError)) mocker.patch('freqtrade.exchange.Exchange.get_order', MagicMock(side_effect=ValueError))
@ -1554,6 +1556,8 @@ def test_update_trade_state_withorderdict(default_conf, trades_for_order, limit_
amount=amount, amount=amount,
exchange='binance', exchange='binance',
open_rate=0.245441, open_rate=0.245441,
fee_open=fee.return_value,
fee_close=fee.return_value,
open_order_id="123456", open_order_id="123456",
is_open=True, is_open=True,
) )
@ -1562,7 +1566,7 @@ def test_update_trade_state_withorderdict(default_conf, trades_for_order, limit_
assert trade.amount == limit_buy_order['amount'] assert trade.amount == limit_buy_order['amount']
def test_update_trade_state_withorderdict_rounding_fee(default_conf, trades_for_order, def test_update_trade_state_withorderdict_rounding_fee(default_conf, trades_for_order, fee,
limit_buy_order, mocker, caplog): limit_buy_order, mocker, caplog):
trades_for_order[0]['amount'] = limit_buy_order['amount'] + 1e-14 trades_for_order[0]['amount'] = limit_buy_order['amount'] + 1e-14
mocker.patch('freqtrade.exchange.Exchange.get_trades_for_order', return_value=trades_for_order) mocker.patch('freqtrade.exchange.Exchange.get_trades_for_order', return_value=trades_for_order)
@ -1577,6 +1581,8 @@ def test_update_trade_state_withorderdict_rounding_fee(default_conf, trades_for_
amount=amount, amount=amount,
exchange='binance', exchange='binance',
open_rate=0.245441, open_rate=0.245441,
fee_open=fee.return_value,
fee_close=fee.return_value,
open_order_id="123456", open_order_id="123456",
is_open=True, is_open=True,
open_date=arrow.utcnow().datetime, open_date=arrow.utcnow().datetime,
@ -2972,7 +2978,7 @@ def test_disable_ignore_roi_if_buy_signal(default_conf, limit_buy_order,
assert trade.sell_reason == SellType.STOP_LOSS.value assert trade.sell_reason == SellType.STOP_LOSS.value
def test_get_real_amount_quote(default_conf, trades_for_order, buy_order_fee, caplog, mocker): def test_get_real_amount_quote(default_conf, trades_for_order, buy_order_fee, fee, caplog, mocker):
mocker.patch('freqtrade.exchange.Exchange.get_trades_for_order', return_value=trades_for_order) mocker.patch('freqtrade.exchange.Exchange.get_trades_for_order', return_value=trades_for_order)
patch_RPCManager(mocker) patch_RPCManager(mocker)
patch_exchange(mocker) patch_exchange(mocker)
@ -2982,6 +2988,8 @@ def test_get_real_amount_quote(default_conf, trades_for_order, buy_order_fee, ca
amount=amount, amount=amount,
exchange='binance', exchange='binance',
open_rate=0.245441, open_rate=0.245441,
fee_open=fee.return_value,
fee_close=fee.return_value,
open_order_id="123456" open_order_id="123456"
) )
freqtrade = FreqtradeBot(default_conf) freqtrade = FreqtradeBot(default_conf)
@ -2994,7 +3002,7 @@ def test_get_real_amount_quote(default_conf, trades_for_order, buy_order_fee, ca
caplog) caplog)
def test_get_real_amount_no_trade(default_conf, buy_order_fee, caplog, mocker): def test_get_real_amount_no_trade(default_conf, buy_order_fee, caplog, mocker, fee):
mocker.patch('freqtrade.exchange.Exchange.get_trades_for_order', return_value=[]) mocker.patch('freqtrade.exchange.Exchange.get_trades_for_order', return_value=[])
patch_RPCManager(mocker) patch_RPCManager(mocker)
@ -3005,6 +3013,8 @@ def test_get_real_amount_no_trade(default_conf, buy_order_fee, caplog, mocker):
amount=amount, amount=amount,
exchange='binance', exchange='binance',
open_rate=0.245441, open_rate=0.245441,
fee_open=fee.return_value,
fee_close=fee.return_value,
open_order_id="123456" open_order_id="123456"
) )
freqtrade = FreqtradeBot(default_conf) freqtrade = FreqtradeBot(default_conf)
@ -3017,7 +3027,7 @@ def test_get_real_amount_no_trade(default_conf, buy_order_fee, caplog, mocker):
caplog) caplog)
def test_get_real_amount_stake(default_conf, trades_for_order, buy_order_fee, mocker): def test_get_real_amount_stake(default_conf, trades_for_order, buy_order_fee, fee, mocker):
trades_for_order[0]['fee']['currency'] = 'ETH' trades_for_order[0]['fee']['currency'] = 'ETH'
patch_RPCManager(mocker) patch_RPCManager(mocker)
@ -3028,6 +3038,8 @@ def test_get_real_amount_stake(default_conf, trades_for_order, buy_order_fee, mo
pair='LTC/ETH', pair='LTC/ETH',
amount=amount, amount=amount,
exchange='binance', exchange='binance',
fee_open=fee.return_value,
fee_close=fee.return_value,
open_rate=0.245441, open_rate=0.245441,
open_order_id="123456" open_order_id="123456"
) )
@ -3038,7 +3050,8 @@ def test_get_real_amount_stake(default_conf, trades_for_order, buy_order_fee, mo
assert freqtrade.get_real_amount(trade, buy_order_fee) == amount assert freqtrade.get_real_amount(trade, buy_order_fee) == amount
def test_get_real_amount_no_currency_in_fee(default_conf, trades_for_order, buy_order_fee, mocker): def test_get_real_amount_no_currency_in_fee(default_conf, trades_for_order, buy_order_fee,
fee, mocker):
limit_buy_order = deepcopy(buy_order_fee) limit_buy_order = deepcopy(buy_order_fee)
limit_buy_order['fee'] = {'cost': 0.004, 'currency': None} limit_buy_order['fee'] = {'cost': 0.004, 'currency': None}
@ -3052,6 +3065,8 @@ def test_get_real_amount_no_currency_in_fee(default_conf, trades_for_order, buy_
pair='LTC/ETH', pair='LTC/ETH',
amount=amount, amount=amount,
exchange='binance', exchange='binance',
fee_open=fee.return_value,
fee_close=fee.return_value,
open_rate=0.245441, open_rate=0.245441,
open_order_id="123456" open_order_id="123456"
) )
@ -3062,7 +3077,7 @@ def test_get_real_amount_no_currency_in_fee(default_conf, trades_for_order, buy_
assert freqtrade.get_real_amount(trade, limit_buy_order) == amount assert freqtrade.get_real_amount(trade, limit_buy_order) == amount
def test_get_real_amount_BNB(default_conf, trades_for_order, buy_order_fee, mocker): def test_get_real_amount_BNB(default_conf, trades_for_order, buy_order_fee, fee, mocker):
trades_for_order[0]['fee']['currency'] = 'BNB' trades_for_order[0]['fee']['currency'] = 'BNB'
trades_for_order[0]['fee']['cost'] = 0.00094518 trades_for_order[0]['fee']['cost'] = 0.00094518
@ -3074,6 +3089,8 @@ def test_get_real_amount_BNB(default_conf, trades_for_order, buy_order_fee, mock
pair='LTC/ETH', pair='LTC/ETH',
amount=amount, amount=amount,
exchange='binance', exchange='binance',
fee_open=fee.return_value,
fee_close=fee.return_value,
open_rate=0.245441, open_rate=0.245441,
open_order_id="123456" open_order_id="123456"
) )
@ -3084,7 +3101,7 @@ def test_get_real_amount_BNB(default_conf, trades_for_order, buy_order_fee, mock
assert freqtrade.get_real_amount(trade, buy_order_fee) == amount assert freqtrade.get_real_amount(trade, buy_order_fee) == amount
def test_get_real_amount_multi(default_conf, trades_for_order2, buy_order_fee, caplog, mocker): def test_get_real_amount_multi(default_conf, trades_for_order2, buy_order_fee, caplog, fee, mocker):
patch_RPCManager(mocker) patch_RPCManager(mocker)
patch_exchange(mocker) patch_exchange(mocker)
mocker.patch('freqtrade.exchange.Exchange.get_trades_for_order', return_value=trades_for_order2) mocker.patch('freqtrade.exchange.Exchange.get_trades_for_order', return_value=trades_for_order2)
@ -3093,6 +3110,8 @@ def test_get_real_amount_multi(default_conf, trades_for_order2, buy_order_fee, c
pair='LTC/ETH', pair='LTC/ETH',
amount=amount, amount=amount,
exchange='binance', exchange='binance',
fee_open=fee.return_value,
fee_close=fee.return_value,
open_rate=0.245441, open_rate=0.245441,
open_order_id="123456" open_order_id="123456"
) )
@ -3106,7 +3125,8 @@ def test_get_real_amount_multi(default_conf, trades_for_order2, buy_order_fee, c
caplog) caplog)
def test_get_real_amount_fromorder(default_conf, trades_for_order, buy_order_fee, caplog, mocker): def test_get_real_amount_fromorder(default_conf, trades_for_order, buy_order_fee, fee,
caplog, mocker):
limit_buy_order = deepcopy(buy_order_fee) limit_buy_order = deepcopy(buy_order_fee)
limit_buy_order['fee'] = {'cost': 0.004, 'currency': 'LTC'} limit_buy_order['fee'] = {'cost': 0.004, 'currency': 'LTC'}
@ -3119,6 +3139,8 @@ def test_get_real_amount_fromorder(default_conf, trades_for_order, buy_order_fee
pair='LTC/ETH', pair='LTC/ETH',
amount=amount, amount=amount,
exchange='binance', exchange='binance',
fee_open=fee.return_value,
fee_close=fee.return_value,
open_rate=0.245441, open_rate=0.245441,
open_order_id="123456" open_order_id="123456"
) )
@ -3132,7 +3154,7 @@ def test_get_real_amount_fromorder(default_conf, trades_for_order, buy_order_fee
caplog) caplog)
def test_get_real_amount_invalid_order(default_conf, trades_for_order, buy_order_fee, mocker): def test_get_real_amount_invalid_order(default_conf, trades_for_order, buy_order_fee, fee, mocker):
limit_buy_order = deepcopy(buy_order_fee) limit_buy_order = deepcopy(buy_order_fee)
limit_buy_order['fee'] = {'cost': 0.004} limit_buy_order['fee'] = {'cost': 0.004}
@ -3144,6 +3166,8 @@ def test_get_real_amount_invalid_order(default_conf, trades_for_order, buy_order
pair='LTC/ETH', pair='LTC/ETH',
amount=amount, amount=amount,
exchange='binance', exchange='binance',
fee_open=fee.return_value,
fee_close=fee.return_value,
open_rate=0.245441, open_rate=0.245441,
open_order_id="123456" open_order_id="123456"
) )
@ -3154,7 +3178,7 @@ def test_get_real_amount_invalid_order(default_conf, trades_for_order, buy_order
assert freqtrade.get_real_amount(trade, limit_buy_order) == amount assert freqtrade.get_real_amount(trade, limit_buy_order) == amount
def test_get_real_amount_wrong_amount(default_conf, trades_for_order, buy_order_fee, mocker): def test_get_real_amount_wrong_amount(default_conf, trades_for_order, buy_order_fee, fee, mocker):
limit_buy_order = deepcopy(buy_order_fee) limit_buy_order = deepcopy(buy_order_fee)
limit_buy_order['amount'] = limit_buy_order['amount'] - 0.001 limit_buy_order['amount'] = limit_buy_order['amount'] - 0.001
@ -3167,6 +3191,8 @@ def test_get_real_amount_wrong_amount(default_conf, trades_for_order, buy_order_
amount=amount, amount=amount,
exchange='binance', exchange='binance',
open_rate=0.245441, open_rate=0.245441,
fee_open=fee.return_value,
fee_close=fee.return_value,
open_order_id="123456" open_order_id="123456"
) )
freqtrade = FreqtradeBot(default_conf) freqtrade = FreqtradeBot(default_conf)
@ -3177,7 +3203,7 @@ def test_get_real_amount_wrong_amount(default_conf, trades_for_order, buy_order_
freqtrade.get_real_amount(trade, limit_buy_order) freqtrade.get_real_amount(trade, limit_buy_order)
def test_get_real_amount_wrong_amount_rounding(default_conf, trades_for_order, buy_order_fee, def test_get_real_amount_wrong_amount_rounding(default_conf, trades_for_order, buy_order_fee, fee,
mocker): mocker):
# Floats should not be compared directly. # Floats should not be compared directly.
limit_buy_order = deepcopy(buy_order_fee) limit_buy_order = deepcopy(buy_order_fee)
@ -3191,6 +3217,8 @@ def test_get_real_amount_wrong_amount_rounding(default_conf, trades_for_order, b
pair='LTC/ETH', pair='LTC/ETH',
amount=amount, amount=amount,
exchange='binance', exchange='binance',
fee_open=fee.return_value,
fee_close=fee.return_value,
open_rate=0.245441, open_rate=0.245441,
open_order_id="123456" open_order_id="123456"
) )
@ -3202,7 +3230,7 @@ def test_get_real_amount_wrong_amount_rounding(default_conf, trades_for_order, b
abs_tol=MATH_CLOSE_PREC,) abs_tol=MATH_CLOSE_PREC,)
def test_get_real_amount_invalid(default_conf, trades_for_order, buy_order_fee, mocker): def test_get_real_amount_invalid(default_conf, trades_for_order, buy_order_fee, fee, mocker):
# Remove "Currency" from fee dict # Remove "Currency" from fee dict
trades_for_order[0]['fee'] = {'cost': 0.008} trades_for_order[0]['fee'] = {'cost': 0.008}
@ -3215,6 +3243,9 @@ def test_get_real_amount_invalid(default_conf, trades_for_order, buy_order_fee,
amount=amount, amount=amount,
exchange='binance', exchange='binance',
open_rate=0.245441, open_rate=0.245441,
fee_open=fee.return_value,
fee_close=fee.return_value,
open_order_id="123456" open_order_id="123456"
) )
freqtrade = FreqtradeBot(default_conf) freqtrade = FreqtradeBot(default_conf)
@ -3223,7 +3254,7 @@ def test_get_real_amount_invalid(default_conf, trades_for_order, buy_order_fee,
assert freqtrade.get_real_amount(trade, buy_order_fee) == amount assert freqtrade.get_real_amount(trade, buy_order_fee) == amount
def test_get_real_amount_open_trade(default_conf, mocker): def test_get_real_amount_open_trade(default_conf, fee, mocker):
patch_RPCManager(mocker) patch_RPCManager(mocker)
patch_exchange(mocker) patch_exchange(mocker)
amount = 12345 amount = 12345
@ -3232,6 +3263,8 @@ def test_get_real_amount_open_trade(default_conf, mocker):
amount=amount, amount=amount,
exchange='binance', exchange='binance',
open_rate=0.245441, open_rate=0.245441,
fee_open=fee.return_value,
fee_close=fee.return_value,
open_order_id="123456" open_order_id="123456"
) )
order = { order = {

View File

@ -136,12 +136,13 @@ def test_update_with_bittrex(limit_buy_order, limit_sell_order, fee, caplog):
id=2, id=2,
pair='ETH/BTC', pair='ETH/BTC',
stake_amount=0.001, stake_amount=0.001,
open_rate=0.01,
amount=5,
fee_open=fee.return_value, fee_open=fee.return_value,
fee_close=fee.return_value, fee_close=fee.return_value,
exchange='bittrex', exchange='bittrex',
) )
assert trade.open_order_id is None assert trade.open_order_id is None
assert trade.open_rate is None
assert trade.close_profit is None assert trade.close_profit is None
assert trade.close_date is None assert trade.close_date is None
@ -173,6 +174,8 @@ def test_update_market_order(market_buy_order, market_sell_order, fee, caplog):
id=1, id=1,
pair='ETH/BTC', pair='ETH/BTC',
stake_amount=0.001, stake_amount=0.001,
amount=5,
open_rate=0.01,
fee_open=fee.return_value, fee_open=fee.return_value,
fee_close=fee.return_value, fee_close=fee.return_value,
exchange='bittrex', exchange='bittrex',
@ -205,6 +208,8 @@ def test_calc_open_close_trade_price(limit_buy_order, limit_sell_order, fee):
trade = Trade( trade = Trade(
pair='ETH/BTC', pair='ETH/BTC',
stake_amount=0.001, stake_amount=0.001,
open_rate=0.01,
amount=5,
fee_open=fee.return_value, fee_open=fee.return_value,
fee_close=fee.return_value, fee_close=fee.return_value,
exchange='bittrex', exchange='bittrex',
@ -212,7 +217,7 @@ def test_calc_open_close_trade_price(limit_buy_order, limit_sell_order, fee):
trade.open_order_id = 'something' trade.open_order_id = 'something'
trade.update(limit_buy_order) trade.update(limit_buy_order)
assert trade.calc_open_trade_price() == 0.0010024999999225068 assert trade._calc_open_trade_price() == 0.0010024999999225068
trade.update(limit_sell_order) trade.update(limit_sell_order)
assert trade.calc_close_trade_price() == 0.0010646656050132426 assert trade.calc_close_trade_price() == 0.0010646656050132426
@ -229,6 +234,8 @@ def test_calc_close_trade_price_exception(limit_buy_order, fee):
trade = Trade( trade = Trade(
pair='ETH/BTC', pair='ETH/BTC',
stake_amount=0.001, stake_amount=0.001,
open_rate=0.1,
amount=5,
fee_open=fee.return_value, fee_open=fee.return_value,
fee_close=fee.return_value, fee_close=fee.return_value,
exchange='bittrex', exchange='bittrex',
@ -244,13 +251,14 @@ def test_update_open_order(limit_buy_order):
trade = Trade( trade = Trade(
pair='ETH/BTC', pair='ETH/BTC',
stake_amount=1.00, stake_amount=1.00,
open_rate=0.01,
amount=5,
fee_open=0.1, fee_open=0.1,
fee_close=0.1, fee_close=0.1,
exchange='bittrex', exchange='bittrex',
) )
assert trade.open_order_id is None assert trade.open_order_id is None
assert trade.open_rate is None
assert trade.close_profit is None assert trade.close_profit is None
assert trade.close_date is None assert trade.close_date is None
@ -258,7 +266,6 @@ def test_update_open_order(limit_buy_order):
trade.update(limit_buy_order) trade.update(limit_buy_order)
assert trade.open_order_id is None assert trade.open_order_id is None
assert trade.open_rate is None
assert trade.close_profit is None assert trade.close_profit is None
assert trade.close_date is None assert trade.close_date is None
@ -268,6 +275,8 @@ def test_update_invalid_order(limit_buy_order):
trade = Trade( trade = Trade(
pair='ETH/BTC', pair='ETH/BTC',
stake_amount=1.00, stake_amount=1.00,
amount=5,
open_rate=0.001,
fee_open=0.1, fee_open=0.1,
fee_close=0.1, fee_close=0.1,
exchange='bittrex', exchange='bittrex',
@ -282,6 +291,8 @@ def test_calc_open_trade_price(limit_buy_order, fee):
trade = Trade( trade = Trade(
pair='ETH/BTC', pair='ETH/BTC',
stake_amount=0.001, stake_amount=0.001,
amount=5,
open_rate=0.00001099,
fee_open=fee.return_value, fee_open=fee.return_value,
fee_close=fee.return_value, fee_close=fee.return_value,
exchange='bittrex', exchange='bittrex',
@ -290,10 +301,10 @@ def test_calc_open_trade_price(limit_buy_order, fee):
trade.update(limit_buy_order) # Buy @ 0.00001099 trade.update(limit_buy_order) # Buy @ 0.00001099
# Get the open rate price with the standard fee rate # Get the open rate price with the standard fee rate
assert trade.calc_open_trade_price() == 0.0010024999999225068 assert trade._calc_open_trade_price() == 0.0010024999999225068
trade.fee_open = 0.003
# Get the open rate price with a custom fee rate # Get the open rate price with a custom fee rate
assert trade.calc_open_trade_price(fee=0.003) == 0.001002999999922468 assert trade._calc_open_trade_price() == 0.001002999999922468
@pytest.mark.usefixtures("init_persistence") @pytest.mark.usefixtures("init_persistence")
@ -301,6 +312,8 @@ def test_calc_close_trade_price(limit_buy_order, limit_sell_order, fee):
trade = Trade( trade = Trade(
pair='ETH/BTC', pair='ETH/BTC',
stake_amount=0.001, stake_amount=0.001,
amount=5,
open_rate=0.00001099,
fee_open=fee.return_value, fee_open=fee.return_value,
fee_close=fee.return_value, fee_close=fee.return_value,
exchange='bittrex', exchange='bittrex',
@ -324,6 +337,8 @@ def test_calc_profit(limit_buy_order, limit_sell_order, fee):
trade = Trade( trade = Trade(
pair='ETH/BTC', pair='ETH/BTC',
stake_amount=0.001, stake_amount=0.001,
amount=5,
open_rate=0.00001099,
fee_open=fee.return_value, fee_open=fee.return_value,
fee_close=fee.return_value, fee_close=fee.return_value,
exchange='bittrex', exchange='bittrex',
@ -356,6 +371,8 @@ def test_calc_profit_percent(limit_buy_order, limit_sell_order, fee):
trade = Trade( trade = Trade(
pair='ETH/BTC', pair='ETH/BTC',
stake_amount=0.001, stake_amount=0.001,
amount=5,
open_rate=0.00001099,
fee_open=fee.return_value, fee_open=fee.return_value,
fee_close=fee.return_value, fee_close=fee.return_value,
exchange='bittrex', exchange='bittrex',
@ -630,6 +647,7 @@ def test_adjust_stop_loss(fee):
trade = Trade( trade = Trade(
pair='ETH/BTC', pair='ETH/BTC',
stake_amount=0.001, stake_amount=0.001,
amount=5,
fee_open=fee.return_value, fee_open=fee.return_value,
fee_close=fee.return_value, fee_close=fee.return_value,
exchange='bittrex', exchange='bittrex',
@ -681,6 +699,7 @@ def test_adjust_min_max_rates(fee):
trade = Trade( trade = Trade(
pair='ETH/BTC', pair='ETH/BTC',
stake_amount=0.001, stake_amount=0.001,
amount=5,
fee_open=fee.return_value, fee_open=fee.return_value,
fee_close=fee.return_value, fee_close=fee.return_value,
exchange='bittrex', exchange='bittrex',