You are viewing a single comment's thread from:
RE: Trading Assistant Bot (Bitfinex): API websocket connection, channel subscriptions and candle data parsing
Thanks for the contribution, @imwatsi! I didn't realise you were a programmer as well, so it's great to see you also contributing in the development category! You've done a really great job showing what you implemented and how - it's a really great post. As for the code, since it's Python I have a couple of things I'd like to point out / suggest:
- It would be great if you'd include a
setup.py
or even arequirements.txt
so people can easily install dependencies and use your code as a proper package. Also adding a configuration file would make sense, I think. - I would recommend adding
if __name__=="__main__"
tot_init.py
. This will allow you (and others) to import it so it can be both used by other programs and modules as a module, and can be run as the main program. - Install
pep8
or another linter (e.g.pylint
) withpip
and use that to keep your code consistent. Currently some things could be improved like keeping line width < 80 characters, imports on a separate line, etc. but it's not a big deal. - You may want to add some classes to make stuff like
lstData[0]
,lstData[1]
etc. more readable, since it's not clear what they actually are, but once again, that's up to you. - Adding some tests would also help. I would recommend using
pytest
for this, since it's really easy to set up, and really helps with development.
Other than that it looks great, and I'm curious to see how the development goes. Good luck!
Your contribution has been evaluated according to Utopian policies and guidelines, as well as a predefined set of questions pertaining to the category.
To view those questions and the relevant answers related to your post, click here.
Need help? Chat with us on Discord.
Thanks for the review @amosbastian! Yeah, I’m a programmer, but had been on a hiatus for like a decade (long story). Started with Visual Basic back in 2004.
I recently decided to start coding again (for good this time, hahaha). My Python is not ‘pro-level’ yet, learning new things everyday. Thanks for the wonderful feedback and suggestions. I’ll start working on them. Cheers!
Good luck with (continuing) your programming journey, this is a great start!
Thank you for your review, @amosbastian! Keep up the good work!