Re-align adjust_trade_position bt with live.
This commit is contained in:
@@ -565,7 +565,8 @@ class Backtesting:
|
|||||||
|
|
||||||
if stake_amount is not None and stake_amount < 0.0:
|
if stake_amount is not None and stake_amount < 0.0:
|
||||||
amount = amount_to_contract_precision(
|
amount = amount_to_contract_precision(
|
||||||
abs(stake_amount * trade.leverage) / current_rate, trade.amount_precision,
|
abs(stake_amount * trade.amount / trade.stake_amount),
|
||||||
|
trade.amount_precision,
|
||||||
self.precision_mode, trade.contract_size)
|
self.precision_mode, trade.contract_size)
|
||||||
if amount == 0.0:
|
if amount == 0.0:
|
||||||
return trade
|
return trade
|
||||||
|
|||||||
Reference in New Issue
Block a user