- Prerequisites
- Cloning the Repository
- Setting Up Python Environment
- Installing TA-Lib
- Installing Dependencies via pyproject.toml
- Configuring Freqtrade
- Setting Up API Keys and Exchange Credentials
- Running with Docker
- Validating Configuration and Strategy
- Troubleshooting Common Issues
- Security Best Practices
Before setting up the NostalgiaForInfinityX6 strategy, ensure the following prerequisites are met:
- Python 3.9+: The strategy requires Python 3.9 or higher. The
pyproject.tomlfile specifiesrequires-python = ">=3.12", so Python 3.12 or later is recommended. - Freqtrade Installation: Freqtrade must be installed either locally or via Docker. The repository uses Freqtrade as the trading bot framework.
- API Keys for Target Exchanges: You need valid API keys from your chosen cryptocurrency exchange (e.g., Binance, OKX, Kucoin). These keys allow the bot to interact with the exchange for trading.
- Basic Understanding of Trading Bots: Familiarity with how trading bots operate, including concepts like dry-run mode, backtesting, and live trading, is essential for proper configuration and monitoring.
Section sources
- pyproject.toml
- README.md
To begin, clone the NostalgiaForInfinityX6 repository from GitHub:
git clone https://github.com/iterativv/NostalgiaForInfinity.git
cd NostalgiaForInfinityThis will download the complete project structure, including strategies, configuration files, Docker setups, and test scripts.
Section sources
- README.md
It is highly recommended to use a virtual environment to manage dependencies and avoid conflicts with other Python projects.
python -m venv venv- On Windows:
venv\Scripts\activate
- On macOS/Linux:
source venv/bin/activate
Once activated, all subsequent Python and pip commands will use this isolated environment.
Section sources
- pyproject.toml
The NostalgiaForInfinityX6 strategy relies on TA-Lib for technical indicator calculations. Install TA-Lib using the following steps:
Download the precompiled TA-Lib wheel from Christoph Gohlke's website and install it using pip:
pip install TA_Lib‑0.4.24‑cp312‑cp312‑win_amd64.whlbrew install ta-lib
pip install TA-Libsudo apt-get install build-essential wget
wget http://prdownloads.sourceforge.net/ta-lib/ta-lib-0.4.0-src.tar.gz
tar -xzf ta-lib-0.4.0-src.tar.gz
cd ta-lib/
./configure --prefix=/usr
make
sudo make install
cd ..
pip install TA-LibVerify installation by running:
import talib
print(talib.__version__)Section sources
- NostalgiaForInfinityX6.py
The project uses pyproject.toml for dependency management. With your virtual environment activated, install the required packages:
pip install -e .This command installs the project in editable mode along with its dependencies, which currently include only freqtrade. The installation respects the Python version constraint specified in the file.
Section sources
- pyproject.toml
Proper configuration is crucial for the strategy to function correctly.
Start by copying the recommended configuration file to your Freqtrade user data directory:
cp configs/recommended_config.json user_data/config.jsonThe recommended_config.json file contains essential settings, including the strategy name and a list of additional configuration files to load:
{
"strategy": "NostalgiaForInfinityX6",
"add_config_files": [
"../configs/trading_mode-spot.json",
"../configs/pairlist-volume-binance-usdt.json",
"../configs/blacklist-binance.json",
"../configs/exampleconfig.json",
"../configs/exampleconfig_secret.json"
]
}These files define trading mode, pair selection, blacklists, and secret credentials.
Section sources
- configs/recommended_config.json
Sensitive credentials should be stored securely.
cp configs/exampleconfig_secret.json user_data/config-private.jsonEdit user_data/config-private.json to add your exchange API credentials:
"exchange": {
"name": "binance",
"key": "YOUR_API_KEY",
"secret": "YOUR_API_SECRET",
"password": "YOUR_API_PASSWORD" // if required by exchange
}Ensure dry_run is set to true during initial testing.
Section sources
- configs/exampleconfig_secret.json
Docker provides an isolated and reproducible environment for running the bot.
The docker-compose.yml file defines the production setup:
services:
freqtrade:
<<: *common-settings
container_name: ${FREQTRADE__BOT_NAME:-Example_Test_Account}_${FREQTRADE__EXCHANGE__NAME:-binance}_${FREQTRADE__TRADING_MODE:-futures}-${FREQTRADE__STRATEGY:-NostalgiaForInfinityX6}
ports:
- "${FREQTRADE__API_SERVER__LISTEN_PORT:-8080}:${FREQTRADE__API_SERVER__LISTEN_PORT:-8080}"
command: >
trade
--db-url sqlite:////freqtrade/user_data/${FREQTRADE__BOT_NAME:-Example_Test_Account}_${FREQTRADE__EXCHANGE__NAME:-binance}_${FREQTRADE__TRADING_MODE:-futures}-tradesv3.sqlite
--log-file user_data/logs/${FREQTRADE__BOT_NAME:-Example_Test_Account}-${FREQTRADE__EXCHANGE__NAME:-binance}-${FREQTRADE__STRATEGY:-NostalgiaForInfinityX6}-${FREQTRADE__TRADING_MODE:-futures}.log
--strategy-path .To start the bot in dry-run mode:
docker-compose upEnvironment variables can be set in a .env file or passed directly.
For backtesting and analysis, use the testing configuration:
docker-compose -f docker-compose.tests.yml up backtestingThis runs backtesting with predefined parameters and time ranges. Other services like backtesting-analysis, plot-dataframe, and plot-profit are available for detailed performance evaluation.
Section sources
- docker-compose.yml
- docker-compose.tests.yml
Before going live, validate that everything is set up correctly.
Run the bot in dry-run mode to verify the strategy loads:
freqtrade trade --config user_data/config.json --strategy NostalgiaForInfinityX6 --dry-runLook for log messages confirming the strategy has been loaded and indicators are being calculated.
Use Freqtrade's built-in configuration validation:
freqtrade check --config user_data/config.jsonThis command checks for syntax errors and missing required fields.
Perform a backtest to ensure the strategy behaves as expected:
freqtrade backtesting --config user_data/config.json --strategy NostalgiaForInfinityX6 --timerange 20230101-20231231Review the results in the user_data/backtest_results/ directory.
Section sources
- NostalgiaForInfinityX6.py
- configs/recommended_config.json
If you encounter import errors (e.g., ModuleNotFoundError: No module named 'talib'), ensure TA-Lib is installed correctly and that you are using the correct Python environment.
- Verify API keys are copied correctly without extra spaces.
- Ensure the exchange name in
config-private.jsonmatches Freqtrade's expected format (e.g.,"binance","okx"). - Check that the API key has the necessary permissions (trading enabled).
Use a JSON validator to check config.json and config-private.json for syntax errors like missing commas or unmatched brackets.
- Confirm the strategy file
NostalgiaForInfinityX6.pyis located inuser_data/strategies/. - Ensure the class name in the Python file matches the strategy name in the config (
NostalgiaForInfinityX6).
Section sources
- configs/exampleconfig_secret.json
- NostalgiaForInfinityX6.py
- NostalgiaForInfinityX6.py
- Never Commit Secrets: Ensure
config-private.jsonand.envfiles are not committed to version control. The repository should already include these in.gitignore. - Use Limited-Permission API Keys: Create API keys with only the permissions necessary (e.g., trade, but not withdraw).
- Store Secrets Securely: Keep API keys in a secure location, preferably using a secrets manager in production.
- Regularly Rotate Keys: Periodically regenerate API keys to minimize the impact of potential leaks.
- Monitor Logs: Avoid logging sensitive information. Freqtrade generally handles this well, but custom logging should be reviewed.
Section sources
- configs/exampleconfig_secret.json
- docker-compose.yml