Hi!
I am currently working on a multiapi platform in python/django. I successfuly created an api which communicates with bitfinex and can place orders, check candles data etc.
Depending what api provides the market its easier or harder to write a bot which place orders etc. Usually markets provide websocket api which is more difficult in use than simple restapi.
If you are interested I can check out what is going on with your code.
Some questions that I have:
Which market are you trying to communicate ?
What api is provided ?
Which python do you use ? Websocket needs asynchronous support which is built in in python 3.
You can feel free to contact me anytime,
Dawid Leśniak