fix(trend): pass empty dict to ccxt create_order for DCA adds
Gate build_gate_order_params returns {} which is falsy; params or None broke trend_market_add with NoneType is not iterable while first-leg place_exchange_order worked.
Co-authored-by: Cursor <cursoragent@cursor.com>
This commit is contained in:
@@ -39,7 +39,8 @@ def trend_market_add(cfg: dict, exchange_symbol: str, direction: str, contracts:
|
||||
params = m.build_okx_order_params(direction, reduce_only=False)
|
||||
else:
|
||||
params = {}
|
||||
return ex.create_order(exchange_symbol, "market", side, float(contracts), None, params or None)
|
||||
order_params = params if params is not None else {}
|
||||
return ex.create_order(exchange_symbol, "market", side, float(contracts), None, order_params)
|
||||
|
||||
|
||||
def trend_market_close(cfg: dict, exchange_symbol: str, direction: str, pos_qty: float, leverage: int):
|
||||
|
||||
Reference in New Issue
Block a user