conor19w / Binance-Futures-Trading-Bot

A Technical Analysis Bot that trades leveraged USDT futures markets on Binance.
539 stars 177 forks source link

Error occurred during live_trading #51

Open loin1234 opened 1 year ago

loin1234 commented 1 year ago

open_trade() - error occurred placing limit order on XRPUSDT, OP: 1, tick_size: 0.0001 Entry price: 0.5176, trade direction: 1, Quantity: 58.1, Error Info: (BinanceAPIException(<Response [400]>, 400, '{"code":-4061,"msg":"Order\'s position side does not match user\'s setting."}'), 'trade_manager.py', 293), Error: APIError(code=-4061): Order's position side does not match user's setting. 29-08-2023 17:47:00 ERROR: new_trades_loop() - error occurred, Error Info: (IndexError('list index out of range'), 'trade_manager.py', 67), Error: list index out of range

trading_strategy = 'tripleEMAStochasticRSIATR' leverage = 10 order_size = 2 ## % of account interval = '1m' TP_SL_choice = '%' SL_mult = .1 ## SL_mult x TP_SL_choice = SL value TP_mult = .1 ## TP_mult x TP_SL_choice = TP value trade_all_symbols = False symbols_to_trade = ['BTCUSDT','ETHUSDT','XRPUSDT'] use_trailing_stop = False trailing_stop_callback = .1 trading_threshold = .1 ## used to cancel trades that have moved this distance in % away from our attempted entry price use_market_orders = False max_number_of_positions = 5

I got this error and I want to know why this error happened and how to fix it

conor19w commented 1 year ago

Youre probably trading in hedged mode on binance, you'll need to change that to use this bot

loin1234 commented 1 year ago

Youre probably trading in hedged mode on binance, you'll need to change that to use this bot

The problem mentioned above has been solved. However, another error occurred during live trading

ERROR: log_trades_loop() - Error: handle is closed, (<class 'OSError'>, 'trade_manager.py', 441)

How can I solve this

conor19w commented 1 year ago

I think the latest code solves this if you pull down the latest changes

loin1234 commented 1 year ago

I think the latest code solves this if you pull down the latest changes

Problem solved Thank you but when it doesn't sell after 5-6 hours of positioning, TP and SL disappear, is there a solution?

conor19w commented 1 year ago

Not sure if you're keeping up to date but a few bug fixes went in recently which may address that. From what I can see the bots stable right now

loin1234 commented 1 year ago

Not sure if you're keeping up to date but a few bug fixes went in recently which may address that. From what I can see the bots stable right now

The problem has been solved. But in the latest version, I used heiken_ashi's strategy, and in the backtest, the Closing position function worked well, but not live_trading. Can you check this bug?

conor19w commented 1 year ago

Closing position isn't hooked up fully yet for live trading