JeeZues / TradeBot

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

2nd copy running with error #11

Closed derrey closed 3 years ago

derrey commented 3 years ago

I have had to create a 2nd folder for a 2nd 3C account. When I run the same program in the 2nd folder I am getting this error. I also tested it by copying my config file over to the new folder and didn't work, so I know the config is good. Any thoughts? I did do a new git copy....

get_bot_signals function took 2656.700 ms 'NoneType' object has no attribute 'lower' Traceback (most recent call last): File "run.py", line 538, in ret = run_account(sub_account, bots) File "/mnt/TradeBotJim/TradeBot/timeout.py", line 18, in wrapper result = func(*args, **kwargs) File "run.py", line 269, in run_account if account_dict['signal_top_pairs'].lower() in ["min", "max"]: AttributeError: 'NoneType' object has no attribute 'lower'

derrey commented 3 years ago

This must be a version update issue and maybe something needs to be added to the config file now? I copied the older version to the folder and it works fine. I will run the older version until I get confirmation on how I should proceed?

JeeZues commented 3 years ago

Can you post your config file (without the api info obviously)? Are you running the latest code from the repo or the latest release when you saw the failure?

derrey commented 3 years ago

Can you post your config file (without the api info obviously)? Are you running the latest code from the repo or the latest release when you saw the failure?

I am using the git pull/fetch from the repo. then had to go back to my backup version before update.


'''


**** Copy this file rename_me_run_config.py to run_config.py before adding your info ***


Create an API key/secret from https://www.binance.com/en/my/settings/api-management with only Enable Reading one per account/sub '''

Binance_APIs = [ { 'account_name': 'Jim Full - Futures1 USDT-M' ,'Binance_API_KEY': 'xxxxxx' ,'Binance_API_SECRET': 'xxxxxxx' ,'stop_at': 2.0 ,'start_at': 1.75 ,'bots_per_position_ratio': 5 ,'signal_top_pairs': True ,'no_short': True }
]

''' Create an API key/secret from https://3commas.io/api_access_tokens/new with BotsRead, BotsWrite, and AccountsRead ''' TCommas_API_KEY = 'xxxxx' TCommas_API_SECRET = 'xxxxxx'

''' Optional ''' ifttt_url = 'https://maker.ifttt.com/trigger/Binance_Futures_Alert/with/key/pslrXaf5UO6lNRH0jh1aoEhc8FZ_lX0x6xxxxxxxxxx'

derrey commented 3 years ago

Also, I was using this as the execution:

python3 run.py --show_deals --colors --auto --keep_running --keep_running_timer 15 --pair_allowance 500 --binance_account_flag ALL_SUBS --do_transfer --transfer_at 5000 --transfer_delta 100 --bot_start_bursts 10 --no_short

JeeZues commented 3 years ago

Hi @derrey, The value of signal_top_pairs changed to be a string. It can be 'min', 'max', or anything that is not min or max, e.g. 'by_count'. See https://github.com/JeeZues/TradeBot/issues/10 for more info.

derrey commented 3 years ago

Sorry, I may have missed something. What is the best way to have the config file setup so some accounts have --signal_top_pairs, --signal_top_pairs_rnd, etc. Also, I keep getting the error and I am sure I am doing something simple wrong. :)

How should the config file look? I have tried several different methods.. all have errors.

Config Info:

Binance_APIs = [ { 'account_name': 'Binance Dave_Sub02 Futures USDT-M' ,'Binance_API_KEY': 'xxxxx' ,'Binance_API_SECRET': 'xxxx'

Optional argument name and value to override command line ones if multiple flags are used.

    ,'stop_at': 2.0
    ,'start_at': 1.75
    ,'bots_per_position_ratio': 5
    ,'signal_top_pairs_rnd': 50
    ,'no_short': True
}
,{
     'account_name': 'Binance Dave_Sub04 Futures USDT-M'
    ,'Binance_API_KEY': 'xxxxx'
    ,'Binance_API_SECRET': 'xxxxx'
    ,'stop_at': 2.0
    ,'start_at': 1.75
    ,'bots_per_position_ratio': 5
    ,'signal_top_pairs': 'max'
    ,'no_short': True
}
,{
     'account_name': 'Binance Dave_Sub05 Futures USDT-M'
    ,'Binance_API_KEY': 'xxxxx'
    ,'Binance_API_SECRET': 'xxxxxx'
    ,'stop_at': 2.0
    ,'start_at': 1.75
    ,'bots_per_position_ratio': 5
    ,'signal_top_pairs': 'min'
    ,'no_short': True
}
,{
     'account_name': 'Binance Dave_Sub06 Futures USDT-M'
    ,'Binance_API_KEY': 'xxxxxx'
    ,'Binance_API_SECRET': 'xxxxxxx'
    ,'stop_at': 2.0
    ,'start_at': 1.75
    ,'bots_per_position_ratio': 5
    ,'signal_top_pairs': 'by_count'
    ,'no_short': True
} 
,{
     'account_name': 'Kelly Hu Futures1 USDT-M'
    ,'Binance_API_KEY': 'xxxxxxx'
    ,'Binance_API_SECRET': 'xxxxxxx'
    ,'stop_at': 2.0
    ,'start_at': 1.75
    ,'bots_per_position_ratio': 5
    ,'signal_top_pairs': 'by_count'
    ,'no_short': True
}     

]

Error:

image

JeeZues commented 3 years ago

@derrey, Try the latest code, should fix the issue. If it didn't you can specify the signal_top_pairs option in the config for now and I can look into it a bit more. I need to add some testing code but who likes doing that :D

derrey commented 3 years ago

@derrey, Try the latest code, should fix the issue. If it didn't you can specify the signal_top_pairs option in the config for now and I can look into it a bit more. I need to add some testing code but who likes doing that :D

That seemed to work.. Thanks.

derrey commented 3 years ago

@derrey, Try the latest code, should fix the issue. If it didn't you can specify the signal_top_pairs option in the config for now and I can look into it a bit more. I need to add some testing code but who likes doing that :D

That seemed to work.. Thanks.

@JeeZues It is still working so I will close this issue.. Thanks