Skip to content

Order type not supported for this endpoint. Please use the Algo Order API endpoints instead. Binance #61

Description

@lukaspistelak

Expected Behavior

self._stop_loss = self.stop_market_order( self.symbol, -meta.get('position_size'),
                                                             meta.get('sl') )
 self._take_profit = self.limit_order( self.symbol, -meta.get('position_size') ,
                                                          meta.get('tp') )
                    
self.debug(" _stop_loss _take_profit created ")

this will create orders

Actual Behavior

Order type not supported for this endpoint. Please use the Algo Order API endpoints instead.

20251231 14:45:11.424 ERROR:: 2025-12-31 14:45:01 Brokerage Warning: Order failed, Order Id: 2 timestamp: 12/31/2025 2:45:01 PM quantity: -0.002 content: {"code":-4120,"msg":"Order type not supported for this endpoint. Please use the Algo Order API endpoints instead."}

Potential Solution

Binance change/ create new API ,

https://developers.binance.com/docs/derivatives/change-log

Reproducing the Problem

    def on_order_event(self, order_event: OrderEvent) -> None:

        self.debug(f"on_order_event order_event.status: {order_event.ticket.status }")

        # # pokud se nefiilnul novy trade tak ndelej nic
        # if order_event.status != OrderStatus.FILLED:
        #     return
        #


        if order_event.status in [OrderStatus.Submitted, OrderStatus.Filled]:

            meta = json.loads(order_event.ticket.tag)

            self.debug(f" meta: { meta }")

            match order_event.ticket.order_type:

                case OrderType.MARKET:
                    self._stop_loss = self.stop_market_order( self.symbol, -meta.get('position_size'),
                                                             meta.get('sl') )

                    self._take_profit = self.limit_order( self.symbol, -meta.get('position_size') ,
                                                          meta.get('tp') )

                    self.debug(" _stop_loss _take_profit created ")

                case OrderType.STOP_MARKET:
                    self._take_profit.cancel()
                case OrderType.LIMIT:
                    self._stop_loss.cancel()

System Information

Ubuntu 25. LTS

Checklist

  • I have completely filled out this template
  • I have confirmed that this issue exists on the current master branch
  • I have confirmed that this is not a duplicate issue by searching issues
  • I have provided detailed steps to reproduce the issue

Metadata

Metadata

Assignees

Labels

bugSomething isn't working

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions