TrendHarvest
- エキスパート
- Rudi Rupian
- バージョン: 1.0
- アクティベーション: 9
TrendHarvest EA — Stochastic and ATR Averaging System for MT5
TrendHarvest EA is an automated Expert Advisor for MetaTrader 5. It uses two technical indicators — the Stochastic Oscillator as the entry trigger and the Average True Range (ATR) as a volatility filter — to determine trade entry conditions. When a valid signal is confirmed, the EA opens an initial position and continues to add orders on each subsequent candle close using a fixed lot multiplier of 1.5, until the maximum averaging limit is reached.
Entry Logic
A buy order is placed when the Stochastic %K line crosses upward above the %D line within the oversold zone, and the ATR value is at or above the minimum pip threshold — confirming that the market has sufficient volatility to support a move. A sell order is placed when the Stochastic %K line crosses downward below the %D line within the overbought zone, under the same ATR condition. No new entry signal is evaluated while positions are open.
Averaging Logic
After the initial entry, the EA opens one additional order on each new candle close in the same direction as the original position. Each subsequent order uses a lot size that is 1.5 times the previous order. This process continues until the maximum number of averaging orders defined in the settings is reached. All averaging orders include a take profit level set in pips, placed directly on each order.
Risk Management
A global stop loss monitors the total floating loss across all open positions. When the combined loss reaches the defined USD threshold, all positions are closed immediately regardless of individual order status. Free margin is verified before every order placement using the CheckMoneyForTrade function. Lot size is automatically validated and adjusted to comply with broker volume rules before execution.
Features
- Entry based on Stochastic crossover with ATR volatility confirmation
- Averaging multiplier of 1.5 applied to each new order on candle close
- Maximum averaging order limit is user-defined
- Take profit set directly on each order in pips
- Global stop loss in USD closes all positions when total loss threshold is met
- Free margin check before every order to prevent over-leverage
- Automatic lot normalization against broker minimum, maximum, and step volume
- Live dashboard showing Stochastic value, ATR value in pips, signal status, averaging count, open profit or loss, take profit and stop loss settings
Input Parameters
- Starting Lot Size — initial trade volume, normalized automatically to broker specifications
- Averaging Multiplier — lot size multiplier applied to each averaging order (default: 1.5)
- Maximum Averaging Orders — total number of orders allowed including the initial entry
- Take Profit (Pips) — pip distance for take profit placed on each individual order
- Global Stop Loss (USD) — total floating loss in USD at which all positions are closed
- ATR Period — number of bars used in ATR calculation (default: 14)
- Minimum ATR in Pips — minimum ATR value required to allow entry, filters low volatility conditions
- Stochastic %K Period — fast line period for the Stochastic Oscillator (default: 5)
- Stochastic %D Period — slow line period for the Stochastic Oscillator (default: 3)
- Stochastic Slowing — smoothing value for the Stochastic Oscillator (default: 3)
- Stochastic Overbought Threshold — level considered overbought (default: 80)
- Stochastic Oversold Threshold — level considered oversold (default: 20)
- Magic Number — unique identifier assigned to all orders placed by this EA
- Max Slippage — maximum permitted slippage in points
- Show Dashboard — enables or disables the on-chart information panel
- Panel Corner — selects the chart corner where the panel appears
- Panel X and Y Offset — adjusts the panel position on the chart
Recommended Use
- Symbols: EURUSD, GBPUSD, USDJPY, XAUUSD
- Timeframes: H1, H4
