J2897

Freqtrade Multibot

Aug 11th, 2022 (edited)
98
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!

Test Bot 001

Create user directories:

freqtrade create-userdir --userdir /home/john/freqtrade/user_data_TB001

New configuration file:

freqtrade new-config --config /home/john/freqtrade/user_data_TB001/config.json

Example:

{
    "max_open_trades": 20,
    "stake_currency": "USDT",
    "stake_amount": "unlimited",
    "tradable_balance_ratio": 0.99,
    "fiat_display_currency": "USD",
    "dry_run": true,
    "cancel_open_orders_on_exit": false,
    "trading_mode": "spot",
    "margin_mode": "",
    "unfilledtimeout": {
        "entry": 10,
        "exit": 10,
        "exit_timeout_count": 0,
        "unit": "minutes"
    },
    "entry_pricing": {
        "price_side": "same",
        "use_order_book": true,
        "order_book_top": 1,
        "price_last_balance": 0.0,
        "check_depth_of_market": {
            "enabled": false,
            "bids_to_ask_delta": 1
        }
    },
    "exit_pricing":{
        "price_side": "same",
        "use_order_book": true,
        "order_book_top": 1
    },
    "exchange": {
        "name": "binance",
        "key": "",
        "secret": "",
        "ccxt_config": {},
        "ccxt_async_config": {},
        "pair_whitelist": [
        ],
        "pair_blacklist": [
            "BNB/.*"
        ]
    },
    "pairlists": [
        {
            "method": "VolumePairList",
            "number_assets": 20,
            "sort_key": "quoteVolume",
            "min_value": 0,
            "refresh_period": 1800
        }
    ],
    "edge": {
        "enabled": false,
        "process_throttle_secs": 3600,
        "calculate_since_number_of_days": 7,
        "allowed_risk": 0.01,
        "stoploss_range_min": -0.01,
        "stoploss_range_max": -0.1,
        "stoploss_range_step": -0.01,
        "minimum_winrate": 0.60,
        "minimum_expectancy": 0.20,
        "min_trade_number": 10,
        "max_trade_duration_minute": 1440,
        "remove_pumps": false
    },
    "telegram": {
        "enabled": false,
        "token": "",
        "chat_id": ""
    },
    "api_server": {
        "enabled": true,
        "listen_ip_address": "127.0.0.1",
        "listen_port": 8080,
        "verbosity": "error",
        "enable_openapi": false,
        "jwt_secret_key": "somethingrandom",
        "CORS_origins": ["http://localhost:8080"],
        "username": "freqtrader",
        "password": "pass"
    },
    "bot_name": "TB001",
    "initial_state": "running",
    "force_entry_enable": false,
    "internals": {
        "process_throttle_secs": 5
    }
}

Start the first bot:

freqtrade trade --logfile /home/john/freqtrade/user_data_TB001/logs/TB001.log --config /home/john/freqtrade/user_data_TB001/config.json --strategy ReinforcedSmoothScalp --db-url sqlite:////home/john/freqtrade/user_data_TB001/TB001.live.sqlite

Test Bot 002

Create user directories:

freqtrade create-userdir --userdir /home/john/freqtrade/user_data_TB002

New configuration file:

freqtrade new-config --config /home/john/freqtrade/user_data_TB002/config.json

Example:

{
    "max_open_trades": 20,
    "stake_currency": "USDT",
    "stake_amount": "unlimited",
    "tradable_balance_ratio": 0.99,
    "fiat_display_currency": "USD",
    "dry_run": true,
    "cancel_open_orders_on_exit": false,
    "trading_mode": "spot",
    "margin_mode": "",
    "unfilledtimeout": {
        "entry": 10,
        "exit": 10,
        "exit_timeout_count": 0,
        "unit": "minutes"
    },
    "entry_pricing": {
        "price_side": "same",
        "use_order_book": true,
        "order_book_top": 1,
        "price_last_balance": 0.0,
        "check_depth_of_market": {
            "enabled": false,
            "bids_to_ask_delta": 1
        }
    },
    "exit_pricing":{
        "price_side": "same",
        "use_order_book": true,
        "order_book_top": 1
    },
    "exchange": {
        "name": "binance",
        "key": "",
        "secret": "",
        "ccxt_config": {},
        "ccxt_async_config": {},
        "pair_whitelist": [
        ],
        "pair_blacklist": [
            "BNB/.*"
        ]
    },
    "pairlists": [
        {
            "method": "VolumePairList",
            "number_assets": 20,
            "sort_key": "quoteVolume",
            "min_value": 0,
            "refresh_period": 1800
        }
    ],
    "edge": {
        "enabled": false,
        "process_throttle_secs": 3600,
        "calculate_since_number_of_days": 7,
        "allowed_risk": 0.01,
        "stoploss_range_min": -0.01,
        "stoploss_range_max": -0.1,
        "stoploss_range_step": -0.01,
        "minimum_winrate": 0.60,
        "minimum_expectancy": 0.20,
        "min_trade_number": 10,
        "max_trade_duration_minute": 1440,
        "remove_pumps": false
    },
    "telegram": {
        "enabled": false,
        "token": "",
        "chat_id": ""
    },
    "api_server": {
        "enabled": true,
        "listen_ip_address": "127.0.0.1",
        "listen_port": 8081,
        "verbosity": "error",
        "enable_openapi": false,
        "jwt_secret_key": "somethingrandom",
        "CORS_origins": ["http://localhost:8080"],
        "username": "freqtrader",
        "password": "pass"
    },
    "bot_name": "TB002",
    "initial_state": "running",
    "force_entry_enable": false,
    "internals": {
        "process_throttle_secs": 5
    }
}

Start the second bot:

freqtrade trade --logfile /home/john/freqtrade/user_data_TB002/logs/TB002.log --config /home/john/freqtrade/user_data_TB002/config.json --strategy ReinforcedSmoothScalp --db-url sqlite:////home/john/freqtrade/user_data_TB002/TB002.live.sqlite

Add to the .bash_aliases file:

# Start trading bots
alias bot1="cd /home/john/freqtrade/; source /home/john/freqtrade/.env/bin/activate; freqtrade trade --logfile /home/john/freqtrade/user_data_TB001/logs/TB001.log --config /home/john/freqtrade/user_data_TB001/config.json --strategy ReinforcedSmoothScalp --db-url sqlite:////home/john/freqtrade/user_data_TB001/TB001.live.sqlite"
alias bot2="cd /home/john/freqtrade/; source /home/john/freqtrade/.env/bin/activate; freqtrade trade --logfile /home/john/freqtrade/user_data_TB002/logs/TB002.log --config /home/john/freqtrade/user_data_TB002/config.json --strategy ReinforcedSmoothScalp --db-url sqlite:////home/john/freqtrade/user_data_TB002/TB002.live.sqlite"
Add Comment
Please, Sign In to add comment