Termos de Referência
"I want to design an Expert Advisor (EA) in MQL5 with a simple signal:
- When the price rises by 50 points = Buy
- When the price drops by 50 points = Sell
**Target:** 100 points
**Stop Loss:** 100 points
**Strategy:**
- When a buy signal is triggered, the EA opens a buy position, for example, with a 1-lot size.
- At the same time, it opens a sell position with a size equivalent to 10% (0.1 lot) of the buy position.
- For every 10% of the stop loss (10 points) the price drops, the EA opens an additional 0.1 lot sell position.
- Each sell position will have a trailing stop loss.
- When the price reaches the overall stop loss or the overall target, all positions are closed.
**Inputs:**
- The initial lot size (if 0, then use capital management)
- Lot size for capital management
- Target as a percentage of capital, e.g., 1%
- Target in points
- Stop loss in points
- Reverse lot percentage
- Gap percentage for reverse lot"
---
This description outlines a trading strategy where positions are managed based on specific price movements, with trailing stops applied to hedge positions. The parameters for the strategy are customizable based on lot size, risk management, and specific price targets.