diff --git a/.nojekyll b/docs/api_reference.md similarity index 100% rename from .nojekyll rename to docs/api_reference.md diff --git a/docs/configuration.md b/docs/configuration.md new file mode 100644 index 00000000..72ffa184 --- /dev/null +++ b/docs/configuration.md @@ -0,0 +1,90 @@ +# Configuration + +## Account Section + +Configure your account settings in the `config.json` file under the `account` section. This includes API keys, account names, and other related settings. + +### Parameters: + +- **api_key**: Your exchange API key. +- **api_secret**: Your exchange API secret. +- **account_name**: A name to identify your account configuration. + +## Bot Section + +Configure your bot settings in the `config.json` file under the `bot` section. This includes strategy parameters, risk management settings, and other related settings. + +### Linear Grid Strategy Parameters + +Here are the parameters for the `linear_grid` strategy in your `config.json` file: + +- **max_qty_percent_long**: Defines the maximum percentage of your wallet balance that can be used for long positions. +- **max_qty_percent_short**: Defines the maximum percentage of your wallet balance that can be used for short positions. +- **auto_reduce_cooldown_enabled**: Boolean parameter that determines whether the auto-reduce cooldown feature is enabled. This feature automatically reduces the size of your positions after a certain period. +- **auto_reduce_cooldown_start_pct**: Defines the percentage at which the auto-reduce cooldown feature starts. +- **wallet_exposure_limit_long**: Defines the maximum exposure limit for long positions as a percentage of your wallet balance. +- **wallet_exposure_limit_short**: Defines the maximum exposure limit for short positions as a percentage of your wallet balance. +- **levels**: Defines the number of grid levels, representing the total number of buy and sell orders placed above and below the current price level. +- **strength**: Defines the strength of the grid. A higher value means the grid levels are spaced further apart. +- **outer_price_distance**: Defines the distance from the current price to the outermost grid levels. +- **min_outer_price_distance**: Defines the minimum distance from the current price to the outermost grid levels. +- **max_outer_price_distance**: Defines the maximum distance from the current price to the outermost grid levels. +- **long_mode**: Boolean parameter that determines whether the bot can open long positions. +- **short_mode**: Boolean parameter that determines whether the bot can open short positions. +- **reissue_threshold**: Defines the threshold at which the bot will reissue orders that have been partially filled. +- **buffer_percentage**: Defines the buffer percentage for the grid. This is the percentage of the price range kept empty between the outermost grid levels and the upper and lower price limits. +- **initial_entry_buffer_pct**: Defines the buffer percentage for the initial entry. +- **min_buffer_percentage**: Defines the minimum buffer percentage for the grid. +- **max_buffer_percentage**: Defines the maximum buffer percentage for the grid. +- **enforce_full_grid**: Boolean parameter that determines whether the bot should always maintain a full grid of orders. +- **min_buffer_percentage_ar**: Defines the minimum buffer percentage for auto-reduce. +- **max_buffer_percentage_ar**: Defines the maximum buffer percentage for auto-reduce. +- **upnl_auto_reduce_threshold_long**: Defines the unrealized profit and loss (UPNL) threshold for auto-reducing long positions. +- **upnl_auto_reduce_threshold_short**: Defines the UPNL threshold for auto-reducing short positions. +- **failsafe_enabled**: Boolean parameter that determines whether the failsafe feature is enabled. This feature automatically closes all positions if the UPNL reaches a certain threshold. +- **failsafe_start_pct**: Defines the percentage at which the failsafe feature starts. +- **long_failsafe_upnl_pct**: Defines the UPNL percentage for the long failsafe. +- **short_failsafe_upnl_pct**: Defines the UPNL percentage for the short failsafe. + +### Example Configuration Snippet + +```json +{ + "account": { + "api_key": "your_api_key", + "api_secret": "your_api_secret", + "account_name": "account_1" + }, + "bot": { + "linear_grid": { + "max_qty_percent_long": 50, + "max_qty_percent_short": 50, + "auto_reduce_cooldown_enabled": true, + "auto_reduce_cooldown_start_pct": 10, + "wallet_exposure_limit_long": 30, + "wallet_exposure_limit_short": 30, + "levels": 10, + "strength": 2, + "outer_price_distance": 5, + "min_outer_price_distance": 2, + "max_outer_price_distance": 10, + "long_mode": true, + "short_mode": true, + "reissue_threshold": 5, + "buffer_percentage": 1, + "initial_entry_buffer_pct": 0.5, + "min_buffer_percentage": 0.2, + "max_buffer_percentage": 2, + "enforce_full_grid": true, + "min_buffer_percentage_ar": 0.2, + "max_buffer_percentage_ar": 2, + "upnl_auto_reduce_threshold_long": 10, + "upnl_auto_reduce_threshold_short": 10, + "failsafe_enabled": true, + "failsafe_start_pct": 50, + "long_failsafe_upnl_pct": -20, + "short_failsafe_upnl_pct": -20 + } + } +} +``` \ No newline at end of file diff --git a/docs/docker.md b/docs/docker.md new file mode 100644 index 00000000..e69de29b diff --git a/docs/index.md b/docs/index.md new file mode 100644 index 00000000..ddd5ed35 --- /dev/null +++ b/docs/index.md @@ -0,0 +1,3 @@ +# Directional Scalper + +Welcome to the documentation for Directional Scalper. diff --git a/docs/installation.md b/docs/installation.md new file mode 100644 index 00000000..766d9dbe --- /dev/null +++ b/docs/installation.md @@ -0,0 +1,95 @@ +# Installation + +## Prerequisites + +Before you begin, ensure you have the following prerequisites: + +- Python 3.11+ +- pip + +## Quickstart + +1. Clone the repository: + ``git clone https://github.com/donewiththedollar/directionalscalper.git`` + + Change current working directory to the project directory: + ``cd directionalscalper`` + +2. Install the required dependencies: + ``` + pip3.11 install -r requirements.txt + ``` + +3. Add your API key(s) to the `config.json` file located in the `/configs` folder. + +4. Run the bot: + - To display the menu and select a strategy, use the following command: + ``` + python3.11 multi_bot_signalscreener.py --config config.json + ``` + or + ``` + python3.11 multi_bot.py --config config.json + ``` + - Alternatively, you can run the bot with command line parameters: + - For the multi-bot auto symbol rotator strategy: + ``` + python3.11 multi_bot_signalscreener_multicore.py --exchange bybit --account_name account_1 --strategy qsgridob --config config.json + ``` + - For the old single coin strategy: + ``` + python3.11 bot.py --exchange bybit --symbol DOGEUSDT --strategy qstrendob --config config.json + ``` + +## Installing Python 3.11 + +To install Python 3.11 on your system, follow these steps: + +1. 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 + ``` + +2. 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 + ``` + +3. Extract the downloaded archive: + ``` + sudo tar -xzf Python-3.11.0.tgz + ``` + +4. Change to the extracted directory: + ``` + cd Python-3.11.0 + ``` + +5. Configure the build with optimizations: + ``` + sudo ./configure --enable-optimizations --prefix=/usr/local + ``` + +6. Compile Python: + ``` + sudo make -j 8 + ``` + +7. Install Python 3.11: + ``` + sudo make altinstall + ``` + +8. 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. diff --git a/docs/strategies.md b/docs/strategies.md new file mode 100644 index 00000000..e69de29b diff --git a/docs/telegram_alerts.md b/docs/telegram_alerts.md new file mode 100644 index 00000000..e69de29b diff --git a/docs/usage.md b/docs/usage.md new file mode 100644 index 00000000..e69de29b diff --git a/mkdocs.yml b/mkdocs.yml new file mode 100644 index 00000000..e75ffeb6 --- /dev/null +++ b/mkdocs.yml @@ -0,0 +1,21 @@ +site_name: Directional Scalper Documentation +theme: + name: material + features: + - navigation.tabs + - navigation.sections + palette: + primary: 'indigo' + accent: 'indigo' + font: + text: 'Roboto' + code: 'Roboto Mono' +nav: + - Home: index.md + - Installation: installation.md + - Usage: usage.md + - Configuration: configuration.md + - Strategies: strategies.md + - API Reference: api_reference.md + - Docker: docker.md + - Telegram Alerts: telegram_alerts.md diff --git a/404.html b/site/404.html similarity index 100% rename from 404.html rename to site/404.html diff --git a/api_reference/index.html b/site/api_reference/index.html similarity index 100% rename from api_reference/index.html rename to site/api_reference/index.html diff --git a/assets/images/favicon.png b/site/assets/images/favicon.png similarity index 100% rename from assets/images/favicon.png rename to site/assets/images/favicon.png diff --git a/assets/javascripts/bundle.ad660dcc.min.js b/site/assets/javascripts/bundle.ad660dcc.min.js similarity index 100% rename from assets/javascripts/bundle.ad660dcc.min.js rename to site/assets/javascripts/bundle.ad660dcc.min.js diff --git a/assets/javascripts/bundle.ad660dcc.min.js.map b/site/assets/javascripts/bundle.ad660dcc.min.js.map similarity index 100% rename from assets/javascripts/bundle.ad660dcc.min.js.map rename to site/assets/javascripts/bundle.ad660dcc.min.js.map diff --git a/assets/javascripts/lunr/min/lunr.ar.min.js b/site/assets/javascripts/lunr/min/lunr.ar.min.js similarity index 100% rename from assets/javascripts/lunr/min/lunr.ar.min.js rename to site/assets/javascripts/lunr/min/lunr.ar.min.js diff --git a/assets/javascripts/lunr/min/lunr.da.min.js b/site/assets/javascripts/lunr/min/lunr.da.min.js similarity index 100% rename from assets/javascripts/lunr/min/lunr.da.min.js rename to site/assets/javascripts/lunr/min/lunr.da.min.js diff --git a/assets/javascripts/lunr/min/lunr.de.min.js b/site/assets/javascripts/lunr/min/lunr.de.min.js similarity index 100% rename from assets/javascripts/lunr/min/lunr.de.min.js rename to site/assets/javascripts/lunr/min/lunr.de.min.js diff --git a/assets/javascripts/lunr/min/lunr.du.min.js b/site/assets/javascripts/lunr/min/lunr.du.min.js similarity index 100% rename from assets/javascripts/lunr/min/lunr.du.min.js rename to site/assets/javascripts/lunr/min/lunr.du.min.js diff --git a/assets/javascripts/lunr/min/lunr.el.min.js b/site/assets/javascripts/lunr/min/lunr.el.min.js similarity index 100% rename from assets/javascripts/lunr/min/lunr.el.min.js rename to site/assets/javascripts/lunr/min/lunr.el.min.js diff --git a/assets/javascripts/lunr/min/lunr.es.min.js b/site/assets/javascripts/lunr/min/lunr.es.min.js similarity index 100% rename from assets/javascripts/lunr/min/lunr.es.min.js rename to site/assets/javascripts/lunr/min/lunr.es.min.js diff --git a/assets/javascripts/lunr/min/lunr.fi.min.js b/site/assets/javascripts/lunr/min/lunr.fi.min.js similarity index 100% rename from assets/javascripts/lunr/min/lunr.fi.min.js rename to site/assets/javascripts/lunr/min/lunr.fi.min.js diff --git a/assets/javascripts/lunr/min/lunr.fr.min.js b/site/assets/javascripts/lunr/min/lunr.fr.min.js similarity index 100% rename from assets/javascripts/lunr/min/lunr.fr.min.js rename to site/assets/javascripts/lunr/min/lunr.fr.min.js diff --git a/assets/javascripts/lunr/min/lunr.he.min.js b/site/assets/javascripts/lunr/min/lunr.he.min.js similarity index 100% rename from assets/javascripts/lunr/min/lunr.he.min.js rename to site/assets/javascripts/lunr/min/lunr.he.min.js diff --git a/assets/javascripts/lunr/min/lunr.hi.min.js b/site/assets/javascripts/lunr/min/lunr.hi.min.js similarity index 100% rename from assets/javascripts/lunr/min/lunr.hi.min.js rename to site/assets/javascripts/lunr/min/lunr.hi.min.js diff --git a/assets/javascripts/lunr/min/lunr.hu.min.js b/site/assets/javascripts/lunr/min/lunr.hu.min.js similarity index 100% rename from assets/javascripts/lunr/min/lunr.hu.min.js rename to site/assets/javascripts/lunr/min/lunr.hu.min.js diff --git a/assets/javascripts/lunr/min/lunr.hy.min.js b/site/assets/javascripts/lunr/min/lunr.hy.min.js similarity index 100% rename from assets/javascripts/lunr/min/lunr.hy.min.js rename to site/assets/javascripts/lunr/min/lunr.hy.min.js diff --git a/assets/javascripts/lunr/min/lunr.it.min.js b/site/assets/javascripts/lunr/min/lunr.it.min.js similarity index 100% rename from assets/javascripts/lunr/min/lunr.it.min.js rename to site/assets/javascripts/lunr/min/lunr.it.min.js diff --git a/assets/javascripts/lunr/min/lunr.ja.min.js b/site/assets/javascripts/lunr/min/lunr.ja.min.js similarity index 100% rename from assets/javascripts/lunr/min/lunr.ja.min.js rename to site/assets/javascripts/lunr/min/lunr.ja.min.js diff --git a/assets/javascripts/lunr/min/lunr.jp.min.js b/site/assets/javascripts/lunr/min/lunr.jp.min.js similarity index 100% rename from assets/javascripts/lunr/min/lunr.jp.min.js rename to site/assets/javascripts/lunr/min/lunr.jp.min.js diff --git a/assets/javascripts/lunr/min/lunr.kn.min.js b/site/assets/javascripts/lunr/min/lunr.kn.min.js similarity index 100% rename from assets/javascripts/lunr/min/lunr.kn.min.js rename to site/assets/javascripts/lunr/min/lunr.kn.min.js diff --git a/assets/javascripts/lunr/min/lunr.ko.min.js b/site/assets/javascripts/lunr/min/lunr.ko.min.js similarity index 100% rename from assets/javascripts/lunr/min/lunr.ko.min.js rename to site/assets/javascripts/lunr/min/lunr.ko.min.js diff --git a/assets/javascripts/lunr/min/lunr.multi.min.js b/site/assets/javascripts/lunr/min/lunr.multi.min.js similarity index 100% rename from assets/javascripts/lunr/min/lunr.multi.min.js rename to site/assets/javascripts/lunr/min/lunr.multi.min.js diff --git a/assets/javascripts/lunr/min/lunr.nl.min.js b/site/assets/javascripts/lunr/min/lunr.nl.min.js similarity index 100% rename from assets/javascripts/lunr/min/lunr.nl.min.js rename to site/assets/javascripts/lunr/min/lunr.nl.min.js diff --git a/assets/javascripts/lunr/min/lunr.no.min.js b/site/assets/javascripts/lunr/min/lunr.no.min.js similarity index 100% rename from assets/javascripts/lunr/min/lunr.no.min.js rename to site/assets/javascripts/lunr/min/lunr.no.min.js diff --git a/assets/javascripts/lunr/min/lunr.pt.min.js b/site/assets/javascripts/lunr/min/lunr.pt.min.js similarity index 100% rename from assets/javascripts/lunr/min/lunr.pt.min.js rename to site/assets/javascripts/lunr/min/lunr.pt.min.js diff --git a/assets/javascripts/lunr/min/lunr.ro.min.js b/site/assets/javascripts/lunr/min/lunr.ro.min.js similarity index 100% rename from assets/javascripts/lunr/min/lunr.ro.min.js rename to site/assets/javascripts/lunr/min/lunr.ro.min.js diff --git a/assets/javascripts/lunr/min/lunr.ru.min.js b/site/assets/javascripts/lunr/min/lunr.ru.min.js similarity index 100% rename from assets/javascripts/lunr/min/lunr.ru.min.js rename to site/assets/javascripts/lunr/min/lunr.ru.min.js diff --git a/assets/javascripts/lunr/min/lunr.sa.min.js b/site/assets/javascripts/lunr/min/lunr.sa.min.js similarity index 100% rename from assets/javascripts/lunr/min/lunr.sa.min.js rename to site/assets/javascripts/lunr/min/lunr.sa.min.js diff --git a/assets/javascripts/lunr/min/lunr.stemmer.support.min.js b/site/assets/javascripts/lunr/min/lunr.stemmer.support.min.js similarity index 100% rename from assets/javascripts/lunr/min/lunr.stemmer.support.min.js rename to site/assets/javascripts/lunr/min/lunr.stemmer.support.min.js diff --git a/assets/javascripts/lunr/min/lunr.sv.min.js b/site/assets/javascripts/lunr/min/lunr.sv.min.js similarity index 100% rename from assets/javascripts/lunr/min/lunr.sv.min.js rename to site/assets/javascripts/lunr/min/lunr.sv.min.js diff --git a/assets/javascripts/lunr/min/lunr.ta.min.js b/site/assets/javascripts/lunr/min/lunr.ta.min.js similarity index 100% rename from assets/javascripts/lunr/min/lunr.ta.min.js rename to site/assets/javascripts/lunr/min/lunr.ta.min.js diff --git a/assets/javascripts/lunr/min/lunr.te.min.js b/site/assets/javascripts/lunr/min/lunr.te.min.js similarity index 100% rename from assets/javascripts/lunr/min/lunr.te.min.js rename to site/assets/javascripts/lunr/min/lunr.te.min.js diff --git a/assets/javascripts/lunr/min/lunr.th.min.js b/site/assets/javascripts/lunr/min/lunr.th.min.js similarity index 100% rename from assets/javascripts/lunr/min/lunr.th.min.js rename to site/assets/javascripts/lunr/min/lunr.th.min.js diff --git a/assets/javascripts/lunr/min/lunr.tr.min.js b/site/assets/javascripts/lunr/min/lunr.tr.min.js similarity index 100% rename from assets/javascripts/lunr/min/lunr.tr.min.js rename to site/assets/javascripts/lunr/min/lunr.tr.min.js diff --git a/assets/javascripts/lunr/min/lunr.vi.min.js b/site/assets/javascripts/lunr/min/lunr.vi.min.js similarity index 100% rename from assets/javascripts/lunr/min/lunr.vi.min.js rename to site/assets/javascripts/lunr/min/lunr.vi.min.js diff --git a/assets/javascripts/lunr/min/lunr.zh.min.js b/site/assets/javascripts/lunr/min/lunr.zh.min.js similarity index 100% rename from assets/javascripts/lunr/min/lunr.zh.min.js rename to site/assets/javascripts/lunr/min/lunr.zh.min.js diff --git a/assets/javascripts/lunr/tinyseg.js b/site/assets/javascripts/lunr/tinyseg.js similarity index 100% rename from assets/javascripts/lunr/tinyseg.js rename to site/assets/javascripts/lunr/tinyseg.js diff --git a/assets/javascripts/lunr/wordcut.js b/site/assets/javascripts/lunr/wordcut.js similarity index 100% rename from assets/javascripts/lunr/wordcut.js rename to site/assets/javascripts/lunr/wordcut.js diff --git a/assets/javascripts/workers/search.b8dbb3d2.min.js b/site/assets/javascripts/workers/search.b8dbb3d2.min.js similarity index 100% rename from assets/javascripts/workers/search.b8dbb3d2.min.js rename to site/assets/javascripts/workers/search.b8dbb3d2.min.js diff --git a/assets/javascripts/workers/search.b8dbb3d2.min.js.map b/site/assets/javascripts/workers/search.b8dbb3d2.min.js.map similarity index 100% rename from assets/javascripts/workers/search.b8dbb3d2.min.js.map rename to site/assets/javascripts/workers/search.b8dbb3d2.min.js.map diff --git a/assets/stylesheets/main.6543a935.min.css b/site/assets/stylesheets/main.6543a935.min.css similarity index 100% rename from assets/stylesheets/main.6543a935.min.css rename to site/assets/stylesheets/main.6543a935.min.css diff --git a/assets/stylesheets/main.6543a935.min.css.map b/site/assets/stylesheets/main.6543a935.min.css.map similarity index 100% rename from assets/stylesheets/main.6543a935.min.css.map rename to site/assets/stylesheets/main.6543a935.min.css.map diff --git a/assets/stylesheets/palette.06af60db.min.css b/site/assets/stylesheets/palette.06af60db.min.css similarity index 100% rename from assets/stylesheets/palette.06af60db.min.css rename to site/assets/stylesheets/palette.06af60db.min.css diff --git a/assets/stylesheets/palette.06af60db.min.css.map b/site/assets/stylesheets/palette.06af60db.min.css.map similarity index 100% rename from assets/stylesheets/palette.06af60db.min.css.map rename to site/assets/stylesheets/palette.06af60db.min.css.map diff --git a/configuration/index.html b/site/configuration/index.html similarity index 100% rename from configuration/index.html rename to site/configuration/index.html diff --git a/docker/index.html b/site/docker/index.html similarity index 100% rename from docker/index.html rename to site/docker/index.html diff --git a/index.html b/site/index.html similarity index 100% rename from index.html rename to site/index.html diff --git a/installation/index.html b/site/installation/index.html similarity index 100% rename from installation/index.html rename to site/installation/index.html diff --git a/search/search_index.json b/site/search/search_index.json similarity index 100% rename from search/search_index.json rename to site/search/search_index.json diff --git a/sitemap.xml b/site/sitemap.xml similarity index 100% rename from sitemap.xml rename to site/sitemap.xml diff --git a/sitemap.xml.gz b/site/sitemap.xml.gz similarity index 100% rename from sitemap.xml.gz rename to site/sitemap.xml.gz diff --git a/strategies/index.html b/site/strategies/index.html similarity index 100% rename from strategies/index.html rename to site/strategies/index.html diff --git a/telegram_alerts/index.html b/site/telegram_alerts/index.html similarity index 100% rename from telegram_alerts/index.html rename to site/telegram_alerts/index.html diff --git a/usage/index.html b/site/usage/index.html similarity index 100% rename from usage/index.html rename to site/usage/index.html