How to use OctoBot - 10 common examples

To help you get started, we’ve selected a few OctoBot examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github Drakkar-Software / OctoBot / octobot / strategy_optimizer / test_suite_result.py View on Github external
def convert_result_into_dict(index, evaluators, time_frames, risk, score, trades):
        return {
            TestSuiteResult.INDEX: index,
            TestSuiteResult.EVALUATORS: evaluators,
            TestSuiteResult.TIME_FRAMES: time_frames,
            TestSuiteResult.RISK: risk,
            TestSuiteResult.SCORE: score,
            TestSuiteResult.AVERAGE_TRADES: trades,
        }
github Drakkar-Software / OctoBot / octobot / strategy_optimizer / test_suite_result.py View on Github external
def convert_result_into_dict(index, evaluators, time_frames, risk, score, trades):
        return {
            TestSuiteResult.INDEX: index,
            TestSuiteResult.EVALUATORS: evaluators,
            TestSuiteResult.TIME_FRAMES: time_frames,
            TestSuiteResult.RISK: risk,
            TestSuiteResult.SCORE: score,
            TestSuiteResult.AVERAGE_TRADES: trades,
        }
github Drakkar-Software / OctoBot / octobot / strategy_optimizer / test_suite_result.py View on Github external
def convert_result_into_dict(index, evaluators, time_frames, risk, score, trades):
        return {
            TestSuiteResult.INDEX: index,
            TestSuiteResult.EVALUATORS: evaluators,
            TestSuiteResult.TIME_FRAMES: time_frames,
            TestSuiteResult.RISK: risk,
            TestSuiteResult.SCORE: score,
            TestSuiteResult.AVERAGE_TRADES: trades,
        }
github Drakkar-Software / OctoBot / octobot / strategy_optimizer / test_suite_result.py View on Github external
def convert_result_into_dict(index, evaluators, time_frames, risk, score, trades):
        return {
            TestSuiteResult.INDEX: index,
            TestSuiteResult.EVALUATORS: evaluators,
            TestSuiteResult.TIME_FRAMES: time_frames,
            TestSuiteResult.RISK: risk,
            TestSuiteResult.SCORE: score,
            TestSuiteResult.AVERAGE_TRADES: trades,
        }
github Drakkar-Software / OctoBot / octobot / strategy_optimizer / test_suite_result.py View on Github external
def convert_result_into_dict(index, evaluators, time_frames, risk, score, trades):
        return {
            TestSuiteResult.INDEX: index,
            TestSuiteResult.EVALUATORS: evaluators,
            TestSuiteResult.TIME_FRAMES: time_frames,
            TestSuiteResult.RISK: risk,
            TestSuiteResult.SCORE: score,
            TestSuiteResult.AVERAGE_TRADES: trades,
        }
github Drakkar-Software / OctoBot / octobot / strategy_optimizer / test_suite_result.py View on Github external
def convert_result_into_dict(index, evaluators, time_frames, risk, score, trades):
        return {
            TestSuiteResult.INDEX: index,
            TestSuiteResult.EVALUATORS: evaluators,
            TestSuiteResult.TIME_FRAMES: time_frames,
            TestSuiteResult.RISK: risk,
            TestSuiteResult.SCORE: score,
            TestSuiteResult.AVERAGE_TRADES: trades,
        }
github Drakkar-Software / OctoBot / tests / endurance_tests / test_backtesting.py View on Github external
def create_backtesting_bot(config):
    bot = OctoBot(config)
    return bot
github Drakkar-Software / OctoBot / tests / endurance_tests / test_start_bot.py View on Github external
def test_create_bot():
    # launch a bot
    config = load_test_config()
    bot = OctoBot(config)
    bot.stop_threads()
github Drakkar-Software / OctoBot / tests / endurance_tests / test_start_bot.py View on Github external
def test_run_bot():
    # launch a bot
    config = load_test_config()
    bot = OctoBot(config)
    bot.time_frames = [TimeFrames.ONE_MINUTE]
    bot.create_exchange_traders()
    bot.create_evaluation_threads()
    bot.start_threads()

    # let it run 2 minutes: test will fail if an exception is raised
    # 1.9 to stop threads before the next time frame
    time.sleep(1.9 * 60)

    # stop the bot
    bot.stop_threads()
github Drakkar-Software / OctoBot-Tentacles / Services / Interfaces / web_interface / models / backtesting.py View on Github external
tools = WebInterface.tools
        previous_independant_backtesting = tools[BOT_TOOLS_BACKTESTING]
        if tools[BOT_TOOLS_STRATEGY_OPTIMIZER] and is_optimizer_in_progress(tools[BOT_TOOLS_STRATEGY_OPTIMIZER]):
            return False, "Optimizer already running"
        elif previous_independant_backtesting and \
                is_independent_backtesting_in_progress(previous_independant_backtesting):
            return False, "A backtesting is already running"
        else:
            if previous_independant_backtesting:
                run_in_bot_main_loop(stop_independent_backtesting(previous_independant_backtesting))
            if reset_tentacle_config:
                tentacles_setup_config = get_tentacles_setup_config()
            else:
                tentacles_setup_config = get_bot_api().get_edited_tentacles_config()
            config = get_global_config()
            independent_backtesting = create_independent_backtesting(config,
                                                                     tentacles_setup_config,
                                                                     files,
                                                                     run_on_common_part_only=run_on_common_part_only)
            run_in_bot_main_loop(initialize_and_run_independent_backtesting(independent_backtesting), blocking=False)
            tools[BOT_TOOLS_BACKTESTING] = independent_backtesting
            tools[BOT_TOOLS_BACKTESTING_SOURCE] = source
            return True, "Backtesting started"
    except Exception as e:
        LOGGER.exception(e)
        return False, f"Error when starting backtesting: {e}"