Hephyrius / binance_futures_bot

A bot that trades leveraged USDT futures markets on binance.
299 stars 123 forks source link

order/close is looping (XRPUSDT/WAVESUSDT) non-stop #2

Closed mhgutier closed 3 years ago

mhgutier commented 3 years ago

Hello sir, first of all , i would like to thankyou for getting this program in public and available yo anyone.

regarding the latest update, i see that it is looking at 5m and 15m time frame.

the bot is looping for ordering and closing trades, my theory is that 15m and 5m time frame are going in opposite direction, so the bot will open position then will close it immediately,

so it will go order exit order exit

i am trying to troubleshoot and modify but no luck(not really a developer, just a trying hard newby pythoneer).

mhgutier commented 3 years ago
====== Request ======
<binance_f.impl.restapirequest.RestApiRequest object at 0x0000012B94BA5F40>
header:{'client_SDK_Version': 'binance_futures-1.0.1-py3.7', 'Content-Type': 'application/json', 'X-MBX-APIKEY': 'mykey'}
host:https://fapi.binance.com
json_parser:None
method:POST
post_body:{}
url:/fapi/v1/order?symbol=HBARUSDT&side=BUY&type=MARKET&quantity=836&positionSide=BOTH&recvWindow=60000&timestamp=1618301343916&signature=907f525ceeff87d642b12244c65a14824bcadfe79caa44c3b4ad8652713eb7b2
=====================
{"orderId":123011554,"symbol":"HBARUSDT","status":"NEW","clientOrderId":"6nzlv97QgysDmLD7FjD7dj","price":"0","avgPrice":"0.00000","origQty":"836","executedQty":"0","cumQty":"0","cumQuote":"0","timeInForce":"GTC","type":"MARKET","reduceOnly":false,"closePosition":false,"side":"BUY","positionSide":"BOTH","stopPrice":"0","workingType":"CONTRACT_PRICE","priceProtect":false,"origType":"MARKET","updateTime":1618301345772}
BUY: 836.0 $0.34362 using x10 leverage
Exit
Exited Position: 836.0 $0.34339
Trailing Stop Triggered: 836.0 $0.34339
====== Request ======
<binance_f.impl.restapirequest.RestApiRequest object at 0x0000012B8BA568E0>
header:{'client_SDK_Version': 'binance_futures-1.0.1-py3.7', 'Content-Type': 'application/json', 'X-MBX-APIKEY': 'mykey'}
host:https://fapi.binance.com
json_parser:None
method:POST
post_body:{}
url:/fapi/v1/order?symbol=HBARUSDT&side=BUY&type=MARKET&quantity=835&positionSide=BOTH&recvWindow=60000&timestamp=1618301391920&signature=ae8cbf37246e7505bad986bdb445a680bd78390a4db51843fbadbf9cda93a7d6
=====================
{"orderId":123012943,"symbol":"HBARUSDT","status":"NEW","clientOrderId":"9g7dsI3QdUBJis5z8cRMvY","price":"0","avgPrice":"0.00000","origQty":"835","executedQty":"0","cumQty":"0","cumQuote":"0","timeInForce":"GTC","type":"MARKET","reduceOnly":false,"closePosition":false,"side":"BUY","positionSide":"BOTH","stopPrice":"0","workingType":"CONTRACT_PRICE","priceProtect":false,"origType":"MARKET","updateTime":1618301393769}
BUY: 835.0 $0.34374 using x10 leverage
Exit
Exited Position: 835.0 $0.34339
Trailing Stop Triggered: 835.0 $0.34339
====== Request ======
<binance_f.impl.restapirequest.RestApiRequest object at 0x0000012B8BCED340>
header:{'client_SDK_Version': 'binance_futures-1.0.1-py3.7', 'Content-Type': 'application/json', 'X-MBX-APIKEY': 'mykey'}
host:https://fapi.binance.com
json_parser:None
method:POST
post_body:{}
url:/fapi/v1/order?symbol=HBARUSDT&side=BUY&type=MARKET&quantity=835&positionSide=BOTH&recvWindow=60000&timestamp=1618301439341&signature=0a58fd52646479e60298a0a8a1fc1dd74b30ed6cc6f9ac825eba47a18f836be7
=====================
{"orderId":123014612,"symbol":"HBARUSDT","status":"NEW","clientOrderId":"99YpTnq7mTIWELrN0BnRjJ","price":"0","avgPrice":"0.00000","origQty":"835","executedQty":"0","cumQty":"0","cumQuote":"0","timeInForce":"GTC","type":"MARKET","reduceOnly":false,"closePosition":false,"side":"BUY","positionSide":"BOTH","stopPrice":"0","workingType":"CONTRACT_PRICE","priceProtect":false,"origType":"MARKET","updateTime":1618301441237}
BUY: 835.0 $0.34388 using x10 leverage
Exit
Exited Position: 835.0 $0.34422
Trailing Stop Triggered: 835.0 $0.34422
Traceback (most recent call last):
mhgutier commented 3 years ago

handle_signal seems like making side = -1 regardless buy or sell