Hephyrius / binance_futures_bot

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

check_in_position always returns False #4

Closed prafulrana closed 3 years ago

prafulrana commented 3 years ago

Hey Harnick,

Not a python expert but I think there is something wrong with check_in_position. Its always returning False even though when its true. I tried printing out the positions array, everything seems right. The key is positionAmt, not sure if some funky string to float thing is happening during the compare.

Hephyrius commented 3 years ago

Hey,

Just merged in a type casting change. Untested of course as I've not got much time to follow up... let me know if that minor change worked!

prafulrana commented 3 years ago

fixed that issue!

prafulrana commented 3 years ago

keeps logging trailing stop triggered. Maybe I overheated my API usage? I will try after a bit with default settings again. Are you considering moving to the binance websockets api?

prafulrana commented 3 years ago

You think client.change_initial_leverage has to have a corresponding close?

Hephyrius commented 3 years ago

you shouldn't get rate limited, the binance rate limits operate on an operation per second over x period of time basis. The bot shouldn't be doing more than 10 operations at any point in time.

Also deleted that log message, it had your api key in it! I recommend changing api keys if you can, it'll have been stored on gitmemory and other services by now

prafulrana commented 3 years ago

omg that was silly of me thanks

prafulrana commented 3 years ago

Yo going to close this issue. There is definitely something wrong though as I tried your exact logic in nodejs and it works fine: https://github.com/prafulrana/btc_futures_piranha/tree/main