Xiaocao Trend 4.8 Full Version MT5 Source Code

Xiaocao Trend 4.8 Full Version MT5 Source Code

Pinned Monthly Featured MT5v4.8

MA trend detection + bi-directional averaging + spacing doubling + three lot modes + TP-line closing + daily profit target + multi-layer risk control + chart panel. Suits trending and pullback markets.

Views 1126 Downloads 210 File 33.5 KB Updated 2026-10-12

Details & Usage Instructions

Product Overview
Xiaocao Trend Full Version 4.8 is an MT5 automated trading EA built on moving-average trend detection.
It uses the 5/20 SMA to define direction, opens the first order once the trend is confirmed, and adds orders against the price at doubling spacing; supports three lot modes - multiplier, incremental and list.
Built in: single-side average-profit close, total floating profit/loss full close, largest-profit-plus-largest-loss pair close, daily profit target, first-order time filter, risk limits and multi-layer risk control.
Highlight: during a trend transition it keeps managing the old-direction positions automatically, avoiding an immediate reversal when direction changes - balancing trend following with position safety.

Core Features

1. Moving-Average Trend Detection (core)

The 5/20 SMA defines the trend: fast line crossing above the slow line is bullish, crossing below is bearish.

On a trend change it enters transition management: old-direction positions keep averaging in as before, while the new direction stays closed until the old positions are cleared.

The MA filter can be disabled to run a pure bi-directional averaging mode.

2. Bi-Directional Averaging

Four direction modes: long only, short only, both directions, stop opening.

After the first entry, an adverse move of the base spacing triggers an add-on.

With spacing doubling enabled, add-on spacing grows layer by layer by a multiplier, avoiding over-dense averaging.

3. Three Lot Modes

Multiplier: first lot x averaging multiplier ^ layer.

Incremental: previous order lot + N lots.

List: takes lots one by one from a "/"-separated lot list.

4. Closing Rules

Single-side average profit of N micro-points: converted via per-lot tick value; closes that direction once its floating profit exceeds the threshold.

Total floating profit of N USD: closes everything once overall floating profit reaches the target.

Total floating loss of N USD: closes everything once overall floating loss reaches the limit and enters a cooldown.

Largest-profit + largest-loss pair N points: when the best and worst orders together reach the target, both are closed.

5. Daily Profit Target

When closed profit for the day reaches the set amount, it closes all and stops opening.

Resets automatically each day; the panel shows today's profit and progress toward the target in real time.

6. First-Order Time Filter

Three filter windows can be enabled independently; they only block first entries and do not affect later add-ons.

Server time / local time switchable.

7. Risk Limits

Three limits: max allowed lot, max orders per side, max total orders.

Orders are rejected once a limit is hit, preventing runaway exposure.

8. Chart Panel

Shows long/short positions, lots, P/L, current trend, transition state, spacing, risk limits, today's profit, filter state, account balance and equity in real time.

The average take-profit line is drawn directly on the chart - green for longs, red for shorts.

Three buttons: pause/resume the EA, close all, shut down the EA.

Suitable Market Conditions
Suits markets with a clear trend and pullbacks.
Not suited to extreme one-way moves, markets without pullbacks, or frequent gaps.

Key Parameters Overview

Category Parameter Default
Basic Direction Both directions
Basic Time mode Server time
Basic First lot 0.01
Basic Averaging multiplier 1.3
Basic EA magic ID 2026
Spacing Spacing doubling Yes
Spacing Base spacing 120 points
Spacing Spacing multiplier 1.0
Spacing Max doubling count 100000
Lots Lot mode Multiplier
Lots Increment N lots 0.01
Closing Single-side average profit N micro-points 100
Closing Total floating profit N USD 70
Closing Total floating loss N USD 6000
Closing Best+worst pair profit N points 0 (off)
Profit Daily profit stop amount 1000
Profit Close all on target reached Yes
Profit Cooldown minutes after loss close 60
Filter Filter window 1 04:00-08:00
Filter Filter window 2 14:00-16:00
Filter Filter window 3 20:00-22:59
Risk Max allowed lot 0 (no limit)
Risk Max orders per side 0 (no limit)
Risk Max total orders 20
MA Enable MA filter Yes
TP line Enable TP line Yes
Risk Warning
This EA is a trend-averaging strategy; it keeps adding orders during one-way moves and carries significant drawdown risk.
Please set the first lot, averaging multiplier, spacing, max order count and total floating-loss close amount sensibly.
Test on demo first. No profit is guaranteed; trading carries risk and you are responsible for your own results.

2.jpg

Risk Warning:Resources on this site are for learning, research and technical exchange only, and do not constitute any investment advice. Before running any EA on any account, please do thorough forward-testing on a demo account first; no strategy can guarantee profits.