diff --git a/src/schedule/index.ts b/src/schedule/index.ts index 8a0fc58..3988be6 100644 --- a/src/schedule/index.ts +++ b/src/schedule/index.ts @@ -68,47 +68,47 @@ export const eventHandlerFuture: EventHandler = { { candle, analysis }: { candle: Candle; analysis: Analysis } ) => { if (eventType === "HighVolatility") { - const positions = await bybitService.listPositions({ - category: "linear", - symbol: analysis.symbol, - }); - if (positions.length > 0) { - const position = positions[0]; - if (position.side === "Buy" && analysis.isOverBbUpper && candle.close > candle.open) { - const halfSize = (Number(position.size) / 2).toFixed(2); - await bybitService.submitOrder({ - category: "linear", - symbol: analysis.symbol, - side: "Sell", - orderType: "Limit", - price: - candle.close > analysis.currentBB.upper - ? Number(candle.close).toFixed(2) - : Number(analysis.currentBB.upper).toFixed(2), - qty: halfSize, - }); - sendMessage( - `Future Căt nửa ${analysis.symbol} ${analysis.interval}M ${analysis.currentBB.upper} ${halfSize}` - ); - } - if (position.side === "Sell" && analysis.isUnderBbLower && candle.close < candle.open) { - const halfSize = (Number(position.size) / 2).toFixed(2); - await bybitService.submitOrder({ - category: "linear", - symbol: analysis.symbol, - side: "Buy", - orderType: "Limit", - price: - candle.close < analysis.currentBB.lower - ? Number(candle.close).toFixed(2) - : Number(analysis.currentBB.lower).toFixed(2), - qty: halfSize, - }); - sendMessage( - `Future Căt nửa ${analysis.symbol} ${analysis.interval}M ${analysis.currentBB.lower} ${halfSize}` - ); - } - } + // const positions = await bybitService.listPositions({ + // category: "linear", + // symbol: analysis.symbol, + // }); + // if (positions.length > 0) { + // const position = positions[0]; + // if (position.side === "Buy" && analysis.isOverBbUpper && candle.close > candle.open) { + // const halfSize = (Number(position.size) / 2).toFixed(2); + // await bybitService.submitOrder({ + // category: "linear", + // symbol: analysis.symbol, + // side: "Sell", + // orderType: "Limit", + // price: + // candle.close > analysis.currentBB.upper + // ? Number(candle.close).toFixed(2) + // : Number(analysis.currentBB.upper).toFixed(2), + // qty: halfSize, + // }); + // sendMessage( + // `Future Căt nửa ${analysis.symbol} ${analysis.interval}M ${analysis.currentBB.upper} ${halfSize}` + // ); + // } + // if (position.side === "Sell" && analysis.isUnderBbLower && candle.close < candle.open) { + // const halfSize = (Number(position.size) / 2).toFixed(2); + // await bybitService.submitOrder({ + // category: "linear", + // symbol: analysis.symbol, + // side: "Buy", + // orderType: "Limit", + // price: + // candle.close < analysis.currentBB.lower + // ? Number(candle.close).toFixed(2) + // : Number(analysis.currentBB.lower).toFixed(2), + // qty: halfSize, + // }); + // sendMessage( + // `Future Căt nửa ${analysis.symbol} ${analysis.interval}M ${analysis.currentBB.lower} ${halfSize}` + // ); + // } + // } } }, };