EA Primary Setup -Inputs
Technique Management Inputs
These inputs decide how the EA behaves with respect to opening further trades and the sensitivity of indicators.
-
enter bool enableAdditionalTrades = true;
Objective: Permits (or disables) the flexibility to open further trades if the buying and selling bias (working complete) will increase considerably.
When enabled: The EA can add to an current place if the sign grows stronger. -
enter double additionalTradeGap = 300.0;
Objective: Defines the minimal worth hole (in pips, transformed to factors internally) that have to be met between consecutive extra trades.
Utilization: Helps keep away from speedy re-entry or “whipsaw” when the worth hasn’t moved sufficient from the earlier extra entry. -
enter double additionalTradeThreshold = 3;
Objective: Units the minimal enhance within the working complete (i.e., the cumulative bias from current bars) required to set off an extra commerce.
Utilization: Ensures that an additional commerce is just taken when the sign’s power will increase by not less than this quantity in comparison with the earlier commerce sign.
Working Whole Configuration
These parameters management how the EA calculates the bias (or sign power) by summing the contributions from a number of bars.
-
enter int runningTotalBars = 13;
Objective: Defines the variety of earlier bars used to compute the working complete of bias values.
Utilization: A bigger quantity smooths out random fluctuations; a smaller quantity makes the EA extra delicate to current strikes. -
enter double minCountThreshold = 7;
Objective: Units the minimal sum of bias (from the current bars) required to set off a brand new commerce.
Utilization: Helps filter out weak or indecisive market situations. -
enter double maxCountThreshold = 0;
Objective: Establishes an higher restrict for the bias—if the working complete exceeds this threshold, the EA would skip the commerce.
Utilization: When set to 0, it’s successfully turned off; if a nonzero worth is offered, it prevents buying and selling in overly sturdy situations the place the bias may be excessively excessive.
Commerce and Threat Administration Inputs
These settings decide your commerce dimension and threat thresholds.
-
enter double fixedLotSize = 0.1;
Objective: Defines the mounted variety of tons to commerce for every order.
Utilization: That is the bottom quantity that can be normalized later to adjust to the dealer’s quantity settings. -
enter int stopLossPoints = 850;
Objective: Specifies the cease loss distance in factors (a “level” being the minimal worth motion outlined by the dealer’s image settings).
Utilization: Determines how removed from the entry worth the cease loss is positioned to restrict potential losses. -
enter bool useTrailingStop = true;
Objective: Permits (or disables) a trailing cease mechanism.
Utilization: When enabled, the EA will alter the cease loss in the course of the lifetime of the commerce, probably locking in earnings because the market strikes favorably. -
enter double takeProfitPercent = 6;
Objective: Units the take revenue threshold as a proportion achieve relative to the account stability.
Utilization: When fairness reaches this proportion above the stability, the EA will shut all trades to safe earnings. -
enter double maxDrawdownPercent = 1;
Objective: Defines the utmost allowable drawdown (as a proportion under the account stability) earlier than all trades are closed.
Utilization: Acts as a security mechanism to restrict losses in adversarial market situations. -
enter int MagicNumber = 123452;
Objective: Offers a novel identifier for all trades executed by this EA.
Utilization: Distinguishes these orders from these positioned manually or by different EAs working on the identical account.
Single Candle Patterns – Bias and Detection Thresholds
These inputs set bias values for indicators generated by sure single-candle patterns and decide detection standards.
-
enter double biasPinBar = 0.5;
Objective: Assigns a bias rating for detecting a Pin Bar sample (a reversal candle with an extended tail).
Utilization: A Pin Bar contributes positively or negatively to the buying and selling sign relying on its context. -
enter double biasInvertedHammerBull = 3;
Objective: Units the bias for an Inverted Hammer sample in a bullish state of affairs, the place an extended higher wick might sign a reversal. -
enter double biasWideRangeBull = -3.5;
Objective: Assigns a bias to wide-range bullish candles (a big candle physique in comparison with the general vary), which may point out sturdy momentum. -
enter double biasMarubozuBull = -1;
Objective: Determines the bias for a Marubozu candle—a candle with little or no wicks that signifies sturdy directional conviction. -
enter double minPinBodyRatio = 0.11;
Objective: The minimal ratio of the candle physique to the total vary required for a candle to qualify as a Pin Bar or hammer sample. -
enter double dojiBodyThresholdRatio = 0.1;
Objective: Establishes the utmost body-to-range ratio for a candle to be thought of a Doji.
Utilization: Ensures that solely candles with little or no physique (indicative of market indecision) are flagged.
Two Candle Patterns – Bias Settings
These inputs are used for patterns involving two consecutive candles.
-
enter double biasBullEngulfing = -1.5;
Objective: Units the bias for a bullish engulfing sample the place a bullish candle fully engulfs a earlier bearish candle. -
enter double biasInsideBarBull = 1;
Objective: Offers a constructive bias for an inside bar sample, the place the present candle’s vary is fully inside the earlier candle’s vary. -
enter double biasHaramiBull = 0;
Objective: Defines the bias for a bullish Harami sample—a small bullish candle contained inside a bigger bearish candle.
Utilization: A zero worth means it has a impartial impression on the sign. -
enter double biasPiercing = 3.5;
Objective: Assigns a bias for a Piercing sample. It is a bullish reversal sample the place a bullish candle closes above the midpoint of a previous bearish candle.
Three Candle Patterns – Bias and Detection Thresholds
These inputs apply to indicators derived from three-candle formations.
-
enter double biasMorningStar = 2;
Objective: Bias for a Morning Star sample (a three-candle bullish reversal that always features a doji), indicating a shift in momentum. -
enter double biasThreeWhiteSoldiers = 4.5;
Objective: A robust bullish bias when three consecutive bullish candles (Three White Troopers) are detected. -
enter double biasThreeInsideUp = 5;
Objective: Bias for a “Three Inside Up” sample, the place an inside sample confirms bullish reversal. -
enter double biasThreeBarBullRev = 3;
Objective: Units a bias for a custom-defined three-bar bullish reversal sample. -
enter double biasUpsideGapTwoCrows = 3;
Objective: Though named with a “crows” reference, it’s related to bearish hole patterns involving two candles.
Utilization: The setting means that such a formation contributes a particular bias to the general sign.
Hole Patterns – Open-Shut Primarily based Bias Settings
These inputs handle hole patterns by evaluating open/shut costs, providing extra indicators.
-
enter double biasGap_OC_Up_BullBull = -1;
Objective: Bias worth for a niche up state of affairs the place bullish situations proceed (each earlier and present candles are bullish). -
enter double biasGap_OC_Up_BullBear = -2;
Objective: Bias for a niche up sample that reverses into bearish conduct. -
enter double biasGap_OC_Down_BullBull = 2;
Objective: Bias for a niche down that continues bullish momentum, an uncommon scenario the place market construction would possibly suggest a retracement. -
enter double biasGap_OC_Down_BullBear = -3;
Objective: Bias for a niche down resulting in bearish continuation.
Hole Patterns – Excessive-Low Primarily based Bias Settings
These settings think about gaps within the high-low vary slightly than open-close ranges.
-
enter double biasGap_HL_Up_BullBull = -2.5;
Objective: Bias for a bullish affirmation in a niche up state of affairs based mostly on the high-low vary. -
enter double biasGap_HL_Up_BullBear = -5;
Objective: A stronger bearish bias in a niche up state of affairs when situations reverse. -
enter double biasGap_HL_Down_BullBull = -1.5;
Objective: Bias for hole down with bullish continuation. -
enter double biasGap_HL_Down_BullBear = 0.5;
Objective: A light bias for hole down eventualities that flip bearish.
Sample Group Allow/Disable Flags
These boolean switches allow you to select which units of sample analyses to run. Disabling a gaggle can simplify the decision-making course of in case you want to give attention to explicit patterns.
-
enter bool analyzeSingleCandlePatterns = true;
Permits or disables the detection of single-candle patterns. -
enter bool analyzeTwoCandlePatterns = true;
Controls whether or not two-candle sample detection is energetic. -
enter bool analyzeThreeCandlePatterns = true;
Toggles the evaluation for three-candle patterns. -
enter bool analyzeGapPatterns = true;
Determines if gap-based patterns are to be included within the buying and selling sign.
MA Cross Visualization Settings (Shifting Common Filter)
These inputs configure two transferring averages used as a filter to additional verify commerce indicators.
Quick Shifting Common (MA1)
-
enter bool InpUseMAFilter = true;
Objective: Permits or disables the transferring common filter fully.
Utilization: When enabled, the EA will solely take a commerce if the quick MA is within the desired relation to the sluggish MA. -
enter string FAST and associated textual content strings ( MA1_TEXT , MA1_TEXT_2 ):
Objective: Present labels or visible separators for the quick MA settings when displayed on the chart. -
enter ENUM_TIMEFRAMES MA1_TIMEFRAME = PERIOD_CURRENT;
Objective: Units the timeframe on which the quick MA is calculated (by default, the present chart’s timeframe). -
enter ENUM_MA_METHOD MA1_MODE = MODE_SMA;
Objective: Defines the tactic used for the quick MA calculation (Easy Shifting Common on this case). -
enter int MA1_PERIOD = 60;
Objective: Specifies the interval (variety of bars) to calculate the quick MA. -
enter int MA1_SHIFT = 0;
Objective: Permits shifting the quick MA ahead or backward relative to the worth bars. -
enter ENUM_APPLIED_PRICE MA1_APPLIED_PRICE = PRICE_CLOSE;
Objective: Chooses the worth knowledge (e.g., shut, open, excessive, low) that’s fed into the quick MA calculation.
Gradual Shifting Common (MA2)
-
enter string SLOW, MA2_TEXT, MA2_TEXT_2 :
Objective: Much like the quick MA strings, these are used for labeling and visible group for the sluggish MA settings. -
enter ENUM_TIMEFRAMES MA2_TIMEFRAME = PERIOD_CURRENT;
Objective: Units the timeframe for the sluggish MA calculation. -
enter ENUM_MA_METHOD MA2_MODE = MODE_SMA;
Objective: Determines the tactic for the sluggish MA (once more utilizing a easy transferring common). -
enter int MA2_PERIOD = 155;
Objective: Units the variety of bars utilized in calculating the sluggish MA. Sometimes, an extended interval is chosen than for the quick MA. -
enter int MA2_SHIFT = 0;
Objective: Permits for adjusting the alignment of the sluggish MA. -
enter ENUM_APPLIED_PRICE MA2_APPLIED_PRICE = PRICE_CLOSE;
Objective: Selects which worth to make use of (right here, the closing worth) for calculating the sluggish MA.
Abstract
Every setting has been fastidiously designed to regulate both the:
-
Commerce Execution and Administration: (lot dimension, cease loss, trailing stops, threat limits, further commerce situations)
-
Sign Technology: (candlestick sample biases and thresholds, working complete calculation)
-
Market Filtering: (transferring common filter for commerce affirmation)
By adjusting these inputs, you possibly can fine-tune the technique’s sensitivity, threat profile, and market situation adaptability.
This thorough clarification ought to enable you to—and any finish person—perceive the aim and performance of each configuration parameter within the EA.