diff --git a/configuration/index.html b/configuration/index.html index 9e76d268..7503b882 100644 --- a/configuration/index.html +++ b/configuration/index.html @@ -1030,6 +1030,8 @@
Welcome to the documentation for Directional Scalper.
"},{"location":"#links","title":"Links","text":"Quantum Void Labs is a non-profit organization dedicated to developing open-source applications. We specialize in developing algorithms that are freely available to the public under the MIT License.
Our focus is on contributing to the global knowledge base rather than commercializing our work.
We do not sell products or services; instead, we aim to encourage innovation and collaboration within the ecosystem through our open-source contributions.
"},{"location":"configuration/","title":"Configuration","text":""},{"location":"configuration/#account-section","title":"Account Section","text":"Configure your account settings in the account.json
file under the account
section. This includes API keys, account names, and other related settings.
Configure your accounts using 'account.json' in the configs folder.
{\n \"exchanges\": [\n {\n \"name\": \"bybit\",\n \"account_name\": \"account_1\",\n \"api_key\": \"your_api_key\",\n \"api_secret\": \"your_api_secret\"\n },\n {\n \"name\": \"bybit_spot\",\n \"account_name\": \"account_2\",\n \"api_key\": \"your_api_key\",\n \"api_secret\": \"your_api_secret\"\n },\n {\n \"name\": \"bybit_unified\",\n \"account_name\": \"account_3\",\n \"api_key\": \"your_api_key\",\n \"api_secret\": \"your_api_secret\"\n }\n ]\n}\n
"},{"location":"configuration/#bot-section","title":"Bot Section","text":"Configure your bot settings in the config.json
file under the bot
section. This includes strategy parameters, risk management settings, and other related settings.
user_defined_leverage_long
, it's a multiplier that increases the size of the position and the potential profit/loss.Risk Management plays a crucial role in trading strategies, as it helps protect the trader's capital and limits potential losses. In the provided code snippet, there are several parameters and calculations related to risk management. Let's dive into each of them and provide examples to clarify their usage.
Example:
user_defined_leverage_long
is set to 5, it means that for every $1 of the trader's capital, they can open a long position worth $5.user_defined_leverage_short
is set to 3, it means that for every $1 of the trader's capital, they can open a short position worth $3.wallet_exposure_limit_long and wallet_exposure_limit_short:
Example:
wallet_exposure_limit_long
is set to 0.1 (10%), it means that the maximum amount allocated to long positions cannot exceed 10% of the total equity.wallet_exposure_limit_short
is set to 0.05 (5%), it means that the maximum amount allocated to short positions cannot exceed 5% of the total equity.Effective Leverage Calculation:
total_equity * wallet_exposure_limit * leverage_used
.Example:
wallet_exposure_limit_long
is set to 0.1 (10%), and user_defined_leverage_long
is set to 5.enforce_full_grid:
enforce_full_grid
is set to True
, the code calculates the required notional amount by dividing the maximum position value by the number of levels.enforce_full_grid
is set to False
, the code uses the maximum position value as the required notional amount.Example:
enforce_full_grid
is True
, the required notional amount for each level would be: $5,000 / 5 = $1,000.enforce_full_grid
is False
, the required notional amount would be the full $5,000.Adjusting Maximum Position Value:
These risk management parameters and calculations help traders control their exposure to risk, limit potential losses, and manage their positions effectively. By adjusting these parameters based on their risk tolerance and trading strategy, traders can optimize their risk management approach and protect their capital.
"},{"location":"configuration/#linear-grid-strategy-parameters","title":"Linear Grid Strategy Parameters","text":"Here are the parameters for the linear_grid
strategy in your config.json
file:
{\n \"api\": {\n \"filename\": \"quantdatav2_bybit.json\",\n \"mode\": \"remote\",\n \"url\": \"https://api.quantumvoid.org/volumedata/\",\n \"data_source_exchange\": \"bybit\"\n },\n \"bot\": {\n \"bot_name\": \"your_bot_name\",\n \"volume_check\": false,\n \"min_distance\": 0.15,\n \"min_volume\": 10000,\n \"upnl_profit_pct\": 0.0029,\n \"max_upnl_profit_pct\": 0.0040,\n \"auto_reduce_enabled\": false,\n \"auto_reduce_start_pct\": 0.068,\n \"entry_during_autoreduce\": false,\n \"stoploss_enabled\": false,\n \"stoploss_upnl_pct\": 0.05,\n \"liq_stoploss_enabled\": false,\n \"liq_price_stop_pct\": 0.50,\n \"percentile_auto_reduce_enabled\": false,\n \"upnl_threshold_pct\": 0.50,\n \"max_pos_balance_pct\": 0.50,\n \"auto_reduce_wallet_exposure_pct\": 0.20,\n \"auto_reduce_maxloss_pct\": 0.30,\n \"auto_reduce_marginbased_enabled\": false,\n \"hedge_ratio\": 0.10,\n \"hedge_price_difference_threshold\": 0.10,\n \"test_orders_enabled\": false,\n \"max_usd_value\": 50,\n \"min_qty_threshold\": 0,\n \"MaxAbsFundingRate\": 0.0002,\n \"blacklist\": [\"BTCUSDT\", \"ETHUSDT\"],\n \"whitelist\": [],\n \"dashboard_enabled\": false,\n \"shared_data_path\": \"data/\",\n \"linear_grid\": {\n \"target_coins_mode\": false,\n \"auto_graceful_stop\": false,\n \"entry_signal_type\": \"lorentzian\",\n \"additional_entries_from_signal\": true,\n \"graceful_stop_long\": false,\n \"graceful_stop_short\": false,\n \"max_qty_percent_long\": 30,\n \"max_qty_percent_short\": 30,\n \"auto_reduce_cooldown_enabled\": false,\n \"auto_reduce_cooldown_start_pct\": 0.051,\n \"wallet_exposure_limit_long\": 0.006,\n \"wallet_exposure_limit_short\": 0.002,\n \"levels\": 4,\n \"strength\": 1.4,\n \"outer_price_distance\": 0.059,\n \"min_outer_price_distance\": 0.019,\n \"max_outer_price_distance\": 0.049,\n \"long_mode\": true,\n \"short_mode\": true,\n \"reissue_threshold\": 0.001,\n \"buffer_percentage\": 0.10,\n \"initial_entry_buffer_pct\": 0.0001,\n \"min_buffer_percentage\": 0.0035,\n \"max_buffer_percentage\": 0.010,\n \"enforce_full_grid\": true,\n \"min_buffer_percentage_ar\": 0.002,\n \"max_buffer_percentage_ar\": 0.004,\n \"upnl_auto_reduce_threshold_long\": 30.0,\n \"upnl_auto_reduce_threshold_short\": 30.0,\n \"failsafe_enabled\": false,\n \"failsafe_start_pct\": 0.07,\n \"long_failsafe_upnl_pct\": 10.0,\n \"short_failsafe_upnl_pct\": 10.0\n },\n \"hotkeys\": {\n \"hotkeys_enabled\": false,\n \"enter_long\": \"1\",\n \"take_profit_long\": \"2\",\n \"enter_short\": \"3\",\n \"take_profit_short\": \"4\"\n }\n },\n \"exchanges\": [\n {\n \"name\": \"bybit\",\n \"account_name\": \"account_1\",\n \"symbols_allowed\": 10\n },\n {\n \"name\": \"bybit_spot\",\n \"account_name\": \"account_2\",\n \"symbols_allowed\": 5\n },\n {\n \"name\": \"bybit_unified\",\n \"account_name\": \"account_3\",\n \"symbols_allowed\": 5\n }\n ],\n \"logger\": {\n \"level\": \"info\"\n },\n \"messengers\": {\n \"discord\": {\n \"active\": false,\n \"embedded_messages\": true,\n \"messenger_type\": \"discord\",\n \"webhook_url\": \"https://discord.com/api/webhooks/your_webhook_id/your_webhook_token\"\n },\n \"telegram\": {\n \"active\": false,\n \"embedded_messages\": true,\n \"messenger_type\": \"telegram\",\n \"bot_token\": \"your_bot_token\",\n \"chat_id\": \"your_chat_id\"\n }\n }\n }\n
"},{"location":"control_center/","title":"Control Center","text":""},{"location":"control_center/#configuring-the-password","title":"Configuring the Password","text":"config.toml
file in the directionalscalper/controlcenter/
directory in a text editor: nano config.toml
[credentials]
section with your desired password: [credentials] password = \"your_password_here\"
To start the Streamlit dashboard (Control Center) for Directional Scalper, follow these steps:
directionalscalper/controlcenter/
directory: cd directionalscalper/controlcenter/
pip install streamlit
streamlit run dashboard.py
config.toml
file located in the same directory.Once the dashboard is running, you can access it through your web browser by navigating to the local URL provided by Streamlit (usually http://localhost:8501
). Ensure that your firewall or network settings allow access to this port if you are accessing it remotely.
To set up a VPS (Virtual Private Server) for running the bot, follow these steps:
Choose a VPS Provider: Select a VPS provider such as Hetzner, DigitalOcean, AWS, or Linode. For optimal performance, it is recommended to use a Hetzner 4 core 8GB Intel server. Create an account and set up a new VPS instance with at least 4 Cores and 8GB of RAM and a suitable operating system (e.g., Ubuntu 20.04).
Connect to Your VPS: Use SSH to connect to your VPS. Replace your_vps_ip
with the IP address of your VPS. ssh root@your_vps_ip
Update and Upgrade Packages: Ensure your VPS is up to date. sudo apt update && sudo apt upgrade -y
Install Python 3.11: Follow the instructions in the \"Installing Python 3.11\" section below to install Python 3.11 on your VPS.
Install Git: If Git is not already installed, install it using: sudo apt install git -y
Clone the Repository: Clone the Directional Scalper repository to your VPS: git clone https://github.com/donewiththedollar/directionalscalper.git
Install Dependencies: Install the required Python dependencies. pip3.11 install -r requirements.txt
Configure the Bot: Rename the configuration files and add your API keys as described in the \"Quickstart\" section.
Run the Bot: Start the bot using the appropriate command as described in the \"Quickstart\" section.
Before you begin, ensure you have the following prerequisites:
Clone the repository: git clone https://github.com/donewiththedollar/directionalscalper.git
Change current working directory to the project directory: cd directionalscalper
Install the required dependencies: pip3.11 install -r requirements.txt
Rename the config_example.json
to config.json
located in the /configs
folder. Also rename account_example.json
to account.json
and add your API key(s) to the account.json
file located in the /configs
folder.
Run the bot:
python3.11 multi_bot_aio.py --config configs/config.json
or the old method python3.11 multi_bot_v4.py --config config.json (outdated)
python3.11 multi_bot_v3.py --exchange bybit --account_name account_1 --strategy qsgridob --config configs/config.json
python3.11 bot.py --exchange bybit --symbol DOGEUSDT --strategy qstrendob --config configs/config.json
To install Python 3.11 on your system, follow these steps:
Update the package list and install the necessary dependencies: sudo apt update sudo apt install -y build-essential gdb lcov pkg-config \\ libbz2-dev libffi-dev libgdbm-dev libgdbm-compat-dev liblzma-dev \\ libncurses5-dev libreadline-dev libsqlite3-dev libssl-dev \\ lzma lzma-dev tk-dev uuid-dev zlib1g-dev
Download the Python 3.11.0 source code: cd /opt wget https://www.python.org/ftp/python/3.11.0/Python-3.11.0.tgz
Extract the downloaded archive: sudo tar -xzf Python-3.11.0.tgz
Change to the extracted directory: cd Python-3.11.0
Configure the build with optimizations: sudo ./configure --enable-optimizations --prefix=/usr/local
Compile Python: sudo make -j 8
Install Python 3.11: sudo make altinstall
Verify the installation: python3.11 --version
You should see the installed Python version displayed.
That's it! You have now installed Python 3.11 on your system.
"},{"location":"risk_management/","title":"Risk Management in DirectionalScalper","text":"This document explains the risk management strategies implemented in the trading bot, focusing on four key parameters from the configuration.
"},{"location":"risk_management/#example-key-configuration-parameters","title":"Example Key Configuration Parameters","text":"wallet_exposure_limit_long
: 0.013 (1.3%)wallet_exposure_limit_short
: 0.004 (0.4%)max_qty_percent_long
: 10%max_qty_percent_short
: 10%The wallet_exposure_limit_long
and wallet_exposure_limit_short
parameters define the maximum percentage of the total equity that can be allocated to long and short positions, respectively.
These limits help prevent overexposure to any single trading direction and maintain a balanced risk profile.
"},{"location":"risk_management/#maximum-quantity-percentages","title":"Maximum Quantity Percentages","text":"The max_qty_percent_long
and max_qty_percent_short
parameters set the maximum allowed position size as a percentage of the total equity for long and short positions, respectively.
These limits act as an additional safety measure to prevent any single position from becoming too large relative to the total equity.
"},{"location":"risk_management/#risk-management-implementation","title":"Risk Management Implementation","text":"The bot implements risk management through the check_and_manage_positions
function. Here's how it works:
max_qty_long = (total_equity * wallet_exposure_limit_long) / current_price
For short positions: max_qty_short = (total_equity * wallet_exposure_limit_short) / current_price
Calculate Position Exposure Percentages:
(long_pos_qty * current_price / total_equity) * 100
Short exposure: (short_pos_qty * current_price / total_equity) * 100
Check Against Maximum Quantity Percentages:
max_qty_percent_long
:max_qty_reached_symbol_long
setIf short exposure > max_qty_percent_short
:
max_qty_reached_symbol_short
setRecovery Mechanism:
max_qty_reached_symbol
set, allowing trading to resume.The bot uses two functions for implementing a proper DCA strategy:
calculate_total_amount_notional_ls_properdca
:Ensures that the total position value (including existing positions) doesn't exceed the maximum allowed exposure.
calculate_order_amounts_notional_properdca
:
max_qty_reached_symbol_long
and max_qty_reached_symbol_short
) to track symbols that have reached their maximum allowed quantities.This risk management system provides a comprehensive approach to controlling exposure and managing position sizes. By using wallet exposure limits and maximum quantity percentages, the bot maintains a balanced risk profile while allowing for effective trading across multiple symbols and strategies.
The implementation of proper DCA and dynamic grid management further enhances the bot's ability to adapt to market conditions while adhering to predefined risk parameters.
"},{"location":"strategies/","title":"Strategies","text":""},{"location":"strategies/#linear-grid-strategy","title":"Linear Grid Strategy","text":""},{"location":"strategies/#overview","title":"Overview","text":"The Linear Grid Strategy is a trading strategy designed to capitalize on market fluctuations by placing multiple buy and sell orders at predefined intervals (grid levels) above and below the current price level. This strategy helps in capturing profits in both upward and downward market movements.
"},{"location":"strategies/#configuration-parameters","title":"Configuration Parameters","text":"Here are the parameters for the linear_grid
strategy in your config.json
file:
This strategy is based on machine learning based signals and utilizes a grid with proper DCA so each grid level is \"meaningful\" to bring the position to current market price staying \"sticky\" to price action.
Set up your config.json from the below snippet
{\n \"api\": {\n \"filename\": \"quantdatav2_bybit.json\",\n \"mode\": \"remote\",\n \"url\": \"https://api.quantumvoid.org/volumedata/\",\n \"data_source_exchange\": \"bybit\"\n },\n \"bot\": {\n \"bot_name\": \"your_bot_name\",\n \"volume_check\": false,\n \"min_distance\": 0.15,\n \"min_volume\": 10000,\n \"upnl_profit_pct\": 0.0029,\n \"max_upnl_profit_pct\": 0.0040,\n \"auto_reduce_enabled\": false,\n \"auto_reduce_start_pct\": 0.068,\n \"entry_during_autoreduce\": false,\n \"stoploss_enabled\": false,\n \"stoploss_upnl_pct\": 0.05,\n \"liq_stoploss_enabled\": false,\n \"liq_price_stop_pct\": 0.50,\n \"percentile_auto_reduce_enabled\": false,\n \"upnl_threshold_pct\": 0.50,\n \"max_pos_balance_pct\": 0.50,\n \"auto_reduce_wallet_exposure_pct\": 0.20,\n \"auto_reduce_maxloss_pct\": 0.30,\n \"auto_reduce_marginbased_enabled\": false,\n \"hedge_ratio\": 0.10,\n \"hedge_price_difference_threshold\": 0.10,\n \"test_orders_enabled\": false,\n \"max_usd_value\": 50,\n \"min_qty_threshold\": 0,\n \"MaxAbsFundingRate\": 0.0002,\n \"blacklist\": [\"BTCUSDT\", \"ETHUSDT\"],\n \"whitelist\": [],\n \"dashboard_enabled\": false,\n \"shared_data_path\": \"data/\",\n \"linear_grid\": {\n \"target_coins_mode\": false,\n \"auto_graceful_stop\": false,\n \"entry_signal_type\": \"lorentzian\",\n \"additional_entries_from_signal\": true,\n \"graceful_stop_long\": false,\n \"graceful_stop_short\": false,\n \"max_qty_percent_long\": 30,\n \"max_qty_percent_short\": 30,\n \"auto_reduce_cooldown_enabled\": false,\n \"auto_reduce_cooldown_start_pct\": 0.051,\n \"wallet_exposure_limit_long\": 0.006,\n \"wallet_exposure_limit_short\": 0.002,\n \"levels\": 4,\n \"strength\": 1.4,\n \"outer_price_distance\": 0.059,\n \"min_outer_price_distance\": 0.019,\n \"max_outer_price_distance\": 0.049,\n \"long_mode\": true,\n \"short_mode\": true,\n \"reissue_threshold\": 0.001,\n \"buffer_percentage\": 0.10,\n \"initial_entry_buffer_pct\": 0.0001,\n \"min_buffer_percentage\": 0.0035,\n \"max_buffer_percentage\": 0.010,\n \"enforce_full_grid\": true,\n \"min_buffer_percentage_ar\": 0.002,\n \"max_buffer_percentage_ar\": 0.004,\n \"upnl_auto_reduce_threshold_long\": 30.0,\n \"upnl_auto_reduce_threshold_short\": 30.0,\n \"failsafe_enabled\": false,\n \"failsafe_start_pct\": 0.07,\n \"long_failsafe_upnl_pct\": 10.0,\n \"short_failsafe_upnl_pct\": 10.0\n },\n \"hotkeys\": {\n \"hotkeys_enabled\": false,\n \"enter_long\": \"1\",\n \"take_profit_long\": \"2\",\n \"enter_short\": \"3\",\n \"take_profit_short\": \"4\"\n }\n },\n \"exchanges\": [\n {\n \"name\": \"bybit\",\n \"account_name\": \"account_1\",\n \"symbols_allowed\": 10\n },\n {\n \"name\": \"bybit_spot\",\n \"account_name\": \"account_2\",\n \"symbols_allowed\": 5\n },\n {\n \"name\": \"bybit_unified\",\n \"account_name\": \"account_3\",\n \"symbols_allowed\": 5\n }\n ],\n \"logger\": {\n \"level\": \"info\"\n },\n \"messengers\": {\n \"discord\": {\n \"active\": false,\n \"embedded_messages\": true,\n \"messenger_type\": \"discord\",\n \"webhook_url\": \"https://discord.com/api/webhooks/your_webhook_id/your_webhook_token\"\n },\n \"telegram\": {\n \"active\": false,\n \"embedded_messages\": true,\n \"messenger_type\": \"telegram\",\n \"bot_token\": \"your_bot_token\",\n \"chat_id\": \"your_chat_id\"\n }\n }\n }\n
Now, just run the bot using this multibot version and strategy
python3.11 multi_bot_aio.py --exchange bybit --account_name account_1 --strategy qsgridob --config configs/config.json
Set up your config.json from the below snippet to whitelist SOLUSDT and set max USD value to a higher value to allow for the symbol.
max_qty_percent_long
and max_qty_pct_short
are set high in this configuration, you can adjust them as needed these are just defaults for testing purposes.
{\n \"api\": {\n \"filename\": \"quantdatav2_bybit.json\",\n \"mode\": \"remote\",\n \"url\": \"https://api.quantumvoid.org/volumedata/\",\n \"data_source_exchange\": \"bybit\"\n },\n \"bot\": {\n \"bot_name\": \"your_bot_name\",\n \"volume_check\": false,\n \"min_distance\": 0.15,\n \"min_volume\": 10000,\n \"upnl_profit_pct\": 0.0032,\n \"max_upnl_profit_pct\": 0.0039,\n \"auto_reduce_enabled\": false,\n \"auto_reduce_start_pct\": 0.068,\n \"entry_during_autoreduce\": false,\n \"stoploss_enabled\": false,\n \"stoploss_upnl_pct\": 0.05,\n \"liq_stoploss_enabled\": false,\n \"liq_price_stop_pct\": 0.50,\n \"percentile_auto_reduce_enabled\": false,\n \"upnl_threshold_pct\": 0.50,\n \"max_pos_balance_pct\": 0.50,\n \"auto_reduce_wallet_exposure_pct\": 0.20,\n \"auto_reduce_maxloss_pct\": 0.30,\n \"auto_reduce_marginbased_enabled\": false,\n \"hedge_ratio\": 0.10,\n \"hedge_price_difference_threshold\": 0.10,\n \"test_orders_enabled\": false,\n \"max_usd_value\": 1000,\n \"min_qty_threshold\": 0,\n \"long_liq_pct\": 0.05,\n \"short_liq_pct\": 0.05,\n \"MaxAbsFundingRate\": 0.0002,\n \"blacklist\": [\"BTCUSDT\", \"ETHUSDT\"],\n \"whitelist\": [\"SOLUSDT\"],\n \"dashboard_enabled\": true,\n \"shared_data_path\": \"data/\",\n \"linear_grid\": {\n \"target_coins_mode\": true,\n \"auto_graceful_stop\": false,\n \"entry_signal_type\": \"lorentzian\",\n \"additional_entries_from_signal\": true,\n \"graceful_stop_long\": false,\n \"graceful_stop_short\": false,\n \"max_qty_percent_long\": 10000,\n \"max_qty_percent_short\": 10000,\n \"auto_reduce_cooldown_enabled\": false,\n \"auto_reduce_cooldown_start_pct\": 0.051,\n \"wallet_exposure_limit_long\": 1,\n \"wallet_exposure_limit_short\": 0.002,\n \"levels\": 4,\n \"strength\": 1.4,\n \"outer_price_distance\": 0.059,\n \"min_outer_price_distance\": 0.019,\n \"max_outer_price_distance\": 0.049,\n \"long_mode\": true,\n \"short_mode\": false,\n \"reissue_threshold\": 0.001,\n \"buffer_percentage\": 0.10,\n \"initial_entry_buffer_pct\": 0.0001,\n \"min_buffer_percentage\": 0.0035,\n \"max_buffer_percentage\": 0.010,\n \"enforce_full_grid\": true,\n \"min_buffer_percentage_ar\": 0.002,\n \"max_buffer_percentage_ar\": 0.004,\n \"upnl_auto_reduce_threshold_long\": 10.0,\n \"upnl_auto_reduce_threshold_short\": 10.0,\n \"failsafe_enabled\": false,\n \"failsafe_start_pct\": 0.05,\n \"long_failsafe_upnl_pct\": 10.0,\n \"short_failsafe_upnl_pct\": 10.0\n },\n \"hotkeys\": {\n \"hotkeys_enabled\": false,\n \"enter_long\": \"1\",\n \"take_profit_long\": \"2\",\n \"enter_short\": \"3\",\n \"take_profit_short\": \"4\"\n }\n },\n \"exchanges\": [\n {\n \"name\": \"bybit\",\n \"account_name\": \"account_1\",\n \"symbols_allowed\": 2\n },\n {\n \"name\": \"bybit_spot\",\n \"account_name\": \"account_2\",\n \"symbols_allowed\": 5\n },\n {\n \"name\": \"bybit_unified\",\n \"account_name\": \"account_3\",\n \"symbols_allowed\": 5\n }\n ],\n \"logger\": {\n \"level\": \"info\"\n },\n \"messengers\": {\n \"discord\": {\n \"active\": false,\n \"embedded_messages\": true,\n \"messenger_type\": \"discord\",\n \"webhook_url\": \"https://discord.com/api/webhooks/your_webhook_id/your_webhook_token\"\n },\n \"telegram\": {\n \"active\": false,\n \"embedded_messages\": true,\n \"messenger_type\": \"telegram\",\n \"bot_token\": \"your_bot_token\",\n \"chat_id\": \"your_chat_id\"\n }\n }\n }\n\n
Now, just run the bot using this multibot version and strategy
python3.11 multi_bot_aio.py --exchange bybit --account_name account_1 --strategy qsgridob --config configs/config.json
This is just a simple example of a long only BTCUSDT strategy to show how one can utilize a single strategy for many use case scenarios on different instruments.
"},{"location":"strategies/#example-high-risk-small-account-longshort-btcusdt-futures-configuration","title":"Example High risk small account long&short BTCUSDT futures configuration","text":"Set up your config.json from the below snippet to whitelist BTCUSDT and set max USD value to a high value to allow for the symbol.
max_qty_percent_long
and max_qty_pct_short
are set high in this configuration, you can adjust them as needed these are just defaults for testing purposes.
{\n \"api\": {\n \"filename\": \"quantdatav2_bybit.json\",\n \"mode\": \"remote\",\n \"url\": \"https://api.quantumvoid.org/volumedata/\",\n \"data_source_exchange\": \"bybit\"\n },\n \"bot\": {\n \"bot_name\": \"your_bot_name\",\n \"volume_check\": false,\n \"min_distance\": 0.15,\n \"min_volume\": 10000,\n \"upnl_profit_pct\": 0.0032,\n \"max_upnl_profit_pct\": 0.0039,\n \"auto_reduce_enabled\": false,\n \"auto_reduce_start_pct\": 0.068,\n \"entry_during_autoreduce\": false,\n \"stoploss_enabled\": false,\n \"stoploss_upnl_pct\": 0.05,\n \"liq_stoploss_enabled\": false,\n \"liq_price_stop_pct\": 0.50,\n \"percentile_auto_reduce_enabled\": false,\n \"upnl_threshold_pct\": 0.50,\n \"max_pos_balance_pct\": 0.50,\n \"auto_reduce_wallet_exposure_pct\": 0.20,\n \"auto_reduce_maxloss_pct\": 0.30,\n \"auto_reduce_marginbased_enabled\": false,\n \"hedge_ratio\": 0.10,\n \"hedge_price_difference_threshold\": 0.10,\n \"test_orders_enabled\": false,\n \"max_usd_value\": 1000,\n \"min_qty_threshold\": 0,\n \"long_liq_pct\": 0.05,\n \"short_liq_pct\": 0.05,\n \"MaxAbsFundingRate\": 0.0002,\n \"blacklist\": [\"ETHUSDT\"],\n \"whitelist\": [\"BTCUSDT\"],\n \"dashboard_enabled\": true,\n \"shared_data_path\": \"data/\",\n \"linear_grid\": {\n \"target_coins_mode\": true,\n \"auto_graceful_stop\": false,\n \"entry_signal_type\": \"lorentzian\",\n \"additional_entries_from_signal\": true,\n \"graceful_stop_long\": false,\n \"graceful_stop_short\": false,\n \"max_qty_percent_long\": 10000,\n \"max_qty_percent_short\": 10000,\n \"auto_reduce_cooldown_enabled\": false,\n \"auto_reduce_cooldown_start_pct\": 0.051,\n \"wallet_exposure_limit_long\": 1,\n \"wallet_exposure_limit_short\": 0.002,\n \"levels\": 4,\n \"strength\": 1.4,\n \"outer_price_distance\": 0.059,\n \"min_outer_price_distance\": 0.019,\n \"max_outer_price_distance\": 0.049,\n \"long_mode\": true,\n \"short_mode\": true,\n \"reissue_threshold\": 0.001,\n \"buffer_percentage\": 0.10,\n \"initial_entry_buffer_pct\": 0.0001,\n \"min_buffer_percentage\": 0.0035,\n \"max_buffer_percentage\": 0.010,\n \"enforce_full_grid\": true,\n \"min_buffer_percentage_ar\": 0.002,\n \"max_buffer_percentage_ar\": 0.004,\n \"upnl_auto_reduce_threshold_long\": 10.0,\n \"upnl_auto_reduce_threshold_short\": 10.0,\n \"failsafe_enabled\": false,\n \"failsafe_start_pct\": 0.05,\n \"long_failsafe_upnl_pct\": 10.0,\n \"short_failsafe_upnl_pct\": 10.0\n },\n \"hotkeys\": {\n \"hotkeys_enabled\": false,\n \"enter_long\": \"1\",\n \"take_profit_long\": \"2\",\n \"enter_short\": \"3\",\n \"take_profit_short\": \"4\"\n }\n },\n \"exchanges\": [\n {\n \"name\": \"bybit\",\n \"account_name\": \"account_1\",\n \"symbols_allowed\": 2\n },\n {\n \"name\": \"bybit_spot\",\n \"account_name\": \"account_2\",\n \"symbols_allowed\": 5\n },\n {\n \"name\": \"bybit_unified\",\n \"account_name\": \"account_3\",\n \"symbols_allowed\": 5\n }\n ],\n \"logger\": {\n \"level\": \"info\"\n },\n \"messengers\": {\n \"discord\": {\n \"active\": false,\n \"embedded_messages\": true,\n \"messenger_type\": \"discord\",\n \"webhook_url\": \"https://discord.com/api/webhooks/your_webhook_id/your_webhook_token\"\n },\n \"telegram\": {\n \"active\": false,\n \"embedded_messages\": true,\n \"messenger_type\": \"telegram\",\n \"bot_token\": \"your_bot_token\",\n \"chat_id\": \"your_chat_id\"\n }\n }\n }\n\n
Now, just run the bot using this multibot version and strategy
python3.11 multi_bot_signalscreener_targetcoin.py --exchange bybit --account_name account_1 --strategy qsgridob --config configs/config.json
This is an aggressive approach because it utilizes a high max_qty_percent_long
and max_qty_percent_short
on a small wallet balance (ie $100 USD) for a symbol with a high USD value with the min notional requirement for BTCUSDT on Bybit it is inherently more risky but also more profitable.
This guide will help you run the Directional Scalper bot using various command-line instructions. Ensure you have properly configured your config.json
and account.json
files before proceeding.
pip3.11 install -r requirements.txt && python3.11 update_config.py --config configs/config.json && mv configs/config.json.new configs/config.json\n
python3.11 multi_bot_v4.py --exchange bybit --account_name account_1 --strategy qsgridob --config configs/config.json\n
"},{"location":"usage/#displaying-the-menu-and-selecting-a-strategy","title":"Displaying the Menu and Selecting a Strategy","text":"To display the menu and select a strategy, use the following command:
python3.11 multi_bot_v4.py --config configs/config.json\n
or
python3.11 multi_bot_v4.py --config configs/config.json\n
"},{"location":"usage/#running-the-bot-with-command-line-parameters","title":"Running the Bot with Command Line Parameters","text":"You can also run the bot directly with specific command-line parameters. Below are examples of different strategies you can use:
"},{"location":"usage/#multi-bot-auto-symbol-rotator-strategy","title":"Multi-Bot Auto Symbol Rotator Strategy","text":"To run the multi-bot auto symbol rotator strategy, use the following command:
python3.11 multi_bot_v4.py --exchange bybit --account_name account_1 --strategy qsgridob --config configs/config.json\n
"},{"location":"usage/#old-single-coin-strategy","title":"Old Single Coin Strategy","text":"To run the old single coin strategy, use the following command: (likely very outdated, but can be updated by anyone or per request)
python3.11 bot.py --exchange bybit --symbol DOGEUSDT --strategy qstrendob --config configs/config.json\n
"},{"location":"usage/#command-line-parameters","title":"Command Line Parameters","text":""},{"location":"usage/#general-parameters","title":"General Parameters","text":"account.json
.config.json
file.python3.11 multi_bot_v4.py --exchange bybit --account_name account_1 --strategy qsgridob --config configs/config.json
python3.11 bot.py --exchange bybit --symbol DOGEUSDT --strategy qstrendob --config configs/config.json
config.json
to suit your trading preferences.This guide provides a straightforward approach to running the Directional Scalper bot with various strategies and configurations. If you encounter any issues, refer to the relevant sections of the documentation for more details.
"}]} \ No newline at end of file +{"config":{"lang":["en"],"separator":"[\\s\\-]+","pipeline":["stopWordFilter"]},"docs":[{"location":"","title":"Directional Scalper","text":"Welcome to the documentation for Directional Scalper.
"},{"location":"#links","title":"Links","text":"Quantum Void Labs is a non-profit organization dedicated to developing open-source applications. We specialize in developing algorithms that are freely available to the public under the MIT License.
Our focus is on contributing to the global knowledge base rather than commercializing our work.
We do not sell products or services; instead, we aim to encourage innovation and collaboration within the ecosystem through our open-source contributions.
"},{"location":"configuration/","title":"Configuration","text":""},{"location":"configuration/#account-section","title":"Account Section","text":"Configure your account settings in the account.json
file under the account
section. This includes API keys, account names, and other related settings.
Configure your accounts using 'account.json' in the configs folder.
{\n \"exchanges\": [\n {\n \"name\": \"bybit\",\n \"account_name\": \"account_1\",\n \"api_key\": \"your_api_key\",\n \"api_secret\": \"your_api_secret\"\n },\n {\n \"name\": \"bybit_spot\",\n \"account_name\": \"account_2\",\n \"api_key\": \"your_api_key\",\n \"api_secret\": \"your_api_secret\"\n },\n {\n \"name\": \"bybit_unified\",\n \"account_name\": \"account_3\",\n \"api_key\": \"your_api_key\",\n \"api_secret\": \"your_api_secret\"\n }\n ]\n}\n
"},{"location":"configuration/#bot-section","title":"Bot Section","text":"Configure your bot settings in the config.json
file under the bot
section. This includes strategy parameters, risk management settings, and other related settings.
user_defined_leverage_long
, it's a multiplier that increases the size of the position and the potential profit/loss.Risk Management plays a crucial role in trading strategies, as it helps protect the trader's capital and limits potential losses. In the provided code snippet, there are several parameters and calculations related to risk management. Let's dive into each of them and provide examples to clarify their usage.
Example:
user_defined_leverage_long
is set to 5, it means that for every $1 of the trader's capital, they can open a long position worth $5.user_defined_leverage_short
is set to 3, it means that for every $1 of the trader's capital, they can open a short position worth $3.wallet_exposure_limit_long and wallet_exposure_limit_short:
Example:
wallet_exposure_limit_long
is set to 0.1 (10%), it means that the maximum amount allocated to long positions cannot exceed 10% of the total equity.wallet_exposure_limit_short
is set to 0.05 (5%), it means that the maximum amount allocated to short positions cannot exceed 5% of the total equity.Effective Leverage Calculation:
total_equity * wallet_exposure_limit * leverage_used
.Example:
wallet_exposure_limit_long
is set to 0.1 (10%), and user_defined_leverage_long
is set to 5.enforce_full_grid:
enforce_full_grid
is set to True
, the code calculates the required notional amount by dividing the maximum position value by the number of levels.enforce_full_grid
is set to False
, the code uses the maximum position value as the required notional amount.Example:
enforce_full_grid
is True
, the required notional amount for each level would be: $5,000 / 5 = $1,000.enforce_full_grid
is False
, the required notional amount would be the full $5,000.Adjusting Maximum Position Value:
These risk management parameters and calculations help traders control their exposure to risk, limit potential losses, and manage their positions effectively. By adjusting these parameters based on their risk tolerance and trading strategy, traders can optimize their risk management approach and protect their capital.
"},{"location":"configuration/#linear-grid-strategy-parameters","title":"Linear Grid Strategy Parameters","text":"Here are the parameters for the linear_grid
strategy in your config.json
file:
{\n \"api\": {\n \"filename\": \"quantdatav2_bybit.json\",\n \"mode\": \"remote\",\n \"url\": \"https://api.quantumvoid.org/volumedata/\",\n \"data_source_exchange\": \"bybit\"\n },\n \"bot\": {\n \"bot_name\": \"your_bot_name\",\n \"volume_check\": false,\n \"min_distance\": 0.15,\n \"min_volume\": 10000,\n \"upnl_profit_pct\": 0.0029,\n \"max_upnl_profit_pct\": 0.0040,\n \"auto_reduce_enabled\": false,\n \"auto_reduce_start_pct\": 0.068,\n \"entry_during_autoreduce\": false,\n \"stoploss_enabled\": false,\n \"stoploss_upnl_pct\": 0.05,\n \"liq_stoploss_enabled\": false,\n \"liq_price_stop_pct\": 0.50,\n \"percentile_auto_reduce_enabled\": false,\n \"upnl_threshold_pct\": 0.50,\n \"max_pos_balance_pct\": 0.50,\n \"auto_reduce_wallet_exposure_pct\": 0.20,\n \"auto_reduce_maxloss_pct\": 0.30,\n \"auto_reduce_marginbased_enabled\": false,\n \"hedge_ratio\": 0.10,\n \"hedge_price_difference_threshold\": 0.10,\n \"test_orders_enabled\": false,\n \"max_usd_value\": 50,\n \"min_qty_threshold\": 0,\n \"MaxAbsFundingRate\": 0.0002,\n \"blacklist\": [\"BTCUSDT\", \"ETHUSDT\"],\n \"whitelist\": [],\n \"dashboard_enabled\": false,\n \"shared_data_path\": \"data/\",\n \"linear_grid\": {\n \"grid_behavior\": \"infinite\",\n \"drawdown_behavior\": \"maxqtypercent\",\n \"target_coins_mode\": false,\n \"auto_graceful_stop\": false,\n \"entry_signal_type\": \"lorentzian\",\n \"additional_entries_from_signal\": true,\n \"graceful_stop_long\": false,\n \"graceful_stop_short\": false,\n \"max_qty_percent_long\": 30,\n \"max_qty_percent_short\": 30,\n \"auto_reduce_cooldown_enabled\": false,\n \"auto_reduce_cooldown_start_pct\": 0.051,\n \"wallet_exposure_limit_long\": 0.006,\n \"wallet_exposure_limit_short\": 0.002,\n \"levels\": 4,\n \"strength\": 1.4,\n \"outer_price_distance\": 0.059,\n \"min_outer_price_distance\": 0.019,\n \"max_outer_price_distance\": 0.049,\n \"long_mode\": true,\n \"short_mode\": true,\n \"reissue_threshold\": 0.001,\n \"buffer_percentage\": 0.10,\n \"initial_entry_buffer_pct\": 0.0001,\n \"min_buffer_percentage\": 0.0035,\n \"max_buffer_percentage\": 0.010,\n \"enforce_full_grid\": true,\n \"min_buffer_percentage_ar\": 0.002,\n \"max_buffer_percentage_ar\": 0.004,\n \"upnl_auto_reduce_threshold_long\": 30.0,\n \"upnl_auto_reduce_threshold_short\": 30.0,\n \"failsafe_enabled\": false,\n \"failsafe_start_pct\": 0.07,\n \"long_failsafe_upnl_pct\": 10.0,\n \"short_failsafe_upnl_pct\": 10.0\n },\n \"hotkeys\": {\n \"hotkeys_enabled\": false,\n \"enter_long\": \"1\",\n \"take_profit_long\": \"2\",\n \"enter_short\": \"3\",\n \"take_profit_short\": \"4\"\n }\n },\n \"exchanges\": [\n {\n \"name\": \"bybit\",\n \"account_name\": \"account_1\",\n \"symbols_allowed\": 10\n },\n {\n \"name\": \"bybit_spot\",\n \"account_name\": \"account_2\",\n \"symbols_allowed\": 5\n },\n {\n \"name\": \"bybit_unified\",\n \"account_name\": \"account_3\",\n \"symbols_allowed\": 5\n }\n ],\n \"logger\": {\n \"level\": \"info\"\n },\n \"messengers\": {\n \"discord\": {\n \"active\": false,\n \"embedded_messages\": true,\n \"messenger_type\": \"discord\",\n \"webhook_url\": \"https://discord.com/api/webhooks/your_webhook_id/your_webhook_token\"\n },\n \"telegram\": {\n \"active\": false,\n \"embedded_messages\": true,\n \"messenger_type\": \"telegram\",\n \"bot_token\": \"your_bot_token\",\n \"chat_id\": \"your_chat_id\"\n }\n }\n }\n
"},{"location":"control_center/","title":"Control Center","text":""},{"location":"control_center/#configuring-the-password","title":"Configuring the Password","text":"config.toml
file in the directionalscalper/controlcenter/
directory in a text editor: nano config.toml
[credentials]
section with your desired password: [credentials] password = \"your_password_here\"
To start the Streamlit dashboard (Control Center) for Directional Scalper, follow these steps:
directionalscalper/controlcenter/
directory: cd directionalscalper/controlcenter/
pip install streamlit
streamlit run dashboard.py
config.toml
file located in the same directory.Once the dashboard is running, you can access it through your web browser by navigating to the local URL provided by Streamlit (usually http://localhost:8501
). Ensure that your firewall or network settings allow access to this port if you are accessing it remotely.
To set up a VPS (Virtual Private Server) for running the bot, follow these steps:
Choose a VPS Provider: Select a VPS provider such as Hetzner, DigitalOcean, AWS, or Linode. For optimal performance, it is recommended to use a Hetzner 4 core 8GB Intel server. Create an account and set up a new VPS instance with at least 4 Cores and 8GB of RAM and a suitable operating system (e.g., Ubuntu 20.04).
Connect to Your VPS: Use SSH to connect to your VPS. Replace your_vps_ip
with the IP address of your VPS. ssh root@your_vps_ip
Update and Upgrade Packages: Ensure your VPS is up to date. sudo apt update && sudo apt upgrade -y
Install Python 3.11: Follow the instructions in the \"Installing Python 3.11\" section below to install Python 3.11 on your VPS.
Install Git: If Git is not already installed, install it using: sudo apt install git -y
Clone the Repository: Clone the Directional Scalper repository to your VPS: git clone https://github.com/donewiththedollar/directionalscalper.git
Install Dependencies: Install the required Python dependencies. pip3.11 install -r requirements.txt
Configure the Bot: Rename the configuration files and add your API keys as described in the \"Quickstart\" section.
Run the Bot: Start the bot using the appropriate command as described in the \"Quickstart\" section.
Before you begin, ensure you have the following prerequisites:
Clone the repository: git clone https://github.com/donewiththedollar/directionalscalper.git
Change current working directory to the project directory: cd directionalscalper
Install the required dependencies: pip3.11 install -r requirements.txt
Rename the config_example.json
to config.json
located in the /configs
folder. Also rename account_example.json
to account.json
and add your API key(s) to the account.json
file located in the /configs
folder.
Run the bot:
python3.11 multi_bot_aio.py --config configs/config.json
or the old method python3.11 multi_bot_v4.py --config config.json (outdated)
python3.11 multi_bot_v3.py --exchange bybit --account_name account_1 --strategy qsgridob --config configs/config.json
python3.11 bot.py --exchange bybit --symbol DOGEUSDT --strategy qstrendob --config configs/config.json
To install Python 3.11 on your system, follow these steps:
Update the package list and install the necessary dependencies: sudo apt update sudo apt install -y build-essential gdb lcov pkg-config \\ libbz2-dev libffi-dev libgdbm-dev libgdbm-compat-dev liblzma-dev \\ libncurses5-dev libreadline-dev libsqlite3-dev libssl-dev \\ lzma lzma-dev tk-dev uuid-dev zlib1g-dev
Download the Python 3.11.0 source code: cd /opt wget https://www.python.org/ftp/python/3.11.0/Python-3.11.0.tgz
Extract the downloaded archive: sudo tar -xzf Python-3.11.0.tgz
Change to the extracted directory: cd Python-3.11.0
Configure the build with optimizations: sudo ./configure --enable-optimizations --prefix=/usr/local
Compile Python: sudo make -j 8
Install Python 3.11: sudo make altinstall
Verify the installation: python3.11 --version
You should see the installed Python version displayed.
That's it! You have now installed Python 3.11 on your system.
"},{"location":"risk_management/","title":"Risk Management in DirectionalScalper","text":"This document explains the risk management strategies implemented in the trading bot, focusing on four key parameters from the configuration.
"},{"location":"risk_management/#example-key-configuration-parameters","title":"Example Key Configuration Parameters","text":"wallet_exposure_limit_long
: 0.013 (1.3%)wallet_exposure_limit_short
: 0.004 (0.4%)max_qty_percent_long
: 10%max_qty_percent_short
: 10%The wallet_exposure_limit_long
and wallet_exposure_limit_short
parameters define the maximum percentage of the total equity that can be allocated to long and short positions, respectively.
These limits help prevent overexposure to any single trading direction and maintain a balanced risk profile.
"},{"location":"risk_management/#maximum-quantity-percentages","title":"Maximum Quantity Percentages","text":"The max_qty_percent_long
and max_qty_percent_short
parameters set the maximum allowed position size as a percentage of the total equity for long and short positions, respectively.
These limits act as an additional safety measure to prevent any single position from becoming too large relative to the total equity.
"},{"location":"risk_management/#risk-management-implementation","title":"Risk Management Implementation","text":"The bot implements risk management through the check_and_manage_positions
function. Here's how it works:
max_qty_long = (total_equity * wallet_exposure_limit_long) / current_price
For short positions: max_qty_short = (total_equity * wallet_exposure_limit_short) / current_price
Calculate Position Exposure Percentages:
(long_pos_qty * current_price / total_equity) * 100
Short exposure: (short_pos_qty * current_price / total_equity) * 100
Check Against Maximum Quantity Percentages:
max_qty_percent_long
:max_qty_reached_symbol_long
setIf short exposure > max_qty_percent_short
:
max_qty_reached_symbol_short
setRecovery Mechanism:
max_qty_reached_symbol
set, allowing trading to resume.The bot uses two functions for implementing a proper DCA strategy:
calculate_total_amount_notional_ls_properdca
:Ensures that the total position value (including existing positions) doesn't exceed the maximum allowed exposure.
calculate_order_amounts_notional_properdca
:
max_qty_reached_symbol_long
and max_qty_reached_symbol_short
) to track symbols that have reached their maximum allowed quantities.This risk management system provides a comprehensive approach to controlling exposure and managing position sizes. By using wallet exposure limits and maximum quantity percentages, the bot maintains a balanced risk profile while allowing for effective trading across multiple symbols and strategies.
The implementation of proper DCA and dynamic grid management further enhances the bot's ability to adapt to market conditions while adhering to predefined risk parameters.
"},{"location":"strategies/","title":"Strategies","text":""},{"location":"strategies/#linear-grid-strategy","title":"Linear Grid Strategy","text":""},{"location":"strategies/#overview","title":"Overview","text":"The Linear Grid Strategy is a trading strategy designed to capitalize on market fluctuations by placing multiple buy and sell orders at predefined intervals (grid levels) above and below the current price level. This strategy helps in capturing profits in both upward and downward market movements.
"},{"location":"strategies/#configuration-parameters","title":"Configuration Parameters","text":"Here are the parameters for the linear_grid
strategy in your config.json
file:
This strategy is based on machine learning based signals and utilizes a grid with proper DCA so each grid level is \"meaningful\" to bring the position to current market price staying \"sticky\" to price action.
Set up your config.json from the below snippet
{\n \"api\": {\n \"filename\": \"quantdatav2_bybit.json\",\n \"mode\": \"remote\",\n \"url\": \"https://api.quantumvoid.org/volumedata/\",\n \"data_source_exchange\": \"bybit\"\n },\n \"bot\": {\n \"bot_name\": \"your_bot_name\",\n \"volume_check\": false,\n \"min_distance\": 0.15,\n \"min_volume\": 10000,\n \"upnl_profit_pct\": 0.0029,\n \"max_upnl_profit_pct\": 0.0040,\n \"auto_reduce_enabled\": false,\n \"auto_reduce_start_pct\": 0.068,\n \"entry_during_autoreduce\": false,\n \"stoploss_enabled\": false,\n \"stoploss_upnl_pct\": 0.05,\n \"liq_stoploss_enabled\": false,\n \"liq_price_stop_pct\": 0.50,\n \"percentile_auto_reduce_enabled\": false,\n \"upnl_threshold_pct\": 0.50,\n \"max_pos_balance_pct\": 0.50,\n \"auto_reduce_wallet_exposure_pct\": 0.20,\n \"auto_reduce_maxloss_pct\": 0.30,\n \"auto_reduce_marginbased_enabled\": false,\n \"hedge_ratio\": 0.10,\n \"hedge_price_difference_threshold\": 0.10,\n \"test_orders_enabled\": false,\n \"max_usd_value\": 50,\n \"min_qty_threshold\": 0,\n \"MaxAbsFundingRate\": 0.0002,\n \"blacklist\": [\"BTCUSDT\", \"ETHUSDT\"],\n \"whitelist\": [],\n \"dashboard_enabled\": false,\n \"shared_data_path\": \"data/\",\n \"linear_grid\": {\n \"grid_behavior\": \"infinite\",\n \"drawdown_behavior\": \"maxqtypercent\",\n \"target_coins_mode\": false,\n \"auto_graceful_stop\": false,\n \"entry_signal_type\": \"lorentzian\",\n \"additional_entries_from_signal\": true,\n \"graceful_stop_long\": false,\n \"graceful_stop_short\": false,\n \"max_qty_percent_long\": 30,\n \"max_qty_percent_short\": 30,\n \"auto_reduce_cooldown_enabled\": false,\n \"auto_reduce_cooldown_start_pct\": 0.051,\n \"wallet_exposure_limit_long\": 0.006,\n \"wallet_exposure_limit_short\": 0.002,\n \"levels\": 4,\n \"strength\": 1.4,\n \"outer_price_distance\": 0.059,\n \"min_outer_price_distance\": 0.019,\n \"max_outer_price_distance\": 0.049,\n \"long_mode\": true,\n \"short_mode\": true,\n \"reissue_threshold\": 0.001,\n \"buffer_percentage\": 0.10,\n \"initial_entry_buffer_pct\": 0.0001,\n \"min_buffer_percentage\": 0.0035,\n \"max_buffer_percentage\": 0.010,\n \"enforce_full_grid\": true,\n \"min_buffer_percentage_ar\": 0.002,\n \"max_buffer_percentage_ar\": 0.004,\n \"upnl_auto_reduce_threshold_long\": 30.0,\n \"upnl_auto_reduce_threshold_short\": 30.0,\n \"failsafe_enabled\": false,\n \"failsafe_start_pct\": 0.07,\n \"long_failsafe_upnl_pct\": 10.0,\n \"short_failsafe_upnl_pct\": 10.0\n },\n \"hotkeys\": {\n \"hotkeys_enabled\": false,\n \"enter_long\": \"1\",\n \"take_profit_long\": \"2\",\n \"enter_short\": \"3\",\n \"take_profit_short\": \"4\"\n }\n },\n \"exchanges\": [\n {\n \"name\": \"bybit\",\n \"account_name\": \"account_1\",\n \"symbols_allowed\": 10\n },\n {\n \"name\": \"bybit_spot\",\n \"account_name\": \"account_2\",\n \"symbols_allowed\": 5\n },\n {\n \"name\": \"bybit_unified\",\n \"account_name\": \"account_3\",\n \"symbols_allowed\": 5\n }\n ],\n \"logger\": {\n \"level\": \"info\"\n },\n \"messengers\": {\n \"discord\": {\n \"active\": false,\n \"embedded_messages\": true,\n \"messenger_type\": \"discord\",\n \"webhook_url\": \"https://discord.com/api/webhooks/your_webhook_id/your_webhook_token\"\n },\n \"telegram\": {\n \"active\": false,\n \"embedded_messages\": true,\n \"messenger_type\": \"telegram\",\n \"bot_token\": \"your_bot_token\",\n \"chat_id\": \"your_chat_id\"\n }\n }\n }\n
Now, just run the bot using this multibot version and strategy
python3.11 multi_bot_aio.py --exchange bybit --account_name account_1 --strategy qsgridob --config configs/config.json
Set up your config.json from the below snippet to whitelist SOLUSDT and set max USD value to a higher value to allow for the symbol.
max_qty_percent_long
and max_qty_pct_short
are set high in this configuration, you can adjust them as needed these are just defaults for testing purposes.
{\n \"api\": {\n \"filename\": \"quantdatav2_bybit.json\",\n \"mode\": \"remote\",\n \"url\": \"https://api.quantumvoid.org/volumedata/\",\n \"data_source_exchange\": \"bybit\"\n },\n \"bot\": {\n \"bot_name\": \"your_bot_name\",\n \"volume_check\": false,\n \"min_distance\": 0.15,\n \"min_volume\": 10000,\n \"upnl_profit_pct\": 0.0032,\n \"max_upnl_profit_pct\": 0.0039,\n \"auto_reduce_enabled\": false,\n \"auto_reduce_start_pct\": 0.068,\n \"entry_during_autoreduce\": false,\n \"stoploss_enabled\": false,\n \"stoploss_upnl_pct\": 0.05,\n \"liq_stoploss_enabled\": false,\n \"liq_price_stop_pct\": 0.50,\n \"percentile_auto_reduce_enabled\": false,\n \"upnl_threshold_pct\": 0.50,\n \"max_pos_balance_pct\": 0.50,\n \"auto_reduce_wallet_exposure_pct\": 0.20,\n \"auto_reduce_maxloss_pct\": 0.30,\n \"auto_reduce_marginbased_enabled\": false,\n \"hedge_ratio\": 0.10,\n \"hedge_price_difference_threshold\": 0.10,\n \"test_orders_enabled\": false,\n \"max_usd_value\": 1000,\n \"min_qty_threshold\": 0,\n \"long_liq_pct\": 0.05,\n \"short_liq_pct\": 0.05,\n \"MaxAbsFundingRate\": 0.0002,\n \"blacklist\": [\"BTCUSDT\", \"ETHUSDT\"],\n \"whitelist\": [\"SOLUSDT\"],\n \"dashboard_enabled\": true,\n \"shared_data_path\": \"data/\",\n \"linear_grid\": {\n \"grid_behavior\": \"infinite\",\n \"drawdown_behavior\": \"maxqtypercent\",\n \"target_coins_mode\": true,\n \"auto_graceful_stop\": false,\n \"entry_signal_type\": \"lorentzian\",\n \"additional_entries_from_signal\": true,\n \"graceful_stop_long\": false,\n \"graceful_stop_short\": false,\n \"max_qty_percent_long\": 10000,\n \"max_qty_percent_short\": 10000,\n \"auto_reduce_cooldown_enabled\": false,\n \"auto_reduce_cooldown_start_pct\": 0.051,\n \"wallet_exposure_limit_long\": 1,\n \"wallet_exposure_limit_short\": 0.002,\n \"levels\": 4,\n \"strength\": 1.4,\n \"outer_price_distance\": 0.059,\n \"min_outer_price_distance\": 0.019,\n \"max_outer_price_distance\": 0.049,\n \"long_mode\": true,\n \"short_mode\": false,\n \"reissue_threshold\": 0.001,\n \"buffer_percentage\": 0.10,\n \"initial_entry_buffer_pct\": 0.0001,\n \"min_buffer_percentage\": 0.0035,\n \"max_buffer_percentage\": 0.010,\n \"enforce_full_grid\": true,\n \"min_buffer_percentage_ar\": 0.002,\n \"max_buffer_percentage_ar\": 0.004,\n \"upnl_auto_reduce_threshold_long\": 10.0,\n \"upnl_auto_reduce_threshold_short\": 10.0,\n \"failsafe_enabled\": false,\n \"failsafe_start_pct\": 0.05,\n \"long_failsafe_upnl_pct\": 10.0,\n \"short_failsafe_upnl_pct\": 10.0\n },\n \"hotkeys\": {\n \"hotkeys_enabled\": false,\n \"enter_long\": \"1\",\n \"take_profit_long\": \"2\",\n \"enter_short\": \"3\",\n \"take_profit_short\": \"4\"\n }\n },\n \"exchanges\": [\n {\n \"name\": \"bybit\",\n \"account_name\": \"account_1\",\n \"symbols_allowed\": 2\n },\n {\n \"name\": \"bybit_spot\",\n \"account_name\": \"account_2\",\n \"symbols_allowed\": 5\n },\n {\n \"name\": \"bybit_unified\",\n \"account_name\": \"account_3\",\n \"symbols_allowed\": 5\n }\n ],\n \"logger\": {\n \"level\": \"info\"\n },\n \"messengers\": {\n \"discord\": {\n \"active\": false,\n \"embedded_messages\": true,\n \"messenger_type\": \"discord\",\n \"webhook_url\": \"https://discord.com/api/webhooks/your_webhook_id/your_webhook_token\"\n },\n \"telegram\": {\n \"active\": false,\n \"embedded_messages\": true,\n \"messenger_type\": \"telegram\",\n \"bot_token\": \"your_bot_token\",\n \"chat_id\": \"your_chat_id\"\n }\n }\n }\n\n
Now, just run the bot using this multibot version and strategy
python3.11 multi_bot_aio.py --exchange bybit --account_name account_1 --strategy qsgridob --config configs/config.json
This is just a simple example of a long only BTCUSDT strategy to show how one can utilize a single strategy for many use case scenarios on different instruments.
"},{"location":"strategies/#example-high-risk-small-account-longshort-btcusdt-futures-configuration","title":"Example High risk small account long&short BTCUSDT futures configuration","text":"Set up your config.json from the below snippet to whitelist BTCUSDT and set max USD value to a high value to allow for the symbol.
max_qty_percent_long
and max_qty_pct_short
are set high in this configuration, you can adjust them as needed these are just defaults for testing purposes.
{\n \"api\": {\n \"filename\": \"quantdatav2_bybit.json\",\n \"mode\": \"remote\",\n \"url\": \"https://api.quantumvoid.org/volumedata/\",\n \"data_source_exchange\": \"bybit\"\n },\n \"bot\": {\n \"bot_name\": \"your_bot_name\",\n \"volume_check\": false,\n \"min_distance\": 0.15,\n \"min_volume\": 10000,\n \"upnl_profit_pct\": 0.0032,\n \"max_upnl_profit_pct\": 0.0039,\n \"auto_reduce_enabled\": false,\n \"auto_reduce_start_pct\": 0.068,\n \"entry_during_autoreduce\": false,\n \"stoploss_enabled\": false,\n \"stoploss_upnl_pct\": 0.05,\n \"liq_stoploss_enabled\": false,\n \"liq_price_stop_pct\": 0.50,\n \"percentile_auto_reduce_enabled\": false,\n \"upnl_threshold_pct\": 0.50,\n \"max_pos_balance_pct\": 0.50,\n \"auto_reduce_wallet_exposure_pct\": 0.20,\n \"auto_reduce_maxloss_pct\": 0.30,\n \"auto_reduce_marginbased_enabled\": false,\n \"hedge_ratio\": 0.10,\n \"hedge_price_difference_threshold\": 0.10,\n \"test_orders_enabled\": false,\n \"max_usd_value\": 1000,\n \"min_qty_threshold\": 0,\n \"long_liq_pct\": 0.05,\n \"short_liq_pct\": 0.05,\n \"MaxAbsFundingRate\": 0.0002,\n \"blacklist\": [\"ETHUSDT\"],\n \"whitelist\": [\"BTCUSDT\"],\n \"dashboard_enabled\": true,\n \"shared_data_path\": \"data/\",\n \"linear_grid\": {\n \"grid_behavior\": \"infinite\",\n \"drawdown_behavior\": \"maxqtypercent\",\n \"target_coins_mode\": true,\n \"auto_graceful_stop\": false,\n \"entry_signal_type\": \"lorentzian\",\n \"additional_entries_from_signal\": true,\n \"graceful_stop_long\": false,\n \"graceful_stop_short\": false,\n \"max_qty_percent_long\": 10000,\n \"max_qty_percent_short\": 10000,\n \"auto_reduce_cooldown_enabled\": false,\n \"auto_reduce_cooldown_start_pct\": 0.051,\n \"wallet_exposure_limit_long\": 1,\n \"wallet_exposure_limit_short\": 0.002,\n \"levels\": 4,\n \"strength\": 1.4,\n \"outer_price_distance\": 0.059,\n \"min_outer_price_distance\": 0.019,\n \"max_outer_price_distance\": 0.049,\n \"long_mode\": true,\n \"short_mode\": true,\n \"reissue_threshold\": 0.001,\n \"buffer_percentage\": 0.10,\n \"initial_entry_buffer_pct\": 0.0001,\n \"min_buffer_percentage\": 0.0035,\n \"max_buffer_percentage\": 0.010,\n \"enforce_full_grid\": true,\n \"min_buffer_percentage_ar\": 0.002,\n \"max_buffer_percentage_ar\": 0.004,\n \"upnl_auto_reduce_threshold_long\": 10.0,\n \"upnl_auto_reduce_threshold_short\": 10.0,\n \"failsafe_enabled\": false,\n \"failsafe_start_pct\": 0.05,\n \"long_failsafe_upnl_pct\": 10.0,\n \"short_failsafe_upnl_pct\": 10.0\n },\n \"hotkeys\": {\n \"hotkeys_enabled\": false,\n \"enter_long\": \"1\",\n \"take_profit_long\": \"2\",\n \"enter_short\": \"3\",\n \"take_profit_short\": \"4\"\n }\n },\n \"exchanges\": [\n {\n \"name\": \"bybit\",\n \"account_name\": \"account_1\",\n \"symbols_allowed\": 2\n },\n {\n \"name\": \"bybit_spot\",\n \"account_name\": \"account_2\",\n \"symbols_allowed\": 5\n },\n {\n \"name\": \"bybit_unified\",\n \"account_name\": \"account_3\",\n \"symbols_allowed\": 5\n }\n ],\n \"logger\": {\n \"level\": \"info\"\n },\n \"messengers\": {\n \"discord\": {\n \"active\": false,\n \"embedded_messages\": true,\n \"messenger_type\": \"discord\",\n \"webhook_url\": \"https://discord.com/api/webhooks/your_webhook_id/your_webhook_token\"\n },\n \"telegram\": {\n \"active\": false,\n \"embedded_messages\": true,\n \"messenger_type\": \"telegram\",\n \"bot_token\": \"your_bot_token\",\n \"chat_id\": \"your_chat_id\"\n }\n }\n }\n\n
Now, just run the bot using this multibot version and strategy
python3.11 multi_bot_signalscreener_targetcoin.py --exchange bybit --account_name account_1 --strategy qsgridob --config configs/config.json
This is an aggressive approach because it utilizes a high max_qty_percent_long
and max_qty_percent_short
on a small wallet balance (ie $100 USD) for a symbol with a high USD value with the min notional requirement for BTCUSDT on Bybit it is inherently more risky but also more profitable.
This guide will help you run the Directional Scalper bot using various command-line instructions. Ensure you have properly configured your config.json
and account.json
files before proceeding.
pip3.11 install -r requirements.txt && python3.11 update_config.py --config configs/config.json && mv configs/config.json.new configs/config.json\n
python3.11 multi_bot_v4.py --exchange bybit --account_name account_1 --strategy qsgridob --config configs/config.json\n
"},{"location":"usage/#displaying-the-menu-and-selecting-a-strategy","title":"Displaying the Menu and Selecting a Strategy","text":"To display the menu and select a strategy, use the following command:
python3.11 multi_bot_v4.py --config configs/config.json\n
or
python3.11 multi_bot_v4.py --config configs/config.json\n
"},{"location":"usage/#running-the-bot-with-command-line-parameters","title":"Running the Bot with Command Line Parameters","text":"You can also run the bot directly with specific command-line parameters. Below are examples of different strategies you can use:
"},{"location":"usage/#multi-bot-auto-symbol-rotator-strategy","title":"Multi-Bot Auto Symbol Rotator Strategy","text":"To run the multi-bot auto symbol rotator strategy, use the following command:
python3.11 multi_bot_v4.py --exchange bybit --account_name account_1 --strategy qsgridob --config configs/config.json\n
"},{"location":"usage/#old-single-coin-strategy","title":"Old Single Coin Strategy","text":"To run the old single coin strategy, use the following command: (likely very outdated, but can be updated by anyone or per request)
python3.11 bot.py --exchange bybit --symbol DOGEUSDT --strategy qstrendob --config configs/config.json\n
"},{"location":"usage/#command-line-parameters","title":"Command Line Parameters","text":""},{"location":"usage/#general-parameters","title":"General Parameters","text":"account.json
.config.json
file.python3.11 multi_bot_v4.py --exchange bybit --account_name account_1 --strategy qsgridob --config configs/config.json
python3.11 bot.py --exchange bybit --symbol DOGEUSDT --strategy qstrendob --config configs/config.json
config.json
to suit your trading preferences.This guide provides a straightforward approach to running the Directional Scalper bot with various strategies and configurations. If you encounter any issues, refer to the relevant sections of the documentation for more details.
"}]} \ No newline at end of file diff --git a/sitemap.xml.gz b/sitemap.xml.gz index 8ea9fb7c..253397b2 100644 Binary files a/sitemap.xml.gz and b/sitemap.xml.gz differ diff --git a/strategies/index.html b/strategies/index.html index 407d5712..c7cc2db9 100644 --- a/strategies/index.html +++ b/strategies/index.html @@ -909,6 +909,8 @@