Binance.Net
Binance.Net copied to clipboard
get limit order sl tp order data
Hi. for futures api USDT please help me how to get SL and TP limit order when the main order is limit too?
How are you going to do the 50 other things you need to do to place an order if you can't figure this out?
This isn't an issue.
@HypsyNZ You do not have to worry about the rest. If you know this, help me, if not, you do not need to answer
This is for TP :
var startTP = await bfc.UsdFuturesApi.Trading.PlaceOrderAsync(ASSET, side: OrderSide.Sell, positionSide: PositionSide.Long, type: FuturesOrderType.TakeProfit, quantity: long_quantity, price: long_price, stopPrice: actpr, timeInForce: TimeInForce.GoodTillCanceled);
You can make await order than => if(PositionLongOpenOrder.Success)
{
....
}
For TP/SL you have to use
STOP/TAKE_PROFIT | quantity, price, stopPrice
@eros1453 Thank you. Is it works on Both Cross and Isolated?
yes for me But try it on both way, sometimes when you miss the order on one side it will close the other side positionb on 'Hedge mode`
@eros1453 Hi. I place an order with the following parameter values first for the limit order: Order Side: Sell, Order Type: Limit, Quantity: 5 ADA, PositionSide: Short, TimeInForce: TimeInForce.GoodTillCancel, Price: 1.25
after success result I place another order for SL Limit as follows: Order Side: Buy, Order Type: Stop, Quantity: 5 ADA, PositionSide: Short, TimeInForce: TimeInForce.GoodTillCancel, Price: 1.25, StopPrice: 1.45
But at binance the result is not as expected. see screen shot please
change order type Stop
or StopLoss
to StopLossLimit
https://github.com/JKorf/Binance.Net/issues/734#issuecomment-842780655
You are currently trying to place a market order at your stop price
@HypsyNZ I have set order type to stoplosslimit. binance futures api return error Invalid orderType. Shouldn't I set closeposition=true??
@JKorf is this a bug? How are they supposed to place a StopLoss Limit order if its an invalid type?
( I don't trade futures just trying to help) @sinaptech
@JKorf @HypsyNZ I want to place a limit order with limit stoploss order too like the attached files in binance. I could not add stoploss order limit by this package.
@eros1453 Hi. I place an order with the following parameter values first for the limit order: Order Side: Sell, Order Type: Limit, Quantity: 5 ADA, PositionSide: Short, TimeInForce: TimeInForce.GoodTillCancel, Price: 1.25
after success result I place another order for SL Limit as follows: Order Side: Buy, Order Type: Stop, Quantity: 5 ADA, PositionSide: Short, TimeInForce: TimeInForce.GoodTillCancel, Price: 1.25, StopPrice: 1.45
But at binance the result is not as expected. see screen shot please
Its cause from limit price. the order is not executed immediately. I use orderbook and use the bestAsk or bestBuy price. On fast moving market it gets stuck sometimes. It
s better to use market order for position opening for fast trades
@eros1453 @JKorf I have still confused in creating limit order with SL and TP limit order like https://github.com/JKorf/Binance.Net/issues/1005#issuecomment-1061823508 I want to know If I can place order with this package like the above screenshots.
The limit order has to be partially filled before you place the second order
limit orders that are still "new" don't actually count.
Best way is to send Limit order with custom Order ID and when you receive the result trough userdatastream Event: Order Update execute the SL/TP orders. That must be the logic
Best way is to send Limit order with custom Order ID and when you receive the result trough userdatastream Event: Order Update execute the SL/TP orders. That must be the logic
thank you my lord of humanity. you just cured my depression.