Job finished
![](https://c.mql5.com/i/avatar/avatar_na2.png)
Specification
A trading Script that is set manually initially on every Buy or Sell.
After activated, the Script sets from Initial Entry Price pending orders of Buy or Sell respectively. These orders are a set amount of pips apart from each other (the amount of pips is indicated by user). The orders only activate if price is reached on the individual orders.
The amount of levels/orders is also set by the user.
If the initial trade is a Buy order, the pending orders are Below the Initial Price. If the initial trade is a Sell Order, the pending orders are above the Initial Price.
The script has to close all trades when the Net Pips between all orders is equal to one set by the user. (Ex: Net 20 Pips)
Example:
Buy EUR/USD @ 1.3204 (Activate Script by User)
User Sets in Script the following Parameters:
- Number of Levels: 5 levels;
- Distance between Levels (pips): 25 pips;
- Net Pips to Close Orders: 20 pips;
- Buy/Sell: Buy;
- Lots per Level: 0.1;
This opens a Market Buy Order @ 1.3204, and 5 pending orders @ 1.3179, 1.3154, 1.3129, 1.3104, and 1.3079.
If after initial position, price goes up 20 pips from first order, all open orders and pending orders are closed (Net 20 Pips Profit).
If after initial position, price goes down 25 pips, 2nd order @ 1.3179 is activated.
If after 2nd position is activated at @ 1.3179, price goes up, and there is 20 Net Pips between Positive Pips from Order 2 and Order 1 (Example: 22.5 Pips Positive from 2nd Order, and 2.5 Pips Negative -> 22.5-2.5=20pips) then all open and pending orders are closed with Net 20 Pips Profit.
And so on. Until 5th Level is reached, if price goes up, between all levels #1,#2,#3,#4,#5 and so on, when Net Pips of 20 is met between all orders, then all orders are closed.