JeeZues / TradeBot

GNU General Public License v3.0
4 stars 4 forks source link

Feature request: Specify config file #8

Closed UC-VR closed 3 years ago

UC-VR commented 3 years ago

Thanks for implementing config parameters in run_config!

Is there a way, to specify different config file to use via command line switch?

Use case:

start bot with custom config file, with different settings - for example run_config_night and run_config_day

I am a newb, or is there a way to feed python parameters via text file? for example like with pip install requirements.txt

JeeZues commented 3 years ago

Great suggestion. I added --config_filename XYZ.py as a new argument you can provide the script.

derrey commented 3 years ago

Great suggestion. I added --config_filename XYZ.py as a new argument you can provide the script.

Works Great! Good idea.

UC-VR commented 3 years ago

Thanks @JeeZues it works!

very newb question, how can I feed it a config file from another folder? is there a way to do so? I tried specifying "path" in multiple ways, but it doesnt work. Is this python limitation?

use case: You can have personal github repo with "bot settings" that you sync when needed, and restart the bots to pick it up.

JeeZues commented 3 years ago

Hi @UC-VR , Import in python prefers subfolders or as setup current folder only. I can look into changing it to import a file I think but will need some work. Let me look into it. If you are on Linux you can create symbolic links to the files from the "bot settings" repo in the TradeBot folder. That would be a work around for now I think...

JeeZues commented 3 years ago

Hi @UC-VR, I just pushed a fix for this. Thanks for the suggestion, keep them coming. This will benefit everyone :)