2025.09.20: . Fixed bug that caused short traders to initialize using the same workflow as a long one. 2025.09.19: . Added pageSize parameter to the open order requests when querying Kucoin. 2025.09.18: . do_cleanup now uses get_min_quote_size. . Added an extra price check to switch_to_long. . Removed old check_old_long_price method. 2025.09.14: . Refactored full order list fetching. . Minor refactor of restart_pair_no_json. . Pausing the trader is now done via set_pause() method. . Reverted modification of wait time after initial market order. . wait_time now present in broker config file. . Minor refactorings. 2025.09.13: . Increased wait time after initial market order. 2025.09.12: . No retries when sending a cleanup order. . Removed redundant try...except blocks in switch_to_long. 2025.09.11: . Fixed bug in start_trader that called amount_to_precision with very low amounts and spammed logs. 2025.09.10: . Deal order history now stores only the id of each order instead of the full order object. 2025.09.08: . Re-enabled long to short autoswitch. 2025.09.07: . Increased wait time after sending market orders. 2025.09.05: . Now the trader supports multiple safety orders at the same time. . Removed forcing orders when importing a trader. Maybe it will be reinstated at a later date. . Removed endpoint /reload_safety_orders. . New endpoints: /mod_concurrent_safety orders, /mod_boosted_concurrent_safety_orders and /force_trader_close. . Modified cleanup routine. . Default wait_time back to 0.5 seconds. . General optimizations. 2025.08.19: . Improved log trimming. 2025.08.18: . Database handling optimization. 2025.08.17: . Minor refactorings. 2025.08.16: . Improved threading. 2025.08.15: . "deal order history" is now disabled by default. . CPU optimizations in status string generation. 2025.08.14: . Refactored gib_so_size. . Refactored seconds_to_time. . Refactored linear_space. . Refactored dca_cost_calculator. . Refactored return_optimal_order_size. . Minor refactor in generate_status_strings. . Optimized imports. . Deal_order_history now only stores the important parts of the orders to save some RAM. . Removed deprecated "profit_to_file" method. 2025.08.12: . Default "check_slippage" value now True. . Removed capitalization from exchange name when sending trader quit notification. . Exception handling when sending Telegram messages. 2025.08.10: . Added exchange name to the trader quit notification. . New endpoint: mod_default_order_size. It modifies the default order size of a broker. . Added "generated_at" field to any new generated trader config file. 2025.07.21: . Corrected an error in switch_to_long. 2025.07.18: . Changed Waitress' logging level to ERROR. 2025.07.11: . Default "check_slippage" value now False. . The default order size is now enforced per exchange. . Reinstated config reloading when a deal is closed. . New endpoint: mod_order_size. 2025.06.04: . Added "base_add_calculation" endpoint: Calculates how many safety orders can be added with the amount of base currency available on the exchange. 2025.05.31: . Added "liquidate after switch": Once the short trader is ready to switch to long, it liquidates the base currency and shuts down the trader. 2025.05.27: . Commented out parameter validation in config and status handlers. 2025.05.26: . Added closed order request wrappers in exchange_wrapper. . In check_status: autoswitch prior to order check. 2025.05.18: . In start_trader, missing base is calculated using amount_to_precision. 2025.05.16: . Added exception handling when removing a trader. . Minor variable renaming. 2025.05.12: . Improved config file handling when switching to long or short. . If the config file does not exist, it creates it. 2025.05.05: . Forced Telegram message when quit flag is raised. 2025.05.04: . Simplified unwrapped_add_pair. 2025.04.10: . Modified Gate.io min_base_size. 2025.04.09: . Modified default retries to 5. 2025.04.08: . Updated Binance, KuCoin and Gate.io min_base_size. 2025.04.04: . Added validate_market method to the broker object. 2025.03.29: . Enabling last_call disables autoswitch. 2025.03.19: . Added the possibility to force specific orders when importing a trader. 2025.03.07: . Error fix in take_profit_routine. 2025.03.04: . Error fix in add_quote. . Error fix in last_call. . Fixed a bug in switch_quote_currency that prevented the new config and status files to be written to disk. 2025.03.03: . Replaced more variables with their respective config handlers. . Added a new API endpoint: reload_trader_config. . Removed the config reloading when a trader closes a deal. 2025.03.02: . Fixed an error in restart_pair_no_json() 2025.03.01: . StatusHandler initial implementation. . Variable cleanup 2025.02.27 . ConfigHandler: centralized configuration handling in an object, for easier future development (parameter validation, for example) . Bugfixes everywhere. . Exchange_wrapper now validates every symbol against the market information from the exchange, both when adding and importing a trader. 2025.02.02: . new_so_routine now cancels the old take profit order after the new safety order is sent. 2025.01.31: . In check_status, when safety order = None it does not return 1 anymore. 2025.01.10: . Added is_paused to status_dict. 2024.12.14: . Modified waitress parameters. 2024.12.07: . Switch to a proper WSGI server (waitress) 2024.12.04: . Proper missing bak file handling on switch_to_long. 2024.12.02: . New endpoint: /get_balance. 2024.12.01: . Added "generated_at" entry: When generating a config file, the generated timestamp is saved in the config file. . If the switch price is lower than the next SO price, it displays it in green instead of the next SO price. 2024.11.30: . Added "forced_restart_if_retries_exhasted" option to the config file of a trader. If set to true, the trader will always restart if the first order of the deal does not fill. Default behavior is one restart only. It is recommended to set this to false, unless there is a specific combination of pair/exchange with too high volatility/underperfoming market order matching engine that requires a forced restart. 2024.11.26: . Implemented deals cache to reduce db load until the new database service is implemented. . Added a new API endpoint: /get_deals_cache. . Combined daly/monthly API endpoint added to statistics_server: /combined_totals. 2024.11.25: . Implemented a short log list: In order to avoid constant log file queries, a list of the last few log entries is stored in memory and it's returned via /get_log_list API endpoint. 2024.11.17: . The trader is supplied with a complete open order list, instead of only the ids. . Removed sum_filled_amounts, it was only called once. 2024.11.13: . Fixed bug handling timestamps. . Added a couple of pauses for OKX. 2024.11.11: . Refactored boost check to optimize CPU usage. 2024.11.10: . Removed a double-summing bug in new_so_routine. 2024.11.09: . Removed multiplier modifier added in 0.12d, since it was not needed anymore. . Minor refactor in take_profit_routine 2024.11.08: . Added boosted take profit level: If the trader is actively closing deals, the expected profit level is raised by x%. Defaults are: Four deals in one hour, 1% raise. 2024.11.06b: . Added /switch_to_long_price endpoint: It displays the price at which the automatic switch_to_long routine is triggered. 2024.11.06: . Optimized the conditionals that lead to switch_to_long. 2024.10.31: . Added an option to set the wait time before sending a new safety order. . Added a per-trader option to enable or disable slippage checks. 2024.10.30: . Changes trying to catch the wrong base amount bug. . Simplified new_market_order code. . Changed the amount to cleanup after the trader starts as a workaround for the wrong base bug. It seems that Gate.io is not "freeing the funds" quick enough after some order fills. 2024.10.29: . New functions to get top ask and top bid prices. . Improvements when dealing with shallow orderbooks. . Removed unnecessary status file writes to disk. 2024.10.28: . Docstrings and comments improvements. . New endpoint: /edit_cooldown_multiplier. 2024.10.25: . Modified some strings. 2024.10.20: . Insted of querying the average fill on the initial order, now the initial price is calculated using total_quote/total_base. . Using create_market_buy_order_with_cost with Gate.io (Because there may be a bug when generating simulated market buy orders.) 2024.10.18: . Improved slippage behavior in take_profit_routine. 2024.10.01: . Improvements when checking for liquidity and restarting the bot because of lack of. 2024.09.27: . Modified some strings. 2024.09.25: . Optimized Binance's open orders fetching routine (Be sure to keep Binance's lap time >= 2 seconds to avoid hitting API limits, increase if banned.) Every fetch_open_orders call have a weight of 80, you have 6000/minute available, the rest of the exchanges don't give a damn. 2024.09.24: . Optimized Binance's price fetch routine. 2024.08.26: . In check_status, if the safety order is none, it assigns it an empty order. 2024.08.15: . Removed "paused_pairs" list and endpoints and added "paused_traders" to global_status. . Switched "trader will be paused" and "trader will be resumed" strings. 2024.08.14: . Added automatic status file backup. 2024.08.11: . Removed some unnecessary variable clearings in unwrapped_switch_to_short. 2024.08.07a: . Added an extra confirmation prior to starting the instance. . Added percentage to switch to long. 2024.08.07: . Added extra exception handling code to update_status to catch an annoying bug. 2024.08.05d: . Minor wrap up. 2024.08.05c: . Further optimizations of previous point. 2024.08.05b: . In new_limit_order and market orders, returns a get_order(new_order) instead of directly what the endpoint returns. 2024.08.05: . Changes in market and simulated_market orders to mitigate Kucoin "order does not exist" error. 2024.08.04: . Now both exceptions in update_status write to log. 2024.07.21: . In a short trader, if the take profit price is bigger than the old_long price, it displays it in bright green. 2024.07.17: . Reverted previous change: It was ugly. 2024.07.15: . Added long/short trader amount to status bar. 2024.07.08: . Added tp order and safety order to the status dict. 2024.07.07: . Extended dynamic_so_deviance to include short traders. . Implemented clip_value() . The order of the traders on screen is now shorts first. 2024.07.03: . Bias implemented (Safety order price variation) 2024.07.01: . Small list comprehension refactor in load_keys_from_db. . Now it rewrites the config file as soon as a new pair is imported. 2024.06.24: . Fixed a small bug in generate_status_strings. 2024.06.23: . Added a flag to /view_old_long endpoint, if true it will load the old_long data from the old_long file, else it will display it from the status dict. . After switching to short, last_call is cancelled. 2024.06.10: . New API endpoint: /reload_safety_order. 2024.06.06: . Splash screen now has its own function. . Implemented max_short_safety_orders: default safety order value for short traders. Default is 45, can be overriden in config_dict by setting "max_short_safety_orders" key. 2024.06.05: . More docstring edits, type checking and type hints :D 2024.06.04: . Refactoring in new_limit_order. . Added some docstrings. 2024.06.03: . Added some type-checking code to linear_space. . Now it forces a Telegram notification when a trader is paused because of exceeded retries limit. 2024.05.31: . Small change in import_trader: Now it loads no_of_safety_orders prior to loading the orders. . Now it does not takes into account a partial SO fill in take_profit_routine. 2024.05.26: . Exchange name is now displayed in bright white (where available). . When the old take profit order is partially filled, the log entry now includes the order id. . Added paused_traders endpoint . Initial refactor of import_trader: No longer a class, simplified it as a function. . Added some type-checking code to the unwrapped API functions. 2024.05.24: . Now the trader calculates minimum_order_size_allowed with a simplified ceil statement. 2024.05.23: . Changed Kucoin minimum_quote_size calculation. 2024.05.22: . "There is no safety order to cancel" message no longer gets into log file. . Cooldown between trades reduced to 2s. 2024.05.21: . Now it removes old_long file when switching to long. 2024.05.20: . Added "view_old_long" endpoint. 2024.05.18: . Added all_markets method to broker. It returns a dictionary of all the markets of the exchange. . In the add_pair endpoint, now it checks first if the market exists and if it's active prior to trying to start the trader. . Added no_retries flag to several methods in broker class. 2024.05.17: . Removed unused offline_workers references. . Enabled autoswitch when safety orders are exhausted. 2024.05.16: . Removed SSL implementation and rate limiter, that tasks will be handled by Nginx from now on. . Removed wraps, refactored api-key implementation. . Fixed a small bug in check_duplicate_profit_in_db that ocurred when a trading pair got its first profit. 2024.05.15: . Removed CORS (not needed anymore) and added a simple rate limiter. If memory leak continues, try waitress. . Partial profits partially implemented: . When a take profit order is partially filled and later a new safety order is sent, the profit of that operation was not taken into account when calculating the total profit at deal close. . Only for long traders, at least for the time being. . Joint-code, test later. 2024.05.14: . When adding quote, status_dict wasn't saved to disk, so if an interruption ocurred the old take profit order id remained in the status dictionary. 2024.05.12: . Initial implementation of API refactoring. . Changed name of main file from dca_runtime_wAPI.py to main.py. 2024.05.09: . Minor refactoring in calculate_safety_prices, with sample code of future changes. 2024.04.30: . screen_buffer is now global, for future API access. 2024.04.29: . Implemented check_for_duplicate_profit_in_db() 2024.04.28: . Minor refactoring when removing keys from the status dictionary. 2024.04.26: . Unwrapped all API calls to prepare for migration to new API. 2024.04.25: . Added even more pause descriptors and exceptions (hunting pause bug only present on testnet) 2024.04.24: . Added a few more pause descriptors 2024.04.23: . Initial screen_buffer implementation. 2024.04.20: . Small detail on draw_line. 2024.04.17: . Removed newly unused telegram_bot_sendmessage() from broker. 2024.04.16: . Changed some variable names in profit_to_db. 2024.04.15: . Added get_write_order_history in broker. 2024.04.14: . Fixed bug while toggling Telegram notifications. 2024.04.13: . Consolidation of profit_db changes. 2024.04.12: . The exception that occurs when there is an error writing status file does not add an entry to the log. 2024.04.11: . Initial implementation of profit_to_db. 2024.04.10a: . Moved get_min_base_size, get_min_quote_size and get_step_size to broker. 2024.04.10: . Changed a conditional in return_status. . Changed min_base_size calculation for Kucoin. 2024.04.09: . Removed market from status_dict. Since market() calls on CCXT are local, it does not make any sense to cache them. . Added deal_order_history to the status_dict, which will be saved in a future implementation of profit_db. 2024.04.08: . In new_limit_order: replaced tries50 traders. . Modified some strings . Fixed a bug that led to online_pairs not be cleared on each iteration . Removed old code and adaptative_so_amount (and its api endpoint), not useful at all 0.9i: . Added handling for a specific division by zero error (rare) 0.9h: . Modified a few variable declarations . Now it restarts the pair when the TP order is missing 0.9g: . Modified log strings . Added a Telegram message when switching back from short to long bot . Fixed an order bug in liquidate_base() 0.9f: . Modified a few strings . Added a log output when rewriting the broker config file 0.9e: . Added an endpoint that returns the last trader time 0.9d: . Added an endpoint that returns server time 0.9c: . Now it sends a Telegram message if a pair errors out. Mostly for debugging, probably will be removed later. 0.9b: . Changed a few self.quit for self.restart 0.9a: . Fixed a bug when processing old long info . Now it searches for the .oldlong file if it can't find the info in status_dict when switching from short to long . Added a config option for attempting pair restart . Commented out some offline pairs restart code . Enabled the change in 0.8o 0.9: . Now it sends a Telegram notification when a trader errors out 0.8t: . restart_pair() now cancels pending buy orders for long traders . Implemented automatic trader restart on error 0.8s: . Now it shows one decimal less. 0.8r: . Modified return_status() so it does not return any number in scientific notation 0.8q: . Updated empty_order . Added a pause after cancelling an order . Added two more decimals to the displayed prices 0.8p: . Some minor refactorings here and there . Removed a few spaces in the console output . Prices shown in console output now to precision . Chasing a stop_when_profit bug 0.8o: . Refactored return_status() . Now it rereads the total amount of base on the exchange in the event of a take profit order rejected for lack of base. This could be nasty, will follow it closely 0.8n: . Removed exceeded pairs notice on console . Removed profit from console view. Might replace it with the amount of deals closed later. . Added the exchange to the exceeded pair Telegram notification . Added an API endpoint to switch the check of old long prices on or off. . Fixed a bug in the missing pairs function that caused it to return an empty list . Fixed a bug that colored an extra character in short mode . Added exception handling to update_status . Fixed alignment of pair and safety order info 0.8m: . Added pair restart . Now the minimum amount for cleanup is double the minimum order size imposed by the exchange (may increase the amount of open orders on the exchange) . Added a Telegram warning when the short price exceeds the old long price and a notice on the console output . Refactored the Telegram messaging methods . Added is_short to status . Allowed multiple restart attempts of a bot (specially useful on Gate.io) 0.8l: . Fixed a bug which led to an empty safety price table 0.8k: . Minor change in error handling in exchange_wrapper 0.8j: . Added an API endpoint that returns the pairs that are included in the config file but not running 0.8i: . Fixed a bug when simulating market orders . Minor refactorings . Fixed unnecessary fee substraction when the trader is short 0.8h: . base_profit now can't be less than zero (maybe that could have been a problem at a later stage?) . Added colors to health_index . Corrected a bug when detecting duplicate profit reports . Added a message that shows the amount of loose change available when taking profit 0.8g: . Now it displays a message when sending a new safety order . Removed cosine table. It was stupid. . Now it removes the pair from the config file when the last deal is closed . Programmable last call added. . Added support for FTX when calculating minimum order sizes . Added timestamp to "free base" screen message . Now it displays order size as an integer when possible when starting a short bot . Added base_change to take into account rounding errors in short traders depleting the base amount 0.8f: . Added a check for duplicate profit reporting 0.8e: . Now it calculates on the fly the optimal order size for short bots . Refactored some code in exchange_wrapper 0.8d: . Reimplemented switch_to_long . Added a few docstrings . Now it double checks if the pair is really offline when restarting an offline pair 0.8c: . Uncommented self.safety_order_index+1 in new_so_routine . Doubled the amount of retries when starting a bot 0.8b: . Added deal price to the profit message displayed onscreen . Upon error, get_open_orders only returns None 0.8a: . Modified the trader pause procedure . Fixed a bug that was present when importing a single trader . Modified the step size when switching to short 0.7u: . Fixed adaptative_so_amount when importing trader 0.7t: . Added a list of paused traders to be displayed onscreen if any are paused . Fixed a route typo when saving old long info . Added adaptative so amount: - When switching to short mode, if the base is not enough, instead of returning an error it decreases the safety order amount to calculate the order size. - This is helpful in situations when the minimum order size of the pair is too big, or the trader long order size was too small. - The lower limit is hardcoded to half the maximum amount of safety orders. - I can't think of a scenario where having less orders than that is optimal. . Changed return API string when toggling cleanup 0.7s: . Changed the order of the conditionals when checking for autoswitch within the take profit routine . Now when a trader switches to short, it writes the tp info on a different file, in case the trader crashes and restarts . To the old_tp entry, a timestamp was added . Removed duplicate method in trader.py . Added an endpoint to toggle trader pause . Improved some error logging 0.7r: . Added a pause character to indicate paused pairs. 0.7q: . Modified the removal routine of "last call" marked pairs. . Commented out some lines dealing with old specific bugs. 0.7p: . Removed write_to_disk conditional, now it only writes to disk if told to. . Fixed a wrong argument passed to fetch_market. 0.7o: . Fixed a wrong color bug. 0.7n: . Writes updated status file as soon as it finishes importing all the values. 0.7m: . In switch_to_long, toggled the is_short flag after messing with the config files. . Removed unused precision variable from trader object. . Minor string editing. . Price now shows bright green if, within a short bot, the current price is larger than the old take profit price. 0.7l: . Commented out global status file loading. . Removed some unnecesary ticker requests in get_min_base_size method. . Added a double check before liquidating base. . Added a switch_to_long API endpoint (Mostly for testing, but it might be useful someday). 0.7k: . Rounded to 6 decimals the base amount of the telegram notification. . In that same message, it was needed to substract 1 from safety_order_index. . Refactored the calculation of minimal base size (Thanks, CCXT) . Minor refactorings here and there 0.7j: . Uncommented a few lines . Now it checks if the pair is already running when adding pairs through API . Added trader pause in market_close, add_quote, close_trader, global_close 0.7i: . Minor bug fixes and refactorings . Fixed importing didn't took into account the original start_time and deal_start_time . Switches on the self.pause flag in take_profit_routine and new_so_routine methods . Moved the autoswitch routine to check_status 0.7h: . Added a notice when autoswitch is on 0.7g: . Now the pause flag of a trader is on by default, it only switches it off once it's properly started . Refactored offline pairs routine 0.7f: . Now checks also for autoswitch when closing a short deal 0.7e: . Added a pause flag to not process orders when an API call manhandles the trader 0.7d: . Added safety order count to the Telegram take profit message 0.7c: . Divided dca_classes into trader and exchange_wrapper modules . Implemented truncate method to easily round down numbers to precision, in preparation to implement a sans-ccxt version . Reduced retry wait times in exchange_wrapper . Now it also indicates the amount of base that was not sold (happens on some exchanges when tick size is too high) .0.7b: . Changed the order of operations in switch_to_short to account for possible bad outcomes . Changed the code when fetching market info due to inconsistencies between different exchange implementations in CCXT (E.g., the fetch_ticker method returns ticker size info on FTX but not on Binance) .0.7a: . new_limit_order now returns None when it encounters errors . Fixed duplicated cleanup message . First implementation of switch to short . First implementation of autoswitch (off by default) . Removed redundant variables . Reduces safety order deviance when switching to short .0.6h: . Changed the first conditional in take_profit_routine() . Changed the order of sending take profit order and safety order, so if there are not enough funds the bots don't close any orders .0.6g: . Some fixes on the telegram notification text . Removed a restriction when importing traders . Removed bug-hunting code in check_status (if safety_order_index==0) . Refactoring at "#Check if SO order is filled" .0.6f: . Status dictionary didn't have deal start time and trader start time. Commented out for now. . Added price to telegram message .0.6e: . Fixed importing bots with all SOs filled. . Previous bug not fixed at all. Retrying. . Short traders now are displayed in yellow. . More changes dealing with safety orders. .0.6d: . Fixed a bug when adding SOs. .0.6c: . Fixed a few lines that substracted fees in quote when it wasn't necessary. .0.6b: . When they were no more opened orders on the exchange, there was a bug that kept the script running as if life was normal. Fixed that. .0.6a: . Some cosmetic changes regarding short bots. . Fixed market close commands for compatibility with short bots. .0.6: . Preliminary support for short bots. Market close API commands not compatible yet. .0.5f: . Cleanup routine now only sweeps half of what it used to be. DCAing dust might be a good idea. . Removed some keys from global_status["config"] that should not be public. . Fixed two flags that signal showing more or less info on the terminal window. . Reformatted a few strings. . Now it displays the filled safety orders instead of the open safety order number. 0.5e: . Now it doesn't try to cancel a non-existent safety order when the deal that closes have consumed all safety orders. 0.5d: . Fixed a minor bug that miscounted the maximum safety orders when importing a trader that had more than the default value. 0.5c: . Serialized trader startup . Added the endpoints for toggling less_info and even_less_info . Updated some sleep timers . Added two more decimals when displaying prices 0.5b: . global_status api endpoint used to return telegram keys. Not anymore. . Small cleanup here and there . Added a space in write_to_log method 0.5a: . Several minor bug fixes . Removed the "Press Ctrl+C..." message . Moved Telegram data to exchange config file 0.5: . First API implementation . Exchange config file now has a host and port entry . Several bug fixes and exception handling routines implemented 0.4q: . Removed a bug in the pair removal process . Added a check for empty order list 0.4p: . In the config file, the time between restarts attempts now is specified in seconds, rather than minutes. . Fixed? a bug that caused a restart of a pair that was marked for deletion 0.4o: . get_tp_level: Implemented dynamic take profit percentage (between +0.5% and -0.5% of config file's tp_level) The first order will always be +0.5%, the first third without change (this is where almost all deals end up closing), the second third -0.25% and the last third -0.5% . get_tp_level_v2: Also there's an alternative available: it generates a cosine table and uses it as a continuous modifier for the tp_level. Due to the nature of the cosine function, it is a bit more agressive when setting the percentage in the first few tp orders. Probably worth a try if the markets are green, perhaps a bit too greedy if the markets are on a downtrend. .0.4n: . Code cleanup (automatically recognizing when there is the need to simulate a market order) .0.4m: . Code cleanup . Added a loop to fetch_orders() . Removed write_try() . When simulating market orders, the initial order was not canceled if retries were exhausted. .0.4l: . Modified a few market order calls that did not support Gate.io . Removed average deal uptime. .0.4k: . Doubled the amount of retries when there's an API bug (Because of a lovely exchange that starts with K and ends with ucoin) . Added "clear offline pair list" command . "Remove pair" now also deletes the pair if it is included in the offline pairs list . The onscreen take profit message now truncates the number to 4 decimals . Added an exception counter. The idea is to see which errors pop up more often and try to eliminate unnecessary exception catchers . Fixed an error when adding funds. It didn't work in OKX as it didn't discount the fees of the buy order (in base currency) . Zero-balance Kucoin bug handled by retrying the order. Commenting out that rounding stuff. . Added average deal uptime. . Added Gate.io support (simulating market orders mostly) .0.4j: . Added a few time.sleep(0.5) when iterating for an order, because Kucoin. . Enabled cleanup for Binance . Minor code cleanup .0.4i: . Added a few exceptions trying to address the 0 balance bug mentioned in the code . Added a looped exception to get_order .0.4h: . Eliminated a few time.sleep() that were unnecessary . Added a looped exception to the start bot routine. I suspect that kucoin balance sometimes hits 0 (The reason? Maybe the balance goes to 0 momentarily while setting up an order) and that is what is making the orders fail. If that is true, the best solution would be to implement async-await, so it does not try to open two orders at the same time. . Added a message on screen when a deal is closed .0.4g: . Corrected a small error that serialized the initialization of the traders in all exchanges. .0.4f: . Implemented rounding routine. .0.4e: . Exchange name now appears in uppercase. . Corrected a wild carriage return when enabling the "even less info" mode. . Changed the take profit routine so it only calculates profits if there are no errors with the tp order. . Added a price list dictionary to attempt to reduce API load (It loads all prices at once instead of fetching them one by one) Some exchanges do not like this and prefer the old way. . A few changes in new_so_routine to try to catch a bug that causes the new tp order not to be sent because of not enough base If that does not work, I'll implement a decreasing rounding routine, just like in the previous version. .0.4d: . Changes in the draw_line function .0.4c: . Added a command to remove a pair without closing the orders . Serialized the start of the bots for kucoin. Also added an "if open" clause when cancelling orders, also for kucoin. IH8U kucoin! .0.4b: . Added another tp check .0.4a: . Now it prints the exchange's name on the screen. . Now it also sends the profit order id to telegram . Minor bug fixes .0.4: . General cleanup and bug-hunting. . Eliminated a few redundant commands . Ready for primetime? .v0.3d: .dca_classes.py: . Modified get_single_price. Now it does not return a tuple but a float. .dca_runtime.py: . Made the necessary changes to accomodate the update above. v0.3c: .dca_classes.py: . Modified send_new_safety_order() in order to catch a bug that results in 0/30 safety orders in an imported_trader .dca_runtime.py: . draw_line(): line width back to 80 v0.3b: .dca_classes.py: . No changes .dca_runtime.py: . You can now save added pairs to the main config file v0.3a: .dca_classes.py: . No changes .dca_runtime.py . Now it isn't necessary to input the pair without the / in some commands v0.3: .dca_classes.py: . Import bot implemented: . Created a child class imported_trader . Now it writes the status_dict to a file .dca_runtime.py: . Import bot implemented v0.2c: .dca_classes.py: . No changes .dca_runtime.py: . Multithreaded "close all pairs and quit" v0.2b: .dca_classes.py: . No changes .dca_runtime.py: . Fixed bugs in cleanup command. . Line width is now 90 characters. v0.2a: .dca_classes.py: . No changes .dca_runtime.py . Multiple corrections to address issues found after testing. v0.2: .dca_classes.py: . No changes .dca_runtime.py: . Finished implementing commands. Now to test them v0.1d: .dca_classes.py: . No changes .dca_runtime.py: . Pair now is shown in blue . Attempt to reconnect counter now does not show negative numbers . Implemented more commands v0.1c: .dca_classes.py: . No changes .dca_runtime.py: . Added the ability to set a timer to attempt to restart an instance v0.1b: . dca_classes.py: . Now it reloads the config file every time it closes a deal. . dca_runtime.py: . When you add an instance, now it adds it to an intermediate list before adding it to the main running_instances list. Sometimes it would trigger an error (Threads can only be started once) if you pressed Ctrl-C at the exact wrong time. v0.1a: . Initial VPS deployment