node-binance-api icon indicating copy to clipboard operation
node-binance-api copied to clipboard

stop loss and take profit on the same trade

Open MishiMish opened this issue 3 years ago • 5 comments

Hey, anyone knows how I can put stop loss and take profit on the same trade? I couldn't find someone with a good answer that works for me.

MishiMish avatar Jan 05 '22 10:01 MishiMish

Hello

I think it's not possible

I used two call here.

ordimans avatar Jan 12 '22 23:01 ordimans

To place orders to open a long position, I use

//ORDER OPEN //await binance.futuresOrder('BUY', coin, amount)

//STOP-LOSS await binance.futuresOrder('SELL', coin, amount, false, { type: 'STOP_MARKET', workingType: 'MARK_PRICE', stopPrice: 0.0116, closePosition: true })

//TAKE_PROFIT_MARKET //await binance.futuresOrder('SELL', coin, amount, false, { type: 'TAKE_PROFIT_MARKET', workingType: 'MARK_PRICE', stopPrice: 0.01375, closePosition: true })

//LIMIT //await binance.futuresOrder('SELL', coin, amount / 3, false, { type: 'LIMIT', timeInForce: 'GTC', price: 0.012796, reduceOnly: true})

Blaag28 avatar Apr 04 '22 15:04 Blaag28

To place orders to open a long position, I use

//ORDER OPEN //await binance.futuresOrder('BUY', coin, amount)

//STOP-LOSS await binance.futuresOrder('SELL', coin, amount, false, { type: 'STOP_MARKET', workingType: 'MARK_PRICE', stopPrice: 0.0116, closePosition: true })

//TAKE_PROFIT_MARKET //await binance.futuresOrder('SELL', coin, amount, false, { type: 'TAKE_PROFIT_MARKET', workingType: 'MARK_PRICE', stopPrice: 0.01375, closePosition: true })

//LIMIT //await binance.futuresOrder('SELL', coin, amount / 3, false, { type: 'LIMIT', timeInForce: 'GTC', price: 0.012796, reduceOnly: true})

Is there any ways to auto close all SL or TP orders, once the original position is closed manually?

buckydroid avatar May 29 '22 15:05 buckydroid

To have orders automatically closed, you need to specify an additional stop loss and take profit parameter: timeInForce: 'GTE_GTC'.

//ORDER OPEN //await binance.futuresOrder('BUY', coin, amount)

//STOP-LOSS await binance.futuresOrder('SELL', coin, amount, false, { type: 'STOP_MARKET', workingType: 'MARK_PRICE', stopPrice: 0.0116, closePosition: true, timeInForce: 'GTE_GTC' })

//TAKE_PROFIT_MARKET //await binance.futuresOrder('SELL', coin, amount, false, { type: 'TAKE_PROFIT_MARKET', workingType: 'MARK_PRICE', stopPrice: 0.01375, closePosition: true, timeInForce: 'GTE_GTC' })

negst1994 avatar Oct 29 '23 21:10 negst1994

To have orders automatically closed, you need to specify an additional stop loss and take profit parameter: timeInForce: 'GTE_GTC'.

//ORDER OPEN //await binance.futuresOrder('BUY', coin, amount)

//STOP-LOSS await binance.futuresOrder('SELL', coin, amount, false, { type: 'STOP_MARKET', workingType: 'MARK_PRICE', stopPrice: 0.0116, closePosition: true, timeInForce: 'GTE_GTC' })

//TAKE_PROFIT_MARKET //await binance.futuresOrder('SELL', coin, amount, false, { type: 'TAKE_PROFIT_MARKET', workingType: 'MARK_PRICE', stopPrice: 0.01375, closePosition: true, timeInForce: 'GTE_GTC' })

Hello, what does GTE mean in this context? I only know GTC as good till cancelled.. so far i used OTOCO to close another position when the initial position is closed manually and is looking other way to do it..

skarbenic avatar Oct 31 '23 06:10 skarbenic