Crypto Currency Trading with a Python Bot - Config File Class

in eos •  6 years ago  (edited)

trading bot.jpg


We now have a base class called configSetup.py that will help us control the loading and saving of the configuration we will use to control our bots behavior( I know these parts fun or exciting, but they are really important when we get into future stages).

It performs all the expected house cleaning such as checking if the file exists, if not it will create it for us and add a default set of values. If the file does exist, it will simply load the configuration into a dictionary ready for enforcing the rules or for amending values.

The script is too big to paste here but I hope the many comments I have added throughout the code will help you understand why I am doing what I have done.

If not, please feel free to ask questions below. The next script I post will be a CLI menu driven configurator that will enable us to amend the values within the JSON config file pragmatically rather than having to edit the file directly.

Here is the Github link

https://github.com/adamclarkuk/TradeBot

Authors get paid when people like you upvote their post.
If you enjoyed what you read here, create your account today and start earning FREE STEEM!