Improve naming of calculate_profit method
This commit is contained in:
@@ -1158,7 +1158,7 @@ def test_calc_profit(
|
||||
)
|
||||
trade.open_order_id = 'something'
|
||||
|
||||
profit_res = trade.calc_profit_combined(close_rate)
|
||||
profit_res = trade.calculate_profit(close_rate)
|
||||
assert pytest.approx(profit_res.profit_abs) == round(profit, 8)
|
||||
assert pytest.approx(profit_res.profit_ratio) == round(profit_ratio, 8)
|
||||
val = trade.open_trade_value * (profit_res.profit_ratio) / lev
|
||||
@@ -1170,7 +1170,7 @@ def test_calc_profit(
|
||||
assert pytest.approx(trade.calc_profit(rate=close_rate)) == round(profit, 8)
|
||||
assert pytest.approx(trade.calc_profit_ratio(rate=close_rate)) == round(profit_ratio, 8)
|
||||
|
||||
profit_res2 = trade.calc_profit_combined(close_rate, trade.amount, trade.open_rate)
|
||||
profit_res2 = trade.calculate_profit(close_rate, trade.amount, trade.open_rate)
|
||||
assert pytest.approx(profit_res2.profit_abs) == round(profit, 8)
|
||||
assert pytest.approx(profit_res2.profit_ratio) == round(profit_ratio, 8)
|
||||
|
||||
|
||||
Reference in New Issue
Block a user