LT Stochastic EA
Complete walkthrough of all inputs for the LT Stochastic EA: four Stochastic strategies, full indicator configuration including K/D/Slowing periods, overbought/oversold levels, trade execution, account protection, and all available filters.

These inputs configure the Stochastic Oscillator indicator and select the trading strategy. The Stochastic compares the closing price to the price range over a given period, generating a %K line and a smoothed %D signal line.
EA Trading Strategy
enumStochastic_SimpleSelects the Stochastic-based entry strategy.
| Strategy | Signal logic |
|---|---|
| Stochastic_Simple | Buy when %K crosses above %D; Sell when %K crosses below %D. The most frequent signal. |
| Stochastic_Reversal | Buy when %K crosses above %D in the oversold zone (below Lower Level); Sell when %K crosses below %D in the overbought zone (above Upper Level). |
| Stochastic_MiddleLine | Buy when %K crosses above 50; Sell when %K crosses below 50. |
| Stochastic_Trend | Buy when both %K and %D are above 50 and %K is rising; Sell when both are below 50 and %K is falling. |
Stochastic_Reversal is the classic mean-reversion approach. It only signals when the crossover occurs inside the overbought or oversold zones, producing fewer but higher quality entry signals.
Close Trades on Opposite Direction Signal
boolfalseWhen true, an opposite Stochastic signal closes the existing position before opening the new one.
Reverse Trade Signal
boolfalseInverts all Stochastic strategy signals.
Stochastic Time Frame
enumPERIOD_CURRENTTimeframe for the Stochastic Oscillator calculation.
Stochastic K Period
int5The number of bars used to calculate the raw %K line. Classic settings: 5 (fast), 14 (medium), or 21 (slow). Lower values react faster and generate more signals.
Stochastic D Period
int3Smoothing period for the %D signal line (a moving average of %K). The classic default is 3. Increasing to 5-9 smooths out the signal line and reduces false crossovers.
Stochastic Slowing
int3Additional smoothing applied to %K before calculating %D. 1 = no slowing (fast stochastic). 3 = slow stochastic (the most common choice). Increasing this reduces noise significantly.
Stochastic MA Method
enumMODE_SMAThe averaging method applied during the slowing calculation. SMA is the standard.
Stochastic Price Field
enumSTO_LOWHIGHDetermines which price extremes the Stochastic uses. STO_LOWHIGH uses the candle High and Low (standard). STO_CLOSECLOSE uses Close as both the high and low, creating a smoother indicator.
Stochastic Upper Level
int80The overbought threshold. Stochastic readings above this level indicate overbought conditions. Classic default is 80. Raise to 85-90 in trending markets to reduce premature sell signals.
Stochastic Lower Level
int20The oversold threshold. Stochastic readings below this level indicate oversold conditions. Classic default is 20. Lower to 10-15 in trending markets to reduce premature buy signals.
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.