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) |