⚙️ Complete Settings Reference
This reference covers every configurable setting in FxMath Evolution, organized by feature area. Default values are shown in bold.
📊 Live Trading Instance Settings
Each Trading Instance represents one trading strategy running on a specific symbol. You can create unlimited instances to trade multiple pairs simultaneously. Configured via the "⚙️ Instances → ➕ Add Instance" dialog.
1. General Settings
| Parameter | Default | Description |
|---|---|---|
name |
— | A unique label for this instance (e.g., "XAUUSD-Primary"). Used to identify the instance in logs and the dashboard. |
symbol |
— | The trading symbol / instrument. Supports any symbol available in your MT5: forex pairs (EURUSD), metals (XAUUSD), indices, cryptocurrencies (ETHUSD, BTCUSD), and commodities. |
timeframes |
M5 M15 M30 | Space-separated list of timeframes to analyze. Each timeframe gets its own dedicated LightGBM model. The system votes across all TFs before trading. Recommended: 3 timeframes (M5, M15, M30) for balanced confluence, but any combination works. |
main_timeframe |
Middle TF | The primary timeframe used for candle counting rhythm and SL/TP ATR calculation. Defaults to the middle timeframe in your list. Must be one of the selected timeframes. |
magic_number |
123456 | Unique identifier assigned to all orders placed by this instance. Used to filter positions belonging to this bot in MT5, allowing multiple instances or EAs to coexist without interference. |
model_path |
— | Path to pre-trained model files (only used when Online Learning is disabled). Expects files named basepath_M5.pkl, basepath_M15.pkl, etc. Leave empty when using Online Learning — models are trained automatically. |
2. Risk Management
| Parameter | Default | Description |
|---|---|---|
risk_percent |
1.0 | Percentage of account balance to risk per trade. At 1.0%, a $10,000 account risks $100 per trade. This is used in dynamic lot sizing — the system calculates the exact lot size so that if SL is hit, the loss equals exactly this percentage. Range: 0.1–5.0 recommended. |
sl_multiplier |
1.5 | Stop Loss distance = ATR(14) × sl_multiplier. ATR is the Average True Range measured over 14 periods. At 1.5×, if ATR = 20 pips, SL = 30 pips. Higher values = wider stops (fewer stop-outs but larger losses). Lower values = tighter stops (more frequent stop-outs but smaller per-trade risk). |
tp_ratio |
3.0 | Take Profit distance = SL distance × tp_ratio. At 3.0× with SL = 30 pips, TP = 90 pips (1:3 risk-reward). Higher ratios mean larger winners when right, but TP is less likely to be hit. Must be ≥ 1.5. |
use_fixed_lot |
false | When enabled, ignores risk_percent and uses a fixed lot size instead. Useful for consistency when account balance fluctuates significantly, or when your broker requires specific lot sizes. |
fixed_lot |
0.01 | The fixed lot size to use when use_fixed_lot is enabled. 0.01 = micro lot, 0.10 = mini lot, 1.00 = standard lot. Check your broker's minimum and step requirements. |
use_fixed_sl_tp |
false | When enabled, overrides ATR-based SL/TP with fixed pip values. Use only if you want constant SL/TP regardless of market volatility. Not recommended — ATR-based stops adapt to market conditions. |
fixed_sl_pips |
0 | Fixed stop loss in pips (only used when use_fixed_sl_tp is enabled). For a 4-digit broker, 1 pip = 0.0001. For a 5-digit broker, 1 pip = 0.00010 (10 points). |
fixed_tp_pips |
0 | Fixed take profit in pips (only used when use_fixed_sl_tp is enabled). |
3. Machine Learning & Online Learning
| Parameter | Default | Description | ||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|
enable_online_learning |
true | When enabled, the system automatically trains and retrains LightGBM models using live market data. No pre-trained model files needed. This is the core feature of FxMath Evolution — the AI constantly adapts to current market conditions. When disabled, you must supply pre-trained .pkl model files. | ||||||||||
retrain_interval |
10 | Number of candles on the main_timeframe between full retraining cycles. Every N candles, the system: (1) fetches the latest training data, (2) engineers all 12 features, (3) generates SL/TP hit-test labels, (4) trains 3 fresh models (one per TF). Lower = more adaptive but higher CPU usage. Higher = more stable but slower to adapt. |
||||||||||
training_bars |
500 | Number of historical bars used for each training session. Models are trained on the most recent N bars of data. More bars = more training data (better generalization) but slower training. Less bars = faster training but may miss longer patterns. Must be > 100 (minimum for indicator warmup). | ||||||||||
horizon |
10 | Prediction horizon (bars forward). The system looks N bars ahead to label each training bar: "Was TP hit before SL?" This is how labels 0 (SELL) and 1 (BUY) are generated. Higher = longer-term predictions but more label noise. Lower = short-term predictions but higher signal frequency. Must match the time horizon your strategy targets. | ||||||||||
sl_atr_multiplier |
1.5 | ATR multiplier used during model training for SL/TP hit-test labeling. Should match sl_multiplier for consistency between training and live execution. Note: this is applied during the labeling step, not live order placement (that uses sl_multiplier). |
||||||||||
tp_atr_multiplier |
3.0 | ATR multiplier used during model training for TP target in labeling. Should match tp_ratio × sl_multiplier for consistency. |
||||||||||
min_confidence |
0.6 | Minimum probability threshold for a signal to be considered valid. The model outputs probabilities (0.0–1.0) for each class. If the highest probability is below this threshold, the system returns NONE (no trade). Also used as the minimum confidence for a timeframe to cast a vote in the aggregation. Range: 0.5–0.9 recommended. | ||||||||||
vote_threshold |
2 | Minimum number of timeframes that must agree on a signal (BUY or SELL) before a trade is executed. For 3 timeframes: 2 means majority rules, 3 means unanimous. Higher = fewer but higher-conviction trades. | ||||||||||
model_params |
— |
Advanced: LightGBM hyperparameters used during model training.
|
||||||||||
4. Position Management
| Parameter | Default | Description |
|---|---|---|
use_trailing_stop |
false | When enabled, the system automatically moves the Stop Loss upward (for BUY) or downward (for SELL) as the price moves in your favor. Locks in profits without manual intervention. |
trailing_start_percent |
50% | Percentage of TP distance that must be reached before trailing begins. At 50% and TP = 90 pips, trailing activates when the position shows 45 pips profit. Prevents premature trailing on small fluctuations. |
trailing_distance_percent |
30% | Distance (as % of TP distance) that the trailing stop maintains behind the current price. At 30% and TP = 90 pips, the SL trails 27 pips behind the best price reached. |
use_breakeven |
false | When enabled, moves the Stop Loss to entry price + lock pips once the trade reaches a certain profit level. Ensures the trade cannot go from winning to losing. |
be_trigger_percent |
50% | Percentage of TP distance required to trigger breakeven. At 50% and TP = 90 pips, breakeven activates at 45 pips profit. Only fires once per position. |
be_lock_pips |
5 | Pips locked above entry when breakeven triggers. SL = entry price + lock pips (for BUY) or entry price − lock pips (for SELL). 5 pips ensures the trade covers the spread and still makes a small profit. |
5. Trading Filters
| Parameter | Default | Description |
|---|---|---|
use_time_filter |
false | When enabled, restricts trading to specific hours of the day. Useful for trading only during high-liquidity sessions (London/NY overlap) or avoiding low-volatility periods. Handles overnight sessions that cross midnight. |
start_time |
08:00 | Trading window start time in HH:MM format (server time). Trades will only be executed at or after this time (when time filter is enabled). |
end_time |
17:00 | Trading window end time in HH:MM format. Trades will only be executed before this time. Supports overnight windows (e.g., 22:00–06:00). |
timezone |
Server Time | Label for the timezone used (currently uses the broker/server time from MT5). Informational only. |
use_news_filter |
false | When enabled, pauses trading during high-impact economic news events. Avoids volatile spread widening and unpredictable price spikes during news releases. Uses ForexFactory calendar data. |
before_news_minutes |
30 | Minutes before a news event to stop trading. Creates a blackout window before the release to avoid the buildup. |
after_news_minutes |
30 | Minutes after a news event to resume trading. Lets the market settle after the initial volatility burst. |
news_impact |
High Only | Filter by impact level: "High Only," "Medium & High," or "All." High-impact events (FOMC, NFP, CPI) cause the most volatility and are recommended as a minimum filter. |
6. Custom Indicator Parameters
| Parameter | Default | Description |
|---|---|---|
rsi_period |
14 | Period for the Relative Strength Index. Lower = more sensitive to recent price changes. Higher = smoother. Range: 7–21 recommended. |
sma_fast |
20 | Fast Simple Moving Average period. Used for short-term trend direction and the price_to_sma20 feature. |
sma_slow |
50 | Slow Simple Moving Average period. Represents medium-term trend direction. |
atr_period |
14 | Period for Average True Range — the core volatility measure. ATR over this period determines SL/TP distances and affects all volatility-sensitive features. |
adx_period |
14 | Period for the Average Directional Index. Measures trend strength. ADX > 25 indicates a strong trend; ADX < 25 indicates ranging/choppy conditions. |
bb_period |
20 | Period for Bollinger Bands. Determines the center SMA and the lookback for standard deviation calculation. |
macd_fast |
12 | Fast EMA period for MACD calculation. |
macd_slow |
26 | Slow EMA period for MACD calculation. |
Pro Tip: The indicator parameters affect both training and prediction. If you change them mid-session, the next retrain cycle will use the new values. Changing atr_period also changes your SL/TP distances since they are ATR-based.
🚀 Strategy Optimizer Settings
The Strategy Optimizer (accessible via the "🚀 Optimizer" sidebar tab) performs a random search over parameter space to find the best configuration for a given symbol and timeframe combination. It runs a walk-forward backtest simulation for each parameter combination and saves the best result to the SQLite database.
1. Optimizer Run Parameters
| Parameter | Default | Description |
|---|---|---|
symbol |
XAUUSD | The symbol to optimize for. The optimzer fetches historical data for this symbol across all selected timeframes. |
main_timeframe |
M15 | The primary timeframe for the optimization. SL/TP ATR values and candle-counting rhythm are based on this TF. |
voting_timeframes |
M5, M15, M30 | Comma-separated list of all timeframes to include in signal aggregation during backtesting. Each TF gets its own model in the simulation. |
test_bars |
1000 | Number of bars on the main timeframe to use for the out-of-sample test period. The optimizer reserves this portion at the end of the data for evaluation. More bars = more statistically robust results but older data. |
iterations |
30 | Number of random parameter combinations to test. Each iteration generates a random set of parameters from the search space and runs a full backtest. More iterations = higher chance of finding the optimum but much longer runtime (30 iterations × ~2–5 seconds each). |
2. Parameter Search Space
These are the values the optimizer randomly samples during each iteration:
| Parameter | Search Values | Description |
|---|---|---|
sl_multiplier |
[1.0, 1.5, 2.0, 2.5] |
Possible ATR multipliers for Stop Loss. Lower = tighter stops, higher = wider stops. |
tp_ratio |
[1.5, 2.0, 2.5, 3.0] |
Risk-reward ratio. Enforced minimum: 1.5 (RR cannot be worse than 1:1.5). |
vote_threshold |
Auto [1, N] | Automatically set to range [majority, N] where N = number of timeframes. For 3 TFs, range = [2, 3]. Ensures at least majority voting, never single-TF decisions. |
retrain_interval |
[10, 20, 50, 100] |
How often (in candles) the model retrains during the backtest simulation. |
training_bars |
[500, 1000, 1500, 2000] |
Amount of historical data used per training session during backtest. |
neutral_band |
[0.05, 0.10, 0.15, 0.20] |
The confidence difference threshold below which the signal is considered NONE. At 0.10, if BUY prob = 0.54 and SELL prob = 0.46 (diff = 0.08), the result is NONE. Higher values = more neutral signals (fewer trades, higher quality). |
horizon |
[1, 3, 5, 10] |
Prediction horizon in bars for SL/TP hit-test labeling during backtest. |
model_params |
3 presets |
Three LightGBM architectures tested: • Light: 50 trees, depth 3, rate 0.1 • Medium: 100 trees, depth 5, rate 0.1 • Deep: 200 trees, depth 7, rate 0.05 |
3. Indicator Search Space
The optimizer also searches over technical indicator parameters. Each iteration picks a random value from each parameter's list:
| Parameter | Search Values | Effect |
|---|---|---|
rsi_period | [7, 10, 14, 21] | 7 = most responsive, 21 = smoothest |
sma_fast | [10, 20, 30] | Shorter = faster trend detection |
sma_slow | [50, 100, 200] | Longer = more stable trend filter |
atr_period | [10, 14, 21] | 10 = responsive volatility, 21 = average volatility |
adx_period | [10, 14, 21] | Lower = faster trend detection |
bb_period | [20, 30, 50] | 20 = standard Bollinger, 50 = wider lookback |
macd_fast | [12, 18, 24] | Standard is 12, 18/24 for slower signals |
macd_slow | [26, 36, 48] | Standard is 26, paired with fast values |
How the Optimizer Works
- Data Fetch: Downloads historical data for all timeframes (test bars + 2100 extra bars for training warmup).
- Random Search: For each iteration, picks random values from the search space for all parameters.
- Walk-Forward Backtest: Simulates trading by walking forward through the data. For each window, models are trained on the earliest bars and tested on the next segment. The simulation tracks retraining every N candles with SL/TP hit-test labeling.
- Fitness Evaluation: Each backtest returns a fitness score (a composite metric of win rate, profit factor, and total trades). Higher = better.
- Save Best: The best-performing parameter combination is saved to the SQLite database (
data/optimized_settings.db) and can be loaded directly into a Trading Instance via the "Load Optimized Settings" button.
Optimization Time Estimate: 30 iterations × ~3 seconds each = ~90 seconds. Larger test bars and more timeframes increase runtime. The optimizer runs in the main thread, so the GUI will be unresponsive during optimization — the progress bar shows iteration count.