Open mzaja opened 1 year ago
multi_order_trades is True
: If a trade is already live allow it to be reused any number of times.multi_order_trades is False
: Validate the trade before order placement. It is possible to place any number of orders with a single trade as long as trade_count
and live_trade_count
are not exceeded. A Trade object can still be reused to place multiple orders.multi_order_trades
's value is irrelevant unless the number of trades or live trades is at the limit or has been exceeded, in which case it acts like force=True
. Post bugfix in #682, this will change to "irrelevant unless the number of trades or live trades has been exceeded"multi_order_trades is True
: Do nothing - proceeed with validation as usual.multi_order_trades is False
: Reject order if len(trade.orders) >= 1
.Since the current implementation of multi_order_trades
argument does not do much on its own and certainly does not do what the name suggest, I propose replacing it with per-trade order limits: max_order_count
and max_live_order_count
. These would behave on the trade level the same as max_trade_count
and max_live_trade_count
behave on the strategy level. To maintain backwards compatibility, they should be None
by default and optionally set by the user.
This section also does not make sense to me. If
self.multi_order_trades==True
and the trade is already live, the rest of the validations is skipped. https://github.com/betcode-org/flumine/blob/796ec51060328edac7e14678c6defd63a964d250/flumine/strategy/strategy.py#L166-L170Should this code not check if
len(trade.orders) >= 1
and reject placement ifself.multi_order_trades==False
? Allowing multiple orders per trade is very different from allowing multiple trades per runner, so the validation should proceed with the other checks. If a trade does not have at least two orders (opening and closing), I would not even call it a trade but a straight bet.Originally posted by @mzaja in https://github.com/betcode-org/flumine/issues/679#issuecomment-1676131870