File tree Expand file tree Collapse file tree 1 file changed +6
-2
lines changed
Expand file tree Collapse file tree 1 file changed +6
-2
lines changed Original file line number Diff line number Diff line change @@ -1181,15 +1181,19 @@ def calc_profit_ratio(
11811181 """
11821182 Calculates the profit as ratio (including fee).
11831183 :param rate: rate to compare with.
1184- :param amount: Amount to use for the calculation. Falls back to trade .amount if not set.
1184+ :param amount: Amount to use for the calculation. Falls back to self .amount if not set.
11851185 :param open_rate: open_rate to use. Defaults to self.open_rate if not provided.
11861186 :return: profit ratio as float
11871187 """
11881188 close_trade_value = self .calc_close_trade_value (rate , amount )
11891189
1190- if amount is None or open_rate is None :
1190+ if ( amount is None ) and ( open_rate is None ) :
11911191 open_trade_value = self .open_trade_value
11921192 else :
1193+ if amount is None :
1194+ amount = self .amount
1195+ if open_rate is None :
1196+ open_rate = self .open_rate
11931197 open_trade_value = self ._calc_open_trade_value (amount , open_rate )
11941198
11951199 if open_trade_value == 0.0 :
You can’t perform that action at this time.
0 commit comments