Moved leverage and is_short variables out of trade constructors and into conftest

This commit is contained in:
Sam Germain 2021-07-07 01:06:51 -06:00
parent 150df3eb88
commit a19466c085
3 changed files with 5 additions and 7 deletions

View File

@ -2150,7 +2150,8 @@ def limit_exit_short_order_open():
'amount': 90.99370639272354,
'filled': 0.0,
'remaining': 90.99370639272354,
'status': 'open'
'status': 'open',
'leverage': 1.0
}
@ -2281,7 +2282,8 @@ def market_leveraged_buy_order():
'remaining': 0.0,
'status': 'closed',
'exchange': 'kraken',
'liquidation_price': 0.00004000
'liquidation_price': 0.00004000,
'leverage': 3.0
}
@ -2298,5 +2300,6 @@ def market_leveraged_sell_order():
'filled': 275.97543219,
'remaining': 0.0,
'status': 'closed',
'leverage': 3.0,
'exchange': 'kraken'
}

View File

@ -157,7 +157,6 @@ def test_update_open_order_lev(limit_leveraged_buy_order):
fee_open=0.1,
fee_close=0.1,
interest_rate=0.0005,
leverage=3.0,
exchange='binance',
interest_mode=InterestMode.HOURSPERDAY
)
@ -412,7 +411,6 @@ def test_update_limit_order_lev(limit_leveraged_buy_order, limit_leveraged_sell_
open_date=datetime.utcnow() - timedelta(hours=0, minutes=10),
fee_open=fee.return_value,
fee_close=fee.return_value,
leverage=3.0,
interest_rate=0.0005,
exchange='binance',
interest_mode=InterestMode.HOURSPERDAY
@ -480,7 +478,6 @@ def test_update_market_order_lev(market_leveraged_buy_order, market_leveraged_se
amount=5,
open_rate=0.00004099,
is_open=True,
leverage=3,
fee_open=fee.return_value,
fee_close=fee.return_value,
open_date=datetime.utcnow() - timedelta(hours=0, minutes=10),

View File

@ -494,7 +494,6 @@ def test_update_market_order_short(
fee_open=fee.return_value,
fee_close=fee.return_value,
open_date=datetime.utcnow() - timedelta(hours=0, minutes=10),
leverage=3.0,
interest_rate=0.0005,
exchange='kraken',
interest_mode=InterestMode.HOURSPER4
@ -584,7 +583,6 @@ def test_calc_profit_short(market_short_order, market_exit_short_order, fee):
fee_close=fee.return_value,
exchange='kraken',
is_short=True,
leverage=3.0,
interest_rate=0.0005,
interest_mode=InterestMode.HOURSPER4
)