Parameters
This section details every user-configurable input parameter, organized by function.
MULTI-PAIR SETTINGS
Settings for running the EA on multiple charts or allocating risk across different instances.
Instance ID: A unique number for this specific instance of the EA running on a chart. If you run the EA on multiple charts (same or different pairs), each instance MUST have a unique Instance ID. This helps the EA manage its trades separately. Minimum value is 1.
Risk Allocation %: The percentage of your total account balance that this EA instance should consider for its risk calculations (like drawdown limits and dynamic lot sizing). Enter as a whole number (e.g., 50 for 50%). This allows you to run multiple EAs or manual trades without one EA risking the entire account balance.
Allocation Mode: Determines how the allocated balance (calculated from Risk Allocation %) adjusts over time.
0 (Fixed): The allocated balance is calculated once at the start and remains fixed.
1 (Increase Only): The allocated balance is recalculated periodically, but only increases if the account balance grows. It won't decrease if the balance drops.
-1 (Both): The allocated balance is recalculated periodically and can increase or decrease based on the current account balance.
RISK MANAGEMENT
Crucial settings for protecting your account equity.
Emergency Close: If set to true, the EA will immediately attempt to close ALL open trades managed by this instance (both basket and hedge trades) on the next tick. Use with extreme caution. It will automatically reset to false after triggering.
Halt Trading: If set to true, the EA will stop opening new trades. It will continue to manage existing open trades until they are closed (either by TP, SL, or manual intervention). Once all trades for this instance are closed, the EA will become inactive until Halt Trading is set back to false and the EA is refreshed/restarted.
Loss Threshold %: Defines a percentage loss level based on the initial allocated balance (Portion Balance). If the current Portion Balance drops below the initial Portion Balance minus this percentage, the EA will stop trading (similar to Halt Trading being activated) to prevent further losses. Enter as a percentage (e.g., 10 for 10%).
Max Drawdown %: The maximum allowable floating loss (drawdown) for the combined basket and hedge trades managed by this instance, calculated as a percentage of the current Portion Balance. If the current open P/L (negative) exceeds this percentage, the EA will trigger an immediate closure of all trades for this instance. Enter as a percentage (e.g., 5 for 5%). This is a critical safety feature.
Max Spread: The maximum allowed spread in pips for opening new trades. If the current market spread exceeds this value, the EA will not open any new positions until the spread narrows. Helps avoid entering trades during volatile, wide-spread conditions. Enter in standard pips (e.g., 3.0 for 3 pips, 50 for 5 pips on a 5-digit broker).
DAILY LIMITS
Set daily profit and loss thresholds to manage daily performance. These are calculated based on the account equity at the start of the trading day.
Daily Profit Target: The target profit amount in your account currency for the current trading day. If the daily equity gain reaches or exceeds this amount, the EA will close all open trades for this instance and stop trading for the rest of the day. Set to 0 to disable.
Max Daily Loss (DailyLossLimit): The maximum loss amount allowed in your account currency for the current trading day. If the daily equity loss reaches or exceeds this amount, the EA will close all open trades for this instance and stop trading for the rest of the day. This is a critical safety feature, especially for funded accounts. Set to 0 to disable (not recommended).
TRADING SCHEDULE
Define the allowed trading hours for the EA.
Session Start: The time the EA is allowed to start opening new trades. Format: HH:MM (24-hour clock, e.g., 08:00). Based on your broker's server time.
Session End: The time the EA must stop opening new trades. Format: HH:MM (24-hour clock, e.g., 17:00). If set to 24:00, trading can continue until midnight. Based on your broker's server time. Note: 24:00 implies trading stops exactly at midnight, not rolls over. Use 23:59 if you need trading up to the last minute.
Off-Hours Close: If set to true, the EA will actively close any open trades managed by this instance as soon as the current time is outside the defined Session Start and Session End window. If false, trades opened within the session will be managed until they hit TP/SL or are otherwise closed, even outside trading hours.
ENTRY METHODS
Configure how the EA determines entry signals using various technical indicators.
Trend Focus: Allows you to bias the EA's entries based on a perceived market condition, or let it auto-detect.
0 (Uptrend): Only allows buy signals/trades (unless overridden by reversal logic).
1 (Downtrend): Only allows sell signals/trades (unless overridden by reversal logic).
2 (Range): Attempts range-based logic (often requiring specific indicator settings).
3 (Auto): The EA attempts to determine the trend automatically (usually based on the MA settings). Default and generally recommended.
Signal Logic: Determines how signals from multiple enabled indicators are combined.
false (All Signals): ALL enabled indicators must agree on a direction (buy or sell) to generate a valid entry signal. More conservative.
true (Any Signal): A valid signal from ANY one of the enabled indicators is sufficient to generate an entry signal. More aggressive.
MA Signal: Enables/disables the Moving Average indicator for entry signals.
0 (Off): MA is not used for signals.
1 (Normal): Standard MA crossover/position logic (e.g., price above MA = potential buy).
2 (Reverse): Reversed MA logic (e.g., price above MA = potential sell, often for counter-trend).
CCI Signal: Enables/disables the Commodity Channel Index indicator for entry signals.
0 (Off): CCI is not used for signals.
1 (Normal): Standard CCI logic (e.g., CCI > threshold = potential buy).
2 (Reverse): Reversed CCI logic.
Bollinger Signal: Enables/disables the Bollinger Bands indicator for entry signals.
0 (Off): Bollinger Bands are not used for signals.
1 (Normal): Standard Bollinger logic (e.g., price touches/crosses lower band = potential buy).
2 (Reverse): Reversed Bollinger logic (e.g., price touches/crosses lower band = potential sell).
Stochastic Signal: Enables/disables the Stochastic Oscillator for entry signals.
0 (Off): Stochastic is not used for signals.
1 (Normal): Standard Stochastic logic (e.g., crossing up from oversold = potential buy).
2 (Reverse): Reversed Stochastic logic.
MACD Signal: Enables/disables the Moving Average Convergence Divergence indicator for entry signals.
0 (Off): MACD is not used for signals.
1 (Normal): Standard MACD logic (e.g., MACD line crosses above signal line = potential buy).
2 (Reverse): Reversed MACD logic.
POSITION SIZING
Configure how the size (volume) of trades is determined.
Dynamic Sizing: Enables or disables automatic lot size calculation based on account equity/balance.
true: Lot size is calculated dynamically based on Risk Allocation %, Lot Scaler, and potentially other factors. The Fixed Lot Size parameter is ignored.
false: Lot size is fixed and determined solely by the Fixed Lot Size parameter.
Lot Scaler: A coefficient used in the dynamic lot sizing calculation when Dynamic Sizing is true. Adjusts the aggressiveness of the lot sizing. Higher values generally lead to larger starting lots relative to the allocated balance. Works in conjunction with internal EA logic (Level input under Advanced Settings affects this).
Fixed Lot Size: The fixed lot size used for the initial trade in a basket only if Dynamic Sizing is set to false. Ensure this value complies with your broker's minimum and step lot requirements.
Grid Multiplier: The factor by which the lot size increases for subsequent trades in the grid sequence.
1.0: No lot size increase (all trades in the grid have the same lot size as the first).
> 1.0: Lot size increases multiplicatively (e.g., 1.4 means the next lot is 1.4 times the previous one). Higher values increase potential profit but also significantly increase risk.
< 1.0: Not typical for martingale-style grids and may behave unexpectedly; usually kept at 1.0 or higher.
GRID SETTINGS
Configure the spacing and behavior of the grid levels. Note: Auto Grid (AutoCal) itself is not extern, meaning the choice between Auto/Manual is likely internal. These settings apply based on that internal choice.
ATR Timeframe: Selects the timeframe for the Average True Range (ATR) indicator, which is used to automatically calculate grid spacing based on market volatility.
0: Chart timeframe.
1: M1
2: M5
3: M15
4: M30
5: H1
6: H4
7: D1
8: W1
9: MN1
ATR Length: (Applies if Auto Grid is internally active) The number of periods used for the ATR calculation. Common values are 14 or 21.
Grid Width: (Applies if Auto Grid is internally active) A multiplier applied to the calculated ATR value (or potentially fixed grid values if Auto Grid is off) to adjust the final grid spacing.
1.0: Uses the calculated/base grid spacing.
> 1.0: Increases the distance between grid levels.
< 1.0: Decreases the distance between grid levels.
Trade Delay: The minimum time in seconds that must pass after a grid trade is opened before the EA is allowed to place the next trade in the grid sequence (either a market order in Smart Grid mode or a pending order). Prevents overly rapid grid entries.
Entry Offset: (Primarily applies if using pending orders for grid entries, FQTraditional=true internal setting) A small distance in pips added to the calculated entry price for pending grid orders (Buy/Sell Stops/Limits). Can help ensure orders are triggered even with minor price fluctuations or spread.
SMART GRID
Settings for an alternative grid entry logic based on RSI. Note: Use Smart Grid itself is not extern. These settings apply if it's internally active.
RSI Timeframe: Selects the timeframe for the Relative Strength Index (RSI) used in the Smart Grid logic. Uses the same 0-9 mapping as ATR Timeframe.
RSI Length: The number of periods for the RSI calculation. Default is typically 14.
RSI Price: The price type used for the RSI calculation.
0: Close price
1: Open price
2: High price
3: Low price
RSI MA Length: The period for a Moving Average calculated on the RSI indicator itself. Used for signal generation within the Smart Grid logic (e.g., RSI crossing its MA).
RSI MA Type: The calculation method for the RSI's Moving Average.
0: Simple Moving Average (SMA)
1: Exponential Moving Average (EMA)
2: Smoothed Moving Average (SMMA)
3: Linear Weighted Moving Average (LWMA) - Note: Code shows 0=Simple, 1=Exponential, 2=Smoothed. Double-check if LWMA (3) is valid.
TRADING SETTINGS
Fine-tune the management of open trades and grid levels.
Max Positions: The absolute maximum number of trades allowed in a single grid basket. Once this limit is reached, no further grid trades will be opened for that basket, regardless of price movement.
BE Level: The grid level (trade number in the sequence) at which the EA should attempt to move the Take Profit for the entire basket to breakeven (plus a small bonus). If set to 12, once the 12th trade is opened, the TP adjusts. Set to 0 to disable.
BE Bonus: The small number of additional pips added to the calculated breakeven price when the BE Level is reached. Helps cover commissions/swaps. Enter in standard pips (e.g., 2.0 for 2 pips).
Age-Based Close: If true, enables a feature to start closing the oldest trades in the basket once a certain grid level is reached, potentially even if they are at a loss.
Close Start Level: (Applies if Age-Based Close is true) The grid level at which the EA begins closing the oldest trade(s).
Force Close: (Applies if Age-Based Close is true)
true: The oldest trade will be closed when the Close Start Level is reached, regardless of whether it's in profit or loss.
false: The oldest trade will only be closed if the price has moved favorably beyond its entry price (less aggressive).
Max Close Count: (Applies if Age-Based Close is true) The maximum number of oldest trades the EA is allowed to close using this mechanism within a single basket.
Post-Close TP: (Applies if Age-Based Close is true and trades have been closed) After oldest trades are closed, this sets a new Take Profit target for the remaining basket, calculated as the new breakeven point plus this many pips. Enter in standard pips.
Forced TP: Overrides the normal Take Profit calculation. Sets the TP to the basket's breakeven price plus/minus this fixed number of pips. Set to 0 to disable and use normal TP logic. Enter in standard pips.
Min TP: Sets a minimum distance in pips between the basket's breakeven price and the calculated Take Profit. Ensures the TP isn't too close to the breakeven point. Set to 0 to disable. Enter in standard pips.
HEDGE SETTINGS
Parameters for the optional drawdown hedging mechanism. Note: Use Hedge itself is not extern. These settings apply if it's internally active.
Hedge Pair: The symbol of the instrument to use for placing hedge trades. If left empty, the EA will hedge using the same symbol as the main chart. If specified (e.g., "EURUSD"), ensure the symbol name exactly matches your broker's naming convention. The EA attempts a basic correlation check if a different symbol is used.
Max Hedge Trades: The maximum number of individual hedge trades allowed to be open simultaneously.
Correlation Days: (Applies if Hedge Pair is different from the chart symbol) The number of daily bars used to calculate the correlation between the chart symbol and the hedge symbol. Used internally to determine hedge direction.
Hedge Trigger: Defines what triggers the initial hedge trade.
"DD": Hedging starts when the basket drawdown reaches the Hedge Threshold percentage.
"Level": Hedging starts when the number of open trades in the basket reaches the Hedge Threshold count.
Hedge Threshold: The value that triggers the hedge, based on the Hedge Trigger setting.
If Hedge Trigger = "DD", enter the drawdown percentage (e.g., 20.0 for 20%).
If Hedge Trigger = "Level", enter the trade count (e.g., 5 for the 5th trade).
Hedge Size: A multiplier applied to the total open lot size of the main basket to determine the lot size of the hedge trade(s). E.g., 0.8 means the hedge lot will be 80% of the basket's total lots.
Hedge Max Loss: A maximum stop-loss distance in pips for individual hedge trades. Can function as a fixed or trailing stop depending on other settings. Set to 0 to disable SL on hedge trades.
Fixed Hedge SL: (Applies if Hedge Max Loss > 0)
true: Uses a fixed stop loss placed Hedge Max Loss pips away from the hedge entry price.
false: Uses a trailing stop logic for the hedge trade, starting Hedge Max Loss pips away, potentially trailing based on price movement (details depend on Stop Trail at BE and Reduce Trail).
Hedge TP: A Take Profit target in pips for individual hedge trades. Set relative to the hedge entry price. Set to 0 to disable TP on hedge trades.
Re-Hedge Buffer: (Primarily applies if Hedge Trigger = "DD") A percentage buffer added to the drawdown level after a hedge trade closes. Prevents immediate re-hedging if drawdown fluctuates near the threshold. E.g., if Hedge Threshold is 20% and this is 5%, after a hedge closes, the next hedge won't trigger until drawdown hits 25% (or higher, depending on logic).
Stop Trail at BE: (Applies to hedge SL if Fixed Hedge SL is false) If true, the trailing stop for the hedge trade will stop trailing once it reaches the hedge trade's breakeven price.
Reduce Trail: (Applies to hedge SL if Fixed Hedge SL is false and Stop Trail at BE is false) If true, the trailing stop distance decreases as the hedge trade moves further into profit (non-linear reduction). If false, the trail distance remains fixed at Hedge Max Loss.
Cover Past Losses: If true, the EA includes previously closed losses (from the current basket cycle, potentially both main and hedge trades) when calculating the overall breakeven point and Take Profit for the main basket. If false, only open trades are considered for the current TP calculation.
EXIT SETTINGS
Configure how trades are exited, including profit maximization and stop-loss strategies.
Trailing Profit: If true, enables a trailing profit mechanism. Once profit reaches a certain percentage (Profit Lock %) of the target, it locks in that profit level as a stop loss and potentially moves the main Take Profit target further away.
Profit Lock %: (Applies if Trailing Profit is true) The percentage of the calculated profit target (TPa - BEa) that price must reach before the profit trailing stop is activated. Enter as a percentage (e.g., 70 for 70%).
TP Adjustment: (Applies if Trailing Profit is true) The distance in pips by which the main Take Profit target is moved further away each time the profit trailing mechanism successfully locks in profit and allows for a move.
Max TP Moves: (Applies if Trailing Profit is true) The maximum number of times the Take Profit target can be adjusted outwards using the TP Adjustment mechanism within a single basket cycle.
SL Master: Master switch to enable (true) or disable (false) the main basket's Stop Loss features (Fixed SL and Trail SL).
Fixed SL: (Applies if SL Master is true) Sets a fixed stop loss distance in pips from the basket's breakeven point. If price reaches this level, the entire basket is closed. Set to 0 to disable fixed SL.
Trail SL: (Applies if SL Master is true) Enables a trailing stop loss for the basket, based on the breakeven point. Enter in standard pips.
Positive Value (e.g., 10): A fixed trailing stop distance of 10 pips.
Negative Value (e.g., -10): A reducing trailing stop. Starts trailing when price moves 10 pips past breakeven, and the trail distance gets progressively smaller (down to Min Trail) as price moves further in profit. More complex logic.
0: Disables trailing stop loss.
Min Trail: (Applies if Trail SL is negative) The minimum distance in pips the reducing trailing stop is allowed to shrink to.
Disconnect SL: If true, enables an emergency stop loss mechanism designed to protect against internet connection loss. It attempts to place a very wide physical stop loss on each individual order.
Emergency SL: (Applies if Disconnect SL is true) The distance in pips used for the emergency stop loss placed on individual orders. Should be set very wide (e.g., 600) as it's calculated relative to the basket breakeven, not individual order prices. Its effectiveness depends on broker execution during disconnects.
FIFO Close: If true, forces the EA to close trades in a First-In, First-Out order when multiple trades need closing simultaneously (e.g., during TP, SL, or Emergency Close). This is primarily for compliance with brokers enforcing FIFO rules (common in the US). If false, trades might be closed based on internal logic (e.g., oldest last if optimizing closing).
MA SETTINGS
Parameters specific to the Moving Average indicator.
MA Period: The number of periods (bars) used for the main Moving Average calculation (often used for trend detection). Common defaults mentioned: 100 for H4, 400 for H1 suggest timeframe dependency, but the input is just the period number.
MA Range: The distance in pips above and below the calculated MA value used to define a "ranging" condition when Trend Focus is set to Auto. If price is within this distance from the MA, the trend is considered ranging.
CCI SETTINGS
Parameters specific to the Commodity Channel Index indicator.
CCI Period: The number of periods (bars) used for the CCI calculation. Default is often 14.
BOLLINGER SETTINGS
Parameters specific to the Bollinger Bands indicator.
BB Period: The number of periods (bars) used for the Bollinger Bands calculation (specifically, the middle moving average).
BB Distance: An additional distance in pips beyond the upper or lower band that price must move before a Bollinger-based entry signal is considered valid (used to filter noise near the bands).
BB Deviation: The number of standard deviations used to calculate the width of the upper and lower bands relative to the middle moving average. Default is typically 2.0.
STOCHASTIC SETTINGS
Parameters specific to the Stochastic Oscillator.
Stoch Zone: The threshold level for identifying oversold (below this level) and overbought (above 100 minus this level) conditions. Default is often 20 (meaning oversold < 20, overbought > 80).
K Period: The number of periods used for the %K line calculation in the Stochastic oscillator.
D Period: The number of periods used for the %D line calculation (smoothing of %K).
Stoch Slowing: The slowing period applied to the %K calculation, which also affects the %D line. Higher values result in smoother lines.
MACD SETTINGS
Parameters specific to the Moving Average Convergence Divergence indicator.
MACD Timeframe: Selects the timeframe specifically for the MACD calculation, independent of the chart timeframe. Uses the same 0-9 mapping as ATR Timeframe. Allows checking MACD signals on a different timeframe than the chart the EA is running on.
Fast EMA: The period for the faster Exponential Moving Average used in the MACD calculation. Default is typically 12.
Slow EMA: The period for the slower Exponential Moving Average used in the MACD calculation. Default is typically 26.
Signal Line: The period for the Exponential Moving Average calculated on the MACD line itself (the difference between Fast and Slow EMAs) to create the signal line. Default is typically 9.
MACD Price: The price type used for the MACD calculations (for the Fast and Slow EMAs).
0: Close price
1: Open price
2: High price
3: Low price
Last updated