LT Moving Average EA
Complete walkthrough of all inputs for the LT Moving Average EA: one, two, and three MA crossover strategies, full MA configuration, trade execution, account protection, and all available filters.

These inputs configure the Moving Average crossover strategy. The EA supports three strategy modes using one, two, or three independently configurable Moving Averages. Each MA has its own timeframe, period, shift, method, and applied price settings.
EA Trading Strategy
enumTwoMAcrossSelects the number of Moving Averages used for the crossover signal.
| Strategy | Signal logic |
|---|---|
| OneMacross | Buy when price crosses above the Fast MA; Sell when price crosses below the Fast MA. Only the Fast MA settings are used. |
| TwoMAcross | Buy when the Fast MA crosses above the Slow MA; Sell when the Fast MA crosses below the Slow MA. Fast and Slow MA settings are used. |
| ThreeMAcross | Buy when all three MAs align bullishly (Fast above Medium above Slow); Sell when all three align bearishly. All three MA settings are used. |
ThreeMAcross generates fewer signals but each signal requires alignment across three timeframes of MA, making it the most selective and trend-confirming mode.
Number of bars to look for signal
int3How many recent bars the EA searches backward to find a valid MA crossover. Must be 3 or greater. Increase on instruments with frequent wicks or gaps to avoid missing crossovers.
Close Trades on Opposite Direction Signal
boolfalseWhen true, an opposite MA crossover closes the existing position before opening the new one.
Reverse Trade Signal
boolfalseInverts all MA crossover signals.
Fast MA Time Frame
enumPERIOD_CURRENTTimeframe for the Fast Moving Average.
Fast MA Period
int10Period of the Fast Moving Average. A shorter period reacts quickly to price changes.
Fast MA Shift
int0Bar shift for the Fast MA.
Fast MA Method
enumMODE_SMASmoothing method for the Fast MA: SMA, EMA, SMMA, or LWMA.
Fast MA Applied Price
enumPRICE_CLOSEApplied price for the Fast MA.
Medium MA Time Frame
enumPERIOD_CURRENTTimeframe for the Medium Moving Average (used in ThreeMAcross mode).
Medium MA Period
int21Period of the Medium Moving Average.
Medium MA Shift
int0Bar shift for the Medium MA.
Medium MA Method
enumMODE_SMASmoothing method for the Medium MA.
Medium MA Applied Price
enumPRICE_CLOSEApplied price for the Medium MA.
Slow MA Time Frame
enumPERIOD_CURRENTTimeframe for the Slow Moving Average.
Slow MA Period
int50Period of the Slow Moving Average. A longer period represents the dominant trend direction.
Slow MA Shift
int0Bar shift for the Slow MA.
Slow MA Method
enumMODE_SMASmoothing method for the Slow MA.
Slow MA Applied Price
enumPRICE_CLOSEApplied price for the Slow MA.
These inputs define which instrument the EA trades and whether it uses a real or virtual account balance for lot-size calculations.
EA Name
stringLT EAThe internal name displayed on the chart and in log messages. Changing this lets you run two instances of the same EA on the same chart with different settings without naming conflicts.
Type of Symbol
enumNChartSelects whether the EA trades the chart symbol (NChart) or a custom symbol entered in the Trading Symbol field (CChart). Use CChart to trade a different instrument from the one the EA is attached to.
| Option | Behaviour |
|---|---|
| NChart | Trades the chart symbol automatically |
| CChart | Trades the symbol entered in Trading Symbol |
Trading Symbol
stringEURUSDThe symbol the EA will trade when Type of Symbol is set to CChart. Enter the exact symbol name as it appears in your broker's Market Watch (e.g EURUSD, XAUUSD, US30).
Use a Virtual Balance
boolfalseWhen enabled the EA uses the value in EA Virtual Balance for lot-size risk calculations instead of the real account equity. Useful for testing fixed-lot scenarios on a live account without changing real risk.
EA Virtual Balance
int1000The virtual account balance (in account currency) used when Use a Virtual Balance is enabled. Has no effect when Use a Virtual Balance is false.
Core execution parameters: which timeframe the EA reads signals on, trade direction, lot sizing, stop loss and take profit modes, and position management options.
Working timeframe
enumPERIOD_CURRENTThe timeframe the EA uses to read indicator values and generate signals. PERIOD_CURRENT means the EA reads the chart timeframe. Changing this lets you run a higher-timeframe strategy on a lower-timeframe chart.
Trade direction
enumbuy_sellRestricts which side the EA can open. Set to buy to only go long, sell to only go short, or buy_sell to trade both directions.
| Option | Behaviour |
|---|---|
| buy | Opens Buy positions only |
| sell | Opens Sell positions only |
| buy_sell | Opens both Buy and Sell positions |
Search signals on ...
enumbar_1Determines which bar the EA reads for entry signals. bar_1 uses the last fully closed bar (no repainting). bar_0 reads the live forming bar for faster signals at the cost of potential repainting.
bar_1 is the safer default for live trading. bar_0 is useful for scalping strategies where speed matters more than repainting protection.
Money management
enumriskSelects how the EA calculates the lot size for each trade.
| Option | Lot calculation |
|---|---|
| lots_min | Always trades the broker minimum lot |
| lot | Uses the fixed lot size set in Lot Size or Risk in Percentage |
| risk | Calculates lot size so the risk equals the percentage set in Lot Size or Risk in Percentage |
Lot Size or Risk in Percentage
double3.0Interpreted based on the Money management setting. When money management is lot, this is the fixed lot size. When it is risk, this is the percentage of account balance to risk per trade (requires a valid Stop Loss to be set).
Stop Loss Mode
enumSL_FIXEDSelects how the stop loss distance is calculated.
| Mode | Calculation |
|---|---|
| SL_FIXED | Uses the fixed number of points set in Fixed Stop Loss (points) |
| SL_RISK | Calculates a stop distance based on the Risk-Based Stop Loss (% of balance) |
Fixed Stop Loss (points)
uint0The stop loss distance in points when Stop Loss Mode is SL_FIXED. Set to 0 to disable the stop loss entirely. A point is the smallest price increment (e.g. 1 point on EURUSD = 0.00001).
Trading without a stop loss (value 0) exposes the account to unlimited drawdown if the market moves against the position.
Risk-Based Stop Loss (% of balance)
double1.0Active when Stop Loss Mode is SL_RISK. The EA calculates a stop distance such that losing the trade would cost this percentage of the account balance.
Take Profit Mode
enumTP_FIXEDSelects how the take profit distance is calculated.
| Mode | Calculation |
|---|---|
| TP_FIXED | Uses the fixed number of points set in Fixed Take Profit (points) |
| TP_RR | Sets the take profit as a multiple of the stop loss distance |
Fixed Take Profit (points)
uint0The take profit distance in points when Take Profit Mode is TP_FIXED. Set to 0 to disable the take profit.
Risk-Reward Ratio (TP = SL x RR)
double2.0Active when Take Profit Mode is TP_RR. The take profit is set at Stop Loss distance multiplied by this value. A value of 2.0 means the take profit is twice the stop loss distance.
Virtual Levels (hide SL/TP from broker)
boolfalseWhen enabled the EA manages stop loss and take profit internally without sending them to the broker. The broker sees positions with no SL/TP, which can prevent stop hunting on some brokers.
Draw Levels on Chart (requires Virtual Levels)
boolfalseWhen Virtual Levels is enabled and this is true, the EA draws horizontal lines on the chart at the virtual SL and TP levels so you can see them visually.
Only one Position
boolfalseWhen true the EA will not open a new position if one is already open on the symbol. Prevents pyramiding or stacking multiple positions from repeated signals.
Reverse All Trade Signal Combined
boolfalseInverts the final combined signal after all filters are applied. A Buy signal becomes a Sell and vice versa. Useful for testing counter-trend approaches without modifying the strategy logic.
Close opposite of All Trade Signal Combined
booltrueWhen true, receiving a Buy signal will close any open Sell positions (and vice versa) before opening the new position. Keeps the EA from holding conflicting positions simultaneously.
Two-level risk management system. Account Level monitors the overall account and closes positions when drawdown or profit thresholds are reached. Symbol Level does the same but scoped to the current trading symbol only.
Protection based on the account trades
boolfalseMaster switch for Account Level protection. When enabled the EA monitors overall account equity and closes positions automatically when the risk or profit percentage thresholds below are breached.
Total risk % on overall account
double1.0Account Level drawdown threshold. If total open positions are losing more than this percentage of the account balance, the EA triggers the close actions selected below.
Close all Trades (loss)
boolfalseWhen the account loss threshold is hit, close ALL open positions regardless of direction or profit.
Close Only BUY Trades (loss)
boolfalseWhen the account loss threshold is hit, close only Buy positions.
Close Only SELL Trades (loss)
boolfalseWhen the account loss threshold is hit, close only Sell positions.
Close Only Profit Trades (loss trigger)
boolfalseWhen the account loss threshold is hit, close only positions that are currently in profit. Locks in winners while cutting the position count.
Close Only Losing Trades (loss trigger)
boolfalseWhen the account loss threshold is hit, close only positions that are currently losing. Stops the bleeding while keeping winners open.
Total profit % on overall account
double2.0Account Level profit threshold. If total open positions are gaining more than this percentage of the account balance, the EA triggers the close actions selected below.
Close all Trades (profit)
boolfalseWhen the account profit threshold is hit, close ALL open positions.
Close Only BUY Trades (profit)
boolfalseWhen the account profit threshold is hit, close only Buy positions.
Close Only SELL Trades (profit)
boolfalseWhen the account profit threshold is hit, close only Sell positions.
Close Only Profit Trades (profit trigger)
boolfalseWhen the account profit threshold is hit, close only positions that are in profit.
Close Only Losing Trades (profit trigger)
boolfalseWhen the account profit threshold is hit, close only positions that are currently losing.
Protection based on the current Symbol trades
boolfalseMaster switch for Symbol Level protection. Same logic as Account Level but scoped to positions on the current trading symbol only.
Total risk % on current symbol
double1.0Symbol Level drawdown threshold as a percentage of account balance.
Close all Current Symbol Trades (loss)
boolfalseClose all symbol positions when the symbol loss threshold is hit.
Close Only Current Symbol BUY Trades (loss)
boolfalseClose only symbol Buy positions when the symbol loss threshold is hit.
Close Only Current Symbol SELL Trades (loss)
boolfalseClose only symbol Sell positions when the symbol loss threshold is hit.
Close Only Profit Trades - Symbol (loss trigger)
boolfalseOn symbol loss trigger: close only profitable symbol positions.
Close Only Losing Trades - Symbol (loss trigger)
boolfalseOn symbol loss trigger: close only losing symbol positions.
Total profit % on current symbol
double2.0Symbol Level profit threshold as a percentage of account balance.
Close all Current Symbol Trades (profit)
boolfalseClose all symbol positions when the symbol profit threshold is hit.
Close Only Current Symbol BUY Trades (profit)
boolfalseClose only symbol Buy positions when the symbol profit threshold is hit.
Close Only Current Symbol SELL Trades (profit)
boolfalseClose only symbol Sell positions when the symbol profit threshold is hit.
Close Only Profit Trades - Symbol (profit trigger)
boolfalseOn symbol profit trigger: close only profitable symbol positions.
Close Only Losing Trades - Symbol (profit trigger)
boolfalseOn symbol profit trigger: close only losing symbol positions.
Automatically close all open positions at a specific time on selected days. Useful for avoiding overnight gaps, weekend holds, or high-impact news windows at market open.
Close Trades at the End of the Day
boolfalseMaster switch for the scheduled close feature. When true the EA closes all open positions at the time configured for each active day below.
Monday
boolfalseEnable automatic position close on Monday.
Time to close Trades - Monday
string16:00The time (server time, HH:MM format) to close all positions on Monday.
Tuesday
boolfalseEnable automatic position close on Tuesday.
Time to close Trades - Tuesday
string16:00The time (server time, HH:MM format) to close all positions on Tuesday.
Wednesday
boolfalseEnable automatic position close on Wednesday.
Time to close Trades - Wednesday
string16:00The time (server time, HH:MM format) to close all positions on Wednesday.
Thursday
boolfalseEnable automatic position close on Thursday.
Time to close Trades - Thursday
string16:00The time (server time, HH:MM format) to close all positions on Thursday.
Friday
boolfalseEnable automatic position close on Friday.
Time to close Trades - Friday
string16:00The time (server time, HH:MM format) to close all positions on Friday.
Saturday
boolfalseEnable automatic position close on Saturday.
Time to close Trades - Saturday
string16:00The time (server time, HH:MM format) to close all positions on Saturday.
Sunday
boolfalseEnable automatic position close on Sunday.
Time to close Trades - Sunday
string16:00The time (server time, HH:MM format) to close all positions on Sunday.
Additional filters that gate or qualify the main strategy signal. All filters are disabled by default. Enable only the ones relevant to your strategy. Available filters: Volume, Spread, News, Moving Average (A and B), NRTR (A and B), SuperTrend (A and B), MACD (A and B), and MA Crossover (A and B).
Use Volume Filter
boolfalseEnables the volume filter. When active the EA only takes signals when tick volume exceeds a threshold, helping to avoid trading on low-liquidity bars.
Reverse Trade Signal - Volume
boolfalseInverts the volume filter logic so signals are blocked during high volume instead of low volume.
Volume Filter Time Frame
enumPERIOD_CURRENTThe timeframe used to read volume data for the volume filter.
Volume Type
enumVOLUME_TICKTick volume (default) or real volume. Most brokers only provide tick volume.
Use Spread Filter
boolfalseBlocks new entries when the current spread exceeds the maximum allowed. Protects against entering during high-spread conditions such as news events or illiquid hours.
Reverse Trade Signal - Spread
boolfalseKept for settings compatibility. Not active in the current version.
Maximum Spread Allowed
int20The maximum spread in points permitted for opening a new trade. If the live spread is above this value the signal is ignored.
Use News Filter
boolfalseEnables the economic news filter. When active the EA pauses trading before and after news events of the selected impact levels. Requires WebRequest access to the news calendar URL whitelisted in MT5.
Reverse Trade Signal - News
boolfalseInverts the news filter so the EA only trades during news windows rather than avoiding them.
Low Impact News
boolfalsePause trading around low-impact economic news events.
Close Trades before Low Impact News
boolfalseClose all open positions before the low-impact news buffer period begins.
Minutes to Stop Before Low Impact News
uchar15How many minutes before a low-impact news event to stop opening new trades.
Minutes to Start After Low Impact News
uchar15How many minutes after a low-impact news event to resume trading.
Medium Impact News
boolfalsePause trading around medium-impact economic news events.
Close Trades before Medium Impact News
boolfalseClose all open positions before the medium-impact news buffer period begins.
Minutes to Stop Before Medium Impact News
uchar15How many minutes before a medium-impact news event to stop opening new trades.
Minutes to Start After Medium Impact News
uchar15How many minutes after a medium-impact news event to resume trading.
High Impact News
boolfalsePause trading around high-impact economic news events (NFP, CPI, FOMC, etc.).
Close Trades before High Impact News
boolfalseClose all open positions before the high-impact news buffer period begins.
Minutes to Stop Before High Impact News
uchar15How many minutes before a high-impact news event to stop opening new trades.
Minutes to Start After High Impact News
uchar15How many minutes after a high-impact news event to resume trading.
Unspecified Impact News
boolfalsePause trading around news events with unspecified impact classification.
Close Trades before Unspecified Impact News
boolfalseClose all open positions before the unspecified-impact news buffer period begins.
Minutes to Stop Before Unspecified Impact News
uchar15How many minutes before an unspecified news event to stop opening new trades.
Minutes to Start After Unspecified Impact News
uchar15How many minutes after an unspecified news event to resume trading.
Use Moving Average Filter A
boolfalseAdds a single Moving Average as a trend filter. When enabled the EA only takes Buy signals when price is above the MA and Sell signals when price is below it (reversed if Reverse is true).
Reverse Trade Signal - MA Filter A
boolfalseInverts MA Filter A logic: Buy signals pass when price is below the MA.
Moving Average Filter A Time Frame
enumPERIOD_CURRENTTimeframe for MA Filter A calculation.
Moving Average Filter A Period
int100Number of bars used to calculate MA Filter A.
Moving Average Filter A Shift
int0Bar shift for MA Filter A (0 = current bar).
Moving Average Filter A Method
enumMODE_SMAMA calculation method: SMA, EMA, SMMA (Wilder), or LWMA.
Moving Average Filter A Price
enumPRICE_CLOSEApplied price for MA Filter A (Close, Open, High, Low, Median, Typical, or Weighted).
Use Moving Average Filter B
boolfalseSecond independent Moving Average filter. Works identically to Filter A but with its own parameters, letting you require two MA conditions simultaneously.
Reverse Trade Signal - MA Filter B
boolfalseInverts MA Filter B logic.
Moving Average Filter B Time Frame
enumPERIOD_CURRENTTimeframe for MA Filter B calculation.
Moving Average Filter B Period
int200Number of bars used to calculate MA Filter B.
Moving Average Filter B Shift
int0Bar shift for MA Filter B.
Moving Average Filter B Method
enumMODE_SMAMA calculation method for Filter B.
Moving Average Filter B Price
enumPRICE_CLOSEApplied price for MA Filter B.
Use NRTR Filter A
boolfalseEnables an NRTR (Nick Rypock Trailing Reverse) trend filter. NRTR is an ATR-based adaptive trailing indicator that defines the current trend direction.
Reverse Trade Signal - NRTR A
boolfalseInverts NRTR Filter A direction logic.
NRTR Filter A Time Frame
enumPERIOD_CURRENTTimeframe for NRTR Filter A.
NRTR Filter A ATR Period
int14ATR period used in the NRTR Filter A calculation.
NRTR Filter A Coefficient
double4.0ATR multiplier for the NRTR trailing band. Higher values create a wider, slower-turning band.
Draw NRTR A on Chart
boolfalseWhen true, draws the NRTR A indicator line directly on the chart.
NRTR A Bullish Color
colorLimeColor of the NRTR A line when it signals bullish trend direction.
NRTR A Bearish Color
colorRedColor of the NRTR A line when it signals bearish trend direction.
Use NRTR Filter B
boolfalseSecond independent NRTR filter with its own parameters.
Reverse Trade Signal - NRTR B
boolfalseInverts NRTR Filter B direction logic.
NRTR Filter B Time Frame
enumPERIOD_CURRENTTimeframe for NRTR Filter B.
NRTR Filter B ATR Period
int14ATR period for NRTR Filter B.
NRTR Filter B Coefficient
double4.0ATR multiplier for NRTR Filter B.
Draw NRTR B on Chart
boolfalseWhen true, draws the NRTR B indicator line on the chart.
NRTR B Bullish Color
colorAquaColor of the NRTR B line when it signals bullish trend direction.
NRTR B Bearish Color
colorLimeColor of the NRTR B line when it signals bearish trend direction.
Use Super Trend Filter A
boolfalseEnables a SuperTrend indicator as a trend confirmation filter. SuperTrend is an ATR-based trend-following overlay that flips direction when price closes beyond its band.
Reverse Trade Signal - SuperTrend A
boolfalseInverts SuperTrend Filter A logic.
Super Trend Filter A Time Frame
enumPERIOD_CURRENTTimeframe for SuperTrend Filter A.
Super Trend Filter A Period
int14ATR period for SuperTrend Filter A.
Super Trend Filter A Multiplier
double4.0ATR multiplier for SuperTrend Filter A. Higher values create a wider, less sensitive band.
Draw Super Trend A on Chart
boolfalseWhen true, draws the SuperTrend A line on the chart.
Super Trend A Bullish Color
colorLimeColor of the SuperTrend A line when it is bullish.
Super Trend A Bearish Color
colorRedColor of the SuperTrend A line when it is bearish.
Use Super Trend Filter B
boolfalseSecond independent SuperTrend filter with its own parameters.
Reverse Trade Signal - SuperTrend B
boolfalseInverts SuperTrend Filter B logic.
Super Trend Filter B Time Frame
enumPERIOD_CURRENTTimeframe for SuperTrend Filter B.
Super Trend Filter B Period
int14ATR period for SuperTrend Filter B.
Super Trend Filter B Multiplier
double4.0ATR multiplier for SuperTrend Filter B.
Draw Super Trend B on Chart
boolfalseWhen true, draws the SuperTrend B line on the chart.
Super Trend B Bullish Color
colorDodgerBlueColor of the SuperTrend B line when it is bullish.
Super Trend B Bearish Color
colorRedColor of the SuperTrend B line when it is bearish.
Use MACD Filter A
boolfalseAdds a MACD indicator as a momentum filter. The EA uses the MACD histogram or signal line direction to qualify entry signals.
Reverse Trade Signal - MACD A
boolfalseInverts MACD Filter A logic.
MACD Filter A Time Frame
enumPERIOD_CURRENTTimeframe for MACD Filter A.
MACD A Fast EMA Period
int12Fast EMA period for MACD Filter A.
MACD A Slow EMA Period
int26Slow EMA period for MACD Filter A.
MACD A Signal SMA Period
int9Signal line period for MACD Filter A.
MACD A Applied Price
enumPRICE_CLOSEApplied price for MACD Filter A.
Use MACD Filter B
boolfalseSecond independent MACD filter with its own parameters.
Reverse Trade Signal - MACD B
boolfalseInverts MACD Filter B logic.
MACD Filter B Time Frame
enumPERIOD_CURRENTTimeframe for MACD Filter B.
MACD B Fast EMA Period
int12Fast EMA period for MACD Filter B.
MACD B Slow EMA Period
int26Slow EMA period for MACD Filter B.
MACD B Signal SMA Period
int9Signal line period for MACD Filter B.
MACD B Applied Price
enumPRICE_CLOSEApplied price for MACD Filter B.
Use Moving Average Crossover Filter A
boolfalseEnables a two-MA crossover filter. The EA only accepts signals that agree with the current fast/slow MA crossover direction.
Reverse Trade Signal - MA Crossover A
boolfalseInverts MA Crossover A logic.
Fast MA Crossover A Time Frame
enumPERIOD_CURRENTTimeframe for the Fast MA in Crossover Filter A.
Fast MA Crossover A Period
int21Period for the Fast MA in Crossover Filter A.
Fast MA Crossover A Shift
int0Bar shift for the Fast MA in Crossover Filter A.
Fast MA Crossover A Method
enumMODE_SMACalculation method for the Fast MA in Crossover Filter A.
Fast MA Crossover A Applied Price
enumPRICE_CLOSEApplied price for the Fast MA in Crossover Filter A.
Slow MA Crossover A Time Frame
enumPERIOD_CURRENTTimeframe for the Slow MA in Crossover Filter A.
Slow MA Crossover A Period
int55Period for the Slow MA in Crossover Filter A.
Slow MA Crossover A Shift
int0Bar shift for the Slow MA in Crossover Filter A.
Slow MA Crossover A Method
enumMODE_SMACalculation method for the Slow MA in Crossover Filter A.
Slow MA Crossover A Applied Price
enumPRICE_CLOSEApplied price for the Slow MA in Crossover Filter A.
Use Moving Average Crossover Filter B
boolfalseSecond independent MA Crossover filter with its own fast and slow MA parameters.
Reverse Trade Signal - MA Crossover B
boolfalseInverts MA Crossover B logic.
Fast MA Crossover B Time Frame
enumPERIOD_CURRENTTimeframe for the Fast MA in Crossover Filter B.
Fast MA Crossover B Period
int21Period for the Fast MA in Crossover Filter B.
Fast MA Crossover B Shift
int0Bar shift for the Fast MA in Crossover Filter B.
Fast MA Crossover B Method
enumMODE_SMACalculation method for the Fast MA in Crossover Filter B.
Fast MA Crossover B Applied Price
enumPRICE_CLOSEApplied price for the Fast MA in Crossover Filter B.
Slow MA Crossover B Time Frame
enumPERIOD_CURRENTTimeframe for the Slow MA in Crossover Filter B.
Slow MA Crossover B Period
int55Period for the Slow MA in Crossover Filter B.
Slow MA Crossover B Shift
int0Bar shift for the Slow MA in Crossover Filter B.
Slow MA Crossover B Method
enumMODE_SMACalculation method for the Slow MA in Crossover Filter B.
Slow MA Crossover B Applied Price
enumPRICE_CLOSEApplied price for the Slow MA in Crossover Filter B.
Restricts when the EA is allowed to open new trades. Each day can be enabled independently with its own start and stop time. Outside of the scheduled windows the EA will not open new positions but will continue to manage open ones.
EA Working Time
boolfalseMaster switch for the time schedule. When false the EA trades at any time. When true it only opens trades within the day/time windows configured below.
Monday - Trade
booltrueAllow trading on Mondays.
Monday - Start Time
string07:00Time (server time, HH:MM) to start trading on Monday.
Monday - Stop Time
string16:00Time (server time, HH:MM) to stop opening new trades on Monday.
Tuesday - Trade
booltrueAllow trading on Tuesdays.
Tuesday - Start Time
string07:00Time to start trading on Tuesday.
Tuesday - Stop Time
string16:00Time to stop opening new trades on Tuesday.
Wednesday - Trade
booltrueAllow trading on Wednesdays.
Wednesday - Start Time
string07:00Time to start trading on Wednesday.
Wednesday - Stop Time
string16:00Time to stop opening new trades on Wednesday.
Thursday - Trade
booltrueAllow trading on Thursdays.
Thursday - Start Time
string07:00Time to start trading on Thursday.
Thursday - Stop Time
string16:00Time to stop opening new trades on Thursday.
Friday - Trade
booltrueAllow trading on Fridays.
Friday - Start Time
string07:00Time to start trading on Friday.
Friday - Stop Time
string16:00Time to stop opening new trades on Friday.
Trading during weekend
boolfalseAllow the EA to trade on weekend days. Enable and configure Saturday and Sunday below.
Saturday - Trade
booltrueAllow trading on Saturdays (requires Trading during weekend to be enabled).
Saturday - Start Time
string07:00Time to start trading on Saturday.
Saturday - Stop Time
string16:00Time to stop opening new trades on Saturday.
Sunday - Trade
booltrueAllow trading on Sundays (requires Trading during weekend to be enabled).
Sunday - Start Time
string07:00Time to start trading on Sunday.
Sunday - Stop Time
string16:00Time to stop opening new trades on Sunday.
Moves the stop loss of open positions as the trade moves in your favour, locking in profit. Seven trailing methods are available, each with its own configuration group below.
Enable Trailing Stop
boolfalseMaster switch for the trailing stop. When false all trailing settings below are ignored.
Trailing Stop Method
enumTRAIL_POINTSSelects the trailing algorithm.
| Method | Description |
|---|---|
| TRAIL_POINTS | Classic fixed-distance trailing stop in points |
| TRAIL_CANDLE_EXTREMUM | Trails to the high/low of the most recent candle |
| TRAIL_FRACTAL | Trails to the most recent fractal high/low |
| TRAIL_ATR | Trails using an ATR-based distance |
| TRAIL_PARABOLIC | Trails using Parabolic SAR |
| TRAIL_MA | Trails to a Moving Average value |
| TRAIL_PROFIT_PCT | Locks in a percentage of peak floating profit |
Trailing Frequency
enumbar_0How often the trailing stop is recalculated. bar_0 updates on every tick. bar_1 updates once per bar close.
Indicator Timeframe
enumPERIOD_CURRENTTimeframe used by indicator-based trailing methods (ATR, Parabolic SAR, MA).
Trailing Stop (points)
uint0The trailing distance in points for TRAIL_POINTS method. The stop loss trails this many points behind the current price.
Trailing Step (points)
uint0Minimum price movement in points before the trailing stop advances. Reduces excessive stop updates on noisy instruments.
ATR Period
int14ATR period used by the TRAIL_ATR method.
SAR Step
double0.02Acceleration factor step for Parabolic SAR trailing.
SAR Maximum
double0.2Maximum acceleration factor for Parabolic SAR trailing.
MA Period
int34Period of the Moving Average used as the trailing stop level for TRAIL_MA.
MA Method
enumMODE_SMACalculation method for the trailing MA.
MA Applied Price
enumPRICE_CLOSEApplied price for the trailing MA.
Profit Percentage (%)
double50Used by TRAIL_PROFIT_PCT. When the trade reaches a profit level, the trailing stop is placed to lock in this percentage of the peak floating profit.
Low-level execution parameters. Leave these at their defaults unless you have a specific reason to change them.
Magic Number
int987654321A unique identifier attached to every order the EA places. Change this when running multiple instances of the same EA on the same account so each instance can identify its own positions.
Coefficient (if Freeze or StopLevels = 0)
uchar3When the broker reports Freeze Level or Stop Level as 0, this coefficient is multiplied by the spread to derive a safe minimum stop distance. Prevents order rejection errors.
Deviation in Points
ulong10Maximum allowed slippage in points. If the market moves more than this between the signal and execution, the order is rejected. 10 points = 1 pip on a 5-decimal broker.
Print log
boolfalseWhen enabled the EA prints detailed diagnostic messages to the MT5 Experts log. Useful for troubleshooting strategy logic or filter interactions. Disable in live trading to avoid log clutter.
充分利用此 EA
- Classic pairs: Common TwoMAcross combinations: 10/50 (short-term trend), 20/100 (medium-term), 50/200 (long-term golden/death cross). The larger the gap between periods the fewer but more significant signals.
- EMA vs SMA: EMA reacts faster to recent price action and generates earlier crossovers. SMA is smoother and generates more reliable but later signals. EMA is preferred for intraday trading, SMA for daily/weekly.
- ThreeMAcross confirmation: The triple MA alignment (10/21/50 for example) requires the trend to be aligned across three lookback periods simultaneously. This eliminates most false crossovers but means entries are later in the trend.
- Different timeframes per MA: You can set each MA to a different timeframe. For example, Fast MA on PERIOD_CURRENT, Slow MA on H4. This creates a multi-timeframe trend confirmation without needing a separate filter.