- No Trades Generated
- Position Not Adjusting
- Configuration Not Loading
- Backtest Results Differ from Live Trading
- Testing and Validation
When the strategy fails to generate any trades, the most common causes are overly strict entry conditions or an incorrect pair list configuration.
- Overly strict entry conditions: Entry signal parameters may be disabled or thresholds too high.
- Incorrect pair list: The configured pair list might not contain suitable trading pairs or may be empty.
- Missing timeframe data: Required candle data might not be available for the specified timeframe (5m).
- Blacklisted pairs: Target pairs might be excluded by the blacklist configuration.
- Check logs for entry signal evaluation:
grep "long_entry_condition" user_data/logs/freqtrade.log - Validate pair list availability:
- Confirm that the pair list file (e.g.,
pairlist-volume-binance-usdt.json) exists and contains valid pairs. - Verify the exchange supports the listed pairs.
- Confirm that the pair list file (e.g.,
- Test entry conditions in isolation:
- Temporarily enable all entry conditions in
long_entry_signal_params. - Use
test_NFIX6.pyto validate signal generation logic.
- Temporarily enable all entry conditions in
- Verify configuration loading:
- Ensure
strategyis set toNostalgiaForInfinityX6in config. - Confirm
timeframeis set to5m.
- Ensure
- Relax entry thresholds: Set all
long_entry_condition_*_enableparameters toTruetemporarily. - Use recommended pair list: Employ
pairlist-volume-binance-usdt.jsonor similar volume-based pair lists. - Validate pair availability: Use exchange API to confirm pairs exist and are tradable.
- Check data availability: Ensure sufficient historical data exists for the 5m timeframe.
Section sources
- NostalgiaForInfinityX6.py
- recommended_config.json
When position adjustments (grinding/derisking) fail to trigger, it typically indicates issues with the adjustment logic or configuration.
- Position adjustment disabled:
position_adjustment_enableset toFalse. - Incorrect entry tags: Trade enter tags don't match expected values for adjustment functions.
- Grinding logic not triggered: Profit thresholds or stop conditions not met.
- Insufficient free slots: Rebuy mode requires minimum free slots (
rebuy_mode_min_free_slots).
- Check adjustment enable flag:
print(strategy.position_adjustment_enable) # Should be True
- Verify enter tags in logs:
grep "enter_tag" user_data/logs/freqtrade.log - Test adjustment logic with unit tests:
pytest tests/unit/test_NFIX6.py::test_adjust_trade_position -v
- Inspect grinding parameters:
- Check
grind_*andderisk_*threshold values. - Verify
grinding_enableandderisk_enableareTrue.
- Check
- Enable position adjustment: Set
position_adjustment_enable = True. - Ensure correct tagging: Confirm trades have appropriate tags (e.g., "61" for rebuy, "120" for grind).
- Adjust thresholds: Modify
grind_*_thresholdsto more achievable levels. - Increase free slots: Reduce
rebuy_mode_min_free_slotsif necessary.
flowchart TD
A[Trade Entry] --> B{Has Enter Tag?}
B --> |Yes| C[Parse Tag]
B --> |No| D[Use Default Adjustment]
C --> E{Tag = 61?}
E --> |Yes| F[Call long_rebuy_adjust_trade_position]
E --> |No| G{Tag = 120?}
G --> |Yes| H[Call long_grind_adjust_trade_position]
G --> |No| I[Call Default Adjustment]
Diagram sources
- NostalgiaForInfinityX6.py
- test_NFIX6.py
Section sources
- NostalgiaForInfinityX6.py
- test_NFIX6.py
Configuration loading issues typically stem from JSON syntax errors or incorrect file paths.
- JSON syntax errors: Invalid JSON in configuration files.
- File path issues: Incorrect relative paths in
add_config_files. - Missing required files: Essential configuration files not present.
- Permission issues: Unable to read configuration files.
- Validate JSON syntax:
python -m json.tool configs/recommended_config.json
- Check file paths:
- Verify all paths in
add_config_filesare correct. - Confirm files exist at specified locations.
- Verify all paths in
- Test configuration loading:
freqtrade trade --config user_data/config.json --dry-run
- Check file permissions:
ls -la configs/
- Fix JSON syntax: Use JSON validator to correct syntax errors.
- Use relative paths: Ensure paths in
add_config_filesare relative to config file location. - Include all required files: Make sure
exampleconfig.jsonand secret files are properly configured. - Verify file existence: Confirm all referenced files are present in the filesystem.
Section sources
- recommended_config.json
Discrepancies between backtest and live trading results are commonly caused by data quality or fee model differences.
- Data quality differences: Backtest data may have gaps or inaccuracies.
- Fee model discrepancies: Different fee structures between backtest and live environments.
- Slippage differences: Backtest may not account for real-world slippage.
- Order execution differences: Market conditions affect actual execution prices.
- Compare data sources:
- Verify backtest data is up-to-date and complete.
- Check for missing candles in the dataset.
- Validate fee configuration:
# In strategy custom_fee_open_rate = None # Uses exchange fees custom_fee_close_rate = None
- Analyze execution differences:
- Compare entry/exit prices between backtest and live trades.
- Check for significant price movements during order execution.
- Run consistency tests:
pytest tests/backtests/test_winrate_and_drawdown.py
- Update market data: Download latest market data using:
./tools/download-necessary-exchange-market-data-for-backtests.sh
- Align fee models: Set
custom_fee_open_rateandcustom_fee_close_rateto match exchange fees. - Account for slippage: Adjust
max_slippageparameter to reflect real-world conditions. - Use consistent timeframes: Ensure backtest and live trading use identical timeframes and data sources.
Section sources
- NostalgiaForInfinityX6.py
- test_winrate_and_drawdown.py
Systematic testing is crucial for validating strategy logic and ensuring reliable operation.
The strategy includes comprehensive unit tests in tests/unit/test_NFIX6.py for validating core logic.
# Run all unit tests
pytest tests/unit/
# Test specific functionality
pytest tests/unit/test_NFIX6.py::test_adjust_trade_position -v
pytest tests/unit/test_NFIX6.py::test_custom_exit_calls_correct_functions -v- Adjust trade position logic: Validates correct adjustment function is called based on enter tags.
- Custom exit functions: Ensures proper exit functions are invoked for different entry conditions.
- Signal updates: Tests configuration-driven updates to entry signal parameters.
Use pytest.ini to configure test execution:
[pytest]
addopts=-n 5 -rA -vv -s -p no:cacheprovider -p no:random_order- Start with dry runs: Test strategy with
dry_run = true. - Proceed to paper trading: Validate in live market conditions without real funds.
- Gradual live deployment: Start with small position sizes and monitor performance.
- Systematic validation: Use unit tests and backtests to verify each component.
# Check indicator outputs
grep "indicator" user_data/logs/freqtrade.log
# Analyze signal generation
grep -E "entry_signal|exit_signal" user_data/logs/freqtrade.log
# Monitor position adjustments
grep "adjust_trade_position" user_data/logs/freqtrade.logSection sources
- test_NFIX6.py
- pytest.ini