FuturesUsdt.Order.PlaceOrder TakeProfitLimit working?
See original GitHub issueThanks again for this wrapper - the best Binance Wrapper I have come across!
I have got the following code, but I was hoping you could kindly guide me through how to set TakeProfit in the same order placement. Is that possible?
Basically, in my code below I have got everything I need except for a takeProfitPrice optional parameter.
public override bool PlaceBuyOrder(TradingData trade, bool closePosition)
{
using (var client = new BinanceClient())
{
var buyOrder = client.FuturesUsdt.Order.PlaceOrder(
trade.CoinPair.ToString(),
OrderSide.Buy,
OrderType.Limit,
quantity: Math.Round(trade.CoinQuantityToTrade, 3),
reduceOnly: closePosition,
price: Math.Round(trade.Price, 2),
timeInForce: TimeInForce.GoodTillCancel);
if (buyOrder.Success)
trade.BuyOrderID = buyOrder.Data.OrderId;
else
Console.WriteLine(buyOrder.Error.Message.ToString());
return buyOrder.Success;
}
}
Thanks in advance!
Issue Analytics
- State:
- Created 3 years ago
- Comments:13 (3 by maintainers)
Top Results From Across the Web
Python Binance Futures - problem creating Take Profit ...
First I send a limit order to open a long/short position. Right after that I can send an equivalent but opposite take profit...
Read more >USDT-T - Cryptorg.net
Specify a trigger price to activate the order. It can be used to set a Stop Loss Limit, or Take Profit Limit Order....
Read more >How To Take Profit On Binance
Profitable trading on Binance Futures USDT-margin with the bot. ... However, in Multiple Take Profits, you are spreading your Take Profit limit order...
Read more >Untitled
Bitsgap Help Center. Successfully & Safely. 2.Trading cryptocurrency futures lets you be part of the crypto market movement through speculation.
Read more >How To Sell Futures On Binance
Cryptocurrency Futures Defined and How They Work on. If you open a futures contract chart and feel that the! Margin is insufficient -...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
Hi @JKorf ,
Strangely, I did not get the desired outcome. I got the following error:
Invalid order type
Instead I used the following function twice (one to open, and one to close using the reduceOnly): This is not ideal but works.Wonder why simply changing OrderType.Limit to OrderType.TakeProfitLimit and using stopPrice broke it?
If it’s not supported/allowed by the Binance API there’s not much I can do about it