Skip to content

how to set a stop loss in binance #780

Open
@paulc1983

Description

@paulc1983

hi

i get this error submitting a stop order or binance.:
Parameter 'timeInForce' sent when not required.

that is submitting it as stop with isBuy = false.

I have looked at the code and set ispostonly = true , or modified the code to prevent the time in force param being added and get:
Binance stop order : ExchangeSharp.APIException: {"code":-1106,"msg":"Parameter 'price' sent when not required."}

whats the correct way to set a stop loss in binance?

I modified the code to change the type of order to 'STOP_LOSS_LIMIT' and added :
if (order.OrderType == OrderType.Stop)
payload["stopPrice"] = order.StopPrice;

this works. should i create a branch with these changes and raise a pr or is there a better way to do this using the existing 'STOP_LOSS' type?

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions